- if ($_SESSION['Items']->direct_invoice)
- $_SESSION['Items']->memo_ = $_POST['InvoiceText'];
-
- $_SESSION['Items']->orig_order_date = $_POST['OrderDate'];
- $_SESSION['Items']->delivery_date = $_POST['delivery_date'];
- $_SESSION['Items']->cust_ref = $_POST['cust_ref'];
- $_SESSION['Items']->freight_cost = $_POST['freight_cost'];
- $_SESSION['Items']->Comments = $_POST['Comments'];
-
- $_SESSION['Items']->deliver_to = $_POST['deliver_to'];
- $_SESSION['Items']->delivery_address = $_POST["delivery_address"];
- $_SESSION['Items']->phone = $_POST["phone"];
- $_SESSION['Items']->Location = $_POST["Location"];
- $_SESSION['Items']->ship_via = $_POST["ship_via"];
+ $cart = &$_SESSION['Items'];
+
+ if ($cart->trans_type!=30) {
+ $cart->reference = $_POST['ref'];
+ }
+ $cart->Comments = $_POST['Comments'];
+
+ $cart->document_date = $_POST['OrderDate'];
+ if ($cart->trans_type == 10)
+ $cart->cash = $_POST['cash'];
+ if ($cart->cash) {
+ $cart->due_date = $cart->document_date;
+ $cart->phone = $cart->cust_ref = $cart->delivery_address = '';
+ $cart->freight_cost = 0;
+ $cart->ship_via = 1;
+ $cart->deliver_to = '';//$_POST['deliver_to'];
+ } else {
+ $cart->due_date = $_POST['delivery_date'];
+ $cart->cust_ref = $_POST['cust_ref'];
+ $cart->freight_cost = input_num('freight_cost');
+ $cart->deliver_to = $_POST['deliver_to'];
+ $cart->delivery_address = $_POST['delivery_address'];
+ $cart->phone = $_POST['phone'];
+ $cart->Location = $_POST['Location'];
+ $cart->ship_via = $_POST['ship_via'];
+ }
+ if (isset($_POST['email']))
+ $cart->email =$_POST['email'];
+ else
+ $cart->email = '';
+ $cart->customer_id = $_POST['customer_id'];
+ $cart->Branch = $_POST['branch_id'];
+ $cart->sales_type = $_POST['sales_type'];
+ // POS