ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilERPDebtor Class Reference
+ Inheritance diagram for ilERPDebtor:
+ Collaboration diagram for ilERPDebtor:

Public Member Functions

 getInvoiceNumber ()
 getName ()
 getEmail ()
 getAll ()
 Get all information about a Debtor.
 setAll ($values)
 Set information about a Debtor.
 saveInvoice ($contens, $preview=true)
 sendInvoice ($subject, $message, $to=null, $bytes, $fname="faktura")
 setTestValues ()
 Generate random values to test integration with ERP.

Data Fields

const website = "http://www.ilias.dk"
const senderEmail = "noreply@ilias.dk"
const senderName = "ILIAS ERP"

Protected Member Functions

 __construct ()

Protected Attributes

 $number
 $name = ''
 $email = ''
 $address = ''
 $postalcode = ''
 $city = ''
 $country = ''
 $phone = ''
 $ean
 $website
 $invoice_booked = false
 $invoice_number = 0
 $handle
 $dgh

Detailed Description

Author
Jesper Godvad jespe.nosp@m.r@il.nosp@m.ias.d.nosp@m.k
Nicolai Lundgaard nicol.nosp@m.ai@i.nosp@m.lias..nosp@m.dk

Definition at line 33 of file class.ilERPDebtor.php.

Constructor & Destructor Documentation

ilERPDebtor::__construct ( )
protected

Reimplemented in ilERPDebtor_eco, and ilERPDebtor_none.

Definition at line 59 of file class.ilERPDebtor.php.

{
}

Member Function Documentation

ilERPDebtor::getAll ( )

Get all information about a Debtor.

Returns
mixed array with Debtor info

Reimplemented in ilERPDebtor_none.

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

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

Referenced by ilERPDebtor_eco\createDebtor().

{
$a['number'] = $this->number;
$a['name'] = $this->name;
$a['email'] = $this->email;
$a['address'] = $this->address;
$a['postalcode'] = $this->postalcode;
$a['city'] = $this->city;
$a['country'] = $this->country;
$a['ean'] = $this->ean;
$a['website'] = $this->website;
$a['dgh'] = $this->dgh;
$a['phone'] = $this->phone;
return $a;
}

+ Here is the caller graph for this function:

ilERPDebtor::getEmail ( )

Reimplemented in ilERPDebtor_none.

Definition at line 73 of file class.ilERPDebtor.php.

References $email.

{
return $this->email;
}
ilERPDebtor::getInvoiceNumber ( )

Reimplemented in ilERPDebtor_none.

Definition at line 63 of file class.ilERPDebtor.php.

References $invoice_number.

Referenced by saveInvoice().

{
}

+ Here is the caller graph for this function:

ilERPDebtor::getName ( )

Reimplemented in ilERPDebtor_none.

Definition at line 68 of file class.ilERPDebtor.php.

References $name.

{
return $this->name;
}
ilERPDebtor::saveInvoice (   $contens,
  $preview = true 
)

Reimplemented in ilERPDebtor_none.

Definition at line 113 of file class.ilERPDebtor.php.

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

{
$fp = @fopen( $file, 'w+' );
if (!$fp)
{
throw new ilERPException("Cannot write " . $file);
}
fwrite($fp, $contens);
fclose($fp);
}

+ Here is the call graph for this function:

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

Reimplemented in ilERPDebtor_none.

Definition at line 126 of file class.ilERPDebtor.php.

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

