Topic: Invoice to end-users INCL. VAT and B2B EXCL. VAT

I found a way to invoice to B2B and to end-users. For B2B I wanted to keep the current invoice excluding tax. For end-users I needed to show the prices per line item including tax/VAT.

I replaced in reporting/rep107.php line 122 (FA version 1.2.6)

                $DisplayPrice = number_format2($myrow2["unit_price"],$dec);

info:

          if( $myrow["tax_id"] == "" ) {
                  $Net = round2($sign * ((1 - $myrow2["discount_percent"]) * ($myrow2["FullUnitPrice"]) * $myrow2["quantity"]), user_price_dec());
               $DisplayPrice = number_format2($myrow2["FullUnitPrice"],$dec);
        } else {
              $DisplayPrice = number_format2($myrow2["unit_price"],$dec);
        }

In case you fill in a TAX_ID which is the GSTNo in the customer record then the customer is considered to be a company and will show the prices excluding VAT. When this is field is kept empty it will show the prices including VAT.

Re: Invoice to end-users INCL. VAT and B2B EXCL. VAT

Well, interesting idea, however line total is still displayed excluding VAT/GST, so price*qty!=amount.
Janusz

Re: Invoice to end-users INCL. VAT and B2B EXCL. VAT

At my side with FA2.2.6 I really get the correct values. So per line item the price per piece and the line total are both including VAT/tax.

The only change I do is to calculate the DisplayPrice based on the price including tax (FullUnitPrice) and als re-calculate the $Net based on this price including tax. With re-calculating I mean that the original $Net= will exist and also the $SubTotal += $Net; so one line after this I re-calcultate $Net for the item line. The re-calculation is not done in case it's a company as then the price is already correct.

4 (edited by shopimport 02/21/2010 09:19:12 pm)

Re: Invoice to end-users INCL. VAT and B2B EXCL. VAT

I also managed to switch the heading of the invoice to show 'price incl. tax' or 'price excl. tax'.

line 106 (FA version 2.2.6) of reporting/includes/doctext.inc

find this:

            $this->headers = array(_("Item Code"), _("Item Description"),    _("Quantity"),
                _("Unit"), _("Price"), _("Discount %"), _("Total"));

and modify into:

          if( $myrow["tax_id"] == "" ) {
            $tax = " incl. VAT";
          } else {
            $tax = " excl. VAT";
      }
            $this->headers = array(_("Item Code"), _("Item Description"),    _("Quantity"),
                _("Unit"), _("Price").$tax, _("Discount %"), _("Total").$tax);

Just to share my adjustments to support end-user B2C and company B2B invoicing.

Re: Invoice to end-users INCL. VAT and B2B EXCL. VAT

I'm just notified on the including tax option for the Sales Type. Maybe it's an idea to select on this flag instead of the GSTno of the customer. So when the sales type has tax included enabled then also show the invoice with item prices and line totals including tax. However I didn't check how to do this...