"; // outer table
- start_table("$table_style width=100%");
+ start_table(TABLESTYLE, "width=100%");
start_row();
label_cells(_("Customer"), $_SESSION['Items']->customer_name, "class='tableheader2'");
label_cells(_("Branch"), get_branch_name($_SESSION['Items']->Branch), "class='tableheader2'");
@@ -238,15 +248,14 @@ function display_credit_items()
start_row();
// if (!isset($_POST['ref']))
-// $_POST['ref'] = references::get_next(11);
+// $_POST['ref'] = $Refs->get_next(11);
if ($_SESSION['Items']->trans_no==0) {
- ref_cells(_("Reference"), 'ref', '', $_SESSION['Items']->reference, "class='tableheader2'");
+ ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'");
} else {
label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
}
-// label_cells(_("Crediting Invoice"), get_customer_trans_view_str(10, $_SESSION['InvoiceToCredit']), "class='tableheader2'");
- label_cells(_("Crediting Invoice"), get_customer_trans_view_str(10, array_keys($_SESSION['Items']->src_docs)), "class='tableheader2'");
+ label_cells(_("Crediting Invoice"), get_customer_trans_view_str(ST_SALESINVOICE, array_keys($_SESSION['Items']->src_docs)), "class='tableheader2'");
if (!isset($_POST['ShipperID'])) {
$_POST['ShipperID'] = $_SESSION['Items']->ship_via;
@@ -263,11 +272,11 @@ function display_credit_items()
echo " | ";// outer table
- start_table("$table_style width=100%");
+ start_table(TABLESTYLE, "width=100%");
label_row(_("Invoice Date"), $_SESSION['Items']->src_date, "class='tableheader2'");
- date_row(_("Credit Note Date"), 'CreditDate', '', null, 0, 0, 0, "class='tableheader2'");
+ date_row(_("Credit Note Date"), 'CreditDate', '', $_SESSION['Items']->trans_no==0, 0, 0, 0, "class='tableheader2'");
end_table();
@@ -276,7 +285,7 @@ function display_credit_items()
end_table(1); // outer table
div_start('credit_items');
- start_table("$table_style width=80%");
+ start_table(TABLESTYLE, "width=80%");
$th = array(_("Item Code"), _("Item Description"), _("Invoiced Quantity"), _("Units"),
_("Credit Quantity"), _("Price"), _("Discount %"), _("Total"));
table_header($th);
@@ -284,8 +293,8 @@ function display_credit_items()
$k = 0; //row colour counter
foreach ($_SESSION['Items']->line_items as $line_no=>$ln_itm) {
- if ($ln_itm->quantity==$ln_itm->qty_done) {
- continue; // this line was fully credited
+ if ($ln_itm->quantity == $ln_itm->qty_done) {
+ continue; // this line was fully credited/removed
}
alt_table_row_color($k);
@@ -310,24 +319,24 @@ function display_credit_items()
if (!check_num('ChargeFreightCost')) {
$_POST['ChargeFreightCost'] = price_format($_SESSION['Items']->freight_cost);
}
-
+ $colspan = 7;
start_row();
- label_cell(_("Credit Shipping Cost"), "colspan=7 align=right");
- amount_cells_ex(null, "ChargeFreightCost", 6, 8, $_POST['ChargeFreightCost']);
+ label_cell(_("Credit Shipping Cost"), "colspan=$colspan align=right");
+ small_amount_cells(null, "ChargeFreightCost", price_format(get_post('ChargeFreightCost',0)));
end_row();
$inv_items_total = $_SESSION['Items']->get_items_total_dispatch();
$display_sub_total = price_format($inv_items_total + input_num($_POST['ChargeFreightCost']));
- label_row(_("Sub-total"), $display_sub_total, "colspan=7 align=right", "align=right");
+ label_row(_("Sub-total"), $display_sub_total, "colspan=$colspan align=right", "align=right");
$taxes = $_SESSION['Items']->get_taxes(input_num($_POST['ChargeFreightCost']));
- $tax_total = display_edit_tax_items($taxes, 7, $_SESSION['Items']->tax_included);
+ $tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['Items']->tax_included);
$display_total = price_format(($inv_items_total + input_num('ChargeFreightCost') + $tax_total));
- label_row(_("Credit Note Total"), $display_total, "colspan=7 align=right", "align=right");
+ label_row(_("Credit Note Total"), $display_total, "colspan=$colspan align=right", "align=right");
end_table();
div_end();
@@ -336,14 +345,14 @@ function display_credit_items()
//-----------------------------------------------------------------------------
function display_credit_options()
{
- global $table_style2, $Ajax;
- echo " ";
+ global $Ajax;
+ br();
-if (isset($_POST['_CreditType_update']))
- $Ajax->activate('options');
+ if (isset($_POST['_CreditType_update']))
+ $Ajax->activate('options');
- div_start('options');
- start_table("$table_style2");
+ div_start('options');
+ start_table(TABLESTYLE2);
credit_type_list_row(_("Credit Note Type"), 'CreditType', null, true);
@@ -367,7 +376,7 @@ if (isset($_POST['_CreditType_update']))
}
//-----------------------------------------------------------------------------
-if (get_post('Update'))
+if (get_post('Update'))
{
$Ajax->activate('credit_items');
}
@@ -379,7 +388,7 @@ display_credit_options();
echo " ";
submit('Update', _("Update"), true, _('Update credit value for quantities entered'), true);
echo " ";
-submit('ProcessCredit', _("Process Credit Note"), true, '', true);
+submit('ProcessCredit', _("Process Credit Note"), true, '', 'default');
echo "";
end_form();
|