do we need to update rep201? i am still getting wrong numbers specially with the opening balance.


boxygen wrote:

You are absolutely right, but let me show you the situation with real client's data.

Login Here
id: admin
pass: Pakistan1947

Open customer balances report from 1st Jan 2017 till date
Select customer QY009-BABJEE TRADERS
Set Show Balance = Yes
Note down the Ending Balance = 811,922

Now set the date from 23 NOv 2017 till Date with same parameters.
Now the Ending balance will be = -2,609,707

This is because the Opening Balance is wrong i.e. -2,286,233
that is supposed to be 1,135,467

Because you can see 5 Bank Payment Entries that are made to this customer by client.

BP319, BP426, BP747, BP748, BP749.

My point is that since we can't stop customer to make a Bank Payment to a Customer because option is there in FA.

So we need to adjust our report that shall contain such silly accounting mistakes.

I hope my point is clear now.

nice catch..
i also think that the same bug causes the same mistake in report 201.
i been facing it and could never figure out the problem..
it seems this happens when there is opening balance and the bug causes the transactions to appear in the wrong side and the opening balance to be minus.

Seems like we have got it wrong....
so in case of inserting a wrong opening balance, what is the best way to edit it

so do i need to edit the opening balance in the database ?

i'd like to add that we get the correct balance value when we use the supplier transaction inquiry, so there must be something wrong with the report, specially when we select to show the balance "set show balance to yes"

so in one report if we keep "Show Balance no" we get the correct value which is 108,144.00
and when we set it to yes, the balance is -126,185.00

we have started this year with a new FA system, and to get the suppliers balances we added the balance for each supplier in the last day of 2017 by a journal voucher and closed the year.

Now the bug we are getting is kinda weird..
sometimes the opening balance is credit when it should be debit and sometimes its debit when it should be in the credit field.

sometimes the opening balance is credit and that is correct, but it gets a minus sign in the balance and thats not right.
supplier invoice should be credit and supplier payment should be debit.

also there is nothing called charges in accounting.. you should use credit and debit "thats easily fixed by updating the PO file"

please check the image.


(13 replies, posted in Accounts Receivable)

yes this way is much better.


(13 replies, posted in Accounts Receivable)


Thanks a lot bro, its perfect, specially the total sales order.. i love it <3 .


(13 replies, posted in Accounts Receivable)

if the sum of Sales Orders for the printed period can be added to the report it'd make a great addition, right now there is noway to know the sum of all sales orders for the selected period. to get it i either use the calculator to enter the amount of each sales order, or by copying the whole sales order inquiry and paste it into excel.

what is the best way to translate it ?


(13 replies, posted in Accounts Receivable)

i have fixed it by removing the location since i don't need it and replaced it with Order Total,,
here is the code in case someone needs it.

    Copyright (C) FrontAccounting, LLC.
    Released under the terms of the GNU General Public License, GPL, 
    as published by the Free Software Foundation, either version 3 
    of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    See the License here <>.
$page_security = 'SA_SALESBULKREP';
// ----------------------------------------------------------------
// $ Revision:    2.0 $
// Creator:    Joe Hunt
// date_:    2005-05-19
// Title:    Order Status List
// ----------------------------------------------------------------

include_once($path_to_root . "/includes/");
include_once($path_to_root . "/includes/");
include_once($path_to_root . "/includes/");
include_once($path_to_root . "/sales/includes/");
include_once($path_to_root . "/inventory/includes/db/");




function GetSalesOrders($from, $to, $category=0, $location=null, $backorder=0)
    $fromdate = date2sql($from);
    $todate = date2sql($to);

    $sql= "SELECT sorder.order_no,
            FROM ".TB_PREF."sales_orders sorder
                   INNER JOIN ".TB_PREF."sales_order_details line
                    ON sorder.order_no = line.order_no
                    AND sorder.trans_type = line.trans_type
                    AND sorder.trans_type = ".ST_SALESORDER."
                INNER JOIN ".TB_PREF."stock_master item
                    ON line.stk_code = item.stock_id
            WHERE sorder.ord_date >='$fromdate'
                AND sorder.ord_date <='$todate'";
    if ($category > 0)
        $sql .= " AND item.category_id=".db_escape($category);
    if ($location != null)
        $sql .= " AND sorder.from_stk_loc=".db_escape($location);
    if ($backorder)
        $sql .= " AND line.quantity - line.qty_sent > 0";
    $sql .= " ORDER BY sorder.order_no";

    return db_query($sql, "Error getting order details");


