From 1ab6955494849e57cad898585082f7be18b3f021 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Sat, 27 Dec 2014 11:27:41 +0100 Subject: [PATCH 1/3] FIX: dont remove price ht if it is forced (ie: calculated by margin rate and cost price, or by external module) --- htdocs/comm/propal.php | 3 +-- htdocs/commande/fiche.php | 3 +-- htdocs/compta/facture.php | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index e3be3ac8361..4929ee9c70e 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -545,16 +545,15 @@ else if ($action == 'addline' && $user->rights->propal->creer) { // Set if we used free entry or predefined product $predef=''; $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); if (GETPOST('prod_entry_mode') == 'free') { $idprod=0; - $price_ht = GETPOST('price_ht'); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod=GETPOST('idprod', 'int'); - $price_ht = ''; $tva_tx = ''; } diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index e0950bdccc7..1c01b975a3b 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -511,16 +511,15 @@ else if ($action == 'addline' && $user->rights->commande->creer) { // Set if we used free entry or predefined product $predef=''; $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); if (GETPOST('prod_entry_mode') == 'free') { $idprod=0; - $price_ht = GETPOST('price_ht'); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod=GETPOST('idprod', 'int'); - $price_ht = ''; $tva_tx = ''; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 25330ba548b..d9582e957e2 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1064,16 +1064,15 @@ else if ($action == 'addline' && $user->rights->facture->creer) // Set if we used free entry or predefined product $predef=''; $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); if (GETPOST('prod_entry_mode') == 'free') { $idprod=0; - $price_ht = GETPOST('price_ht'); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod=GETPOST('idprod', 'int'); - $price_ht = ''; $tva_tx = ''; } From 191d4467e358274a77e21f821838924170fd99f3 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 28 Dec 2014 12:31:27 +0100 Subject: [PATCH 2/3] Update facture.php $soc already filled upper when $socid send --- htdocs/compta/facture.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 25330ba548b..b2da9f652f7 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1884,8 +1884,10 @@ if ($action == 'create') $projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : ''); $ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : ''); $ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : ''); - - $soc = $objectsrc->thirdparty; + + // only if socid not filled else it's allready done upper + if (empty($socid)) + $soc = $objectsrc->thirdparty; $cond_reglement_id = (! empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(! empty($soc->cond_reglement_id)?$soc->cond_reglement_id:1)); $mode_reglement_id = (! empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(! empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); From a668d163fdbf3cf97ba685b015a2c6ff4b573ef9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jan 2015 00:27:35 +0100 Subject: [PATCH 3/3] Repair corrupted data --- htdocs/install/mysql/migration/repair.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 70fae404149..90730796279 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -115,7 +115,7 @@ ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseu -- Fix: deprecated tag to new one update llx_opensurvey_sondage set format = 'D' where format = 'D+'; update llx_opensurvey_sondage set format = 'A' where format = 'A+'; - +update llx_opensurvey_sondage set tms = now(); -- ALTER TABLE llx_facture_fourn ALTER COLUMN fk_cond_reglement DROP NOT NULL;