This commit is contained in:
Laurent Destailleur 2022-03-28 21:12:57 +02:00
parent 3fd1f22b28
commit e2425c10e0

View File

@ -527,6 +527,8 @@ class FactureRec extends CommonInvoice
*/
public function fetch($rowid, $ref = '', $ref_ext = '')
{
dol_syslog('FactureRec::fetch', LOG_DEBUG);
$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc, f.total_tva, f.localtax1, f.localtax2, f.total_ht, f.total_ttc';
$sql .= ', f.remise_percent, f.remise_absolue, f.remise';
$sql .= ', f.date_lim_reglement as dlr';
@ -671,6 +673,8 @@ class FactureRec extends CommonInvoice
$extrafields->fetch_name_optionals_label($this->table_element_line, true);
*/
dol_syslog('FactureRec::fetch_lines', LOG_DEBUG);
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx, ';
$sql .= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,';
$sql .= ' l.info_bits, l.date_start_fill, l.date_end_fill, l.total_ht, l.total_tva, l.total_ttc, l.fk_product_fournisseur_price, l.buy_price_ht as pa_ht,';
@ -683,7 +687,6 @@ class FactureRec extends CommonInvoice
$sql .= ' WHERE l.fk_facture = '.((int) $this->id);
$sql .= ' ORDER BY l.rang';
dol_syslog('FactureRec::fetch_lines', LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);