ILIAS  release_4-4 Revision
ilERPDebtor_none Class Reference
+ Inheritance diagram for ilERPDebtor_none:
+ Collaboration diagram for ilERPDebtor_none:

Public Member Functions

 __construct ()
 
 getDebtorByNumber ($number)
 
 setDebtorGroup ($number=1)
 
 createDebtor ($number)
 
 setEAN ($ean)
 
 createInvoice ()
 
 createInvoiceLine ($p, $d, $q, $u)
 
 bookInvoice ()
 
 getProduct ($procuet=null)
 
 getInvoicePDF ($v)
 
 getInvoiceNumber ()
 
 getName ()
 
 getEmail ()
 
 getAll ()
 Get all information about a Debtor. More...
 
 setAll ($values)
 Set information about a Debtor. More...
 
 saveInvoice ($contens, $preview=true)
 
 sendInvoice ($subject, $message, $to=null, $bytes, $fname="faktura")
 
 setTestValues ()
 Generate random values to test integration with ERP. More...
 
- Public Member Functions inherited from ilERPDebtor
 getInvoiceNumber ()
 
 getName ()
 
 getEmail ()
 
 getAll ()
 Get all information about a Debtor. More...
 
 setAll ($values)
 Set information about a Debtor. More...
 
 saveInvoice ($contens, $preview=true)
 
 sendInvoice ($subject, $message, $to=null, $bytes, $fname="faktura")
 
 setTestValues ()
 Generate random values to test integration with ERP. More...
 

Data Fields

const website = "http://www.ilias.dk"
 
const senderEmail = "noreply@ilias.dk"
 
const senderName = "ILIAS ERP"
 
- Data Fields inherited from ilERPDebtor
const website = "http://www.ilias.dk"
 
const senderEmail = "noreply@ilias.dk"
 
const senderName = "ILIAS ERP"
 

Additional Inherited Members

- Protected Member Functions inherited from ilERPDebtor
 __construct ()
 
- Protected Attributes inherited from ilERPDebtor
 $number
 
 $name = ''
 
 $email = ''
 
 $address = ''
 
 $postalcode = ''
 
 $city = ''
 
 $country = ''
 
 $phone = ''
 
 $ean
 
 $website
 
 $invoice_booked = false
 
 $invoice_number = 0
 
 $handle
 
 $dgh
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilERPDebtor_none::__construct ( )

Definition at line 43 of file class.ilERPDebtor_none.php.

44  {
45 
46  }

Member Function Documentation

◆ bookInvoice()

ilERPDebtor_none::bookInvoice ( )

Definition at line 79 of file class.ilERPDebtor_none.php.

80  {
81  }

◆ createDebtor()

ilERPDebtor_none::createDebtor (   $number)

Definition at line 61 of file class.ilERPDebtor_none.php.

62  {
63  }

◆ createInvoice()

ilERPDebtor_none::createInvoice ( )

Definition at line 71 of file class.ilERPDebtor_none.php.

72  {
73  }

◆ createInvoiceLine()

ilERPDebtor_none::createInvoiceLine (   $p,
  $d,
  $q,
  $u 
)

Definition at line 75 of file class.ilERPDebtor_none.php.

76  {
77  }

◆ getAll()

ilERPDebtor_none::getAll ( )

Get all information about a Debtor.

Returns
mixed array with Debtor info

Definition at line 112 of file class.ilERPDebtor_none.php.

References ilERPDebtor\$address, ilERPDebtor\$city, ilERPDebtor\$country, ilERPDebtor\$dgh, ilERPDebtor\$ean, ilERPDebtor\$email, ilERPDebtor\$name, ilERPDebtor\$number, ilERPDebtor\$phone, ilERPDebtor\$postalcode, and ilERPDebtor\$website.

113  {
114  $a['number'] = $this->number;
115  $a['name'] = $this->name;
116  $a['email'] = $this->email;
117  $a['address'] = $this->address;
118  $a['postalcode'] = $this->postalcode;
119  $a['city'] = $this->city;
120  $a['country'] = $this->country;
121  $a['ean'] = $this->ean;
122  $a['website'] = $this->website;
123  $a['dgh'] = $this->dgh;
124  $a['phone'] = $this->phone;
125  return $a;
126  }

◆ getDebtorByNumber()

ilERPDebtor_none::getDebtorByNumber (   $number)

Definition at line 49 of file class.ilERPDebtor_none.php.

50  {
51  return true;
52  }

◆ getEmail()

ilERPDebtor_none::getEmail ( )

Definition at line 102 of file class.ilERPDebtor_none.php.

References ilERPDebtor\$email.

103  {
104  return $this->email;
105  }

◆ getInvoiceNumber()

ilERPDebtor_none::getInvoiceNumber ( )

Definition at line 92 of file class.ilERPDebtor_none.php.

References ilERPDebtor\$invoice_number.

Referenced by saveInvoice().

93  {
94  return $this->invoice_number;
95  }
+ Here is the caller graph for this function:

◆ getInvoicePDF()

ilERPDebtor_none::getInvoicePDF (   $v)

Definition at line 87 of file class.ilERPDebtor_none.php.

88  {}

◆ getName()

ilERPDebtor_none::getName ( )

Definition at line 97 of file class.ilERPDebtor_none.php.

References ilERPDebtor\$name.

98  {
99  return $this->name;
100  }

◆ getProduct()

ilERPDebtor_none::getProduct (   $procuet = null)

Definition at line 83 of file class.ilERPDebtor_none.php.

84  {
85  }

◆ saveInvoice()

ilERPDebtor_none::saveInvoice (   $contens,
  $preview = true 
)