function print_order_status_list()
    global $path_to_root;

    $from = $_POST['PARAM_0'];
    $to = $_POST['PARAM_1'];
    $category = $_POST['PARAM_2'];
    $location = $_POST['PARAM_3'];
    $backorder = $_POST['PARAM_4'];
    $comments = $_POST['PARAM_5'];
    $orientation = $_POST['PARAM_6'];
    $destination = $_POST['PARAM_7'];
    if ($destination)
        include_once($path_to_root . "/reporting/includes/");
        include_once($path_to_root . "/reporting/includes/");
    $orientation = ($orientation ? 'L' : 'P');

    if ($category == ALL_NUMERIC)
        $category = 0;
    if ($location == ALL_TEXT)
        $location = null;
    if ($category == 0)
        $cat = _('All');
        $cat = get_category_name($category);
    if ($location == null)
        $loc = _('All');
        $loc = get_location_name($location);
    if ($backorder == 0)
        $back = _('All Orders');
        $back = _('Back Orders Only');

    $cols = array(0, 60, 150, 260, 325,    385, 450, 515);

    $headers2 = array(_('Order'), _('Customer'), _('Branch'), _('Customer Ref'),
        _('Ord Date'),    _('Del Date'),    _('Order Total'));

    $aligns = array('left',    'left',    'right', 'right', 'right', 'right',    'right');

    $headers = array(_('Code'),    _('Description'), _('Ordered'),    _('Delivered'),
        _('Outstanding'), '');

    $params =   array(     0 => $comments,
                        1 => array(  'text' => _('Period'), 'from' => $from, 'to' => $to),
                        2 => array(  'text' => _('Category'), 'from' => $cat,'to' => ''),
                        3 => array(  'text' => _('Location'), 'from' => $loc, 'to' => ''),
                        4 => array(  'text' => _('Selection'),'from' => $back,'to' => ''));

    $aligns2 = $aligns;

    $rep = new FrontReport(_('Order Status Listing'), "OrderStatusListing", user_pagesize(), 9, $orientation);
    if ($orientation == 'L')
    $cols2 = $cols;
    $rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2);

    $orderno = 0;

    $result = GetSalesOrders($from, $to, $category, $location, $backorder);

    while ($myrow=db_fetch($result))
        $rep->NewLine(0, 2, false, $orderno);
        if ($orderno != $myrow['order_no'])
            if ($orderno != 0)
            $rep->TextCol(0, 1,    $myrow['order_no']);
            $rep->TextCol(1, 2,    get_customer_name($myrow['debtor_no']));
            $rep->TextCol(2, 3,    get_branch_name($myrow['branch_code']));
            $rep->TextCol(3, 4,    $myrow['customer_ref']);
            $rep->DateCol(4, 5,    $myrow['ord_date'], true);
            $rep->DateCol(5, 6,    $myrow['delivery_date'], true);
            $rep->TextCol(6, 7,    $myrow['total']);
            $orderno = $myrow['order_no'];
        $rep->TextCol(0, 1,    $myrow['stk_code']);
        $rep->TextCol(1, 2,    $myrow['description']);
        $dec = get_qty_dec($myrow['stk_code']);
        $rep->AmountCol(2, 3, $myrow['quantity'], $dec);
        $rep->AmountCol(3, 4, $myrow['qty_sent'], $dec);
        $rep->AmountCol(4, 5, $myrow['quantity'] - $myrow['qty_sent'], $dec);
        if ($myrow['quantity'] - $myrow['qty_sent'] > 0)
            $rep->TextCol(5, 6,    _('Outstanding'));


(13 replies, posted in Accounts Receivable)


Thats the same as printing Sales Orders.
i think report 105 is just perfect if we can add the total amount for each sales order next to the location.



Is there anyway to check the items in all sales order for today and the amount or the total value of all sales orders for a certain period, like today.

Right now we have to download all today's sales order and to calculate them one by one. There is also no way to know what items that has been requested in the sales order.

I don't know if there is a better way that I am unaware of.

Kind Regards.

good-luck bro, waiting for the great news.

how long do you think it'll take?

How to close a task or set the begin and end dates?


(5 replies, posted in Report Bugs here)

works great now.. but wondering why $sign works just fine in other reports like 107.


(5 replies, posted in Report Bugs here)

it seems there is a bug in report 110 "Print Deliveries"
the bug appears when you create a new sales order and add a shipping value.

the shipping value would be shown correctly in the sales order report.
but when printing deliveries the shipping value w'll always appear as "0" even though the total balance is correct.

i tested it on the default demo page and i got the same result.

please check the attached image

seems like there is a bug with this code, when you print an invoice for a customer who have a credit note the balance w'll be incorrect.


(5 replies, posted in Report Bugs here)

Thanks a lot..
works pretty well now.


(5 replies, posted in Report Bugs here)

in my old FA installation 2.4 beta i used to select the latest (newest) invoice in the "from" drop down and the 1st issued invoice (oldest) in the "to" .. it used to work..

now when i try it in 2.4.3 i get white pdf.. but if i do it the other way by selecting the oldest invoice in the "From" and the newest in the "to" .. the report is generated successfully, but i get the following errors
You have missing or invalid sales document in database (type:30, number:28).
You have missing or invalid sales document in database (type:30, number:29).
You have missing or invalid sales document in database (type:30, number:38).
You have missing or invalid sales document in database (type:30, number:71).
You have missing or invalid sales document in database (type:30, number:82).
You have missing or invalid sales document in database (type:30, number:462).


(5 replies, posted in Report Bugs here)

it seems there is a bug when trying to Generate "Print Sales Orders" ID 109.
if you select to print just 1 sale order.. like the last sales order it works.. but if you select a range of sales order "multiple sales order"  like 2 or more than one sale order then you get a white pdf.

i could produce this on the demo FA website.

this is the file you need to update.

Is it possible to edit the customer payment ??
sometimes i make a mistake by selecting the wrong customer,
when i try to edit only the price value is editable.. not the customer name/branch.

is there anyway to change the customer name or do we have to void it ?


(5 replies, posted in Report Bugs here)

ty bro <3