Skip to content

Commit

Permalink
No display of shipping if there are no shipping costs on sales docume…
Browse files Browse the repository at this point in the history
…nts or views.
  • Loading branch information
joe-hunt committed Nov 23, 2015
1 parent fbfb1ee commit 805b766
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 33 deletions.
11 changes: 7 additions & 4 deletions reporting/rep107.php
Expand Up @@ -145,17 +145,20 @@ function print_invoices()
}

$DisplaySubTot = number_format2($SubTotal,$dec);
$DisplayFreight = number_format2($sign*$myrow["ov_freight"],$dec);

$rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
$doctype = ST_SALESINVOICE;

$rep->TextCol(3, 6, _("Sub-total"), -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
$rep->NewLine();
$rep->TextCol(3, 6, _("Shipping"), -2);
$rep->TextCol(6, 7, $DisplayFreight, -2);
$rep->NewLine();
if ($myrow['ov_freight'] != 0.0)
{
$DisplayFreight = number_format2($sign*$myrow["ov_freight"],$dec);
$rep->TextCol(3, 6, _("Shipping"), -2);
$rep->TextCol(6, 7, $DisplayFreight, -2);
$rep->NewLine();
}
$tax_items = get_trans_tax_details(ST_SALESINVOICE, $i);
$first = true;
while ($tax_item = db_fetch($tax_items))
Expand Down
12 changes: 7 additions & 5 deletions reporting/rep109.php
Expand Up @@ -144,18 +144,20 @@ function print_sales_orders()
$rep->TextColLines(1, 5, $myrow['comments'], -2);
}
$DisplaySubTot = number_format2($SubTotal,$dec);
$DisplayFreight = number_format2($myrow["freight_cost"],$dec);

$rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
$doctype = ST_SALESORDER;

