I'm trying to set up credit card takings.

Credit card takings at POS: Credit card Takings Bank Account (Dr)
                                          Sales account (Cr)

When merchant services payment is received: Credit Card Takings Bank Account (Cr)
                                                                    Business Current Bank Account (Dr)
                                                                    Bank Charges (Dr)

Question is do the Bank account types (Savings, Cash, Credit, Chequing) affect operation? - Or are they just for info. Not sure which fits Credit card Takings Bank Account?
Also is best to setup Quick entry for transactions when merchant services payment received? I have three different terminals and accounts to reconcile, so planned to track these for reconciliation using dimensions?

Anyone else set a similar situation up and can give advice?
Many thanks.

27

(1 replies, posted in Reporting)

Anyone having a problem with reports in pdf files especially when getting slightly larger? Cannot view in different browsers or adobe - indicates error?

Can send to Excel with no problems?

28

(2 replies, posted in Setup)

I couldn't find much info on loading the module/extensions manually.

For anyone who needs to add a module manually ( specifically rep_tax_cash_basis in this example) The extension file is available from https://github.com/apmuthu/frontaccounting/tree/master/extensions

These are placed in the modules directory and info from the \modules\rep_tax_cash_basis\_init\config file and placed in the file \installed_extensions.php extending the array as below: 

Instructions are given in this file to increment $next_extension_id  also.

  0 =>
  array (
    'name' => 'British COA',
    'package' => 'chart_en_GB-general',
    'version' => '2.3.0-4',
    'type' => 'chart',
    'active' => false,
    'path' => 'sql',
    'sql' => 'en_GB-general.sql',
  ),
  1 =>
  array (
    'name' => 'Cash Basis Tax Reporting',
    'package' => 'rep_tax_cash_basis',
    'version' => '2.3.7-4',
    'type' => 'extension',
    'active' => true,
    'path' => 'modules/rep_tax_cash_basis',
    'sql' => '',
  ),

The same needs to be done in the company file for it to be active for that company ie \company\X\installed_extensions.php

And that's it.

29

(2 replies, posted in Setup)

Are there any instructions on how to install extensions manually.

I 'm running 2.3.22 and using the automatic install in the setup menu get no errors logged and it seems to tie FA up and hang it. All write permissions ok for modules and tmp directory/files

It seems it's the memory limit, due to the archive. I can't increase this. Is there any way round this? I have tried the unpacked extension directory in  /modules/   

Anyone else had this problem?

Thanks

30

(44 replies, posted in Reporting)

As a temporary fix to enable me to correctly use FA for tax reporting I have modified the code to post net amount from SI entry now - This is implemented using QE so that the 0VAT is associated to a particular entry. For the 0VAT reporting to work the zero-rated QE must be used. The posting to the tables works correctly.

The tax report rep709 however reports each SI twice. This is as a result of the following sql query:

SELECT tt.name as taxname, taxrec.*, taxrec.amount*ex_rate AS amount,
                taxrec.net_amount*ex_rate AS net_amount,
                IF(taxrec.trans_type= 1 OR taxrec.trans_type=2,
                    IF(gl.person_type_id<>0, gl.memo_, gl.person_id),
                    IF(ISNULL(supp.supp_name), debt.name, supp.supp_name)) as name,
                branch.br_name
        FROM 0_trans_tax_details taxrec
        LEFT JOIN 0_tax_types tt
            ON taxrec.tax_type_id=tt.id
        LEFT JOIN 0_gl_trans gl
            ON taxrec.trans_type=gl.type AND taxrec.trans_no=gl.type_no AND
            (tt.purchasing_gl_code=gl.account OR tt.sales_gl_code=gl.account)
        LEFT JOIN 0_supp_trans strans
            ON taxrec.trans_no=strans.trans_no AND taxrec.trans_type=strans.type
        LEFT JOIN 0_suppliers as supp ON strans.supplier_id=supp.supplier_id
        LEFT JOIN 0_debtor_trans dtrans
            ON taxrec.trans_no=dtrans.trans_no AND taxrec.trans_type=dtrans.type
        LEFT JOIN 0_debtors_master as debt ON dtrans.debtor_no=debt.debtor_no
        LEFT JOIN 0_cust_branch as branch ON dtrans.branch_code=branch.branch_code
        WHERE (taxrec.amount <> 0 OR taxrec.net_amount <> 0)
            AND taxrec.trans_type <> 13
        ORDER BY taxrec.trans_type, taxrec.tran_date, taxrec.trans_no, taxrec.ex_rate