Definition at line 142 of file class.ilERPDebtor_none.php.

References $file, $preview, getInvoiceNumber(), ilERP\getPreviewFile(), and ilERP\getSaveDirectory().

143  {
145  $fp = @fopen( $file, 'w+' );
146  if (!$fp)
147  {
148  throw new ilERPException("Cannot write " . $file);
149  }
150  fwrite($fp, $contens);
151  fclose($fp);
152  }
print $file
static getSaveDirectory()
Definition: class.ilERP.php:84
Class for ERP related exception handling in ILIAS.
$preview
static getPreviewFile()
Definition: class.ilERP.php:69
+ Here is the call graph for this function:

◆ sendInvoice()

ilERPDebtor_none::sendInvoice (   $subject,
  $message,
  $to = null,
  $bytes,
  $fname = "faktura" 
)

Definition at line 155 of file class.ilERPDebtor_none.php.

References ilERPDebtor\$email, $filename, ilERPDebtor\senderEmail, and ilERPDebtor\senderName.

156  {
157 
158  $content = chunk_split(base64_encode($bytes));
159 
160  if (!isset($to)) $to = $this->email;
161  $filename = $fname . ".pdf";
162 
163  $uid = md5(uniqid(time()));
164 
165  $header = "From: " . ilERPDebtor::senderName . " <". ilERPDebtor::senderEmail.">\r\n";
166  $header .= "Reply-To: " . ilERPDebtor::senderEmail . "\r\n";
167  $header .= "MIME-Version: 1.0\r\n";
168  $header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n";
169  $header .= "This is a multi-part message in MIME format.\r\n";
170  $header .= "--".$uid."\r\n";
171  $header .= "Content-type:text/plain; charset=utf-8\r\n";
172  $header .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
173  $header .= $message."\r\n\r\n";
174  $header .= "--".$uid."\r\n";
175  $header .= "Content-Type: application/octet-stream; name=\"".$filename."\"\r\n"; // use diff. tyoes here
176  $header .= "Content-Transfer-Encoding: base64\r\n";
177  $header .= "Content-Disposition: attachment; filename=\"".$filename."\"\r\n\r\n";
178  $header .= $content."\r\n\r\n";
179  $header .= "--".$uid."--";
180 
181  /*
182  include_once './Services/Mail/classes/class.ilMimeMail.php';
183  $mail = new ilMimeMail;
184  $mail->autoCheck(true);
185  $mail->Subject($subject);
186  $mail->From(ilERPDebtor::senderName . " <". ilERPDebtor::senderEmail.">");
187  $mail->ReplyTo(ilERPDebtor::senderEmail);
188  $mail->To($to);
189  $mail->Body("Mail body");
190  $mail->Attach(
191 
192  $mail->Send();*/
193 
194  $restore_me = ini_get('display_errors');
195  ini_set('display_errors', 0);
196  mail($to, $subject, "", $header);
197  ini_set('display_errors', $restore_me);
198 
199  }
$filename
Definition: buildRTE.php:89

◆ setAll()

ilERPDebtor_none::setAll (   $values)

Set information about a Debtor.

Definition at line 132 of file class.ilERPDebtor_none.php.

133  {
134  foreach ($values as $key => $value)
135  $this->$key = $value;
136  }

◆ setDebtorGroup()

ilERPDebtor_none::setDebtorGroup (   $number = 1)

Definition at line 55 of file class.ilERPDebtor_none.php.

56  {
57 
58  }

◆ setEAN()

ilERPDebtor_none::setEAN (   $ean)

Definition at line 66 of file class.ilERPDebtor_none.php.

67  {
68  }

◆ setTestValues()

ilERPDebtor_none::setTestValues ( )

Generate random values to test integration with ERP.

Definition at line 204 of file class.ilERPDebtor_none.php.

References ilERPDebtor\$city, ilERPDebtor\$country, website, and ilERPDebtor\website.

205  {
206  $fname = array("Jesper", "Nicolai", "Alex", "Stefan", "Helmut", "Elvis");
207  $lname = array("Gødvad", "Lundgaard", "Killing", "Meyer", "Schottmüller", "Presly");
208  $city = array("Copenhagen", "Århus", "Collonge", "Bremen", "SecretPlace" );
209  $country = array("Denmark", "Germany", "France", "Ümlaudia", "Graceland");
210  $road = array(" Straße", " Road", "vej", " Boulevard");
211 
212  $this->number = rand(1000,1010);
213  $this->name = $fname[rand(0,5)] . " " . $lname[rand(0,5)];
214  $this->email = "noreply@ilias.dk";
215  $this->address= "Ilias" . $road[rand(0,3)] ." " . rand(1,100);
216  $this->postalcode = rand(2000,7000);
217  $this->city = $city[rand(0,3)];
218  $this->country = $country[rand(0,4)];
219  $this->phone = "+" . rand(1,45) . " " . rand(100,999) . " " . rand(1000, 9999);
220  $this->ean = 0;
221  $this->website = ilERPDebtor::website;
222  }

Field Documentation

◆ senderEmail

const ilERPDebtor_none::senderEmail = "noreply@ilias.dk"

Definition at line 40 of file class.ilERPDebtor_none.php.

◆ senderName

const ilERPDebtor_none::senderName = "ILIAS ERP"

Definition at line 41 of file class.ilERPDebtor_none.php.

◆ website

const ilERPDebtor_none::website = "http://www.ilias.dk"

Definition at line 38 of file class.ilERPDebtor_none.php.

Referenced by setTestValues().


The documentation for this class was generated from the following file: