diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php
index bf425ffb992..50084ba1af0 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/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php
index d92ce1ee213..6624cc52dc5 100644
--- a/htdocs/admin/agenda_reminder.php
+++ b/htdocs/admin/agenda_reminder.php
@@ -191,7 +191,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";
@@ -208,7 +208,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";
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 8233a50aca3..70ba4c9ede6 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;
diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php
index fcee95b688f..bd9f25bb0b8 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/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 257750559a1..fab8aa705de 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);
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 9012448959c..e00ebc91828 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
@@ -267,6 +267,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);
+
+
+