$rep->TextCol(2, 3, sql2date($myrow2['tran_date']), -2);
if ($myrow2['type'] == ST_SALESINVOICE)
$rep->TextCol(3, 4, sql2date($myrow2['due_date']), -2);
- if ($myrow2['type'] == ST_SALESINVOICE || $myrow2['type'] == ST_BANKPAYMENT)
+ if ($myrow2['type'] == ST_SALESINVOICE || $myrow2['type'] == ST_BANKPAYMENT ||
+ ($myrow2['type'] == ST_JOURNAL && $myrow2["TotalAmount"] > 0.0))
$rep->TextCol(4, 5, $DisplayTotal, -2);
else
$rep->TextCol(5, 6, $DisplayTotal, -2);
$past1 = get_company_pref('past_due_days');
$past2 = 2 * $past1;
// removed - debtor_trans.alloc from all summations
- $sign = "IF(`type` IN(".implode(',', array(ST_CUSTCREDIT,ST_CUSTPAYMENT,ST_BANKDEPOSIT,ST_JOURNAL))."), -1, 1)";
+ $sign = "IF(`type` IN(".implode(',', array(ST_CUSTCREDIT,ST_CUSTPAYMENT,ST_BANKDEPOSIT))."), -1, 1)";
if ($all)
$value = "IFNULL($sign*(trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount),0)";
else