From edcc2013056780dff3537f6519fa84fc080834dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Apr 2013 23:04:25 +0200 Subject: [PATCH] Fix: not complete renaming --- htdocs/core/lib/tax.lib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index faa0c2552c1..507f6f615b2 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -243,6 +243,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $total_localtax2='total_localtax2'; $paymenttable='paiement'; $paymentfacturetable='paiement_facture'; + $invoicefieldref='facnumber'; } if ($direction == 'buy') { @@ -256,6 +257,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $total_localtax2='total_localtax2'; $paymenttable='paiementfourn'; $paymentfacturetable='paiementfourn_facturefourn'; + $invoicefieldref='ref'; } // CAS DES BIENS @@ -279,7 +281,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,"; + $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; $sql.= " 0 as payment_id, 0 as payment_amount"; $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; @@ -324,7 +326,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,"; + $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; $sql.= " 0 as payment_id, 0 as payment_amount"; $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; @@ -437,7 +439,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,"; + $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; $sql.= " 0 as payment_id, 0 as payment_amount"; $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; @@ -483,7 +485,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.facnumber as facnum, f.type, f.total_ttc as ftotal_ttc,"; + $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; $sql.= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount"; $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";