From 13e5c8ff7ac61bd3b22810d06a229f7c7d768166 Mon Sep 17 00:00:00 2001 From: fappels Date: Mon, 26 Jun 2017 22:44:56 +0200 Subject: [PATCH 01/17] Create patch Add Number of supplier prices and wap columns --- .../fourn/class/fournisseur.product.class.php | 28 ++++++++--- htdocs/langs/en_US/suppliers.lang | 1 + htdocs/product/list.php | 49 ++++++++++++++++++- 3 files changed, 70 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 4f576148099..e8a63e252d7 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -699,17 +699,33 @@ class ProductFournisseur extends Product /** * Display price of product * - * @param int $showunitprice Show "Unit price" into output string - * @param int $showsuptitle Show "Supplier" into output string - * @param int $maxlen Max length of name - * @param integer $notooltip 1=Disable tooltip + * @param int $showunitprice Show "Unit price" into output string + * @param int $showsuptitle Show "Supplier" into output string + * @param int $maxlen Max length of name + * @param integer $notooltip 1=Disable tooltip + * @param array $productFournList list of ProductFournisseur objects to display in table format. * @return string String with supplier price */ - function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0) + function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0, $productFournList=array()) { global $langs; + + $out = ''; $langs->load("suppliers"); - $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").'   (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':''); + if (count($productFournList) > 0) { + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + foreach ($productFournList as $productFourn) { + $out.= ''; + $out.= ''; + $out.= ''; + } + $out .= '
'.($showunitprice?$langs->trans("Price").' '.$langs->trans("HT"):'').''.$langs->trans("Supplier").''.$langs->trans("SupplierRef").'
'.($showunitprice?price($productFourn->fourn_unitprice * (1 -$productFourn->fourn_remise_percent/100) + $productFourn->fourn_unitcharges - $productFourn->fourn_remise):'').''.$productFourn->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).''.$productFourn->fourn_ref.'
'; + } else { + $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").'   (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':''); + } return $out; } diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index d84925d0676..079b588167f 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -43,3 +43,4 @@ NotTheGoodQualitySupplier=Wrong quality ReputationForThisProduct=Reputation BuyerName=Buyer name AllProductServicePrices=All product / service prices +BuyingPriceNumShort=Nbr of Buying prices diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 74f9c59cff3..fa0ee2cace7 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -164,6 +164,8 @@ $arrayfields=array( 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))), 'p.sellprice'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)), 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))), + 'p.numbuyprice'=>array('label'=>$langs->trans("BuyingPriceNumShort"), 'checked'=>0, 'enabled'=>(! empty($user->rights->fournisseur->lire))), + 'p.pmp'=>array('label'=>$langs->trans("PMPValueShort"), 'checked'=>0, 'enabled'=>(! empty($user->rights->fournisseur->lire))), 'p.seuil_stock_alerte'=>array('label'=>$langs->trans("StockLimit"), 'checked'=>0, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), 'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), 'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), @@ -266,7 +268,7 @@ else $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,'; $sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; $sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy,'; - $sql.= ' p.datec as date_creation, p.tms as date_update,'; + $sql.= ' p.datec as date_creation, p.tms as date_update, p.pmp,'; //$sql.= ' pfp.ref_fourn as ref_supplier, '; $sql.= ' MIN(pfp.unitprice) as minsellprice'; if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { @@ -335,7 +337,7 @@ else $sql.=$hookmanager->resPrint; $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,"; $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; - $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy'; + $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy, p.pmp'; if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { $sql .= ', pac.rowid'; } @@ -563,6 +565,20 @@ else print ''; print ' '; print ''; + } + // Number buying Price + if (! empty($arrayfields['p.numbuyprice']['checked'])) + { + print ''; + print ' '; + print ''; + } + // Number buying Price + if (! empty($arrayfields['p.pmp']['checked'])) + { + print ''; + print ' '; + print ''; } // Limit for alert if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) @@ -640,6 +656,8 @@ else if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.numbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.numbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.pmp']['checked'])) print_liste_field_titre($arrayfields['p.pmp']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) print_liste_field_titre($arrayfields['p.seuil_stock_alerte']['label'], $_SERVER["PHP_SELF"],"p.seuil_stock_alerte","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desiredstock","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder); @@ -703,6 +721,7 @@ else $product_static->status_buy = $obj->tobuy; $product_static->status = $obj->tosell; $product_static->entity = $obj->entity; + $product_static->pmp = $obj->pmp; if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) // To optimize call of load_stock { @@ -798,6 +817,32 @@ else print ''; } + // Number of buy prices + if (! empty($arrayfields['p.numbuyprice']['checked'])) + { + print ''; + if ($obj->tobuy) + { + if (($productFournList = $product_fourn->list_product_fournisseur_price($product_fourn->id)) > 0) + { + $htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1, $productFournList); + print $form->textwithpicto(count($productFournList),$htmltext); + } + } + print ''; + } + + // WAP + if (! empty($arrayfields['p.pmp']['checked'])) + { + print ''; + if ($obj->tobuy) + { + print price($product_static->pmp, 1, $langs, 1, 2, 1, 'auto'); + } + print ''; + } + // Limit alert if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) { From 7556a604e364a6d4cb3d5517605170012277bf84 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 29 Jun 2017 16:30:57 +0200 Subject: [PATCH 02/17] fix travis --- .../class/accountancycategory.class.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 7668756a046..a7bab16b30d 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -429,7 +429,7 @@ class AccountancyCategory return - 1; } } - + public function getCats() { global $db, $langs, $user, $mysoc; @@ -462,7 +462,7 @@ class AccountancyCategory if ($num) { while ( $i < $num ) { $obj = $this->db->fetch_object($resql); - + $data[] = array ( 'rowid' => $obj->rowid, 'code' => $obj->code, @@ -483,10 +483,10 @@ class AccountancyCategory return - 1; } } - - - // calcule - + + + // calcule + const PATTERN = '/(?:\-?\d+(?:\.?\d+)?[\+\-\*\/])+\-?\d+(?:\.?\d+)?/'; const PARENTHESIS_DEPTH = 10; @@ -535,10 +535,12 @@ class AccountancyCategory return 0; } - + /** * get cpts of category * + * @param int $cat_id Id accounting account category + * * @return array Result in table */ public function getCptsCat($cat_id) { @@ -554,7 +556,7 @@ class AccountancyCategory $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t"; $sql .= " WHERE t.fk_accounting_category = ".$cat_id; $sql .= " ORDER BY t.account_number "; - + //echo $sql; $resql = $this->db->query($sql); @@ -582,5 +584,5 @@ class AccountancyCategory return -1; } } - + } From 7dc4eeddf04d0bfb6de78a5c4bcf6c793e32c405 Mon Sep 17 00:00:00 2001 From: KHELIFA Date: Thu, 29 Jun 2017 16:44:52 +0200 Subject: [PATCH 03/17] FIX: Function load_board in commande.class.php for warnings delay in dashboard --- htdocs/commande/class/commande.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 93df2f1aa0b..eb62d84ce48 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3243,7 +3243,8 @@ class Commande extends CommonOrder $response->nbtodo++; $generic_commande->statut = $obj->fk_statut; - $generic_commande->date_livraison = $obj->delivery_date; + $generic_commande->date_commande = $this->db->jdate($obj->date_commande); + $generic_commande->date_livraison = $this->db->jdate($obj->delivery_date); if ($generic_commande->hasDelay()) { $response->nbtodolate++; From 62f8aa8b40f1a45ee22a8ddfff25a54b462835f6 Mon Sep 17 00:00:00 2001 From: KHELIFA Date: Thu, 29 Jun 2017 16:49:30 +0200 Subject: [PATCH 04/17] Fix: In supplier order, show link Now for order date and delivery date --- htdocs/fourn/commande/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index bdd38ebc0b7..d49d9df85d2 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2704,7 +2704,7 @@ elseif (! empty($object->id)) //print ''.$langs->trans("ToOrder").''; print ''.$langs->trans("OrderDate").''; $date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - print $form->select_date($date_com,'',1,1,'',"commande",1,0,1); + print $form->select_date($date_com,'',1,1,'',"commande",1,1,1); print ''; print ''.$langs->trans("OrderMode").''; @@ -2756,7 +2756,7 @@ if ($action != 'makeorder') print ''; //print ''; print '\n"; print "
'.$langs->trans("Receive").'
'.$langs->trans("DeliveryDate").''; - print $form->select_date('','',1,1,'',"commande",1,0,1); + print $form->select_date('','',1,1,'',"commande",1,1,1); print "
".$langs->trans("Delivery")."\n"; From 7d4a093d9ebd49be669e43061e037dff7280f2d5 Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 30 Jun 2017 10:52:54 +0200 Subject: [PATCH 05/17] WAP alway decimal 2 digits --- .../fourn/class/fournisseur.product.class.php | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 38a1ea366c5..bcbaf18e9f5 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -699,12 +699,13 @@ class ProductFournisseur extends Product /** * Display price of product * - * @param int $showunitprice Show "Unit price" into output string - * @param int $showsuptitle Show "Supplier" into output string - * @param int $maxlen Max length of name - * @param integer $notooltip 1=Disable tooltip - * @param array $productFournList list of ProductFournisseur objects to display in table format. - * @return string String with supplier price + * @param int $showunitprice Show "Unit price" into output string + * @param int $showsuptitl Show "Supplier" into output string + * @param int $maxlen Max length of name + * @param integer $notooltip 1=Disable tooltip + * @param array $productFournList list of ProductFournisseur objects + * to display in table format. + * @return string String with supplier price */ function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0, $productFournList=array()) { @@ -713,16 +714,18 @@ class ProductFournisseur extends Product $out = ''; $langs->load("suppliers"); if (count($productFournList) > 0) { - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; + $out .= '
'.($showunitprice?$langs->trans("Price").' '.$langs->trans("HT"):'').''.$langs->trans("Supplier").''.$langs->trans("SupplierRef").'
'; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; foreach ($productFournList as $productFourn) { $out.= ''; + $out.= ''; $out.= ''; $out.= ''; } - $out .= '
'.($showunitprice?$langs->trans("Price").' '.$langs->trans("HT"):'').''.($showunitprice?$langs->trans("QtyMin"):'').''.$langs->trans("Supplier").''.$langs->trans("SupplierRef").'
'.($showunitprice?price($productFourn->fourn_unitprice * (1 -$productFourn->fourn_remise_percent/100) + $productFourn->fourn_unitcharges - $productFourn->fourn_remise):'').''.($showunitprice?$productFourn->fourn_qty:'').''.$productFourn->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).''.$productFourn->fourn_ref.'
'; + $out .= '
'; } else { $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").'   (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':''); } From d0599cd9528dd9ad9e3e45d4930cf61bd6dd9159 Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 30 Jun 2017 10:54:04 +0200 Subject: [PATCH 06/17] Revert "WAP alway decimal 2 digits" This reverts commit 7d4a093d9ebd49be669e43061e037dff7280f2d5. --- .../fourn/class/fournisseur.product.class.php | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index bcbaf18e9f5..38a1ea366c5 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -699,13 +699,12 @@ class ProductFournisseur extends Product /** * Display price of product * - * @param int $showunitprice Show "Unit price" into output string - * @param int $showsuptitl Show "Supplier" into output string - * @param int $maxlen Max length of name - * @param integer $notooltip 1=Disable tooltip - * @param array $productFournList list of ProductFournisseur objects - * to display in table format. - * @return string String with supplier price + * @param int $showunitprice Show "Unit price" into output string + * @param int $showsuptitle Show "Supplier" into output string + * @param int $maxlen Max length of name + * @param integer $notooltip 1=Disable tooltip + * @param array $productFournList list of ProductFournisseur objects to display in table format. + * @return string String with supplier price */ function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0, $productFournList=array()) { @@ -714,18 +713,16 @@ class ProductFournisseur extends Product $out = ''; $langs->load("suppliers"); if (count($productFournList) > 0) { - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; + $out .= '
'.($showunitprice?$langs->trans("Price").' '.$langs->trans("HT"):'').''.($showunitprice?$langs->trans("QtyMin"):'').''.$langs->trans("Supplier").''.$langs->trans("SupplierRef").'
'; + $out .= ''; + $out .= ''; + $out .= ''; foreach ($productFournList as $productFourn) { $out.= ''; - $out.= ''; $out.= ''; $out.= ''; } - $out .= '
'.($showunitprice?$langs->trans("Price").' '.$langs->trans("HT"):'').''.$langs->trans("Supplier").''.$langs->trans("SupplierRef").'
'.($showunitprice?price($productFourn->fourn_unitprice * (1 -$productFourn->fourn_remise_percent/100) + $productFourn->fourn_unitcharges - $productFourn->fourn_remise):'').''.($showunitprice?$productFourn->fourn_qty:'').''.$productFourn->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).''.$productFourn->fourn_ref.'
'; + $out .= ''; } else { $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").'   (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':''); } From 574590a59860e3cda4189a4d0e59573fd4996fc1 Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 30 Jun 2017 10:55:45 +0200 Subject: [PATCH 07/17] Add minimum qty column --- .../fourn/class/fournisseur.product.class.php | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 38a1ea366c5..bcbaf18e9f5 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -699,12 +699,13 @@ class ProductFournisseur extends Product /** * Display price of product * - * @param int $showunitprice Show "Unit price" into output string - * @param int $showsuptitle Show "Supplier" into output string - * @param int $maxlen Max length of name - * @param integer $notooltip 1=Disable tooltip - * @param array $productFournList list of ProductFournisseur objects to display in table format. - * @return string String with supplier price + * @param int $showunitprice Show "Unit price" into output string + * @param int $showsuptitl Show "Supplier" into output string + * @param int $maxlen Max length of name + * @param integer $notooltip 1=Disable tooltip + * @param array $productFournList list of ProductFournisseur objects + * to display in table format. + * @return string String with supplier price */ function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0, $productFournList=array()) { @@ -713,16 +714,18 @@ class ProductFournisseur extends Product $out = ''; $langs->load("suppliers"); if (count($productFournList) > 0) { - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; + $out .= '
'.($showunitprice?$langs->trans("Price").' '.$langs->trans("HT"):'').''.$langs->trans("Supplier").''.$langs->trans("SupplierRef").'
'; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; foreach ($productFournList as $productFourn) { $out.= ''; + $out.= ''; $out.= ''; $out.= ''; } - $out .= '
'.($showunitprice?$langs->trans("Price").' '.$langs->trans("HT"):'').''.($showunitprice?$langs->trans("QtyMin"):'').''.$langs->trans("Supplier").''.$langs->trans("SupplierRef").'
'.($showunitprice?price($productFourn->fourn_unitprice * (1 -$productFourn->fourn_remise_percent/100) + $productFourn->fourn_unitcharges - $productFourn->fourn_remise):'').''.($showunitprice?$productFourn->fourn_qty:'').''.$productFourn->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).''.$productFourn->fourn_ref.'
'; + $out .= ''; } else { $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").'   (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':''); } From 989084e4dece898320c368ac34f2561f8cb245eb Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 30 Jun 2017 10:56:05 +0200 Subject: [PATCH 08/17] WAP always 2 decimals --- htdocs/langs/en_US/suppliers.lang | 2 +- htdocs/product/list.php | 46 +++++++++++++++---------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index 079b588167f..28c5fe39d0d 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -43,4 +43,4 @@ NotTheGoodQualitySupplier=Wrong quality ReputationForThisProduct=Reputation BuyerName=Buyer name AllProductServicePrices=All product / service prices -BuyingPriceNumShort=Nbr of Buying prices +BuyingPriceNumShort=Supplier prices diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 50bd61fad17..cb31de75892 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -829,31 +829,31 @@ else } // Number of buy prices - if (! empty($arrayfields['p.numbuyprice']['checked'])) - { - print ''; - if ($obj->tobuy) - { - if (($productFournList = $product_fourn->list_product_fournisseur_price($product_fourn->id)) > 0) - { - $htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1, $productFournList); - print $form->textwithpicto(count($productFournList),$htmltext); - } - } - print ''; - } + if (! empty($arrayfields['p.numbuyprice']['checked'])) + { + print ''; + if ($obj->tobuy) + { + if (($productFournList = $product_fourn->list_product_fournisseur_price($product_fourn->id)) > 0) + { + $htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1, $productFournList); + print $form->textwithpicto(count($productFournList),$htmltext); + } + } + print ''; + } // WAP - if (! empty($arrayfields['p.pmp']['checked'])) - { - print ''; - if ($obj->tobuy) - { - print price($product_static->pmp, 1, $langs, 1, 2, 1, 'auto'); - } - print ''; - } - + if (! empty($arrayfields['p.pmp']['checked'])) + { + print ''; + if ($obj->tobuy) + { + print price($product_static->pmp, 1, $langs, 1, 2, 2, 'auto'); + } + print ''; + } + // Limit alert if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) { From 11cd4e1164d8e3dd0380afa9e70f4566e7497fe5 Mon Sep 17 00:00:00 2001 From: Darkjeff Date: Fri, 30 Jun 2017 11:29:37 +0200 Subject: [PATCH 09/17] Fix Binding Customer --- htdocs/accountancy/customer/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 75c1a59aa30..2663ab1d779 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -189,7 +189,8 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accounta $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; $sql .= " AND product_type <= 2"; -$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')"; +$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='' OR p.accountancy_code_sell NOT IN + (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid ='" . $conf->global->CHARTOFACCOUNTS . "'))"; // Add search filter like if ($search_lineid) { $sql .= natural_search("l.rowid", $search_lineid, 1); From 2c795da664e5c932bade64139ae121849ddbd760 Mon Sep 17 00:00:00 2001 From: Darkjeff Date: Fri, 30 Jun 2017 11:30:20 +0200 Subject: [PATCH 10/17] Fix Binding Supplier --- htdocs/accountancy/supplier/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index ff39aad67f4..3077f8f337b 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -191,7 +191,8 @@ $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountan $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; $sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; $sql.= " AND product_type <= 2"; -$sql.= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_buy IS NULL OR p.accountancy_code_buy ='')"; +$sql.= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_buy IS NULL OR p.accountancy_code_buy =''OR p.accountancy_code_buy NOT IN + (SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid ='" . $conf->global->CHARTOFACCOUNTS . "'))"; // Add search filter like if ($search_lineid) { $sql .= natural_search("l.rowid", $search_lineid, 1); From f978b0795a5d1d119d5016cc5d6f3e83ae776deb Mon Sep 17 00:00:00 2001 From: Darkjeff Date: Fri, 30 Jun 2017 11:31:24 +0200 Subject: [PATCH 11/17] Fix action in journal --- htdocs/accountancy/journal/bankjournal.php | 6 +++--- htdocs/accountancy/journal/purchasesjournal.php | 6 +++--- htdocs/accountancy/journal/sellsjournal.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index ed8d1d7501a..056f3644770 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -75,7 +75,7 @@ $date_endyear = GETPOST('date_endyear'); $in_bookkeeping = GETPOST('in_bookkeeping'); $now = dol_now(); -$action = GETPOST('action','alpha'); +$action = GETPOST('action','aZ09'); // Security check if ($user->societe_id > 0 && empty($id_journal)) @@ -612,7 +612,7 @@ if (! $error && $action == 'writebookkeeping') { } // Export -if ($action == 'export_csv') { +if ($action == 'exportcsv') { $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; @@ -760,7 +760,7 @@ if (empty($action) || $action == 'view') {