浏览代码

Merge branch '16.0-mmi' into 17.0-mmi

Mathieu Moulin 1 年之前
父节点
当前提交
f1b1f39530

+ 5 - 1
htdocs/core/actions_sendmails.inc.php

@@ -279,7 +279,11 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
 			if ($fromtype === 'robot') {
 				$from = dol_string_nospecial($conf->global->MAIN_MAIL_EMAIL_FROM, ' ', array(",")).' <'.$conf->global->MAIN_MAIL_EMAIL_FROM.'>';
 			} elseif ($fromtype === 'user') {
-				$from = dol_string_nospecial($user->getFullName($langs), ' ', array(",")).' <'.$user->email.'>';
+				// MMI Hack : Email sender name
+				if (!empty($conf->mmicrm->enabled) && !empty($conf->global->MMICRM_USER_MAILFROM_NAME) && !empty($user->array_options['options_email_sender_name']))
+					$from = dol_string_nospecial($user->array_options['options_email_sender_name'], ' ', array(",")).' <'.$user->email.'>';
+				else
+					$from = dol_string_nospecial($user->getFullName($langs), ' ', array(",")).' <'.$user->email.'>';
 			} elseif ($fromtype === 'company') {
 				$from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>';
 			} elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) {

+ 1 - 1
htdocs/custom/margincontrol

@@ -1 +1 @@
-Subproject commit 6be114e16aece9c3b80685e47dab86c2a989e99a
+Subproject commit 6eeffdaf56e0f7c085ee97d8145bdbd58deff7e7

+ 1 - 1
htdocs/custom/mmiavisverifies

@@ -1 +1 @@
-Subproject commit d7cc45d84f6f1fe8f8addf80764cc9fdaa90ebfa
+Subproject commit 299b77ac4065d8539db8b365f0b5da4d1daf887a

+ 1 - 1
htdocs/custom/mmicommon

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

+ 1 - 1
htdocs/custom/mmicrm

@@ -1 +1 @@
-Subproject commit 6ffd0577fa873b6b1732d859231bef3cfeed50ec
+Subproject commit 30e756527801fe37956ae33e9b2fe90bd6126893

+ 1 - 1
htdocs/custom/mmifournisseurprice

@@ -1 +1 @@
-Subproject commit 27b54a5888b05a4074917398180ad5754cb7c851
+Subproject commit bd20fb987fde1229ae85032edb83b00dba31148b

+ 1 - 1
htdocs/custom/mmipayments

@@ -1 +1 @@
-Subproject commit 23a0800d18821fa48ba7927563c6012313376734
+Subproject commit 011d25aa8e7de3e170500c6ec1aa77a7f472dcb7

+ 1 - 1
htdocs/custom/mmiprestasync

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

+ 1 - 1
htdocs/custom/mmiproduct

@@ -1 +1 @@
-Subproject commit 60b95350d1b12bae114057b8e0804aa5986c6f6e
+Subproject commit ad006856af995354e764f0104e87dd3a4481785f

+ 1 - 1
htdocs/custom/mmiproductdluo

@@ -1 +1 @@
-Subproject commit cf8e9539cfc6edeacc2e8388f6c0f514578b4f9e
+Subproject commit 11029b2ca88b01fdcdc526ef8a314f44f135a21c

+ 1 - 1
htdocs/custom/mmishipping

@@ -1 +1 @@
-Subproject commit 2ab3fea20025227bcb950d0837eb7f2d09cf2c83
+Subproject commit 11acc8c2eeecb8754d3c156ec867c34b8db0c7ef

+ 1 - 1
htdocs/custom/mmiworkflow

@@ -1 +1 @@
-Subproject commit 7ebba3a13458cddfa258fc5f97fddc6933820e30
+Subproject commit 6930e8c62f52ed71cf952b10467629fd081573ca

+ 1 - 1
htdocs/custom/sfycustom

@@ -1 +1 @@
-Subproject commit 30493f15fa2380a470ed97dec38d88f44e51d886
+Subproject commit 6987821348872094598574508081af14f1bae84f

+ 1 - 1
htdocs/custom/subtotal

@@ -1 +1 @@
-Subproject commit d975b846d977807edcf803d8950e5f16a4cd18e0
+Subproject commit d9a52cf6c58fd53e00a92371e15eee4394270e66

+ 1 - 1
htdocs/custom_dolicloud

@@ -1 +1 @@
-Subproject commit 63a75e655eadda8372009aff0b2a2f636b243c68
+Subproject commit 6c96ceb8a2aa185d8f07f07bec54cba15b4b7bf4

+ 35 - 0
htdocs/product/fournisseurs.php

@@ -792,6 +792,41 @@ 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="8" value="'.number_format($price*(1-$remise_percent/100), 5, ',', ' ').'" /></td>';
+					print '</tr>';
+					print '<script type="text/javascript">';
+					print 'function dolinumber(x) {
+						var parts = x.toString().split(".");
+    					parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, " ");
+    					return parts.join(".").replace(".", ",");
+					}';
+					print '$("input[name=price]").change(function(){
+						var price = $(this).val().replace(",", ".").replace(" ", "");
+						var remise_percent = $("input[name=remise_percent]").val().replace(",", ".").replace(" ", "");
+						var discount_price = price*(1-remise_percent/100);
+						$("input[name=discount_price]").val(dolinumber(discount_price));
+					}).change();;';
+					print '$("input[name=remise_percent]").change(function(){
+						var remise_percent = $(this).val().replace(",", ".").replace(" ", "");
+						var price = $("input[name=price]").val().replace(",", ".").replace(" ", "");
+						var discount_price = price*(1-remise_percent/100);
+						$("input[name=discount_price]").val(dolinumber(discount_price));
+					});';
+					print '$("input[name=discount_price]").change(function(){
+						var discount_price = $(this).val().replace(",", ".").replace(" ", "");
+						var remise_percent = $("input[name=remise_percent]").val().replace(",", ".").replace(" ", "");
+						var price = discount_price/(1-remise_percent/100);
+						$("input[name=price]").val(dolinumber(price));
+					})';
+					print '</script>';
+				}
+
 				// Delivery delay in days
 				print '<tr>';
 				print '<td>'.$langs->trans('NbDaysToDelivery').'</td>';