X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Finquiry%2Fcustomer_allocation_inquiry.php;h=5630f04d20facd74821acb5918f19a9266f9c6ff;hb=ec98559a543b666f4824149e8522d0aa65818936;hp=e3aa9567082a2e45dea005cd09e260808ee3a04f;hpb=832403f85f84fc91734eca085a32db6a509ffd3d;p=fa-stable.git diff --git a/sales/inquiry/customer_allocation_inquiry.php b/sales/inquiry/customer_allocation_inquiry.php index e3aa9567..5630f04d 100644 --- a/sales/inquiry/customer_allocation_inquiry.php +++ b/sales/inquiry/customer_allocation_inquiry.php @@ -87,7 +87,7 @@ function due_date($row) function fmt_balance($row) { - return $row["TotalAmount"] - $row["Allocated"]; + return ($row["type"] == ST_JOURNAL && $row["TotalAmount"] < 0 ? -$row["TotalAmount"] : $row["TotalAmount"]) - $row["Allocated"]; } function alloc_link($row) @@ -144,9 +144,9 @@ $sql = get_sql_for_customer_allocation_inquiry(get_post('TransAfterDate'), get_p //------------------------------------------------------------------------------------------------ $cols = array( _("Type") => array('fun'=>'systype_name'), - _("#") => array('fun'=>'view_link'), + _("#") => array('fun'=>'view_link', 'align'=>'right'), _("Reference"), - _("Order") => array('fun'=>'order_link', 'ord'=>''), + _("Order") => array('fun'=>'order_link', 'ord'=>'', 'align'=>'right'), _("Date") => array('name'=>'tran_date', 'type'=>'date', 'ord'=>'asc'), _("Due Date") => array('type'=>'date', 'fun'=>'due_date'), _("Customer") => array('name' =>'name', 'ord'=>'asc'),