{
$content = chunk_split(base64_encode($bytes));
if (!isset($to)) $to = $this->email;
$filename = $fname . ".pdf";
$uid = md5(uniqid(time()));
$header = "From: " . ilERPDebtor::senderName . " <". ilERPDebtor::senderEmail.">\r\n";
$header .= "Reply-To: " . ilERPDebtor::senderEmail . "\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n";
$header .= "This is a multi-part message in MIME format.\r\n";
$header .= "--".$uid."\r\n";
$header .= "Content-type:text/plain; charset=utf-8\r\n";
$header .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$header .= $message."\r\n\r\n";
$header .= "--".$uid."\r\n";
$header .= "Content-Type: application/octet-stream; name=\"".$filename."\"\r\n"; // use diff. tyoes here
$header .= "Content-Transfer-Encoding: base64\r\n";
$header .= "Content-Disposition: attachment; filename=\"".$filename."\"\r\n\r\n";
$header .= $content."\r\n\r\n";
$header .= "--".$uid."--";
/*
include_once './Services/Mail/classes/classes/class.ilMimeMail.php';
$mail = new ilMimeMail;
$mail->autoCheck(true);
$mail->Subject($subject);
$mail->From(ilERPDebtor::senderName . " <". ilERPDebtor::senderEmail.">");
$mail->ReplyTo(ilERPDebtor::senderEmail);
$mail->To($to);
$mail->Body("Mail body");
$mail->Attach(
$mail->Send();*/
$restore_me = ini_get('display_errors');
ini_set('display_errors', 0);
mail($to, $subject, "", $header);
ini_set('display_errors', $restore_me);
}
ilERPDebtor::setAll (   $values)

Set information about a Debtor.

Reimplemented in ilERPDebtor_none.

Definition at line 103 of file class.ilERPDebtor.php.

{
foreach ($values as $key => $value)
$this->$key = $value;
}
ilERPDebtor::setTestValues ( )

Generate random values to test integration with ERP.

Reimplemented in ilERPDebtor_none.

Definition at line 175 of file class.ilERPDebtor.php.

References $city, $country, and website.

{
$fname = array("Jesper", "Nicolai", "Alex", "Stefan", "Helmut", "Elvis");
$lname = array("Gødvad", "Lundgaard", "Killing", "Meyer", "Schottmüller", "Presly");
$city = array("Copenhagen", "Århus", "Collonge", "Bremen", "SecretPlace" );
$country = array("Denmark", "Germany", "France", "Ümlaudia", "Graceland");
$road = array(" Straße", " Road", "vej", " Boulevard");
$this->number = rand(1000,1010);
$this->name = $fname[rand(0,5)] . " " . $lname[rand(0,5)];
$this->email = "noreply@ilias.dk";
$this->address= "Ilias" . $road[rand(0,3)] ." " . rand(1,100);
$this->postalcode = rand(2000,7000);
$this->city = $city[rand(0,3)];
$this->country = $country[rand(0,4)];
$this->phone = "+" . rand(1,45) . " " . rand(100,999) . " " . rand(1000, 9999);
$this->ean = 0;
}

Field Documentation

ilERPDebtor::$address = ''
protected

Definition at line 39 of file class.ilERPDebtor.php.

Referenced by getAll(), and ilERPDebtor_none\getAll().

ilERPDebtor::$city = ''
protected
ilERPDebtor::$country = ''
protected
ilERPDebtor::$dgh
protected
ilERPDebtor::$ean
protected

Definition at line 44 of file class.ilERPDebtor.php.

Referenced by getAll(), ilERPDebtor_none\getAll(), and ilERPDebtor_eco\setEAN().

ilERPDebtor::$email = ''
protected
ilERPDebtor::$handle
protected

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

ilERPDebtor::$invoice_booked = false
protected

Definition at line 46 of file class.ilERPDebtor.php.

ilERPDebtor::$invoice_number = 0
protected

Definition at line 47 of file class.ilERPDebtor.php.

Referenced by getInvoiceNumber(), and ilERPDebtor_none\getInvoiceNumber().

ilERPDebtor::$name = ''
protected
ilERPDebtor::$phone = ''
protected

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

Referenced by getAll(), and ilERPDebtor_none\getAll().

ilERPDebtor::$postalcode = ''
protected

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

Referenced by getAll(), and ilERPDebtor_none\getAll().

ilERPDebtor::$website
protected

Definition at line 45 of file class.ilERPDebtor.php.

Referenced by getAll(), and ilERPDebtor_none\getAll().

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

Definition at line 54 of file class.ilERPDebtor.php.

Referenced by sendInvoice(), and ilERPDebtor_none\sendInvoice().

const ilERPDebtor::senderName = "ILIAS ERP"

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

Referenced by sendInvoice(), and ilERPDebtor_none\sendInvoice().

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

Definition at line 52 of file class.ilERPDebtor.php.

Referenced by setTestValues().


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