hyperlink_params($_SERVER['PHP_SELF'], _("Enter Another &Credit Note"), "NewCredit=yes");
display_footer_exit();
-}
+} else
+ check_edit_conflicts();
+
//--------------------------------------------------------------------------------
function line_start_focus() {
function copy_to_cn()
{
- $_SESSION['Items']->Comments = $_POST['CreditText'];
- $_SESSION['Items']->document_date = $_POST['OrderDate'];
- $_SESSION['Items']->freight_cost = input_num('ChargeFreightCost');
- $_SESSION['Items']->Location = $_POST["Location"];
- $_SESSION['Items']->sales_type = $_POST['sales_type_id'];
- $_SESSION['Items']->reference = $_POST['ref'];
- $_SESSION['Items']->ship_via = $_POST['ShipperID'];
- $_SESSION['Items']->dimension_id = $_POST['dimension_id'];
- $_SESSION['Items']->dimension2_id = $_POST['dimension2_id'];
+ $cart = &$_SESSION['Items'];
+ $cart->Comments = $_POST['CreditText'];
+ $cart->document_date = $_POST['OrderDate'];
+ $cart->freight_cost = input_num('ChargeFreightCost');
+ $cart->Location = $_POST["Location"];
+ $cart->sales_type = $_POST['sales_type_id'];
+ $cart->reference = $_POST['ref'];
+ $cart->ship_via = $_POST['ShipperID'];
+ $cart->dimension_id = $_POST['dimension_id'];
+ $cart->dimension2_id = $_POST['dimension2_id'];
}
//-----------------------------------------------------------------------------
function copy_from_cn()
{
- $_POST['CreditText'] = $_SESSION['Items']->Comments;
- $_POST['OrderDate'] = $_SESSION['Items']->document_date;
- $_POST['ChargeFreightCost'] = price_format($_SESSION['Items']->freight_cost);
- $_POST['Location'] = $_SESSION['Items']->Location;
- $_POST['sales_type_id'] = $_SESSION['Items']->sales_type;
- $_POST['ref'] = $_SESSION['Items']->reference;
- $_POST['ShipperID'] = $_SESSION['Items']->ship_via;
- $_POST['dimension_id'] = $_SESSION['Items']->dimension_id;
- $_POST['dimension2_id'] = $_SESSION['Items']->dimension2_id;
+ $cart = &$_SESSION['Items'];
+ $_POST['CreditText'] = $cart->Comments;
+ $_POST['OrderDate'] = $cart->document_date;
+ $_POST['ChargeFreightCost'] = price_format($cart->freight_cost);
+ $_POST['Location'] = $cart->Location;
+ $_POST['sales_type_id'] = $cart->sales_type;
+ $_POST['ref'] = $cart->reference;
+ $_POST['ShipperID'] = $cart->ship_via;
+ $_POST['dimension_id'] = $cart->dimension_id;
+ $_POST['dimension2_id'] = $cart->dimension2_id;
+ $_POST['cart_id'] = $cart->cart_id;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
start_form(false, true);
+hidden('cart_id');
$customer_error = display_credit_header($_SESSION['Items']);
start_table("$table_style width=80%", 10);
echo "<tr><td>";
display_credit_items(_("Credit Note Items"), $_SESSION['Items']);
- credit_options_controls();
+ credit_options_controls($_SESSION['Items']);
echo "</td></tr>";
end_table();
} else {
display_note(get_gl_view_str($trans_type, $credit_no, _("View the GL &Journal Entries for this Credit Note")),1);
display_footer_exit();
-}
+} else
+ check_edit_conflicts();
+
//-----------------------------------------------------------------------------
$_POST['CreditDate']= $cart->document_date;
$_POST['Location']= $cart->Location;
$_POST['CreditText']= $cart->Comments;
+ $_POST['cart_id'] = $cart->cart_id;
}
//-----------------------------------------------------------------------------
global $table_style, $table_style2;
start_form(false, true);
+ hidden('cart_id');
start_table("$table_style2 width=80%", 5);
echo "<tr><td>"; // outer table
end_page();
exit;
-} elseif (!check_quantities()) {
- display_error(_("Selected quantity cannot be less than quantity invoiced nor more than quantity
- not dispatched on sales order."));
+} else {
+ check_edit_conflicts();
-} elseif(!check_num('ChargeFreightCost', 0))
- display_error(_("Freight cost cannot be less than zero"));
- set_focus('ChargeFreightCost');
+ if (!check_quantities()) {
+ display_error(_("Selected quantity cannot be less than quantity invoiced nor more than quantity
+ not dispatched on sales order."));
+ } elseif(!check_num('ChargeFreightCost', 0))
+ display_error(_("Freight cost cannot be less than zero"));
+ set_focus('ChargeFreightCost');
+}
//-----------------------------------------------------------------------------
$_POST['due_date'] = $cart->due_date;
$_POST['Location'] = $cart->Location;
$_POST['Comments'] = $cart->Comments;
+ $_POST['cart_id'] = $cart->cart_id;
}
//------------------------------------------------------------------------------
}
//------------------------------------------------------------------------------
start_form(false, true);
+hidden('cart_id');
start_table("$table_style2 width=80%", 5);
echo "<tr><td>"; // outer table
page($_SESSION['page_title'], false, false, "", $js);
//-----------------------------------------------------------------------------
+check_edit_conflicts();
if (isset($_GET['AddedID'])) {
//-----------------------------------------------------------------------------
if ( (isset($_GET['DeliveryNumber']) && ($_GET['DeliveryNumber'] > 0) )
- || isset($_GET['BatchInvoice'])) {
+|| isset($_GET['BatchInvoice'])) {
processing_start();
$_POST['InvoiceDate']);
$Ajax->activate('due_date');
}
+
//-----------------------------------------------------------------------------
function check_quantities()
{
$_POST['InvoiceDate']= $cart->document_date;
$_POST['due_date'] = $cart->due_date;
$_POST['Comments']= $cart->Comments;
+ $_POST['cart_id'] = $cart->cart_id;
}
//-----------------------------------------------------------------------------
$is_edition = $_SESSION['Items']->trans_type == 10 && $_SESSION['Items']->trans_no != 0;
start_form(false, true);
+hidden('cart_id');
start_table("$table_style2 width=80%", 5);
hyperlink_params($_SERVER['PHP_SELF'], _("Enter a &New Direct Invoice"), "NewInvoice=0");
display_footer_exit();
-}
+} else
+ check_edit_conflicts();
//-----------------------------------------------------------------------------
$_POST['dimension_id'] = $cart->dimension_id;
$_POST['dimension2_id'] = $cart->dimension2_id;
}
+ $_POST['cart_id'] = $cart->cart_id;
}
//--------------------------------------------------------------------------------
$corder = _("Commit Order Changes");
}
start_form(false, true);
+hidden('cart_id');
$customer_error = display_order_header($_SESSION['Items'],
($_SESSION['Items']->any_already_delivered() == 0), $idate);
display_heading(sprintf(_("Sales Order #%d"),$_GET['trans_no']));
-if (isset($_SESSION['Items']))
+if (isset($_SESSION['View']))
{
- unset ($_SESSION['Items']);
+ unset ($_SESSION['View']);
}
-$_SESSION['Items'] = new Cart(30, $_GET['trans_no'], true);
+$_SESSION['View'] = new Cart(30, $_GET['trans_no'], true);
start_table("$table_style2 width=95%", 5);
echo "<tr valign=top><td>";
echo "<tr valign=top><td>";
start_table("$table_style width=95%");
-label_row(_("Customer Name"), $_SESSION['Items']->customer_name, "class='tableheader2'",
+label_row(_("Customer Name"), $_SESSION['View']->customer_name, "class='tableheader2'",
"colspan=3");
start_row();
-label_cells(_("Customer Order Ref."), $_SESSION['Items']->cust_ref, "class='tableheader2'");
-label_cells(_("Deliver To Branch"), $_SESSION['Items']->deliver_to, "class='tableheader2'");
+label_cells(_("Customer Order Ref."), $_SESSION['View']->cust_ref, "class='tableheader2'");
+label_cells(_("Deliver To Branch"), $_SESSION['View']->deliver_to, "class='tableheader2'");
end_row();
start_row();
-label_cells(_("Ordered On"), $_SESSION['Items']->document_date, "class='tableheader2'");
-label_cells(_("Requested Delivery"), $_SESSION['Items']->due_date, "class='tableheader2'");
+label_cells(_("Ordered On"), $_SESSION['View']->document_date, "class='tableheader2'");
+label_cells(_("Requested Delivery"), $_SESSION['View']->due_date, "class='tableheader2'");
end_row();
start_row();
-label_cells(_("Order Currency"), $_SESSION['Items']->customer_currency, "class='tableheader2'");
-label_cells(_("Deliver From Location"), $_SESSION['Items']->location_name, "class='tableheader2'");
+label_cells(_("Order Currency"), $_SESSION['View']->customer_currency, "class='tableheader2'");
+label_cells(_("Deliver From Location"), $_SESSION['View']->location_name, "class='tableheader2'");
end_row();
-label_row(_("Delivery Address"), nl2br($_SESSION['Items']->delivery_address),
+label_row(_("Delivery Address"), nl2br($_SESSION['View']->delivery_address),
"class='tableheader2'", "colspan=3");
-label_row(_("Telephone"), $_SESSION['Items']->phone, "class='tableheader2'", "colspan=3");
-label_row(_("E-mail"), "<a href='mailto:" . $_SESSION['Items']->email . "'>" . $_SESSION['Items']->email . "</a>",
+label_row(_("Telephone"), $_SESSION['View']->phone, "class='tableheader2'", "colspan=3");
+label_row(_("E-mail"), "<a href='mailto:" . $_SESSION['View']->email . "'>" . $_SESSION['View']->email . "</a>",
"class='tableheader2'", "colspan=3");
-label_row(_("Comments"), $_SESSION['Items']->Comments, "class='tableheader2'", "colspan=3");
+label_row(_("Comments"), $_SESSION['View']->Comments, "class='tableheader2'", "colspan=3");
end_table();
echo "</td><td valign='top'>";
$k = 0; //row colour counter
-foreach ($_SESSION['Items']->line_items as $stock_item) {
+foreach ($_SESSION['View']->line_items as $stock_item) {
$line_total = round2($stock_item->quantity * $stock_item->price * (1 - $stock_item->discount_percent),
user_price_dec());
end_row();
}
-$items_total = $_SESSION['Items']->get_items_total();
+$items_total = $_SESSION['View']->get_items_total();
-$display_total = price_format($items_total + $_SESSION['Items']->freight_cost);
+$display_total = price_format($items_total + $_SESSION['View']->freight_cost);
-label_row(_("Shipping"), price_format($_SESSION['Items']->freight_cost),
+label_row(_("Shipping"), price_format($_SESSION['View']->freight_cost),
"align=right colspan=6", "nowrap align=right");
label_row(_("Total Order Value"), $display_total, "align=right colspan=6",
"nowrap align=right");