! -> Note
$ -> Affected files
+09-Oct-2009 Joe Hunt
++ Added option to print delivery notes as packing slip in reports and links.
+$ /includes/ui/ui_controls.inc
+ /reporting/rep110.php
+ /reporting/reports_main.php
+ /reporting/includes/doctext.inc
+ /reporting/includes/doctext2.inc
+ /reporting/includes/header2.inc
+ /reporting/includes/pdf_report.inc
+ /reporting/includes/reporting.inc
+ /sales/customer_delivery.php
+ /sales/sales_order_entry.php
+
08-Oct-2009 Joe Hunt
+ Prepared the Report Engine for Tags handling.
! Changed report::getDisplay() to use combo_input from ui_lists.inc insted of local function
display_note(get_trans_view_str($type, $number, $title, false, 'menu_option', $id), 0, 1);
}
-function submenu_print($title, $type, $number, $id=null, $email=0)
+function submenu_print($title, $type, $number, $id=null, $email=0, $extra=0)
{
- display_note(print_document_link($number, $title, true, $type, false, 'menu_option', $id, $email), 0, 1);
+ display_note(print_document_link($number, $title, true, $type, false, 'menu_option', $id, $email, $extra), 0, 1);
}
//-----------------------------------------------------------------------------------
elseif ($doctype == 8)
$this->title = _("PURCHASE ORDER");
elseif ($doctype == 13)
- $this->title = _("DELIVERY NOTE");
+ $this->title = ($packing_slip==1 ? _("PACKING SLIP") : _("DELIVERY NOTE"));
elseif ($doctype == 9)
$this->title = ($print_as_quote==1 ? _("QUOTE") : _("SALES ORDER"));
elseif ($doctype == 10)
elseif ($doctype == 10)
$this->title = "INVOICE";
elseif ($doctype == 13)
- $this->title = "DELIVERY NOTE";
+ $this->title = ($packing_slip==1 ? "PACKING SLIP" : "DELIVERY NOTE");
elseif ($doctype == 26)
$this->title = "WORK ORDER";
else
$col += $width;
if ($doctype == 26)
$this->TextWrap($col, $this->row, $width, sql2date($myrow["required_by"]), 'C');
- else
+ elseif (!isset($packing_slip) || $packing_slip == 0)
{
$id = $myrow['payment_terms'];
$sql = "SELECT terms FROM ".TB_PREF."payment_terms WHERE terms_indicator='$id'";
function Header2($myrow, $branch, $sales_order, $bankaccount, $doctype)
{
- global $comp_path, $path_to_root, $print_as_quote, $print_invoice_no;
+ global $comp_path, $path_to_root, $print_as_quote, $print_invoice_no, $packing_slip;
$this->pageNumber++;
if ($this->pageNumber > 1)
// You only need full parameter list for invoices/credit notes
function print_document_link($doc_no, $link_text, $link=true, $type_no,
- $icon=false, $class='printlink', $id='', $email=0)
+ $icon=false, $class='printlink', $id='', $email=0, $extra=0)
{
global $path_to_root;
include_once($path_to_root . "/includes/types.inc");
$ar = array(
'PARAM_0' => $doc_no,
'PARAM_1' => $doc_no,
- 'PARAM_2' => $email);
+ 'PARAM_2' => $email,
+ 'PARAM_3' => $extra);
break;
case ST_SALESINVOICE : // Sales Invoice
case ST_CUSTCREDIT : // Customer Credit Note
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/sales/includes/sales_db.inc");
+$packing_slip = 0;
//----------------------------------------------------------------------------------------------------
print_deliveries();
function print_deliveries()
{
- global $path_to_root;
+ global $path_to_root, $packing_slip;
include_once($path_to_root . "/reporting/includes/pdf_report.inc");
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$email = $_POST['PARAM_2'];
- $comments = $_POST['PARAM_3'];
+ $packing_slip = $_POST['PARAM_3'];
+ $comments = $_POST['PARAM_4'];
if ($from == null)
$from = 0;
if ($email == 0)
{
- $rep = new FrontReport(_('DELIVERY'), "DeliveryNoteBulk", user_pagesize());
+ if ($packing_slip == 0)
+ $rep = new FrontReport(_('DELIVERY'), "DeliveryNoteBulk", user_pagesize());
+ else
+ $rep = new FrontReport(_('PACKING SLIP'), "PackingSlipBulk", user_pagesize());
$rep->currency = $cur;
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
$rep = new FrontReport("", "", user_pagesize());
$rep->currency = $cur;
$rep->Font();
+ if ($packing_slip == 0)
+ {
$rep->title = _('DELIVERY NOTE');
$rep->filename = "Delivery" . $myrow['reference'] . ".pdf";
+ }
+ else
+ {
+ $rep->title = _('PACKING SLIP');
+ $rep->filename = "Packing_slip" . $myrow['reference'] . ".pdf";
+ }
$rep->Info($params, $cols, null, $aligns);
}
else
$rep->title = _('DELIVERY NOTE');
$rep->Header2($myrow, $branch, $sales_order, '', 13);
- $result = get_customer_trans_details(13, $i);
+ $result = get_customer_trans_details(13, $i);
$SubTotal = 0;
while ($myrow2=db_fetch($result))
{
$rep->row = $oldrow;
$rep->TextCol(2, 3, $DisplayQty, -2);
$rep->TextCol(3, 4, $myrow2['units'], -2);
- $rep->TextCol(4, 5, $DisplayPrice, -2);
- $rep->TextCol(5, 6, $DisplayDiscount, -2);
- $rep->TextCol(6, 7, $DisplayNet, -2);
+ if ($packing_slip == 0)
+ {
+ $rep->TextCol(4, 5, $DisplayPrice, -2);
+ $rep->TextCol(5, 6, $DisplayDiscount, -2);
+ $rep->TextCol(6, 7, $DisplayNet, -2);
+ }
$rep->row = $newrow;
//$rep->NewLine(1);
if ($rep->row < $rep->bottomMargin + (15 * $rep->lineHeight))
{
include($path_to_root . "/reporting/includes/doctext.inc");
}
-
- $rep->TextCol(3, 6, $doc_Sub_total, -2);
- $rep->TextCol(6, 7, $DisplaySubTot, -2);
- $rep->NewLine();
- $rep->TextCol(3, 6, $doc_Shipping, -2);
- $rep->TextCol(6, 7, $DisplayFreight, -2);
- $rep->NewLine();
- $tax_items = get_trans_tax_details(13, $i);
- while ($tax_item = db_fetch($tax_items))
- {
- $DisplayTax = number_format2($tax_item['amount'], $dec);
- if ($tax_item['included_in_price'])
- {
- $rep->TextCol(3, 7, $doc_Included . " " . $tax_item['tax_type_name'] .
- " (" . $tax_item['rate'] . "%) " . $doc_Amount . ":" . $DisplayTax, -2);
- }
- else
- {
- $rep->TextCol(3, 6, $tax_item['tax_type_name'] . " (" .
- $tax_item['rate'] . "%)", -2);
- $rep->TextCol(6, 7, $DisplayTax, -2);
- }
+ if ($packing_slip == 0)
+ {
+ $rep->TextCol(3, 6, $doc_Sub_total, -2);
+ $rep->TextCol(6, 7, $DisplaySubTot, -2);
$rep->NewLine();
- }
- $rep->NewLine();
- $DisplayTotal = number_format2($myrow["ov_freight"] +$myrow["ov_freight_tax"] + $myrow["ov_gst"] +
- $myrow["ov_amount"],$dec);
- $rep->Font('bold');
- $rep->TextCol(3, 6, $doc_TOTAL_DELIVERY, - 2);
- $rep->TextCol(6, 7, $DisplayTotal, -2);
- $rep->Font();
+ $rep->TextCol(3, 6, $doc_Shipping, -2);
+ $rep->TextCol(6, 7, $DisplayFreight, -2);
+ $rep->NewLine();
+ $tax_items = get_trans_tax_details(13, $i);
+ while ($tax_item = db_fetch($tax_items))
+ {
+ $DisplayTax = number_format2($tax_item['amount'], $dec);
+ if ($tax_item['included_in_price'])
+ {
+ $rep->TextCol(3, 7, $doc_Included . " " . $tax_item['tax_type_name'] .
+ " (" . $tax_item['rate'] . "%) " . $doc_Amount . ":" . $DisplayTax, -2);
+ }
+ else
+ {
+ $rep->TextCol(3, 6, $tax_item['tax_type_name'] . " (" .
+ $tax_item['rate'] . "%)", -2);
+ $rep->TextCol(6, 7, $DisplayTax, -2);
+ }
+ $rep->NewLine();
+ }
+ $rep->NewLine();
+ $DisplayTotal = number_format2($myrow["ov_freight"] +$myrow["ov_freight_tax"] + $myrow["ov_gst"] +
+ $myrow["ov_amount"],$dec);
+ $rep->Font('bold');
+ $rep->TextCol(3, 6, $doc_TOTAL_DELIVERY, - 2);
+ $rep->TextCol(6, 7, $DisplayTotal, -2);
+ $rep->Font();
+ }
if ($email == 1)
{
$myrow['dimension_id'] = $paylink; // helper for pmt link
array( new ReportParam(_('From'),'DELIVERY'),
new ReportParam(_('To'),'DELIVERY'),
new ReportParam(_('email Customers'),'YES_NO'),
+ new ReportParam(_('Print as Packing Slip'),'YES_NO'),
new ReportParam(_('Comments'),'TEXTBOX')));
$reports->addReport(_('Customer'),108,_('Print &Statements'),
array( new ReportParam(_('Customer'),'CUSTOMERS_NO_FILTER'),
display_note(get_customer_trans_view_str(ST_CUSTDELIVERY, $dispatch_no, _("&View This Delivery")), 0, 1);
display_note(print_document_link($dispatch_no, _("&Print Delivery Note"), true, ST_CUSTDELIVERY));
- display_note(print_document_link($dispatch_no, _("&Email Delivery Note"), true, ST_CUSTDELIVERY, false, "", "", 1), 1);
+ display_note(print_document_link($dispatch_no, _("&Email Delivery Note"), true, ST_CUSTDELIVERY, false, "", "", 1), 1, 1);
+ display_note(print_document_link($dispatch_no, _("P&rint as Packing Slip"), true, ST_CUSTDELIVERY, false, "", "", 0, 1));
+ display_note(print_document_link($dispatch_no, _("E&mail as Packing Slip"), true, ST_CUSTDELIVERY, false, "", "", 1, 1), 1);
display_note(get_gl_view_str(13, $dispatch_no, _("View the GL Journal Entries for this Dispatch")),1);
display_notification_centered(sprintf(_('Delivery Note # %d has been updated.'),$delivery_no));
- display_note(get_trans_view_str(ST_CUSTDELIVERY, $delivery_no, _("View this delivery")));
- echo '<br>';
- display_note(print_document_link($delivery_no, _("Print this delivery"), true, ST_CUSTDELIVERY));
+ display_note(get_trans_view_str(ST_CUSTDELIVERY, $delivery_no, _("View this delivery")), 0, 1);
+
+ display_note(print_document_link($delivery_no, _("&Print Delivery Note"), true, ST_CUSTDELIVERY));
+ display_note(print_document_link($delivery_no, _("&Email Delivery Note"), true, ST_CUSTDELIVERY, false, "", "", 1), 1, 1);
+ display_note(print_document_link($delivery_no, _("P&rint as Packing Slip"), true, ST_CUSTDELIVERY, false, "", "", 0, 1));
+ display_note(print_document_link($delivery_no, _("E&mail as Packing Slip"), true, ST_CUSTDELIVERY, false, "", "", 1, 1), 1);
hyperlink_params($path_to_root . "/sales/customer_invoice.php", _("Confirm Delivery and Invoice"), "DeliveryNumber=$delivery_no");
submenu_print(_("&Print Delivery Note"), ST_CUSTDELIVERY, $delivery, 'prtopt');
submenu_print(_("&Email Delivery Note"), ST_CUSTDELIVERY, $delivery, null, 1);
+ submenu_print(_("P&rint as Packing Slip"), ST_CUSTDELIVERY, $delivery, 'prtopt', null, 1);
+ submenu_print(_("E&mail as Packing Slip"), ST_CUSTDELIVERY, $delivery, null, 1, 1);
set_focus('prtopt');
display_note(get_gl_view_str(ST_CUSTDELIVERY, $delivery, _("View the GL Journal Entries for this Dispatch")),0, 1);