Skip to content

Commit

Permalink
fix(facture): removed useless fetch product
Browse files Browse the repository at this point in the history
  • Loading branch information
atm-irvine committed Feb 5, 2025
1 parent 07648f5 commit 4e7d199
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
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

0 comments on commit 4e7d199

Please sign in to comment.