コード例 #1
0
ファイル: lms-sendinvoices.php プロジェクト: itav/lms
 } else {
     $invoice_classname = 'LMSHtmlInvoice';
 }
 if ($dnote_filetype == 'pdf') {
     $dnote_classname = 'LMSTcpdfDebitNote';
 } else {
     $dnote_classname = 'LMSHtmlDebitNote';
 }
 foreach ($docs as $doc) {
     if ($doc['doctype'] == DOC_DNOTE) {
         if ($dnote_filetype == 'pdf') {
             $document = new $dnote_classname(trans('Notes'));
         } else {
             $document = new $dnote_classname($SMARTY);
         }
         $invoice = $LMS->GetNoteContent($doc['id']);
     } else {
         if ($invoice_filetype == 'pdf') {
             $document = new $invoice_classname(trans('Invoices'));
         } else {
             $document = new $invoice_classname($SMARTY);
         }
         $invoice = $LMS->GetInvoiceContent($doc['id']);
     }
     $invoice['type'] = trans('ORIGINAL');
     $document->Draw($invoice);
     $res = $document->WriteToString();
     $custemail = !empty($debug_email) ? $debug_email : $doc['email'];
     $invoice_number = !empty($doc['template']) ? $doc['template'] : '%N/LMS/%Y';
     $body = $mail_body;
     $subject = $mail_subject;