I haven't looked further into this report yet, the joins are obviously pulling the data out twice when only required once.
To save time, wondered if anyone had encountered this issue before.  Before I start modifying the statement.

On a longer term, when I have more time, I would like to modify the SI code to deal with input more on the lines of elax's Banking/GL entry. Unless, of course, this is dealt with in a future version of FA.

Thanks

Carlo
I see the problem. The required data is available in the trans_tax_details table which is accessed lower down in the report -get_trans_tax_details(ST_SALESINVOICE, $I)   and the data is used -(".$tax_item['rate']."%)

One approach is therefore to get that data and incorporate appropriately. I am working on other things at the moment, but I would look further into that. Sorry I can't be more help at this time.

32

(44 replies, posted in Reporting)

@apmuthu: feedback for post 39.

Same results found -ie those noted in post 40

Many thanks for help so far

33

(44 replies, posted in Reporting)

@apmuthu: I will check the files again when I get some time later, although I didn't think i'd missed anything.

It would appear that:

trans_type 20 (SI) doesn't post net_amount (just sets it to 0) to trans_tax_details when posting SI with no items included just gl item entries.

trans_type 20 (SI) posts net_amount to trans_tax_details when posting SI with items included just gl item entries and also posts another entry to the trans_tax_details with net_amount =0

As noted Banking and Journal entry seems fine.

@elax: do you have any pointers as to where to look to sort this?

34

(44 replies, posted in Reporting)

I have removed the above

Link for gl_tax_support files for ver: 2.3.22  (0-VAT reporting)
http://91.84.138.17/FAdev/FrontaccountingTaxPatch2.3.22.rar

temporarily as this seems to have caused a problem with the reporting on the SI which was not there previously. Banking and Journal entries seem to work and report 0VAT ok.

@elax: SI doesn't post tax when just GL Items entered. When items are added into SI with GL items tax including 0VAT is posted (which was before patch) but is now reported twice?

Hi Carlo

Try the one below. From what you say I think it should fit your requirements. - It is available elsewhere on this forum.


