From 0dbc73a6cc2ea7a851fc47a2c73dadf0f35ca45e Mon Sep 17 00:00:00 2001 From: fhenry Date: Thu, 2 May 2013 22:57:42 +0200 Subject: [PATCH] Change-Id: Ie16265e57fa29748fa6c8a1e15ac15ff70786d1d --- htdocs/comm/propal.php | 2 ++ htdocs/comm/propal/class/propal.class.php | 3 ++- htdocs/compta/bank/fiche.php | 2 +- htdocs/core/tpl/predefinedproductline_create.tpl.php | 2 +- htdocs/margin/productMargins.php | 4 ++-- htdocs/margin/tabs/thirdpartyMargins.php | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 9cde868a97a..84650a9c60c 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -767,7 +767,9 @@ else if ($action == "addline" && $user->rights->propal->creer) // Margin $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + dol_syslog('ssdfsd:: $fournprice:'.var_export($fournprice,true)); $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + dol_syslog('ssdfsd:: $$buyingprice='.$buyingprice); $date_start=dol_mktime(0, 0, 0, GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end=dol_mktime(0, 0, 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index f407d6b597a..dc2c708cbec 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -407,6 +407,7 @@ class Propal extends CommonObject $this->line->date_start=$date_start; $this->line->date_end=$date_end; + // infos marge $this->line->fk_fournprice = $fk_fournprice; $this->line->pa_ht = $pa_ht; @@ -2817,7 +2818,7 @@ class PropaleLigne $sql.= " ".price2num($this->tva_tx).","; $sql.= " ".price2num($this->localtax1_tx).","; $sql.= " ".price2num($this->localtax2_tx).","; - $sql.= " ".($this->subprice?price2num($this->subprice):'null').","; + $sql.= " ".($this->subprice?price2num($this->subprice):"null").","; $sql.= " ".price2num($this->remise_percent).","; $sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").","; $sql.= " ".price2num($this->total_ht).","; diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index e7d6fbbce9f..daee366ebdb 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -239,7 +239,7 @@ if ($action == 'create') // Ref print ''.$langs->trans("Ref").''; - print 'ref).'">'; + print 'ref).'" maxlength="12">'; // Label print ''.$langs->trans("LabelBankCashAccount").''; diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index 422e7fa063e..ae8491784e6 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -186,7 +186,7 @@ if (! empty($usemargins)) } options += '>'+this.label+''; }); - options += ''; + options += ''; $("#buying_price").hide(); $("#fournprice").html(options).show(); $("#fournprice").change(function() { diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 3b709559f28..e5896d1f1b3 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -182,11 +182,11 @@ if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPr if ($id > 0) $sql.= " GROUP BY f.rowid"; else - $sql.= " GROUP BY d.fk_product"; + $sql.= " GROUP BY d.fk_product, p.label, p.rowid, p.fk_product_type, p.ref, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.rowid"; $sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); - +dol_syslog('margin::productMargin.php sql='.$sql,LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 643d190d04d..b91955d28c0 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -144,7 +144,7 @@ if ($socid > 0) $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; - $sql.= " GROUP BY f.rowid"; + $sql.= " GROUP BY f.rowid, s.nom, s.rowid, s.code_client, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; $sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset);