- date_row(_("Date:"), 'OrderDate');
-
-// if (!isset($_POST['tax_group_id']) || $_POST['tax_group_id'] == "")
-// $_POST['tax_group_id'] = $order->tax_group_id;
-// tax_groups_list_row(_("Tax Group:"), 'tax_group_id', null, true);
- shippers_list_row(_("Shipping Company:"), 'ShipperID', $order->ship_via);
-
- echo "</table>";
-
- echo "</td></tr>";
+ date_row(_("Date:"), 'OrderDate', '', $order->trans_no==0, 0, 0, 0, null, true);
+ if (isset($_POST['_OrderDate_changed'])) {
+ if (!is_company_currency($order->customer_currency)
+ && (get_base_sales_type()>0)) {
+ $change_prices = 1;
+ }
+ $Ajax->activate('_ex_rate');
+ }
+ // 2008-11-12 Joe Hunt added dimensions
+ $dim = get_company_pref('use_dimension');
+ if ($dim > 0)
+ dimensions_list_row(_("Dimension").":", 'dimension_id',
+ null, true, ' ', false, 1, false);
+ else
+ hidden('dimension_id', 0);
+ if ($dim > 1)
+ dimensions_list_row(_("Dimension")." 2:", 'dimension2_id',
+ null, true, ' ', false, 2, false);
+ else
+ hidden('dimension2_id', 0);
+
+ end_outer_table(1); // outer table
+
+ if ($change_prices != 0) {
+ foreach ($order->line_items as $line_no=>$item) {
+ $line = &$order->line_items[$line_no];
+ $line->price = get_price($line->stock_id, $order->customer_currency,
+ $order->sales_type, $order->price_factor, get_post('OrderDate'));
+ // $line->discount_percent = $order->default_discount;
+ }
+ $Ajax->activate('items_table');
+ }