[0000536] Fixed phone/email branch retrieval.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 13 Feb 2011 08:52:27 +0000 (08:52 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 13 Feb 2011 08:52:27 +0000 (08:52 +0000)
sales/includes/ui/sales_order_ui.inc

index fbb669fdc0764d0143650e8603533d2c161d6bac..7ececedb4e6aeb5f93940ab71dcc01b13a3711ac 100644 (file)
@@ -108,9 +108,8 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id)
 
        // FIX - implement editable contact selector in sales order 
        $contact = get_branch_contacts($branch_id, 'order', $customer_id);
-
        $order->set_branch($branch_id, $myrow["tax_group_id"],
-       $myrow["tax_group_name"], @$contact[0]["phone"], @$contact[0]["email"]);
+       $myrow["tax_group_name"], @$contact["phone"], @$contact["email"]);
 
        $address = trim($myrow["br_post_address"]) != '' ? $myrow["br_post_address"]
                : (trim($myrow["br_address"]) != '' ? $myrow["br_address"]:$deliver);
@@ -394,8 +393,6 @@ function display_order_header(&$order, $editable, $date_text)
                        $order->payment_terms = get_payment_terms($order->payment);
                        $order->due_date = get_invoice_duedate($order->payment, $order->document_date);
                        if ($order->payment_terms['cash_sale']) {
-                               $order->cash_account = $order->pos['pos_account'];
-                               $order->account_name = $order->pos['bank_account_name'];
                                $_POST['Location'] = $order->Location = $order->pos['pos_location'];
                                $order->location_name = $order->pos['location_name'];
                        }
@@ -586,7 +583,7 @@ function display_delivery_details(&$order)
                start_table(TABLESTYLE2, "width=60%");
 
                locations_list_row(_("Deliver from Location:"), 'Location', null, false, true);
-               label_row(_("Cash account:"), $order->account_name);
+               label_row(_("Cash account:"), $order->pos['bank_account_name']);
                textarea_row(_("Comments:"), "Comments", $order->Comments, 31, 5);
                end_table();
        } else {