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

fix(facture): removed useless fetch product #567

Open
wants to merge 1 commit into
base: 17.0_koesio
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog_Koesio.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Backported from 17.0 :
- Backport 7.0 PR #32948 : Removed useless fetch product code in facture.class.php
- Backport develop PR #32662 : New hooks in services_list and added global search
- Backport 17.0 PR #32654 : Search thirdparty in services list
- Backport develop PR #32129 : New field rule for lines dates
Expand Down
5 changes: 3 additions & 2 deletions htdocs/compta/facture/class/facture-rec.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1094,13 +1094,14 @@ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocalt
$factureRecLine->id = $lineId;
$result = $factureRecLine->insertExtraFields();
if ($result < 0) {
$this->error[] = $factureRecLine->error;
$this->error = $factureRecLine->error;
return -2;
}

return $lineId;
} else {
$this->error = $this->db->lasterror();
return -1;
return -3;
}
}
}
Expand Down
13 changes: 0 additions & 13 deletions htdocs/compta/facture/class/facture.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -992,19 +992,6 @@ public function create(User $user, $notrigger = 0, $forceduedate = 0)
*/
if (!$error && $this->fac_rec > 0) {
foreach ($_facrec->lines as $i => $val) {
if ($_facrec->lines[$i]->fk_product) {
$prod = new Product($this->db);
$res = $prod->fetch($_facrec->lines[$i]->fk_product);
}

// For line from template invoice, we use data from template invoice
/*
$tva_tx = get_default_tva($mysoc,$soc,$prod->id);
$tva_npr = get_default_npr($mysoc,$soc,$prod->id);
if (empty($tva_tx)) $tva_npr=0;
$localtax1_tx=get_localtax($tva_tx,1,$soc,$mysoc,$tva_npr);
$localtax2_tx=get_localtax($tva_tx,2,$soc,$mysoc,$tva_npr);
*/
$tva_tx = $_facrec->lines[$i]->tva_tx.($_facrec->lines[$i]->vat_src_code ? '('.$_facrec->lines[$i]->vat_src_code.')' : '');
$tva_npr = $_facrec->lines[$i]->info_bits;
if (empty($tva_tx)) {
Expand Down
Loading