Template for Belgian Market


#1

Supporting product and financial discounts as well as mutliple VAT rates.
Also mentions composition of VAT amount as required by BE VAT administration.


Tax rules when multiple tax rates are used
#2

Thank you for sharing this.


#3

Do you have a download for the template?


#4

SRNGBEFact.php (16.0 KB)
This is the template. In debug mode, it still produces some warnings on line 179 and following lines that needs to be sorted out.


#5

Hi!

I’m trying to setup your template, but no success so far :frowning:

is there any chance you could explain the 4 topics in the document?

Prerequisites:

  1. apply fix for VAT in case of commercial discount , see support website of invoiceplane for the fix
  2. apply customisation add format_currency_other function to number_helper.php to allow dual currency
  3. add new labels in Dutch in custom_lang.php
  4. add custom fields to invoice

I also believe the css locations are different in the current version?

Hope to hear from you!

Thanks,
K


#6

Hi, I simplified and changed this template to work with InvoicePlane 1.5.2
See this link , I can’t upload files so hyperlink it is …
Also, for it to work (in my case), none of the older instructions are needed. New info:

  • css for logo is included in the template, adjust as you see fit
  • I created a custom client field called “Referentie”, if you don’t need it (or want to change the name), then edit or remove line 98:
    echo '<div>' . trans('yourorderref') . ': ' . $custom_fields['client']['Referentie'] . '</div>';
  • the edits for application/language/Dutch/custom_lang.php are:
    $lang = array( 'taxcomposition' => 'Samenstelling totaal Btw bedrag', 'taxtariff'=> 'Btw tarief', 'tobetaxed' => 'Belast. basis', 'taxpct' => 'Btw %', 'itemtaxamount1' => 'Btw bedrag', 'totaltax' => 'Totaal Btw', 'totalinc' => 'Totaal te betalen (inc. Btw)', 'vat_id_short' => 'O.N.', 'yourorderref' => 'Referentie', 'phone_abbr' => 'Tel', 'mobile_abbr' => 'GSM', 'fax_abbr' => 'Fax' );
    See if it suits your needs and let me know what you think about it …

#7

Hi liedekef, I was looking for a template that could handle multiple tax (BTW) rates. I found your template and copied it from the link. When i select this template I get several php errors. I did, as you said, remove the line with the custom field ‘Referentie’. I found this line on line number 110 in stead of 98…
So maybe the link points to the wrong template(???) and maybe therefore it does not work in IP version 1.5.2.
Any help would be very welcome.


#8

I said line 98 but after that I added some extra fields for fax etc … so indeed line 110 sounds correct now. But what are the other php errors you have if you remove that line?


#9

The list with errors is very long so maybe not a good idea to paste it here. I did some research and at first it looks like the problem is in the php code lines 178 - 189 where the tax calculation is made. When I comment out these lines, the pdf is printed correctly but, of course, without the tax values.

However when I try to debug the template i see the following error:

    A PHP Error was encountered

   _Severity: Notice
   _Message: Undefined index: taxdescr
   _Filename: pdf/InvoicePlane-nl3.php
   _Line Number: 274

Can this have to do with that BE00? I have no idea what this is…
Is this the name of one of your tax rules?
Maybe it also depends on how i configured tax in the configuration settings.


#10

Line 274 contains an error indeed, ‘taxdescr’ should be 'taxname’
For line 178-189, I think it is just because the first array element is not defined.
I updated the template, could you try again? Any error message is usefull, so feel free to mail that to me.


#11

Thanks for your reply.
No, the lines 178-189 do not show errors but when i commented these out the error with the presentation of the taxvalues was not there.
taxdescr is used twice in this form. It is on line 262 and on line 275 (274). Should both be changed into taxname?
Can you explain what the BE00 is and how you configured your tax/btw setup in the system configuration?


#12

That would be it:

Also: for Belgium, it seems sometimes you need to indicate you want an item with 0% tax, so I created one called BE00 (apparently that is an official naming, the regular 21% one is called BE21)


#13

Many thanks. You are my hero!
It works without errors now :slight_smile: I will use this tax (btw) calculation/presentation in my own template!


#14

The template worked for version 1.4.10. Still need to update our system to 1.5.2. where indeed the css have changed position.If you want to see this template in action simply send email info(at)sanremong.com and we will give you access to our demo system.

About the prerequisites

  1. This was to correct a known issue where discounts were incorrectly calculated in version 1.4.10. Is probably solved in 1.5.2.

  2. as the template supports invoicing in an other currency than euro some customisation was done in another file called number_helper.php. If you don’t need other currency than Euro you can remove this code from the template.

  3. These are the custom fields you need to add in the application , for this go to settings then go to custom fields
    ip_invoice_custom Leveringsdatum invoice_custom_leveringsdatum
    ip_invoice_custom UwBestelbon invoice_custom_uwbestelbon
    ip_invoice_custom FinancieleKortingExclBTW invoice_custom_financielekortingexclbtw
    ip_invoice_custom OtherCurrencySymbol invoice_custom_othercurrencysymbol
    ip_invoice_custom OtherCurrencyExchangeRate invoice_custom_othercurrencyexchangerate

  4. these are the fields you need to add to /application/language/Dutch/custom_lang.php
    ’phone_abbr’ => ‘Tel’,
    ‘email_abbr’ => ‘E-mail’,
    ‘taxpct’ => ‘Btw %’,
    ‘totalnet’ => ‘Netto’,
    ‘totaltax’ => ‘Totaal btw’,
    ‘tobetaxed’ => ‘Belast. basis’,
    ‘totalinc’ => ‘Totaal te betalen (incl. btw)’,
    ‘totcontractualcurrency’ => 'Totaal te betalen in vreemde munt/ Amount due in currency ',
    ‘totalincwithoutdiscount’ => ‘Totaal te betalen zonder fin. korting (incl. btw)’,
    ‘totcontractualcurrencywodisc’ => 'Totaal te betalen in vreemde munt zonder fin. korting/ Amount due without fin. discount in currency ',
    ‘taxcomposition’ => ‘Samenstelling totaal btw bedrag’,
    ‘itemtaxamount1’ => ‘Btw bedrag’,
    ‘taxtariff’ => ‘Btw tarief’,
    ‘delivery_date’ => ‘Leveringsdatum’,
    ‘yourorderref’ => ‘Uw bestelbon ref.’


#15

A new version that works in version 1.5.2 is now available , see separate topic https://community.invoiceplane.com/t/topic/4364