From eca1a2cd6472efa4b6ffae90e91263da8536e0db Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Tue, 29 Jan 2019 11:08:13 +0100
Subject: [PATCH 01/10] Update societe.class.php
---
htdocs/societe/class/societe.class.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index a240c83b89f..18a4dbda8f2 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -3798,6 +3798,7 @@ class Societe extends CommonObject
$sql .= " WHERE fk_soc = ". $this->id;
$sql .= " AND paye = 0";
$sql .= " AND fk_statut <> 0"; // Not a draft
+ $sql .= " AND entity IN (".getEntity('invoice').")";
//$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason
$sql .= " AND fk_statut <> 3"; // Not abandonned
$sql .= " AND fk_statut <> 2"; // Not clasified as paid
From 508fb5c9cb82234a6523a35560d3c10cce473091 Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Tue, 29 Jan 2019 11:13:11 +0100
Subject: [PATCH 02/10] =?UTF-8?q?Prise=20en=20charge=20des=20Travaux=20sup?=
=?UTF-8?q?pl=C3=A9mentaires?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Corrige la filtration lors des situations client afin de prendre en compte la possibilité d'ajouter des travaux en cours de chantier.
---
htdocs/core/tpl/objectline_view.tpl.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index 313a4ee4def..ac2de384ddc 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -283,7 +283,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) {
+ if (($line->fk_prev_id == NULL ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
print 'id . '&action=ask_deleteline&lineid=' . $line->id . '">';
print img_delete();
print '';
From 30548d977fc46ccb6dee6952e5523e2438a01745 Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Tue, 29 Jan 2019 11:19:11 +0100
Subject: [PATCH 03/10] =?UTF-8?q?Prise=20en=20charge=20des=20Travaux=20sup?=
=?UTF-8?q?pl=C3=A9mentaires?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Corrige la filtration pour permettre l'ajout de ligne lors de la présence de travaux supplémentaires en cours de chantier.
---
htdocs/compta/facture/card.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 9ad79393499..bec4097935f 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -4540,7 +4540,7 @@ else if ($id > 0 || ! empty($ref))
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1);
// Form to add new line
- if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline' && ($object->is_first() || !$object->situation_cycle_ref))
+ if ($object->statut == 0 && $usercancreate && $action != 'valid' && $action != 'editline')
{
if ($action != 'editline' && $action != 'selectlines')
{
From dd0f6b38290a6660b2a68b0bd1960cd882c1d110 Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Tue, 29 Jan 2019 11:30:14 +0100
Subject: [PATCH 04/10] =?UTF-8?q?Edition=20Ligne=20Travaux=20Suppl=C3=A9me?=
=?UTF-8?q?ntaires?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Correction pour permettre l'édition si la ligne n'existe pas dans une précédente situation. Permet l'édition d'une ligne si elle a été ajouté dans la situation actuelle.
---
htdocs/core/tpl/objectline_edit.tpl.php | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index d3dc9807c5a..62387001de5 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -99,7 +99,7 @@ $coldisplay=-1; // We remove first td
}
// Do not allow editing during a situation cycle
- if (empty($this->situation_cycle_ref) || $this->situation_counter == 1)
+ if ($line->fk_prev_id == NULL )
{
// editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -137,7 +137,7 @@ $coldisplay=-1; // We remove first td
}
$coldisplay++;
- if ($this->situation_counter == 1 || !$this->situation_cycle_ref) {
+ if ($line->fk_prev_id == NULL ) {
print '
';
}
?>
@@ -167,7 +167,7 @@ $coldisplay=-1; // We remove first td
// must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
print 'situation_counter > 1) print ' readonly';
+ if ($line->fk_prev_id != NULL ) print ' readonly';
print '>';
} else { ?>
@@ -186,7 +186,7 @@ $coldisplay=-1; // We remove first td
info_bits & 2) != 2) {
print 'situation_counter > 1) print ' readonly';
+ if ($line->fk_prev_id != NULL ) print ' readonly';
print '>%';
} else { ?>
From f9b86225454e6a15f141fdec5c264fc45d0ae476 Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Tue, 29 Jan 2019 11:33:22 +0100
Subject: [PATCH 05/10] Prise en charge de Multicompany
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Correction pour éviter que les factures appartenant à d'autres entités n'apparaissent dans celle qui est consultée sur le moment.
---
htdocs/fourn/recap-fourn.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php
index e680c18074e..577ffc6a99a 100644
--- a/htdocs/fourn/recap-fourn.php
+++ b/htdocs/fourn/recap-fourn.php
@@ -1,6 +1,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur
+ * Copyright (C) 2019 Pierre Ardoin
*
* 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
@@ -76,6 +77,7 @@ if ($socid > 0)
$sql.= " u.login, u.rowid as userid";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id;
+ $sql.= " AND f.entity IN (".getEntity("facture_fourn").")"; // Reconaissance de l'entité attribuée à cette facture pour Multicompany
$sql.= " AND f.fk_user_valid = u.rowid";
$sql.= " ORDER BY f.datef DESC";
From e75170137e5ded0c3bd1145c2b87ac71aac12ab1 Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Tue, 29 Jan 2019 11:42:44 +0100
Subject: [PATCH 06/10] =?UTF-8?q?Correction=20de=20la=20filtration=20de=20?=
=?UTF-8?q?l'entit=C3=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Corrige pour que la marge réalisée sur d'autres entités n'apparaisse pas sur celle sur laquelle l'utilisateur est connecté.
---
htdocs/margin/tabs/productMargins.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php
index e6c51e2217d..3b826501614 100644
--- a/htdocs/margin/tabs/productMargins.php
+++ b/htdocs/margin/tabs/productMargins.php
@@ -147,7 +147,7 @@ if ($id > 0 || ! empty($ref))
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.fk_statut > 0";
- $sql.= " AND s.entity = ".$conf->entity;
+ $sql.= " AND f.entity IN (".getEntity('invoice').")";
$sql.= " AND d.fk_facture = f.rowid";
$sql.= " AND d.fk_product =".$object->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
From b6df02e795664a188d3f9981f49d7707b8594386 Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Tue, 29 Jan 2019 11:47:39 +0100
Subject: [PATCH 07/10] Correction oubli date de livraison
Corrige l'oubli de la substitution de la date de livraison pour les commandes et demande de prix fournisseurs
---
htdocs/core/lib/functions.lib.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 90167504f3f..792da337aac 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -5993,6 +5993,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
$substitutionarray['__REF__'] = $object->ref;
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : ''));
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : '');
+ $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs): '');
// TODO Use this ?
$msgishtml = 0;
From 5ea1cf077502d05f7f89fd20a24113579a8726f5 Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Tue, 29 Jan 2019 14:25:34 +0100
Subject: [PATCH 08/10] Update objectline_edit.tpl.php
---
htdocs/core/tpl/objectline_edit.tpl.php | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index 62387001de5..00fc4f8e885 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -99,7 +99,7 @@ $coldisplay=-1; // We remove first td
}
// Do not allow editing during a situation cycle
- if ($line->fk_prev_id == NULL )
+ if ($line->fk_prev_id == null )
{
// editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -137,7 +137,7 @@ $coldisplay=-1; // We remove first td
}
$coldisplay++;
- if ($line->fk_prev_id == NULL ) {
+ if ($line->fk_prev_id == null ) {
print '
fk_prev_id == NULL ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
+ if (($line->fk_prev_id == null ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
print 'id . '&action=ask_deleteline&lineid=' . $line->id . '">';
print img_delete();
print '';
From 99892c13b0eda7b26747701f14567e9ae0c79e72 Mon Sep 17 00:00:00 2001
From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com>
Date: Tue, 29 Jan 2019 23:26:08 +0100
Subject: [PATCH 10/10] FIX : Erreur dans le Total
Corrige l'erreur de calcul dans le total des produits et services
---
htdocs/product/index.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 9f11813fdee..bfd6f6ad18f 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -184,7 +184,7 @@ else if ($type == '1')
else
{
print $statProducts.$statServices;
- $total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2])+round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2]);
+ $total=round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2])+round($prodser[0][3])+round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2])+round($prodser[1][3]); //Calcul du Total des Produits et Services
}
print '