<?php
/**********************************************************************
    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
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = $_POST['PARAM_0'] == $_POST['PARAM_1'] ?
    'SA_SALESTRANSVIEW' : 'SA_SALESBULKREP';
// ----------------------------------------------------------------
// $ Revision:    2.0 $
// Creator:    Joe Hunt
// date_:    2005-05-19
// Title:    Print Invoices
// ----------------------------------------------------------------
$path_to_root="..";

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/sales/includes/sales_db.inc");

//----------------------------------------------------------------------------------------------------

print_invoices();

//----------------------------------------------------------------------------------------------------

function print_invoices()
{
    global $path_to_root, $alternative_tax_include_on_docs, $suppress_tax_rates, $no_zero_lines_amount;
   
    include_once($path_to_root . "/reporting/includes/pdf_report.inc");

    $from = $_POST['PARAM_0'];
    $to = $_POST['PARAM_1'];
    $currency = $_POST['PARAM_2'];
    $email = $_POST['PARAM_3'];
    $pay_service = $_POST['PARAM_4'];
    $comments = $_POST['PARAM_5'];
    $customer = $_POST['PARAM_6'];
    $orientation = $_POST['PARAM_7'];

    if (!$from || !$to) return;

    $orientation = ($orientation ? 'L' : 'P');
    $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, 60, 225, 300, 325, 375, 425, 465, 515);

    // $headers in doctext.inc
    $aligns = array('left',    'left',    'right', 'left', 'right', 'right', 'right', 'right');

    $params = array('comments' => $comments);

    $cur = get_company_Pref('curr_default');

    if ($email == 0)
        $rep = new FrontReport(_('INVOICE'), "InvoiceBulk", user_pagesize(), 9, $orientation);
    if ($orientation == 'L')
        recalculate_cols($cols);
    for ($i = $from; $i <= $to; $i++)
    {
            if (!exists_customer_trans(ST_SALESINVOICE, $i))
                continue;
            $sign = 1;
            $myrow = get_customer_trans($i, ST_SALESINVOICE);

            if($customer && $myrow['debtor_no'] != $customer) {
                continue;
            }
            $baccount = get_default_bank_account($myrow['curr_code']);
            $params['bankaccount'] = $baccount['id'];

            $branch = get_branch($myrow["branch_code"]);
            $sales_order = get_sales_order_header($myrow["order_"], ST_SALESORDER);
            if ($email == 1)
            {
                $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
                $rep->title = _('INVOICE');
                $rep->filename = "Invoice" . $myrow['reference'] . ".pdf";
            }   
            $rep->SetHeaderType('Header2');
            $rep->currency = $cur;
            $rep->Font();
            $rep->Info($params, $cols, null, $aligns);

            $contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], true);
            $baccount['payment_service'] = $pay_service;
            $rep->SetCommonData($myrow, $branch, $sales_order, $baccount, ST_SALESINVOICE, $contacts);
            $rep->NewPage();
               $result = get_customer_trans_details(ST_SALESINVOICE, $i);
            $SubTotal = 0;
            while ($myrow2=db_fetch($result))
            {
                if ($myrow2["quantity"] == 0)
                    continue;

                $Net = round2($sign * ((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]),
                   user_price_dec());
                $SubTotal += $Net;
                $DisplayPrice = number_format2($myrow2["unit_price"],$dec);
                $DisplayQty = number_format2($sign*$myrow2["quantity"],get_qty_dec($myrow2['stock_id']));
            $DisplayTaxRate = number_format2(abs($myrow2["unit_tax"]) * 100 / abs($myrow2["unit_price"]),user_percent_dec()) . "%";
                $DisplayNet = number_format2($Net,$dec);
                if ($myrow2["discount_percent"]==0)
                      $DisplayDiscount ="";
                else
                      $DisplayDiscount = number_format2($myrow2["discount_percent"]*100,user_percent_dec()) . "%";
                $rep->TextCol(0, 1,    $myrow2['stock_id'], -2);
                $oldrow = $rep->row;
                $rep->TextColLines(1, 2, $myrow2['StockDescription'], -2);
                $newrow = $rep->row;
                $rep->row = $oldrow;
                if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !isset($no_zero_lines_amount) || $no_zero_lines_amount == 0)
                {
                    $rep->TextCol(2, 3,    $DisplayQty, -2);
                    $rep->TextCol(3, 4,    $myrow2['units'], -2);
                    $rep->TextCol(4, 5,    $DisplayPrice, -2);
                    $rep->TextCol(5, 6,    $DisplayDiscount, -2);
                    $rep->TextCol(6, 7,    $DisplayTaxRate, -2);
                    $rep->TextCol(7, 8,    $DisplayNet, -2);
                }   
                $rep->row = $newrow;
                //$rep->NewLine(1);
                if ($rep->row < $rep->bottomMargin + (15 * $rep->lineHeight))
                    $rep->NewPage();
            }

            $memo = get_comments_string(ST_SALESINVOICE, $i);
            if ($memo != "")
            {
                $rep->NewLine();
                $rep->TextColLines(1, 5, $memo, -2);
            }

               $DisplaySubTot = number_format2($SubTotal,$dec);
               $DisplayFreight = number_format2($sign*$myrow["ov_freight"],$dec);

            $rep->row = $rep->bottomMargin + (15 * $rep->lineHeight);
            $doctype = ST_SALESINVOICE;

            $rep->TextCol(3, 6, _("Sub-total"), -2);
            $rep->TextCol(7, 8,    $DisplaySubTot, -2);
            $rep->NewLine();
            $rep->TextCol(3, 6, _("Shipping"), -2);
            $rep->TextCol(7, 8,    $DisplayFreight, -2);
            $rep->NewLine();
            $tax_items = get_trans_tax_details(ST_SALESINVOICE, $i);
            $first = true;
            while ($tax_item = db_fetch($tax_items))
            {
                if ($tax_item['amount'] == 0)
                    continue;
                $DisplayTax = number_format2($sign*$tax_item['amount'], $dec);
               
                if (isset($suppress_tax_rates) && $suppress_tax_rates == 1)
                    $tax_type_name = $tax_item['tax_type_name'];
                else
                    $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) ";

                if ($tax_item['included_in_price'])
                {
                    if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1)
                    {
                        if ($first)
                        {
                            $rep->TextCol(3, 6, _("Total Tax Excluded"), -2);
                            $rep->TextCol(7, 8,    number_format2($sign*$tax_item['net_amount'], $dec), -2);
                            $rep->NewLine();
                        }
                        $rep->TextCol(3, 6, $tax_type_name, -2);
                        $rep->TextCol(7, 8,    $DisplayTax, -2);
                        $first = false;
                    }
                    else
                        $rep->TextCol(3, 7, _("Included") . " " . $tax_type_name . _("Amount") . ": " . $DisplayTax, -2);
                }
                else
                {
                    $rep->TextCol(3, 6, $tax_type_name, -2);
                    $rep->TextCol(7, 8,    $DisplayTax, -2);
                }
                $rep->NewLine();
            }

            $rep->NewLine();
            $DisplayTotal = number_format2($sign*($myrow["ov_freight"] + $myrow["ov_gst"] +
                $myrow["ov_amount"]+$myrow["ov_freight_tax"]),$dec);
            $rep->Font('bold');
            $rep->TextCol(3, 6, _("TOTAL INVOICE"), - 2);
            $rep->TextCol(7, 8, $DisplayTotal, -2);
            $words = price_in_words($myrow['Total'], ST_SALESINVOICE);
            if ($words != "")
            {
                $rep->NewLine(1);
                $rep->TextCol(1, 7, $myrow['curr_code'] . ": " . $words, - 2);
            }
            $rep->Font();
            if ($email == 1)
            {
                $rep->End($email);
            }
    }
    if ($email == 0)
        $rep->End();
}

?>

36

(44 replies, posted in Reporting)

Apologies, done in hast! The archive should now be correct.

37

(44 replies, posted in Reporting)

Link for gl_tax_support files for ver: 2.3.22  (0-VAT reporting)

http://91.84.138.17/FAdev/FrontaccountingTaxPatch2.3.22.rar

containing:
config.default.php
gl/gl_bank.php
gl/gl_journal.php
gl/includes/db/gl_db_banking.inc
gl/includes/db/gl_db_trans.inc
gl/includes/ui/gl_bank_ui.inc
gl/includes/ui/gl_journal_ui.inc
includes/ui/items_cart.inc
js/inserts.js

38

(44 replies, posted in Reporting)

Not on here sure how to post files on here. Anyone interested I'll send the zipped file to.

39

(44 replies, posted in Reporting)

Have worked my way through patch from 19th post as advised by apmuthu. A few other mods to code to correspond with 2.3.22 were needed, but seems to be working well. Currently, if I use my 0VAT QE I just need to click edit on the tax item and the Tax input/output is updated and tax posting works for that too.

Many thanks guys - absolutely spot on

40

(44 replies, posted in Reporting)

Thanks

To be honest i'm not familiar with git

41

(44 replies, posted in Reporting)

Ok I just got the files from

http://devel.frontaccounting.com/git/?p=fa-stable.git;a=commit;h=481038ba4817907d494aa66fb6a888f1493221b2



I'm running 2.3.22 Do I just copy files from the zip file over my current files?  (backing up current prior)

42

(44 replies, posted in Reporting)

I'll have another look, but rep709 pulls the Net amount from the x_trans_tax_details table does it not? When I tried the patch -if it was the correct one rep709 didn't report any 0VAT Net transaction.

Does the patch just affect these files?

config.default.php
gl/gl_bank.php
gl/includes/ui/gl_bank_ui.inc
includes/ui/items_cart.inc

43

(44 replies, posted in Reporting)

I've had a little play with a file gl_tax_support of the repo and it does what you indicate,  but it still doesn't seamlessly report using the current tax report. This seems to pull the required data from the net_amount column of the trans_tax_details table.

The patch needs to include this data as a matter of course. Surely the net amount needs tobe stored in the same table as the rest of the reported tax data?

44

(44 replies, posted in Reporting)

OK so another approach to this 0VAT reporting problem

(I haven't coded PHP much - most in RT robotics using C. - also I'm very new to frontaccounting so very much finding out how it works. The code below is more a concept and would need to be tidied etc --But constructive feedback from those who know would be great)  I'm also snowed under with other work so don't have much time to spend on this - but would really like to get it sorted as it's holding my accounts back.


Use of SESSION variable just for OVAT gl entry.

By adding the code below in includes/ui/ui_view.inc

display_quick_entries()

            switch (strtolower($qe_line['action'])) {
                case "=": // post current base amount to GL account
                    $part = $base;
                    break;
                case "a": // post amount to GL account and reduce base
                    //Hack fix for 0VAT reporting
                    if ($qe_line['dest_id']==2206)
                    {
                $_SESSION['zero_tax_net_amount']= $base;
                    }

I can transfer the net amount associated with gl 0VAT QE input straight into the trans_tax_details table. This is where the standard tax report gets its data from.

(The 2206 relates to my 0VAT gl_account this could be set in the config file as 0VAT account for tax reporing purposes)

The modification to the function below in includes/db/gl_db_trans.inc deals with the data insertion to the table.

function add_trans_tax_details($trans_type, $trans_no, $tax_id, $rate, $included,
    $amount, $net_amount, $ex_rate, $tran_date, $memo)
{

//Hack fix for 0VAT reporting
if ($_SESSION['zero_tax_net_amount'] != 0)
$net_amount = $_SESSION['zero_tax_net_amount'];

           
    $sql = "INSERT INTO ".TB_PREF."trans_tax_details
        (trans_type, trans_no, tran_date, tax_type_id, rate, ex_rate,
            included_in_price, net_amount, amount, memo)
        VALUES (".db_escape($trans_type)."," . db_escape($trans_no).",'"
                .date2sql($tran_date)."',".db_escape($tax_id).","
                .db_escape($rate).",".db_escape($ex_rate).",".($included ? 1:0).","
                .db_escape($net_amount).","
                .db_escape($amount).",".db_escape($memo).")";

//Hack fix for 0VAT reporting
if ($_SESSION['zero_tax_net_amount'] != 0)
$_SESSION['zero_tax_net_amount']=0;


    db_query($sql, "Cannot save trans tax details");

}


Currently by using quick entry I can get proper tax reporting by just using this code - no other modification. This can be extended to  gl payment /deposit by similar code to the first snippet and appropriate insertion in the payment /deposit areas.

I wish to keep my FA system in line with the official development so ask for advice and thoughts as to any reason this will not work or is a bad idea.
Does this make any sense. Any comments please and thanks in advance.

I most certainly did. - very easy - Thank you

Thanks - that works.

Thanks for the reply apmuthu

I've tried that, but the Search Not Invoiced Deliveries screen only gives 10 items at a time. I can select all of those and batch those, limiting me to 10 items.

If I select the full screen (10 items) and then go to the next screen to continue selecting, when I process the invoice, only the last screen selection is processed.

Is there any way of selecting and batching more? Or am I missing something?

Is there any way of batching more than one screen (10 sales Delivery) into an invoice? Every time I select the items and go onto the next screen the first selection is lost.

Thanks

49

(44 replies, posted in Reporting)

Yes sure, my thoughts were - when the quick entry works and adds the VAT (in this case) 0VAT I was that would be the time the net amount was registered?? Otherwise the net amount would have to somehow be manually attached to the VAT would it not? Which doesn't seem very neat!

Thank you in advance very much for sending me the patch.

50

(44 replies, posted in Reporting)

Having looked closer I see the problem more clearly and now realise why it has not been addressed very quickly. The trans_tax_details are not uniquely associated with the relevant gl_trans line making the direct assignment of the net amount a problem. The problem then becomes how to implement this satisfactorily. It would probably be neater to implement it automatically with QE when a zero rate tax is applied as this links the application of tax to the specific gl entry?