Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V13 Create new customer discount #16165

Closed
Likeandfeel opened this issue Feb 4, 2021 · 8 comments
Closed

V13 Create new customer discount #16165

Likeandfeel opened this issue Feb 4, 2021 · 8 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@Likeandfeel
Copy link

Hi

Since v13 and v13.0.1, when you want add fixed discount to a custome, you get this error message :

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ’ ‹ ›, 14.94, 0, 14.94, null, null)’ at line 1 - sql=INSERT INTO llx_societe_remise_except (entity, datec, fk_soc, discount_type, fk_user, description, amount_ht, amount_tva, amount_ttc, tva_tx, vat_src_code, multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc, fk_facture_source, fk_invoice_supplier_source) VALUES (1, ‹ 2021-02-02 15:24:36 ›, 27180, 0, 1, ‹ Remise revendeur ›, 14.94, 0, 14.94, , ‹ ›, 14.94, 0, 14.94, null, null)

I dont have Multicurrency setup, nd this error came from a company setup as GB but using EUR as currency, on configuration. I get same issue with FR. I tried on Mysql insert manually value and get this sql code

INSERT INTO llx_societe_remise_except (rowid, entity, fk_soc, discount_type, datec, amount_ht, amount_tva, amount_ttc, tva_tx, fk_user, fk_facture_line, fk_facture, fk_facture_source, description, multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc, fk_invoice_supplier_line, fk_invoice_supplier, fk_invoice_supplier_source, vat_src_code) VALUES ('49', '1', '27180', '0', '2021-02-02 14:43:09', '14.94', '0.00000000', '14.94', '0.000', '1', NULL, NULL, NULL, 'Remise revendeur', '0.00000000', '0.00000000', '0.00000000', NULL, NULL, NULL, '');

Any idea regarding this issue ?
Thanks in advance
Best regards

@ksar-ksar
Copy link
Contributor

Hello,

Could you explain on which page/url you have the error ?

@ksar-ksar ksar-ksar added the Bug need more information This bug needs more information to be processed label Feb 9, 2021
@Likeandfeel
Copy link
Author

Hi Ksar

This issue following discussion there >> https://www.dolibarr.fr/forum/t/version-13-remise-client-erreur/35538

You get the issue when you want to create fixed discount (création d'une remise fixe client / fournisseur)
/comm/remx.php

issue is present since version 13.
I'm on v 13.0.1 and same issue. On v12 its working fine.

Thanks in advance.
Best regards

@ksar-ksar ksar-ksar added Bug This is a bug (something does not work as expected) and removed Bug need more information This bug needs more information to be processed labels Feb 10, 2021
@daraelmin
Copy link
Contributor

Hi @Likeandfeel ,

I can not reproduce your situation but I think thid may occure when no vat (tva) is defined.

Could you try to add this code:

if (empty($this->tva_tx)) $this->tva_tx = 0;

at line 225

of

htdocs/core/class/discount.class.php

And tell me if it helps.

@Likeandfeel
Copy link
Author

HI @daraelmin

Just tried it and >> Works !

Do you think its possible to push this fix on version 13.0.1 ?
Thanks a lot for your help

Best regards

@daraelmin
Copy link
Contributor

daraelmin commented Feb 18, 2021

Hi @Likeandfeel,

Thanks for your response. I have pushed the fix will see when it will be implemented but as it is blocking it should be pushed for next version.

Please let the issue opened till the fixed is merged into the core.

Cheers

@ksar-ksar
Copy link
Contributor

#16340

@jhaand
Copy link

jhaand commented Feb 27, 2021

Thanks for reproting and fixing this. This error was driving me insane.
As a tax exempt association, these things can prop up with these niche applications.

@daraelmin
Copy link
Contributor

@jhaand with pleasure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

4 participants