diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 58a20167c53..af4010b27cd 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -152,13 +152,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $sql.= " s.rowid as socid, s.nom, s.fournisseur"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; - $sql.= " WHERE f.paye = 0 AND fk_statut > 0"; + $sql.= " WHERE f.paye = 0 AND fk_statut = 1"; $sql.= " UNION DISTINCT"; $sql.= " SELECT ff.rowid as facid, ff.facnumber, (-1*ff.total_ttc), ff.type, ".$db->pdate("ff.date_lim_reglement")." as dlr,"; $sql.= " s.rowid as socid, s.nom, s.fournisseur"; $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid"; - $sql.= " WHERE ff.paye = 0 AND fk_statut > 0"; + $sql.= " WHERE ff.paye = 0 AND fk_statut = 1"; $sql.= " ORDER BY dlr ASC"; $result = $db->query($sql); diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index 699ca6193af..50ac987bdf1 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -87,6 +87,8 @@ update llx_rights_def set libelle='Cr -- Supprime colone en doublon avec fk_user_creat alter table llx_paiement drop column author; +-- Supprime colonne obsolete car gérée par llx_paiement_facture +alter table llx_paiement drop column fk_facture; update llx_actioncomm set fk_action = 9 where fk_action = 10; update llx_actioncomm set percent = 100 where percent = 0 and datea is not null; diff --git a/mysql/tables/llx_paiement.sql b/mysql/tables/llx_paiement.sql index 345377b722a..0557eebb4de 100644 --- a/mysql/tables/llx_paiement.sql +++ b/mysql/tables/llx_paiement.sql @@ -26,7 +26,6 @@ create table llx_paiement ( rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_facture integer, datec datetime, -- date de creation tms timestamp, datep datetime, -- payment date