コード例 #1
0
ファイル: PrintCustTrans.php プロジェクト: bodi000/weberp-cvs
 		echo '<p>' . _('There were no transactions to print in the range selected');
 		include('includes/footer.inc');
 		exit;
 	}*/
 if (isset($_GET['Email'])) {
     //email the invoice to address supplied
     include 'includes/header.inc';
     include 'includes/htmlMimeMail.php';
     $mail = new htmlMimeMail();
     $filename = $_SESSION['reports_dir'] . '/Invoice.pdf';
     $fp = fopen($_SESSION['reports_dir'] . '/Invoice.pdf', 'wb');
     fwrite($fp, $pdfcode);
     fclose($fp);
     $attachment = $mail->getFile($filename);
     $mail->setText(_('Please find attached') . ' ' . $InvOrCredit . ' ' . $_GET['FromTransNo']);
     $mail->SetSubject($InvOrCredit . ' ' . $_GET['FromTransNo']);
     $mail->addAttachment($attachment, $filename, 'application/pdf');
     $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>');
     $result = $mail->send(array($_GET['Email']));
     unlink($filename);
     //delete the temporary file
     $title = _('Emailing') . ' ' . $InvOrCredit . ' ' . _('Number') . ' ' . $FromTransNo;
     include 'includes/header.inc';
     echo "<p>{$InvOrCredit} " . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('has been emailed to') . ' ' . $_GET['Email'];
     include 'includes/footer.inc';
     exit;
 } else {
     header('Content-type: application/pdf');
     header('Content-Length: ' . $len);
     header('Content-Disposition: inline; filename=Customer_trans.pdf');
     header('Expires: 0');
コード例 #2
0
     /* end of check to see that there was an invoice record to print */
     $FromTransNo++;
 }
 /* end loop to print invoices */
 /* Put the transaction number back as would have been incremented by one after last pass */
 $FromTransNo--;
 if (isset($_GET['Email'])) {
     //email the invoice to address supplied
     include 'includes/header.inc';
     include 'includes/htmlMimeMail.php';
     $FileName = $_SESSION['reports_dir'] . '/' . $_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $FromTransNo . '.pdf';
     $pdf->Output($FileName, 'F');
     $mail = new htmlMimeMail();
     $Attachment = $mail->getFile($FileName);
     $mail->setText(_('Please find attached') . ' ' . $InvOrCredit . ' ' . $FromTransNo);
     $mail->SetSubject($InvOrCredit . ' ' . $FromTransNo);
     $mail->addAttachment($Attachment, $FileName, 'application/pdf');
     if ($_SESSION['SmtpSetting'] == 0) {
         $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>');
         $result = $mail->send(array($_GET['Email']));
     } else {
         $result = SendmailBySmtp($mail, array($_GET['Email']));
     }
     unlink($FileName);
     //delete the temporary file
     $Title = _('Emailing') . ' ' . $InvOrCredit . ' ' . _('Number') . ' ' . $FromTransNo;
     include 'includes/header.inc';
     echo '<p>' . $InvOrCredit . ' ' . _('number') . ' ' . $FromTransNo . ' ' . _('has been emailed to') . ' ' . $_GET['Email'];
     include 'includes/footer.inc';
     exit;
 } else {
コード例 #3
0
and an array of the receipients */
/*The following three variables need to be modified for the report - the company database to use and the receipients */
/*The Sales report to send */
$_GET['ReportID'] = 2;
/*The company database to use */
$DatabaseName = 'kwamojademo';
/*The people to receive the emailed report */
$Recipients = array('"Root" <root@localhost>', '"' . _('someone else') . '" <*****@*****.**>');
$AllowAnyone = true;
include 'includes/session.inc';
include 'includes/ConstructSQLForUserDefinedSalesReport.inc';
include 'includes/PDFSalesAnalysis.inc';
include 'includes/htmlMimeMail.php';
$mail = new htmlMimeMail();
if ($Counter > 0) {
    /* the number of lines of the sales report is more than 0  ie there is a report to send! */
    $pdfcode = $pdf->output();
    $fp = fopen($_SESSION['reports_dir'] . '/SalesReport.pdf', 'wb');
    fwrite($fp, $pdfcode);
    fclose($fp);
    $attachment = $mail->getFile($_SESSION['reports_dir'] . '/SalesReport.pdf');
    $mail->setText(_('Please find herewith sales report'));
    $mail->SetSubject(_('Sales Analysis Report'));
    $mail->addAttachment($attachment, 'SalesReport.pdf', 'application/pdf');
    $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>');
    $result = $mail->send($Recipients);
} else {
    $mail->setText(_('Error running automated sales report number') . ' ' . $ReportID);
    $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>');
    $result = $mail->send($Recipients);
}
コード例 #4
0
         $NoLines = $LineNumber;
     }
     if ($LineDetails['section'] == 'Summary' and $LastLine == 'Detail') {
         $MsgLineText = $LineDetails['linetext'];
         include 'includes/EDIVariableSubstitution.inc';
     }
 }
 /*end while there are message lines to parse and substitute vbles for */
 fclose($fp);
 /*close the file at the end of each transaction */
 DB_query("UPDATE debtortrans SET EDISent=1 WHERE ID=" . $TransDetails['id']);
 /*Now send the file using the customer transport */
 if ($CustDetails['editransport'] == 'email') {
     $mail = new htmlMimeMail();
     $attachment = $mail->getFile("EDI_INV_" . $TransNo . ".txt");
     $mail->SetSubject('EDI Invoice/Credit Note ' . $TransNo);
     $mail->addAttachment($attachment, 'EDI_INV_' . $TransNo . '.txt', 'application/txt');
     if ($_SESSION['SmtpSetting'] == 0) {
         $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>');
         $MessageSent = $mail->send(array($CustDetails['ediaddress']));
     } else {
         $MessageSent = SendmailBySmtp($mail, array($CustDetails['ediaddress']));
     }
     if ($MessageSent == True) {
         echo '<BR><BR>';
         prnMsg(_('EDI Message') . ' ' . $TransNo . ' ' . _('was sucessfully emailed'), 'success');
     } else {
         echo '<BR><BR>';
         prnMsg(_('EDI Message') . ' ' . $TransNo . _('could not be emailed to') . ' ' . $CustDetails['ediaddress'], 'error');
     }
 } else {