X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep112.php;h=ba6c94653b4571ccf24f83b4ff94a1294ad7efd4;hb=aed0d601bf245cda4ae5867b8c2f54925658644d;hp=d2e06c0964a0e4e221f097366220d21d19f9cf02;hpb=565a41e2d7fd4b4a32848e4829c11dbbcb5881d1;p=fa-stable.git diff --git a/reporting/rep112.php b/reporting/rep112.php index d2e06c09..ba6c9465 100644 --- a/reporting/rep112.php +++ b/reporting/rep112.php @@ -71,14 +71,14 @@ function print_receipts() $currency = $_POST['PARAM_2']; $comments = $_POST['PARAM_3']; - if ($from == null) - $from = 0; - if ($to == null) - $to = 0; + if (!$from || !$to) return; + $dec = user_price_dec(); $fno = explode("-", $from); $tno = explode("-", $to); + $from = min($fno[0], $tno[0]); + $to = max($fno[0], $tno[0]); $cols = array(4, 85, 150, 225, 275, 360, 450, 515); @@ -95,7 +95,7 @@ function print_receipts() $rep->Font(); $rep->Info($params, $cols, null, $aligns); - for ($i = $fno[0]; $i <= $tno[0]; $i++) + for ($i = $from; $i <= $to; $i++) { if ($fno[0] == $tno[0]) $types = array($fno[1]); @@ -106,8 +106,9 @@ function print_receipts() $myrow = get_receipt($j, $i); if (!$myrow) continue; - $baccount = get_default_bank_account($myrow['curr_code']); - $params['bankaccount'] = $baccount['id']; + $res = get_bank_trans($j, $i); + $baccount = db_fetch($res); + $params['bankaccount'] = $baccount['bank_act']; $rep->title = _('RECEIPT'); $contacts = get_branch_contacts($myrow['branch_code'], 'invoice', $myrow['debtor_no']); @@ -137,6 +138,13 @@ function print_receipts() $rep->NewPage(); } + $memo = get_comments_string($j, $i); + if ($memo != "") + { + $rep->NewLine(); + $rep->TextColLines(1, 5, $memo, -2); + } + $rep->row = $rep->bottomMargin + (15 * $rep->lineHeight); $rep->TextCol(3, 6, _("Total Allocated"), -2);