$rep->TextCol(3, 6, _("Sub-total"), -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
$rep->NewLine();
$rep->TextCol(3, 6, _("Shipping"), -2);
$rep->TextCol(6, 7, $DisplayFreight, -2);
$rep->NewLine();

if ($myrow['freight_cost'] != 0.0)
{
$DisplayFreight = number_format2($myrow["freight_cost"],$dec);
$rep->TextCol(3, 6, _("Shipping"), -2);
$rep->TextCol(6, 7, $DisplayFreight, -2);
$rep->NewLine();
}
$DisplayTotal = number_format2($myrow["freight_cost"] + $SubTotal, $dec);
if ($myrow['tax_included'] == 0) {
$rep->TextCol(3, 6, _("TOTAL ORDER EX VAT"), - 2);
Expand Down
11 changes: 7 additions & 4 deletions reporting/rep110.php
Expand Up @@ -150,7 +150,6 @@ function print_deliveries()
}

$DisplaySubTot = number_format2($SubTotal,$dec);
$DisplayFreight = number_format2($myrow["ov_freight"],$dec);

$rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
$doctype=ST_CUSTDELIVERY;
Expand All @@ -159,9 +158,13 @@ function print_deliveries()
$rep->TextCol(3, 6, _("Sub-total"), -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
$rep->NewLine();
$rep->TextCol(3, 6, _("Shipping"), -2);
$rep->TextCol(6, 7, $DisplayFreight, -2);
$rep->NewLine();
if ($myrow['ov_freight'] != 0.0)
{
$DisplayFreight = number_format2($myrow["ov_freight"],$dec);
$rep->TextCol(3, 6, _("Shipping"), -2);
$rep->TextCol(6, 7, $DisplayFreight, -2);
$rep->NewLine();
}
$tax_items = get_trans_tax_details(ST_CUSTDELIVERY, $i);
$first = true;
while ($tax_item = db_fetch($tax_items))
Expand Down
12 changes: 7 additions & 5 deletions reporting/rep111.php
Expand Up @@ -147,18 +147,20 @@ function print_sales_quotations()
$rep->TextColLines(1, 5, $myrow['comments'], -2);
}
$DisplaySubTot = number_format2($SubTotal,$dec);
$DisplayFreight = number_format2($myrow["freight_cost"],$dec);

$rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
$doctype = ST_SALESQUOTE;

$rep->TextCol(3, 6, _("Sub-total"), -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
$rep->NewLine();
$rep->TextCol(3, 6, _("Shipping"), -2);
$rep->TextCol(6, 7, $DisplayFreight, -2);
$rep->NewLine();

if ($myrow['freight_cost'] != 0.0)
{
$DisplayFreight = number_format2($myrow["freight_cost"],$dec);
$rep->TextCol(3, 6, _("Shipping"), -2);
$rep->TextCol(6, 7, $DisplayFreight, -2);
$rep->NewLine();
}
$DisplayTotal = number_format2($myrow["freight_cost"] + $SubTotal, $dec);
if ($myrow['tax_included'] == 0) {
$rep->TextCol(3, 6, _("TOTAL ORDER EX VAT"), - 2);
Expand Down
11 changes: 7 additions & 4 deletions reporting/rep113.php
Expand Up @@ -139,17 +139,20 @@ function print_credits()
}

$DisplaySubTot = number_format2($SubTotal,$dec);
$DisplayFreight = number_format2($sign*$myrow["ov_freight"],$dec);

$rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
$doctype = ST_CUSTCREDIT;

$rep->TextCol(3, 6, _("Sub-total"), -2);
$rep->TextCol(6, 7, $DisplaySubTot, -2);
$rep->NewLine();
$rep->TextCol(3, 6, _("Shipping"), -2);
$rep->TextCol(6, 7, $DisplayFreight, -2);
$rep->NewLine();
if ($myrow['ov_freight'] != 0.0)
{
$DisplayFreight = number_format2($sign*$myrow["ov_freight"],$dec);
$rep->TextCol(3, 6, _("Shipping"), -2);
$rep->TextCol(6, 7, $DisplayFreight, -2);
$rep->NewLine();
}
$tax_items = get_trans_tax_details(ST_CUSTCREDIT, $i);
$first = true;
while ($tax_item = db_fetch($tax_items))
Expand Down
7 changes: 5 additions & 2 deletions sales/view/view_credit.php
Expand Up @@ -126,7 +126,6 @@
display_note(_("There are no line items on this credit note."), 1, 2);

$display_sub_tot = price_format($sub_total);
$display_freight = price_format($myrow["ov_freight"]);

$credit_total = $myrow["ov_freight"]+$myrow["ov_gst"]+$myrow["ov_amount"]+$myrow["ov_freight_tax"];
$display_total = price_format($credit_total);
Expand All @@ -135,8 +134,12 @@
if ($sub_total != 0)
label_row(_("Sub Total"), $display_sub_tot, "colspan=6 align=right",
"nowrap align=right width='15%'");
label_row(_("Shipping"), $display_freight, "colspan=6 align=right", "nowrap align=right");

if ($myrow["ov_freight"] != 0.0)
{
$display_freight = price_format($myrow["ov_freight"]);
label_row(_("Shipping"), $display_freight, "colspan=6 align=right", "nowrap align=right");
}
$tax_items = get_trans_tax_details(ST_CUSTCREDIT, $trans_id);
display_customer_trans_tax_details($tax_items, 6);

Expand Down
9 changes: 5 additions & 4 deletions sales/view/view_dispatch.php
Expand Up @@ -150,10 +150,11 @@
else
display_note(_("There are no line items on this dispatch."), 1, 2);

$display_freight = price_format($myrow["ov_freight"]);

label_row(_("Shipping"), $display_freight, "colspan=6 align=right", "nowrap align=right");

if ($myrow['ov_freight'] != 0.0)
{
$display_freight = price_format($myrow["ov_freight"]);
label_row(_("Shipping"), $display_freight, "colspan=6 align=right", "nowrap align=right");
}
$tax_items = get_trans_tax_details(ST_CUSTDELIVERY, $trans_id);
display_customer_trans_tax_details($tax_items, 6);

Expand Down
8 changes: 5 additions & 3 deletions sales/view/view_invoice.php
Expand Up @@ -151,11 +151,13 @@
else
display_note(_("There are no line items on this invoice."), 1, 2);

$display_freight = price_format($myrow["ov_freight"]);

/*Print out the invoice text entered */
label_row(_("Shipping"), $display_freight, "colspan=6 align=right", "nowrap align=right");

if ($myrow['ov_freight'] != 0.0)
{
$display_freight = price_format($myrow["ov_freight"]);
label_row(_("Shipping"), $display_freight, "colspan=6 align=right", "nowrap align=right");
}
$tax_items = get_trans_tax_details(ST_SALESINVOICE, $trans_id);
display_customer_trans_tax_details($tax_items, 6);

Expand Down
5 changes: 3 additions & 2 deletions sales/view/view_sales_order.php
Expand Up @@ -224,8 +224,9 @@
end_row();
}

label_row(_("Shipping"), price_format($_SESSION['View']->freight_cost),
"align=right colspan=6", "nowrap align=right", 1);
if ($_SESSION['View']->freight_cost != 0.0)
label_row(_("Shipping"), price_format($_SESSION['View']->freight_cost),
"align=right colspan=6", "nowrap align=right", 1);

$sub_tot = $_SESSION['View']->get_items_total() + $_SESSION['View']->freight_cost;

Expand Down

0 comments on commit 805b766

Please sign in to comment.