Widget & commonobject
This commit is contained in:
parent
d7993253e7
commit
ae4fc565e1
@ -89,8 +89,8 @@ class box_factures extends ModeleBoxes
|
|||||||
|
|
||||||
if ($user->rights->facture->lire) {
|
if ($user->rights->facture->lire) {
|
||||||
$sql = "SELECT f.rowid as facid";
|
$sql = "SELECT f.rowid as facid";
|
||||||
$sql .= ", f.ref, f.type, f.total as total_ht";
|
$sql .= ", f.ref, f.type, f.total_ht";
|
||||||
$sql .= ", f.tva as total_tva";
|
$sql .= ", f.total_tva";
|
||||||
$sql .= ", f.total_ttc";
|
$sql .= ", f.total_ttc";
|
||||||
$sql .= ", f.datef as df";
|
$sql .= ", f.datef as df";
|
||||||
$sql .= ", f.paye, f.fk_statut, f.datec, f.tms";
|
$sql .= ", f.paye, f.fk_statut, f.datec, f.tms";
|
||||||
|
|||||||
@ -95,8 +95,8 @@ class box_factures_imp extends ModeleBoxes
|
|||||||
$sql .= ", f.ref, f.date_lim_reglement as datelimite";
|
$sql .= ", f.ref, f.date_lim_reglement as datelimite";
|
||||||
$sql .= ", f.type";
|
$sql .= ", f.type";
|
||||||
$sql .= ", f.datef as df";
|
$sql .= ", f.datef as df";
|
||||||
$sql .= ", f.total as total_ht";
|
$sql .= ", f.total_ht";
|
||||||
$sql .= ", f.tva as total_tva";
|
$sql .= ", f.total_tva";
|
||||||
$sql .= ", f.total_ttc";
|
$sql .= ", f.total_ttc";
|
||||||
$sql .= ", f.paye, f.fk_statut, f.rowid as facid";
|
$sql .= ", f.paye, f.fk_statut, f.rowid as facid";
|
||||||
$sql .= ", sum(pf.amount) as am";
|
$sql .= ", sum(pf.amount) as am";
|
||||||
@ -112,7 +112,7 @@ class box_factures_imp extends ModeleBoxes
|
|||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
$sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.code_client, s.code_compta, s.client, s.logo, s.email, s.entity, s.tva_intra, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6,";
|
$sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.code_client, s.code_compta, s.client, s.logo, s.email, s.entity, s.tva_intra, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6,";
|
||||||
$sql .= " f.ref, f.date_lim_reglement,";
|
$sql .= " f.ref, f.date_lim_reglement,";
|
||||||
$sql .= " f.type, f.datef, f.total, f.tva, f.total_ttc, f.paye, f.fk_statut, f.rowid";
|
$sql .= " f.type, f.datef, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.fk_statut, f.rowid";
|
||||||
//$sql.= " ORDER BY f.datef DESC, f.ref DESC ";
|
//$sql.= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||||
$sql .= " ORDER BY datelimite ASC, f.ref ASC ";
|
$sql .= " ORDER BY datelimite ASC, f.ref ASC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|||||||
@ -3228,7 +3228,7 @@ abstract class CommonObject
|
|||||||
$fieldlocaltax2 = 'localtax2';
|
$fieldlocaltax2 = 'localtax2';
|
||||||
$fieldttc = 'total_ttc';
|
$fieldttc = 'total_ttc';
|
||||||
// Specific code for backward compatibility with old field names
|
// Specific code for backward compatibility with old field names
|
||||||
if ($this->element == 'facture' || $this->element == 'facturerec') $fieldht = 'total';
|
if ($this->element == 'facture' || $this->element == 'facturerec') $fieldtva = 'total_tva';
|
||||||
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva = 'total_tva';
|
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva = 'total_tva';
|
||||||
if ($this->element == 'propal') {
|
if ($this->element == 'propal') {
|
||||||
$fieldttc = 'total';
|
$fieldttc = 'total';
|
||||||
|
|||||||
@ -182,4 +182,6 @@ ALTER TABLE llx_supplier_proposal CHANGE COLUMN total total_ttc double(24,8) def
|
|||||||
ALTER TABLE llx_propal CHANGE COLUMN tva total_tva double(24,8) default 0;
|
ALTER TABLE llx_propal CHANGE COLUMN tva total_tva double(24,8) default 0;
|
||||||
ALTER TABLE llx_facture CHANGE COLUMN tva total_tva double(24,8) default 0;
|
ALTER TABLE llx_facture CHANGE COLUMN tva total_tva double(24,8) default 0;
|
||||||
ALTER TABLE llx_facture CHANGE COLUMN total total_ht double(24,8) default 0;
|
ALTER TABLE llx_facture CHANGE COLUMN total total_ht double(24,8) default 0;
|
||||||
|
ALTER TABLE llx_facture_rec CHANGE COLUMN tva total_tva double(24,8) default 0;
|
||||||
|
ALTER TABLE llx_facture_rec CHANGE COLUMN total total_ht double(24,8) default 0;
|
||||||
|
|
||||||
|
|||||||
@ -36,11 +36,11 @@ create table llx_facture_rec
|
|||||||
remise_absolue real DEFAULT 0,
|
remise_absolue real DEFAULT 0,
|
||||||
|
|
||||||
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
|
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
|
||||||
tva double(24,8) DEFAULT 0,
|
total_tva double(24,8) DEFAULT 0,
|
||||||
localtax1 double(24,8) DEFAULT 0, -- amount localtax1
|
localtax1 double(24,8) DEFAULT 0, -- amount localtax1
|
||||||
localtax2 double(24,8) DEFAULT 0, -- amount localtax2
|
localtax2 double(24,8) DEFAULT 0, -- amount localtax2
|
||||||
revenuestamp double(24,8) DEFAULT 0, -- amount total revenuestamp
|
revenuestamp double(24,8) DEFAULT 0, -- amount total revenuestamp
|
||||||
total double(24,8) DEFAULT 0,
|
total_ht double(24,8) DEFAULT 0,
|
||||||
total_ttc double(24,8) DEFAULT 0,
|
total_ttc double(24,8) DEFAULT 0,
|
||||||
|
|
||||||
fk_user_author integer, -- user creating
|
fk_user_author integer, -- user creating
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user