X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fdb%2Fsales_delivery_db.inc;h=f2237dbd9fe0f6e21aef534990784543ae1a672c;hb=fd59c60718609c1bf3240a303030167a4f1b1885;hp=11aa2f665c0cc57525320e3f8b87824c3d3a39b3;hpb=72c2c14186e95cfe455c29b16cd0c20a8b029440;p=fa-stable.git diff --git a/sales/includes/db/sales_delivery_db.inc b/sales/includes/db/sales_delivery_db.inc index 11aa2f66..f2237dbd 100644 --- a/sales/includes/db/sales_delivery_db.inc +++ b/sales/includes/db/sales_delivery_db.inc @@ -31,7 +31,7 @@ function write_sales_delivery(&$delivery,$bo_policy) $delivery->freight_cost, $delivery->tax_included ? 0 : $freight_tax, $delivery->sales_type, $delivery->order_no, 0, - $delivery->ship_via, $delivery->due_date); + $delivery->ship_via, $delivery->due_date, 0, $delivery->dimension_id, $delivery->dimension2_id); if ($trans_no == 0) { $delivery->trans_no = array($delivery_no=>0); @@ -81,8 +81,8 @@ function write_sales_delivery(&$delivery,$bo_policy) /*first the cost of sales entry*/ // 2008-08-01. If there is a Customer Dimension, then override with this, // else take the Item Dimension (if any) - $dim = ($customer['dimension_id'] != 0 ? $customer["dimension_id"] : $stock_gl_code["dimension_id"]); - $dim2 = ($customer['dimension2_id'] != 0 ? $customer["dimension2_id"] : $stock_gl_code["dimension2_id"]); + $dim = ($delivery->dimension_id > 0 ? $delivery->dimension_id : ($customer['dimension_id'] != 0 ? $customer["dimension_id"] : $stock_gl_code["dimension_id"])); + $dim2 = ($delivery->dimension2_id > 0 ? $delivery->dimension2_id : ($customer['dimension2_id'] != 0 ? $customer["dimension2_id"] : $stock_gl_code["dimension2_id"])); add_gl_trans_std_cost(13, $delivery_no, $delivery->document_date, $stock_gl_code["cogs_account"], $dim, $dim2, "",