Browse Source

Merge branch '16.0-mmi' of gogs.iprospective.fr:iProspective/dolibarr into 16.0-mmi

Mathieu Moulin 1 year ago
parent
commit
b6f39a58e2

+ 1 - 1
htdocs/custom/mmicommon

@@ -1 +1 @@
-Subproject commit 5427f84bd6d665b38dd2d1eae8deaff812b24512
+Subproject commit d238374023322a1d7013feca725bdce9f1ff3a1c

+ 1 - 1
htdocs/custom/mmifournisseurprice

@@ -1 +1 @@
-Subproject commit 058e3c5658dcb3aa51d309bfbe19a7c828a6ef6a
+Subproject commit bd20fb987fde1229ae85032edb83b00dba31148b

+ 1 - 1
htdocs/custom/mmiprestasync

@@ -1 +1 @@
-Subproject commit d91a4dd78e16137021ae3d9f6a5f4205f5b4d605
+Subproject commit e3ea48dc9ac3272b814efa7df9ddd91290e37c01

+ 1 - 1
htdocs/custom/mmiproduct

@@ -1 +1 @@
-Subproject commit 79d71427d57e761aca4e7e85343f89f567f19c5f
+Subproject commit ad006856af995354e764f0104e87dd3a4481785f

+ 1 - 1
htdocs/custom/mmiworkflow

@@ -1 +1 @@
-Subproject commit 7ebba3a13458cddfa258fc5f97fddc6933820e30
+Subproject commit 6a81e057e6d7816ccf2b406bd35318c8ce8d4829

+ 27 - 0
htdocs/product/fournisseurs.php

@@ -743,6 +743,33 @@ END;
 				print '</td>';
 				print '</tr>';
 
+				// MMI Hack
+				if (!empty($conf->global->MMIPRODUCT_SUPPLIER_PRICE_REDUCTED_DISPLAY)) {
+					$price = GETPOST('price') ? GETPOST('price') : (isset($object->fourn_price) ? $object->fourn_price : 0);
+					$remise_percent = GETPOSTISSET('remise_percent') ? GETPOST('remise_percent') : (isset($object->fourn_remise_percent) ?$object->fourn_remise_percent : 0);
+					// Supplier priced with rediction
+					print '<tr><td>'.$langs->trans("DiscountPriceQtyMin").'</td>';
+					print '<td><input class="flat" name="discount_price" size="4" value="'.($price*(1-$remise_percent/100)).'" /></td>';
+					print '</tr>';
+					print '<script type="text/javascript">';
+					print '$("input[name=price]").change(function(){
+						var price = $(this).val().replace(",", ".");
+						var remise_percent = $("input[name=remise_percent]").val().replace(",", ".");
+						$("input[name=discount_price]").val(price*(1-remise_percent/100));
+					}).change();;';
+					print '$("input[name=remise_percent]").change(function(){
+						var remise_percent = $(this).val().replace(",", ".");
+						var price = $("input[name=price]").val().replace(",", ".");
+						$("input[name=discount_price]").val(price*(1-remise_percent/100));
+					});';
+					print '$("input[name=discount_price]").change(function(){
+						var discount_price = $(this).val().replace(",", ".");
+						var remise_percent = $("input[name=remise_percent]").val().replace(",", ".");
+						$("input[name=price]").val(discount_price/(1-remise_percent/100));
+					})';
+					print '</script>';
+				}
+
 				// Delivery delay in days
 				print '<tr>';
 				print '<td>'.$langs->trans('NbDaysToDelivery').'</td>';