From 58d82eb4779d9adcd15397034ad1b71b18d7356c Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 21 Feb 2019 11:08:55 +0100 Subject: [PATCH 1/5] FIX : function sendEmailsReminder isn't completely developed, then MAIN_FEATURES_LEVEL must be 2 to "use" it --- htdocs/admin/agenda_reminder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index fac49dcfcde..3ea0e397c92 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -194,7 +194,7 @@ print ''."\n"; // AGENDA REMINDER EMAIL -if ($conf->global->MAIN_FEATURES_LEVEL > 0) +if ($conf->global->MAIN_FEATURES_LEVEL == 2) { print ''."\n"; print ''.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).''."\n"; @@ -211,7 +211,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) } // AGENDA REMINDER BROWSER -if ($conf->global->MAIN_FEATURES_LEVEL > 0) +if ($conf->global->MAIN_FEATURES_LEVEL == 2) { print ''."\n"; print ''.$langs->trans('AGENDA_REMINDER_BROWSER').''."\n"; From c38b0c4dbec7414a21f94f8457aa3495b3d1261f Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 22 Feb 2019 12:17:34 +0100 Subject: [PATCH 2/5] FIX fk_default_warehouse missing in group by --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 761cce030f7..77fd4b1aa69 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -499,7 +499,7 @@ if ($id > 0 || ! empty($ref)) { $sql .= " WHERE l.fk_commande = " . $object->id; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql .= " AND l.product_type = 0"; - $sql .= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product + $sql .= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent, p.fk_default_warehouse"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product $sql .= " ORDER BY p.ref, p.label"; $resql = $db->query($sql); From 8ca6935f8b00cde18544fcdcf14278d8f19b54ac Mon Sep 17 00:00:00 2001 From: Cristian Torres Date: Tue, 19 Feb 2019 11:37:46 -0600 Subject: [PATCH 3/5] [FIX] Variable $i is already declared It was preventing displaying of the other accounts --- htdocs/compta/resultat/clientfourn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index ee94b4ab5fc..f25a6baf87a 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -301,7 +301,7 @@ if ($modecompta == 'BOOKKEEPING') // Get cpts of category/group $cpts = $AccCat->getCptsCat(0, $tmppredefinedgroupwhere); - foreach($cpts as $i => $cpt) + foreach($cpts as $j => $cpt) { $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cpt['dc']); if ($return < 0) { From 9ba6e3f8f57c4e0c8c468653f9f9b8ce0c54b879 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Feb 2019 15:57:57 +0100 Subject: [PATCH 4/5] FIX #10638 --- htdocs/accountancy/class/accountancycategory.class.php | 7 ++++--- htdocs/compta/resultat/result.php | 4 ++-- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 6 ++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 5b3282a3b29..a6c9f09c7cb 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -720,7 +720,7 @@ class AccountancyCategory // extends CommonObject * @param int|array $cpt Accounting account or array of accounting account * @param string $date_start Date start * @param string $date_end Date end - * @param int $sens Sens of the account: 0: credit - debit, 1: debit - credit + * @param int $sens Sens of the account: 0: credit - debit (use this by default), 1: debit - credit * @param string $thirdparty_code Thirdparty code * @param int $month Specifig month - Can be empty * @param int $year Specifig year - Can be empty @@ -805,7 +805,7 @@ class AccountancyCategory // extends CommonObject exit(); } - $sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type"; + $sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_accounting_category as c"; $sql .= " WHERE c.active = 1"; $sql .= " AND c.entity = " . $conf->entity; @@ -829,7 +829,8 @@ class AccountancyCategory // extends CommonObject 'label' => $obj->label, 'formula' => $obj->formula, 'position' => $obj->position, - 'category_type' => $obj->category_type + 'category_type' => $obj->category_type, + 'bc' => $obj->sens ); $i++; } diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 16d2631686c..d3ec7082bfb 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -405,7 +405,7 @@ elseif ($modecompta=="BOOKKEEPING") // N-1 if (! empty($arrayofaccountforfilter)) { - $return = $AccCat->getSumDebitCredit($arrayofaccountforfilter, $date_start_previous, $date_end_previous, $cpt['dc']?$cpt['dc']:0); + $return = $AccCat->getSumDebitCredit($arrayofaccountforfilter, $date_start_previous, $date_end_previous, $cat['dc']?$cat['dc']:0); if ($return < 0) { setEventMessages(null, $AccCat->errors, 'errors'); @@ -438,7 +438,7 @@ elseif ($modecompta=="BOOKKEEPING") if (($k+1) < $start_month) $yeartoprocess++; //var_dump($monthtoprocess.'_'.$yeartoprocess); - $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cpt['dc']?$cpt['dc']:0, 'nofilter', $monthtoprocess, $yeartoprocess); + $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cat['dc']?$cat['dc']:0, 'nofilter', $monthtoprocess, $yeartoprocess); if ($return < 0) { setEventMessages(null, $AccCat->errors, 'errors'); $resultM=0; diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index f2a8ca9f380..8e9d82c5fd1 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -266,6 +266,12 @@ CREATE TABLE llx_pos_cash_fence( UPDATE llx_const set name = 'PRELEVEMENT_END_TO_END' where name = 'END_TO_END'; UPDATE llx_const set name = 'PRELEVEMENT_USTRD' where name = 'USTRD'; +-- Delete duplicate accounting account not used + + ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account; ALTER TABLE llx_accounting_account ADD UNIQUE INDEX uk_accounting_account (account_number, entity, fk_pcg_version); + + + From d7ffcca59bbb312cdb3e08598637d7d37ddccd1a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 20 Feb 2019 12:35:13 +0100 Subject: [PATCH 5/5] FIX fetch module / pos source --- htdocs/compta/facture/class/facture.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 2fb31440e56..fd050297fe5 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1324,6 +1324,7 @@ class Facture extends CommonInvoice $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', f.fk_incoterms, f.location_incoterms'; + $sql.= ', f.module_source, f.pos_source'; $sql.= ", i.libelle as libelle_incoterms"; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; @@ -1357,7 +1358,7 @@ class Facture extends CommonInvoice $this->date_pointoftax = $this->db->jdate($obj->date_pointoftax); $this->date_creation = $this->db->jdate($obj->datec); $this->date_validation = $this->db->jdate($obj->datev); - $this->date_modification = $this->db->jdate($obj->datem); + $this->date_modification = $this->db->jdate($obj->datem); $this->datem = $this->db->jdate($obj->datem); $this->remise_percent = $obj->remise_percent; $this->remise_absolue = $obj->remise_absolue; @@ -1396,9 +1397,12 @@ class Facture extends CommonInvoice $this->extraparams = (array) json_decode($obj->extraparams, true); //Incoterms - $this->fk_incoterms = $obj->fk_incoterms; - $this->location_incoterms = $obj->location_incoterms; - $this->libelle_incoterms = $obj->libelle_incoterms; + $this->fk_incoterms = $obj->fk_incoterms; + $this->location_incoterms = $obj->location_incoterms; + $this->libelle_incoterms = $obj->libelle_incoterms; + + $this->module_source = $obj->module_source; + $this->pos_source = $obj->pos_source; // Multicurrency $this->fk_multicurrency = $obj->fk_multicurrency;