diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index e2391e08d89..ba6fd2198e9 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -203,6 +203,7 @@ if ($resql) dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$action,-1,$actioncode,$usergroup); + dol_fiche_end(); // Add link to show birthdays diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 2628fd6607c..e8095954a37 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1216,18 +1216,11 @@ class BonPrelevement extends CommonObject /** -<<<<<<< HEAD - * Generate a withdrawal file. Generation Formats: - * European countries: SEPA - * Others: Warning message - * File is generated with name this->filename -======= * Generate a withdrawal file. * Generation Formats: * - Europe: SEPA (France: CFONB no more supported, Spain: AEB19 if external module EsAEB is enabled) * - Others countries: Warning message * File is generated with name this->filename ->>>>>>> refs/remotes/origin/3.6 * * @return int 0 if OK, <0 if KO */ diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 07172e663c4..0a69c0874a1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -430,7 +430,7 @@ class Product extends CommonObject { // Call trigger $result=$this->call_trigger('PRODUCT_CREATE',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers } @@ -602,7 +602,7 @@ class Product extends CommonObject foreach ($this->stock_warehouse as $idW => $ObjW) { $qty_batch = 0; - foreach ($ObjW->detail_batch as $detail) + foreach ($ObjW->detail_batch as $detail) { $qty_batch += $detail->qty; } @@ -615,12 +615,12 @@ class Product extends CommonObject $ObjBatch->qty = $ObjW->real - $qty_batch; $ObjBatch->fk_product_stock = $ObjW->id; if ($ObjBatch->create($user,1) < 0) - { + { $error++; $this->errors=$ObjBatch->errors; } } - } + } } // For automatic creation if ($this->barcode == -1) $this->barcode = $this->get_barcode($this,$this->barcode_type_code); @@ -699,7 +699,7 @@ class Product extends CommonObject { // Call trigger $result=$this->call_trigger('PRODUCT_MODIFY',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers } @@ -796,7 +796,7 @@ class Product extends CommonObject { // Call trigger $result=$this->call_trigger('PRODUCT_DELETE',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers } @@ -820,7 +820,7 @@ class Product extends CommonObject } } } - + // Delete product if (! $error) { @@ -1257,7 +1257,7 @@ class Product extends CommonObject $localtax2=get_localtax($newvat,2); if (empty($localtax1)) $localtax1=0; // If = '' then = 0 if (empty($localtax2)) $localtax2=0; // If = '' then = 0 - + $this->db->begin(); // Ne pas mettre de quote sur les numeriques decimaux. @@ -1298,13 +1298,13 @@ class Product extends CommonObject // Call trigger $result=$this->call_trigger('PRODUCT_PRICE_MODIFY',$user); - if ($result < 0) - { + if ($result < 0) + { $this->db->rollback(); return -1; - } + } // End call triggers - + $this->db->commit(); } else @@ -1423,8 +1423,8 @@ class Product extends CommonObject $this->entity = $obj->entity; $this->db->free($resql); - - + + // Retreive all extrafield for thirdparty // fetch optionals attributes and labels require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); @@ -3514,35 +3514,38 @@ class Product extends CommonObject } } } - + /** - * Return minimum product recommended price + * Return minimum product recommended price * - * @return void + * @return int Minimum recommanded price that is higher price among all suppliers * PRODUCT_MINIMUM_RECOMMENDED_PRICE */ - function min_recommended_price() + function min_recommended_price() { global $conf; - if ( !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) + + $maxpricesupplier=0; + + if (! empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $product_fourn = new ProductFournisseur($this->db); $product_fourn_list = $product_fourn->list_product_fournisseur_price($this->id, '', ''); - $maxpricesupplier=0; - + if (is_array($product_fourn_list) && count($product_fourn_list)>0) - { + { foreach($product_fourn_list as $productfourn) - { - if ($productfourn->fourn_unitprice>$maxpricesupplier) + { + if ($productfourn->fourn_unitprice > $maxpricesupplier) { $maxpricesupplier = $productfourn->fourn_unitprice; } } - - $maxpricesupplier*=$conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE; + + $maxpricesupplier *= $conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE; } - return $maxpricesupplier; } + + return $maxpricesupplier; } } diff --git a/htdocs/product/price.php b/htdocs/product/price.php index fa6d127a085..cc566e3ba6d 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -99,7 +99,7 @@ if ($action == 'update_price' && ! $_POST ["cancel"] && ($user->rights->produit- $newpsq = empty($newpsq) ? 0 : $newpsq; } - if ($newprice_min<$maxpricesupplier && !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) + if (! empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $newprice_min < $maxpricesupplier) { setEventMessage($langs->trans("MinimumPriceLimit",price($maxpricesupplier,0,'',1,-1,-1,'auto')),'errors'); $error++; @@ -227,7 +227,7 @@ if ($action == 'add_customer_price_confirm' && ! $_POST ["cancel"] && ($user->ri $prodcustprice->tva_tx = str_replace('*', '', GETPOST("tva_tx")); $prodcustprice->recuperableonly = (preg_match('/\*/', GETPOST("tva_tx")) ? 1 : 0); - if ($prodcustprice->price_min<$maxpricesupplier && !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) + if (! empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $prodcustprice->price_min<$maxpricesupplier) { setEventMessage($langs->trans("MinimumPriceLimit",price($maxpricesupplier,0,'',1,-1,-1,'auto')),'errors'); $error++;