X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep309.php;h=67f4a07c35333ab18d937ad24834ee8231365b74;hb=5fb0585fed8931145e34038debf2323d434f3b51;hp=6b769bf322a37ca822eb846aa9d51c11a28351ae;hpb=840f9a44261cdf4ee95a5cc9a29314b9ddb06b9c;p=fa-stable.git diff --git a/reporting/rep309.php b/reporting/rep309.php index 6b769bf3..67f4a07c 100644 --- a/reporting/rep309.php +++ b/reporting/rep309.php @@ -38,7 +38,7 @@ function getTransactions($category, $from, $to) item.stock_id, item.description, line.unit_price * trans.rate AS unit_price, - SUM(line.quantity) as quantity + SUM(IF(line.debtor_trans_type = ".ST_CUSTCREDIT.", -line.quantity, line.quantity)) AS quantity FROM ".TB_PREF."stock_master item, ".TB_PREF."stock_category category, ".TB_PREF."debtor_trans trans,