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

Bug: cost price on recurring invoice line is not reported from invoice template #16530

Closed
aschio opened this issue Mar 3, 2021 · 1 comment
Closed
Labels
Bug This is a bug (something does not work as expected)

Comments

@aschio
Copy link
Contributor

aschio commented Mar 3, 2021

Bug

I inserted cost price on single invoice line into invoice template. When I go to generate single invoice, cost price is 0.

Environment

  • Version: Dolibarr 12.0.2
  • OS: Debian
  • Web server: Apache
  • PHP: 7.4
  • Database: mysql
  • URL(s): compta/facture/facture.class.php

Steps to reproduce the behavior

  • create template invoice and set cost price for at least one line
  • create single invoice
  • cost price is 0

Template invoice:
image

Invoice generated from template:
image

Solution:
in compta/facture/facture.class.php:

// fix core: 19.coop 
//$fk_product_fournisseur_price = empty($_facrec->lines[$i]->fk_product_fournisseur_price) ?null:$_facrec->lines[$i]->fk_product_fournisseur_price;
//$buyprice = empty($_facrec->lines[$i]->buyprice) ? 0 : $_facrec->lines[$i]->buyprice;
$fk_product_fournisseur_price = empty($_facrec->lines[$i]->fk_fournprice) ?null:$_facrec->lines[$i]->fk_fournprice;
$buyprice = empty($_facrec->lines[$i]->pa_ht) ? 0 : $_facrec->lines[$i]->pa_ht;
// end fix core: 19.coop 

buyprice --> pa_ht
fk_product_fournisseur_price --> fk_fournprice

@aschio aschio added the Bug This is a bug (something does not work as expected) label Mar 3, 2021
eldy added a commit that referenced this issue Mar 3, 2021
@eldy
Copy link
Member

eldy commented Mar 3, 2021

Thanks @aschio I fixed a lot of other problem too. My fix is more complete.

@eldy eldy closed this as completed in 30dd4ac Mar 5, 2021
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

2 participants