From: Joe Hunt Date: Thu, 6 Sep 2007 15:13:38 +0000 (+0000) Subject: Added optional link for electronic payment on invoices (PayPal) X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=c1c7224eaa0e46c24c71bcee6d93208db75a5225;p=textcart.git Added optional link for electronic payment on invoices (PayPal) --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8e9e7b2..4e59d50 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,15 @@ Legend: ! -> Note $ -> Affected files +06-Sep-2007 Joe Hunt + + Added optional link for electronic payment on invoices (PayPal) + $ /reporting/reports_main.php + /reporting/rep107.php + /reporting/includes/report_classes.inc + /reporting/includes/pdf_report.inc + /reporting/includes/doc_text.inc + /reporting/includes/doc_text2.inc + 23-Aug-2007 Joe Hunt # Unnecessary parameter ($db) in check_for_recursive_bom $ /manufacturing/manage/bom_edit.php diff --git a/reporting/includes/doctext.inc b/reporting/includes/doctext.inc index 38ba3aa..8ef084b 100644 --- a/reporting/includes/doctext.inc +++ b/reporting/includes/doctext.inc @@ -22,6 +22,7 @@ if (isset($header2type)) $doc_Phone_Fax_Email = _("Phone/Fax/Email"); $doc_Bank = _("Bank"); $doc_Bank_Account = _("Bank Account"); + $doc_Payment_Link = _("You can pay through"); if ($doctype == 8 || $doctype == 9 || $doctype == 10 || $doctype == 11) { if ($doctype == 8) @@ -51,6 +52,7 @@ if (isset($emailtype)) $doc_Dear_Sirs = _("Dear Sirs"); $doc_AttachedFile = _("Attached you will find "); $doc_Kindest_regards = _("Kindest regards"); + $doc_Payment_Link = _("You can pay through"); } if (isset($header2type) || isset($linetype)) { diff --git a/reporting/includes/doctext2.inc b/reporting/includes/doctext2.inc index 43394c3..f509b5d 100644 --- a/reporting/includes/doctext2.inc +++ b/reporting/includes/doctext2.inc @@ -22,6 +22,7 @@ if (isset($header2type)) $doc_Phone_Fax_Email = "Phone/Fax/Email"; $doc_Bank = "Bank"; $doc_Bank_Account = "Bank Account"; + $doc_Payment_Link = "You can pay through"; if ($doctype == 8 || $doctype == 9 || $doctype == 10 || $doctype == 11) { if ($doctype == 8) @@ -51,6 +52,7 @@ if (isset($emailtype)) $doc_Dear_Sirs = "Dear Sirs"; $doc_AttachedFile = "Attached you will find "; $doc_Kindest_regards = "Kindest regards"; + $doc_Payment_Link = "You can pay through"; } if (isset($header2type) || isset($linetype)) { diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc index e145555..c6ea80b 100644 --- a/reporting/includes/pdf_report.inc +++ b/reporting/includes/pdf_report.inc @@ -326,7 +326,7 @@ class FrontReport extends Cpdf if ($this->company['coy_logo'] != '') { $logo = $path_to_root . "themes/default/images/" . $this->company['coy_logo']; - $this->AddImage($logo, $ccol, $iline1 + 5, 220, 40); + $this->AddImage($logo, $ccol, $iline1 + 5, 250, 40); } else { @@ -444,6 +444,21 @@ class FrontReport extends Cpdf $temp = $this->row - 2 * $this->lineHeight; $this->row = $iline5 - $this->lineHeight - 6; $this->Text($ccol, $doc_Please_Quote . " - " . $myrow['curr_code']); + if ($branch['disable_branch'] > 0) // payment links + { + if ($branch['disable_branch'] == 1) + { + $this->NewLine(); + $amt = number_format($myrow["ov_freight"] + $myrow["ov_gst"] + $myrow["ov_amount"], user_price_dec()); + $txt = $doc_Payment_Link . " PayPal: "; + $url = "https://www.paypal.com/xclick/business=" . $this->company['email'] . "&item_name=" . + $this->title . "+" . $myrow['reference'] . "&amount=" . $amt . "¤cy_code=" . $myrow['curr_code']; + $this->fontSize -= 2; + $this->Text($ccol, $txt.$url); + $this->addLink($url, $ccol, $this->row, $this->pageWidth - $this->rightMargin, $this->row - $this->lineHeight); + $this->fontSize += 2; + } + } if ($this->params['comments'] != '') { $this->NewLine(2); @@ -632,7 +647,19 @@ class FrontReport extends Cpdf $from = $this->company['coy_name'] . " <" . $this->company['email'] . ">"; $to = $myrow['DebtorName'] . " <" . $myrow['email'] . ">"; $msg = $doc_Dear_Sirs . ",\n\n" . $doc_AttachedFile . " " . $subject . - "\n\n" . $doc_Kindest_regards . "\n\n"; + "\n\n"; + if ($myrow['dimension_id'] > 0) // helper for payment links + { + if ($myrow['dimension_id'] == 1) + { + $amt = number_format($myrow["ov_freight"] + $myrow["ov_gst"] + $myrow["ov_amount"], user_price_dec()); + $txt = $doc_Payment_Link . " PayPal: "; + $url = "https://www.paypal.com/xclick/business=" . $this->company['email'] . "&item_name=" . + $this->title . "+" . $myrow['reference'] . "&amount=" . $amt . "¤cy_code=" . $myrow['curr_code']; + $msg .= $txt . $url . "\n\n"; + } + } + $msg .= $doc_Kindest_regards . "\n\n"; $sender = $this->user . "\n" . $this->company['coy_name']; $mail->to($to); $mail->subject($subject); diff --git a/reporting/includes/reports_classes.inc b/reporting/includes/reports_classes.inc index 9c6834a..badf630 100644 --- a/reporting/includes/reports_classes.inc +++ b/reporting/includes/reports_classes.inc @@ -164,6 +164,10 @@ class Report $sel = array(_('No'), _("Yes")); $st .= dup_simple_name_list("RP_" . $this->id . "_$index", $sel); break; + case 'PAYMENT_LINK': + $sel = array(_("No Payment Link"), "PayPal"); + $st .= dup_simple_name_list("RP_" . $this->id . "_$index", $sel); + break; case 'COMPARE': $sel = array(_("Accumulated"), _("Period Y-1"), _("Budget")); $st .= dup_simple_name_list("RP_" . $this->id . "_$index", $sel); diff --git a/reporting/rep107.php b/reporting/rep107.php index 653347e..966fe7d 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -32,7 +32,8 @@ function print_invoices() $currency = $_POST['PARAM_2']; $bankaccount = $_POST['PARAM_3']; $email = $_POST['PARAM_4']; - $comments = $_POST['PARAM_5']; + $paylink = $_POST['PARAM_5']; + $comments = $_POST['PARAM_6']; if ($from == null) $from = 0; @@ -70,6 +71,7 @@ function print_invoices() continue; $myrow = get_customer_trans($i, $j); $branch = get_branch($myrow["branch_code"]); + $branch['disable_branch'] = $paylink; // helper if ($j == 10) $sales_order = get_sales_order($myrow["order_"]); else @@ -175,6 +177,7 @@ function print_invoices() $rep->Font(); if ($email == 1) { + $myrow['dimension_id'] = $paylink; // helper for pmt link if ($myrow['email'] == '') { $myrow['email'] = $branch['email']; diff --git a/reporting/reports_main.php b/reporting/reports_main.php index 1cabc95..fcaeab3 100644 --- a/reporting/reports_main.php +++ b/reporting/reports_main.php @@ -53,6 +53,7 @@ $reports->addReport(_('Customer'),107,_('Print Invoices/Credit Notes'), new ReportParam(_('Currency Filter'),'CURRENCY'), new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'), new ReportParam(_('email Customers'),'YES_NO'), + new ReportParam(_('Payment Link'),'PAYMENT_LINK'), new ReportParam(_('Comments'),'TEXTBOX'))); $reports->addReport(_('Customer'),108,_('Print Statements'), array( new ReportParam(_('Customer'),'CUSTOMERS_NO_FILTER'),