ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 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"
- Data Fields inherited from ilERPDebtor
const website = "http://www.ilias.dk"
const senderEmail = "noreply@ilias.dk"
const senderName = "ILIAS ERP"

Additional Inherited Members

- 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

ilERPDebtor_none::__construct ( )

Reimplemented from ilERPDebtor.

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

{
}

Member Function Documentation

ilERPDebtor_none::bookInvoice ( )

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

{
}
ilERPDebtor_none::createDebtor (   $number)

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

{
}
ilERPDebtor_none::createInvoice ( )

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

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

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

{
}
ilERPDebtor_none::getAll ( )

Get all information about a Debtor.

Returns
mixed array with Debtor info

Reimplemented from ilERPDebtor.

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.

{
$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;
}
ilERPDebtor_none::getDebtorByNumber (   $number)

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

{
return true;
}
ilERPDebtor_none::getEmail ( )

Reimplemented from ilERPDebtor.

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

References ilERPDebtor\$email.

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

Reimplemented from ilERPDebtor.

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

References ilERPDebtor\$invoice_number.

Referenced by saveInvoice().

{
}

+ Here is the caller graph for this function:

ilERPDebtor_none::getInvoicePDF (   $v)

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

{}
ilERPDebtor_none::getName ( )

Reimplemented from ilERPDebtor.

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

References ilERPDebtor\$name.

{
return $this->name;
}
ilERPDebtor_none::getProduct (   $procuet = null)

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

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

Reimplemented from ilERPDebtor.

Definition at line 142 of file class.ilERPDebtor_none.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_none::sendInvoice (   $subject,
  $message,
  $to = null,
  $bytes,
  $fname = "faktura" 
)

Reimplemented from ilERPDebtor.

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

References ilERPDebtor\$email, $filename, ilERPDebtor\senderEmail, and ilERPDebtor\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_none::setAll (   $values)

Set information about a Debtor.

Reimplemented from ilERPDebtor.

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

{
foreach ($values as $key => $value)
$this->$key = $value;
}
ilERPDebtor_none::setDebtorGroup (   $number = 1)

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

{
}
ilERPDebtor_none::setEAN (   $ean)

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

{
}
ilERPDebtor_none::setTestValues ( )

Generate random values to test integration with ERP.

Reimplemented from ilERPDebtor.

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

References ilERPDebtor\$city, ilERPDebtor\$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

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

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

const ilERPDebtor_none::senderName = "ILIAS ERP"

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

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: