diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ba7be823853..b883cb84df1 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -6189,7 +6189,7 @@ class Facture extends CommonInvoice } else { $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; } - $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) + $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch processes only one company (no sharing) if (!empty($paymentmode) && $paymentmode != 'all') { $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; } @@ -6199,6 +6199,7 @@ class Facture extends CommonInvoice } else { $sql .= $this->db->order("date_lim_reglement", "ASC"); } + // TODO Add a date date_last_remind_email in select. We can update date after the result of sendfile() later. To avoid to send it twiceif we rerun the batch. $resql = $this->db->query($sql); diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql index 164b370c823..a5a1bc5f8ca 100644 --- a/htdocs/install/mysql/tables/llx_facture.sql +++ b/htdocs/install/mysql/tables/llx_facture.sql @@ -5,7 +5,7 @@ -- Copyright (C) 2010 Juanjo Menent -- Copyright (C) 2012 Cédric Salvador -- Copyright (C) 2014 Raphaël Doursenaud --- +-- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or @@ -54,7 +54,7 @@ create table llx_facture total_tva double(24,8) DEFAULT 0, -- amount total tva apres remise totale localtax1 double(24,8) DEFAULT 0, -- amount total localtax1 - localtax2 double(24,8) DEFAULT 0, -- amount total localtax2 + localtax2 double(24,8) DEFAULT 0, -- amount total localtax2 revenuestamp double(24,8) DEFAULT 0, -- amount total revenuestamp total_ht double(24,8) DEFAULT 0, -- amount total ht apres remise totale total_ttc double(24,8) DEFAULT 0, -- amount total ttc apres remise totale @@ -65,7 +65,7 @@ create table llx_facture fk_user_modif integer, -- user making last change fk_user_valid integer, -- user validating fk_user_closing integer, -- user closing - + module_source varchar(32), -- name of module when invoice generated by a dedicated module (POS, ecommerce...) pos_source varchar(32), -- numero of POS terminal when order is generated by a POS module, IDsession@IDwebsite when order is generated for a website basket. fk_fac_rec_source integer, -- facture rec source @@ -75,7 +75,7 @@ create table llx_facture fk_account integer, -- bank account fk_currency varchar(3), -- currency code - + fk_cond_reglement integer DEFAULT 1 NOT NULL, -- payment term (30 days, end of month...) fk_mode_reglement integer, -- payment mode (Virement, Prelevement) date_lim_reglement date, -- due date @@ -85,6 +85,7 @@ create table llx_facture model_pdf varchar(255), last_main_doc varchar(255), -- relative filepath+filename of last main generated document fk_input_reason integer DEFAULT NULL, -- id coming from c_input_reason + fk_incoterms integer, -- for incoterms location_incoterms varchar(255), -- for incoterms @@ -103,6 +104,7 @@ create table llx_facture import_key varchar(14), extraparams varchar(255), -- for other parameters with json format is_also_delivery_note tinyint DEFAULT 0 NOT NULL, -- 0=default, 1=can act also as a delivery note (for countries that accept invoices as delivery notes) + fk_multicurrency integer, multicurrency_code varchar(3), multicurrency_tx double(24,8) DEFAULT 1,