Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.22k stars 2.72k forks source link

ODT {object_total_..._x} v 17.0.3 #25932

Closed michalhana99 closed 11 months ago

michalhana99 commented 11 months ago

Bug

When trying to generate a sum of a specific VAT rate in the odt file, the sum is not generated, but only {object_total_vat_20} remains here

I tried: {object_total_vat_20} {object_total_vat_20.000} {object_total_vat_20.00}

and also for other VAT assessments, but the specific sum will not appear in the document

I am attaching a test file

Environment Version

17.0.3, 16.0.3

Environment OS

No response

Environment Web server

No response

Environment PHP

8.1

Environment Database

No response

Environment URL(s)

No response

Expected and actual behavior

template_invoicetest.odt

Steps to reproduce the behavior

Create an odt file where you specify the specific VAT rate to be added. Have this document generated, for example an invoice. Where {object_total_vat_20} is should contain the sum of the rows that contain 20% VAT {object_total_vat_20} {object_total_vat_20.000} {object_total_vat_20.00}

Attached files

No response

priojk commented 11 months ago

I just tried to reproduce this on 17.0.3, just changed it to the 19% VAT we are using here. The result for the keys is as follows:

3229.05 {object_total_vat_19.000} {object_total_vat_19.00}

So the first version worked as expected.

What might have happened in your template is that you either corrected something in the key or used copy/paste. In this case, LibreOffice might have added invisible data for internal version history which makes the placeholder key undetectable for dolibarr.

Could you try to select your keys and remove all formatting with this button image in LibreOffice?

michalhana99 commented 11 months ago

Hello, I had to first edit it in notepad and then insert it into LibreOffice.

Unfortunately, only "{object_total_vat_19}" works for me, but e.g. "{object_total_ht_x}" no longer works.

KlaasOl commented 11 months ago

Hi, Tested with the percentage of 21.5% and no problem with the format {object_total_vat_21,5} If there is only one digit, I put in my variable , (comma!) 5, (No dot) For an percentage of 21.25% it also works. I used a comma, not a dot in the variable. So it looked like: {object_total_vat_21,25}

michalhana99 commented 11 months ago

Thanks, but how can i get the ht or ttc rating there?

KlaasOl commented 11 months ago

The only way to get de VAT rate in a variable is in the table-line: {line_vatrate}. At the bottom of an invoice you have to "hard" edit it as: VAT 25% = {object_total_vat_25}

fappels commented 11 months ago

object_total_ht_x does not exist, only object_total_ht