瀏覽代碼

Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
	htdocs/core/class/commonobject.class.php
	htdocs/core/class/html.form.class.php
Laurent Destailleur 5 年之前
父節點
當前提交
c54294285a

+ 0 - 66
htdocs/comm/mailing/class/html.formadvtargetemailing.class.php

@@ -339,72 +339,6 @@ class FormAdvTargetEmailing extends Form
 		return $return;
     }
 
-	/**
-	 *  Return combo list with customer categories
-	 *
-	 *  @param  string	$htmlname   Name of categorie
-	 * 	@param	array	$selected_array	value selected
-	 *  @return	string HTML combo
-	 */
-	public function multiselectCustomerCategories($htmlname = 'cust_cat', $selected_array = array())
-	{
-		return $this->multiselectCategories($htmlname, $selected_array, 2);
-	}
-
-	/**
-	 *  Return combo list with customer contact
-	 *
-	 *  @param  string	$htmlname   Name of categorie
-	 * 	@param	array	$selected_array	value selected
-	 *  @return	string HTML combo
-	 */
-	public function multiselectContactCategories($htmlname = 'contact_cat', $selected_array = array())
-	{
-		return $this->multiselectCategories($htmlname, $selected_array, 4);
-	}
-
-	/**
-	 *  Return combo list of categories
-	 *
-	 *  @param  string	$htmlname  		Name of categorie
-	 * 	@param	array	$selected_array	Value selected
-	 * 	@param	int		$type			Type
-	 *  @return	string 					HTML combo
-	 */
-	public function multiselectCategories($htmlname = '', $selected_array = array(), $type = 0)
-	{
-		global $conf, $langs, $user;
-		$langs->load("dict");
-
-		$options_array = array();
-
-		$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."categorie";
-		$sql .= " WHERE type=".$type;
-
-		dol_syslog(__METHOD__, LOG_DEBUG);
-		$resql = $this->db->query($sql);
-		if ($resql)
-		{
-			$num = $this->db->num_rows($resql);
-			$i = 0;
-			if ($num)
-			{
-				while ($i < $num)
-				{
-					$obj = $this->db->fetch_object($resql);
-
-					$options_array[$obj->rowid] = $obj->label;
-
-					$i++;
-				}
-			}
-		} else {
-			dol_print_error($this->db);
-		}
-
-		return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
-	}
-
 	/**
 	 * Return a combo list to select emailing target selector
 	 *

+ 22 - 5
htdocs/compta/facture/card.php

@@ -313,15 +313,23 @@ if (empty($reshook))
 
 				if (($tmp_total_ht < 0 || $tmp_total_ht_devise < 0) && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
 				{
-					$langs->load("errors");
 					if ($object->type == $object::TYPE_DEPOSIT) {
+						$langs->load("errors");
 						// Using negative lines on deposit lead to headach and blocking problems when you want to consume them.
 						setEventMessages($langs->trans("ErrorLinesCantBeNegativeOnDeposits"), null, 'errors');
+						$error++;
+						$action = '';
 					} else {
-						setEventMessages($langs->trans("ErrorLinesCantBeNegativeForOneVATRate"), null, 'errors');
+						$tmpvatratetoshow = explode('_', $vatrate);
+						$tmpvatratetoshow[0] = round($tmpvatratetoshow[0], 2);
+
+						if ($tmpvatratetoshow[0] != 0) {
+							$langs->load("errors");
+							setEventMessages($langs->trans("ErrorLinesCantBeNegativeForOneVATRate", $tmpvatratetoshow[0]), null, 'errors');
+							$error++;
+							$action = '';
+						}
 					}
-					$error++;
-					$action = '';
 				}
 			}
 		}
@@ -3417,10 +3425,19 @@ if ($action == 'create')
 	}
 
 	// Other attributes
-	$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols' => '2');
+	$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols' => '2', 'socid'=>$socid);
 	$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
 	print $hookmanager->resPrint;
 	if (empty($reshook)) {
+		if (!empty($conf->global->THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_INVOICE)) {
+			// copy from thirdparty
+			$tpExtrafields = new Extrafields($db);
+			$tpExtrafieldLabels = $tpExtrafields->fetch_name_optionals_label($soc->table_element);
+			if ($soc->fetch_optionals() > 0) {
+				$object->array_options = array_merge($object->array_options, $soc->array_options);
+			}
+		};
+
 		print $object->showOptionals($extrafields, 'edit', $parameters);
 	}
 

+ 2 - 1
htdocs/compta/facture/list.php

@@ -448,6 +448,7 @@ if (!$sall) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.f
 if ($sall || $search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as pd ON f.rowid=pd.fk_facture';
 if ($search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet";
+$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid';
 // We'll need this table joined to the select in order to filter by sale
 if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
 if ($search_user > 0)
@@ -455,7 +456,7 @@ if ($search_user > 0)
 	$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
 	$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
 }
-$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid';
+
 $sql .= ' WHERE f.fk_soc = s.rowid';
 $sql .= ' AND f.entity IN ('.getEntity('invoice').')';
 if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;

+ 4 - 2
htdocs/compta/paiement/class/paiement.class.php

@@ -498,8 +498,10 @@ class Paiement extends CommonObject
 		{
 			$accline = new AccountLine($this->db);
 
-			$result = $accline->fetch($bank_line_id);
-			if ($result == 0) $accline->rowid = $bank_line_id; // If not found, we set artificially rowid to allow delete of llx_bank_url
+			$result=$accline->fetch($bank_line_id);
+			if ($result == 0) {
+				$accline->id = $accline->rowid = $bank_line_id;    // If not found, we set artificially rowid to allow delete of llx_bank_url
+			}
 
             // Delete bank account url lines linked to payment
 			$result = $accline->delete_urls($user);

+ 5 - 3
htdocs/core/class/commonobject.class.php

@@ -5844,7 +5844,7 @@ abstract class CommonObject
 			if ($type == 'date')
 			{
 				$morecss = 'minwidth100imp';
-			} elseif ($type == 'datetime' || $type == 'link')
+			} elseif ($type == 'datetime' || $type == 'link')	// link means an foreign key to another primary id
 			{
 				$morecss = 'minwidth200imp';
 			} elseif (in_array($type, array('int', 'integer', 'price')) || preg_match('/^double(\([0-9],[0-9]\)){0,1}/', $type))
@@ -6278,11 +6278,13 @@ abstract class CommonObject
 			$param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter]]'
 			$param_list_array = explode(':', $param_list[0]);
 			$showempty = (($required && $default != '') ? 0 : 1);
+			if (!empty($param_list_array[2])) {		// If the entry into $fields is set to add a create button
+				$morecss .= ' widthcentpercentminusx';
+			}
 
 			$out = $form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, $moreparam, 0, empty($val['disabled']) ? 0 : 1);
 
-			if (!empty($param_list_array[2]))		// If we set to add a create button
-			{
+			if (!empty($param_list_array[2])) {		// If the entry into $fields is set to add a create button
 				if (!GETPOSTISSET('backtopage') && empty($val['disabled']) && empty($nonewbutton))	// To avoid to open several times the 'Create Object' button and to avoid to have button if field is protected by a "disabled".
 				{
 		   			list($class, $classfile) = explode(':', $param_list[0]);

+ 7 - 7
htdocs/core/class/html.form.class.php

@@ -5676,8 +5676,7 @@ class Form
 			$minSelected = convertSecondToTime($iSecond, 'min');
 		}
 
-		if ($typehour == 'select')
-		{
+		if ($typehour == 'select') {
 			$retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>';
 			for ($hour = 0; $hour < 25; $hour++)	// For a duration, we allow 24 hours
 			{
@@ -5689,10 +5688,11 @@ class Form
 				$retstring .= ">".$hour."</option>";
 			}
 			$retstring .= "</select>";
-		} elseif ($typehour == 'text' || $typehour == 'textselect')
-		{
-			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" size="1" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
-		} else return 'BadValueForParameterTypeHour';
+		} elseif ($typehour == 'text' || $typehour == 'textselect') {
+			$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
+		} else {
+			return 'BadValueForParameterTypeHour';
+		}
 
 		if ($typehour != 'text') $retstring .= ' '.$langs->trans('HourShort');
 		else $retstring .= '<span class="hideonsmartphone">:</span>';
@@ -5713,7 +5713,7 @@ class Form
 			$retstring .= "</select>";
 		} elseif ($typehour == 'text')
 		{
-			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" size="1" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
+			$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
 		}
 
 		if ($typehour != 'text') $retstring .= ' '.$langs->trans('MinuteShort');

+ 1 - 1
htdocs/core/lib/emailing.lib.php

@@ -48,7 +48,7 @@ function emailing_prepare_head(Mailing $object)
     	$h++;
 	}
 
-	if (empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR))
+	if (!empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR))
 	{
 		$head[$h][0] = DOL_URL_ROOT."/comm/mailing/advtargetemailing.php?id=".$object->id;
 		$head[$h][1] = $langs->trans("MailAdvTargetRecipients");

+ 1 - 1
htdocs/core/lib/website2.lib.php

@@ -462,7 +462,7 @@ function showWebsiteTemplates(Website $website)
 
 	$colspan = 2;
 
-	print '<!-- For to import website template -->'."\n";
+	print '<!-- For website template import -->'."\n";
 	print '<table class="noborder centpercent">';
 
 	// Title

+ 78 - 68
htdocs/core/tpl/advtarget.tpl.php

@@ -15,6 +15,10 @@
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
 
+if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
+	require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
+}
+
 print '<script type="text/javascript" language="javascript">
 	$(document).ready(function() {
 
@@ -135,7 +139,7 @@ print '</td></tr>'."\n";
 
 // Customer Country
 print '<tr><td>'.$langs->trans("Country");
-if (count($array_query['cust_country']) > 0) {
+if (!empty($array_query['cust_country'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>'."\n";
@@ -145,7 +149,7 @@ print '</td></tr>'."\n";
 
 // State Customer
 print '<tr><td>'.$langs->trans('Status').' '.$langs->trans('ThirdParty');
-if (count($array_query['cust_status']) > 0) {
+if (!empty($array_query['cust_status'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>';
@@ -173,7 +177,7 @@ print '</td></tr>'."\n";
 // Prospect/Customer
 $selected = $array_query['cust_typecust'];
 print '<tr><td>'.$langs->trans('ProspectCustomer').' '.$langs->trans('ThirdParty');
-if (count($array_query['cust_typecust']) > 0) {
+if (!empty($array_query['cust_typecust'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>';
@@ -189,7 +193,7 @@ print '</td></tr>'."\n";
 
 // Prospection status
 print '<tr><td>'.$langs->trans('ProspectLevel');
-if (count($array_query['cust_prospect_status']) > 0) {
+if (!empty($array_query['cust_prospect_status'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>';
@@ -199,7 +203,7 @@ print '</td></tr>'."\n";
 
 // Prospection comm status
 print '<tr><td>'.$langs->trans('StatusProsp');
-if (count($array_query['cust_comm_status']) > 0) {
+if (!empty($array_query['cust_comm_status'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>';
@@ -209,7 +213,7 @@ print '</td></tr>'."\n";
 
 // Customer Type
 print '<tr><td>'.$langs->trans("ThirdPartyType");
-if (count($array_query['cust_typeent']) > 0) {
+if (!empty($array_query['cust_typeent'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>'."\n";
@@ -219,7 +223,7 @@ print '</td></tr>'."\n";
 
 // Staff number
 print '<td>'.$langs->trans("Staff");
-if (count($array_query['cust_effectif_id']) > 0) {
+if (!empty($array_query['cust_effectif_id'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>';
@@ -229,7 +233,7 @@ print '</td></tr>'."\n";
 
 // Sales manager
 print '<tr><td>'.$langs->trans("SalesRepresentatives");
-if (count($array_query['cust_saleman']) > 0) {
+if (!empty($array_query['cust_saleman'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>'."\n";
@@ -240,7 +244,7 @@ print '</td></tr>'."\n";
 // Customer Default Langauge
 if (!empty($conf->global->MAIN_MULTILANGS)) {
 	print '<tr><td>'.$langs->trans("DefaultLang");
-	if (count($array_query['cust_language']) > 0) {
+	if (!empty($array_query['cust_language'])) {
 		print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 	}
 	print '</td><td>'."\n";
@@ -252,11 +256,12 @@ if (!empty($conf->global->MAIN_MULTILANGS)) {
 if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
 	// Customer Categories
 	print '<tr><td>'.$langs->trans("CustomersCategoryShort");
-	if (count($array_query['cust_categ']) > 0) {
+	if (!empty($array_query['cust_categ'])) {
 		print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 	}
 	print '</td><td>'."\n";
-	print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']);
+	$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
+	print $form->multiselectarray('cust_categ', $cate_arbo, GETPOST('cust_categ', 'array'), null, null, null, null, "90%");
 	print '</td><td>'."\n";
 	print '</td></tr>'."\n";
 }
@@ -346,7 +351,7 @@ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
 
 // State Contact
 print '<tr><td>'.$langs->trans('Status').' '.$langs->trans('Contact');
-if (count($array_query['contact_status']) > 0) {
+if (!empty($array_query['contact_status'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>';
@@ -364,7 +369,7 @@ print '</td></tr>'."\n";
 
 // Civility
 print '<tr><td width="15%">'.$langs->trans("UserTitle");
-if (count($array_query['contact_civility']) > 0) {
+if (!empty($array_query['contact_civility'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>';
@@ -389,7 +394,7 @@ print '</td></tr>'."\n";
 
 // Contact Country
 print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("Country");
-if (count($array_query['contact_country']) > 0) {
+if (!empty($array_query['contact_country'])) {
 	print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 }
 print '</td><td>'."\n";
@@ -448,11 +453,12 @@ print '</td></tr>'."\n";
 if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
 	// Customer Categories
 	print '<tr><td>'.$langs->trans("ContactCategoriesShort");
-	if (count($array_query['contact_categ']) > 0) {
+	if (!empty($array_query['contact_categ'])) {
 		print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
 	}
 	print '</td><td>'."\n";
-	print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']);
+	$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1);
+	print $form->multiselectarray('contact_categ', $cate_arbo, GETPOST('contact_categ', 'array'), null, null, null, null, "90%");
 	print '</td><td>'."\n";
 	print '</td></tr>'."\n";
 }
@@ -465,62 +471,66 @@ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
 	dol_include_once('/core/class/extrafields.class.php');
 	$extrafields = new ExtraFields($db);
 	$extrafields->fetch_name_optionals_label($elementype);
-    foreach ($extrafields->attributes[$elementtype]['type'] as $key=>&$value) {
-        if ($value == 'radio')$value = 'select';
-    }
-
-    foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) {
-		print '<tr><td>'.$extrafields->attributes[$elementtype]['label'][$key];
-		if ($array_query['options_'.$key.'_cnct'] != '' || (is_array($array_query['options_'.$key.'_cnct']) && count($array_query['options_'.$key.'_cnct']) > 0)) {
-			print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+	if (!empty($extrafields->attributes[$elementtype]['type'])) {
+		foreach ($extrafields->attributes[$elementtype]['type'] as $key => &$value) {
+			if ($value == 'radio')
+				$value = 'select';
 		}
-		print '</td><td>';
-		if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') || ($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
-			print '<input type="text" name="options_'.$key.'_cnct"/></td><td>'."\n";
-			print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
-		} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') || ($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
-			print $langs->trans("AdvTgtMinVal").'<input type="text" name="options_'.$key.'_min_cnct"/>';
-			print $langs->trans("AdvTgtMaxVal").'<input type="text" name="options_'.$key.'_max_cnct"/>';
-			print '</td><td>'."\n";
-			print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help');
-		} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') || ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
-			print '<table class="nobordernopadding"><tr>';
-			print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>';
-			print $form->selectDate('', 'options_'.$key.'_st_dt_cnct');
-			print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>';
-			print $form->selectDate('', 'options_'.$key.'_end_dt_cnct');
-			print '</td></tr></table>';
-			print '</td><td>'."\n";
-			print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help');
-		} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'boolean')) {
-            print $form->selectarray(
-                'options_'.$key.'_cnct',
-                array(
-					'' => '',
-					'1' => $langs->trans('Yes'),
-					'0' => $langs->trans('No')
-                ),
-                $array_query['options_'.$key.'_cnct']
-            );
-			print '</td><td>'."\n";
-		} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'select')) {
-			print $formadvtargetemaling->advMultiselectarray('options_'.$key.'_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key.'_cnct']);
-			print '</td><td>'."\n";
-		} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'sellist')) {
-			print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key.'_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key.'_cnct']);
-			print '</td><td>'."\n";
-		} else {
-			print '<table class="nobordernopadding"><tr>';
-			print '<td></td><td>';
-			if (is_array($array_query['options_'.$key.'_cnct'])) {
-				print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key.'_cnct']), '', '_cnct');
+	}
+	if (!empty($extrafields->attributes[$elementtype]['label'])) {
+		foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) {
+			print '<tr><td>' . $extrafields->attributes[$elementtype]['label'][$key];
+			if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) {
+				print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+			}
+			print '</td><td>';
+			if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') || ($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
+				print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n";
+				print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
+			} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') || ($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
+				print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>';
+				print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>';
+				print '</td><td>' . "\n";
+				print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help');
+			} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') || ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
+				print '<table class="nobordernopadding"><tr>';
+				print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>';
+				print $form->selectDate('', 'options_' . $key . '_st_dt_cnct');
+				print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>';
+				print $form->selectDate('', 'options_' . $key . '_end_dt_cnct');
+				print '</td></tr></table>';
+				print '</td><td>' . "\n";
+				print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help');
+			} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'boolean')) {
+				print $form->selectarray(
+					'options_' . $key . '_cnct',
+					array(
+						''  => '',
+						'1' => $langs->trans('Yes'),
+						'0' => $langs->trans('No')
+					),
+					$array_query['options_' . $key . '_cnct']
+				);
+				print '</td><td>' . "\n";
+			} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'select')) {
+				print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_' . $key . '_cnct']);
+				print '</td><td>' . "\n";
+			} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'sellist')) {
+				print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_' . $key . '_cnct']);
+				print '</td><td>' . "\n";
 			} else {
-				print $extrafields->showInputField($key, $array_query['options_'.$key.'_cnct'], '', '_cnct');
+				print '<table class="nobordernopadding"><tr>';
+				print '<td></td><td>';
+				if (is_array($array_query['options_' . $key . '_cnct'])) {
+					print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct');
+				} else {
+					print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct');
+				}
+				print '</td></tr></table>';
+				print '</td><td>' . "\n";
 			}
-			print '</td></tr></table>';
-			print '</td><td>'."\n";
+			print '</td></tr>' . "\n";
 		}
-		print '</td></tr>'."\n";
 	}
 }
 print '<tr>'."\n";

二進制
htdocs/install/doctemplates/websites/website_template-corporate.zip


二進制
htdocs/install/doctemplates/websites/website_template-stellar.zip


+ 4 - 2
htdocs/langs/en_US/cashdesk.lang

@@ -107,6 +107,8 @@ OrderPrinterToUse=Order printer to use
 MainTemplateToUse=Main template to use
 OrderTemplateToUse=Order template to use
 BarRestaurant=Bar Restaurant
-AutoOrder=Customer auto order
+AutoOrder=Order by the customer himself
 RestaurantMenu=Menu
-CustomerMenu=Customer menu
+CustomerMenu=Customer menu
+ScanToMenu=Scan QR code to see the menu
+ScanToOrder=Scan QR code to order

+ 1 - 1
htdocs/langs/en_US/errors.lang

@@ -119,7 +119,7 @@ ErrorLoginHasNoEmail=This user has no email address. Process aborted.
 ErrorBadValueForCode=Bad value for security code. Try again with new value...
 ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative
 ErrorFieldCantBeNegativeOnInvoice=Field <strong>%s</strong> cannot be negative on this type of invoice. If you need to add a discount line, just create the discount first (from field '%s' in thirdparty card) and apply it to the invoice.
-ErrorLinesCantBeNegativeForOneVATRate=Total of lines can't be negative for a given VAT rate.
+ErrorLinesCantBeNegativeForOneVATRate=Total of lines (net of tax) can't be negative for a given not null VAT rate (Found a negative total for VAT rate <b>%s</b>%%).
 ErrorLinesCantBeNegativeOnDeposits=Lines can't be negative in a deposit. You will face problems when you will need to consume the deposit in final invoice if you do so.
 ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative
 ErrorWebServerUserHasNotPermission=User account <b>%s</b> used to execute web server has no permission for that

+ 0 - 1
htdocs/langs/en_US/stocks.lang

@@ -59,7 +59,6 @@ AllowAddLimitStockByWarehouse=Manage also value for minimum and desired stock pe
 RuleForWarehouse=Rule for warehouses
 WarehouseAskWarehouseDuringOrder=Set a warehouse on Sale orders
 UserDefaultWarehouse=Set a warehouse on Users
-DefaultWarehouseActive=Default warehouse active
 MainDefaultWarehouse=Default warehouse
 MainDefaultWarehouseUser=Use a default warehouse for each user
 MainDefaultWarehouseUserDesc=By activating this option, during creation of a product, the warehouse assigned to the product will be defined on this one. If no warehouse is defined on the user, the default warehouse is defined.

+ 1 - 1
htdocs/langs/fr_FR/errors.lang

@@ -119,7 +119,7 @@ ErrorLoginHasNoEmail=Cet utilisateur n'a pas d'email. Impossible de continuer.
 ErrorBadValueForCode=Mauvaise valeur saisie pour le code. Réessayez avec une nouvelle valeur...
 ErrorBothFieldCantBeNegative=Les champs %s et %s ne peuvent être tous deux négatifs
 ErrorFieldCantBeNegativeOnInvoice=Le champ <strong> %s </strong> ne peut pas être négatif sur ce type de facture. Si vous devez ajouter une ligne de remise, créez d'abord la remise (à partir du champ '%s' dans la fiche du tiers) et appliquez-la à la facture.
-ErrorLinesCantBeNegativeForOneVATRate=Le total des lignes ne peut pas être négatif pour un taux de TVA donné.
+ErrorLinesCantBeNegativeForOneVATRate=Le total des lignes (HT) ne peut pas être négatif pour un taux de TVA donné (Montant total négatif trouvé pour le taux <b>%s</b>%%).
 ErrorLinesCantBeNegativeOnDeposits=Les lignes ne peuvent pas être négatives dans un acompte. Si vous le faites, vous rencontrerez des problèmes lorsque vous devrez consommer l'acompte dans la facture finale.
 ErrorQtyForCustomerInvoiceCantBeNegative=La quantité d'une ligne ne peut pas être négative dans les factures clients 
 ErrorWebServerUserHasNotPermission=Le compte d'exécution du serveur web <b>%s</b> n'a pas les permissions pour cela

+ 2 - 2
htdocs/takepos/admin/bar.php

@@ -161,7 +161,7 @@ if ($conf->global->TAKEPOS_AUTO_ORDER)
 		print '<td>';
 		print "<a target='_blank' href='".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."'>".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."</a>";
 		print '<td>';
-		print "<img src='".DOL_URL_ROOT."/takepos/genimg/qr.php?key=".dol_encode($row['rowid'])."' height='42' width='42'>";
+		print "<a target='_blank' href='printqr.php?id=".$row['rowid']."'><img src='".DOL_URL_ROOT."/takepos/genimg/qr.php?key=".dol_encode($row['rowid'])."' height='42' width='42'></a>";
 		print '</td></tr>';
     }
 
@@ -180,7 +180,7 @@ if ($conf->global->TAKEPOS_QR_MENU)
 	print '<tr class="oddeven value"><td>';
 	print "<a target='_blank' href='".$urlwithroot."/takepos/public/menu.php'>".$urlwithroot."/takepos/public/menu.php</a>";
 	print '<td>';
-	print "<img src='".DOL_URL_ROOT."/takepos/genimg/qr.php' height='42' width='42'>";
+	print "<a target='_blank' href='printqr.php'><img src='".DOL_URL_ROOT."/takepos/genimg/qr.php' height='42' width='42'></a>";
 	print '</td></tr>';
 	print '</table>';
 }

+ 52 - 0
htdocs/takepos/admin/printqr.php

@@ -0,0 +1,52 @@
+<?php
+/* Copyright (C) 2020       Andreu Bisquerra Gaya  <jove@bisquerra.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+/**
+ *	\file       htdocs/takepos/admin/printqr.php
+ *	\ingroup    takepos
+ *	\brief      Print QR Menu
+ */
+
+require '../../main.inc.php';
+
+// Security check
+if (!$user->admin) accessforbidden();
+
+$langs->load("cashdesk");
+
+$id = GETPOST('id', 'int');
+
+$_GET['optioncss'] = "print";
+
+print '<center>';
+
+if (GETPOSTISSET("id")) {
+	print '<h1><b>'.$langs->trans("ScanToOrder").'</b></h1>';
+	print "<img src='".DOL_URL_ROOT."/takepos/genimg/qr.php?key=".dol_encode($id)."' width='30%'>";
+}
+else {
+	print '<h1><b>'.$langs->trans("ScanToMenu").'</b></h1>';
+	print "<img src='".DOL_URL_ROOT."/takepos/genimg/qr.php' width='30%'>";
+}
+
+print '<h1><b>'.$mysoc->name.'</b></h1>';
+
+print '</center>';
+
+llxFooter();
+
+$db->close();

+ 1 - 1
htdocs/takepos/invoice.php

@@ -707,7 +707,7 @@ function TakeposConnector(id){
 	?>';
     $.ajax({
         type: "POST",
-        url: '<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>/print.php',
+        url: 'http://<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>:8111/print.php',
         data: 'invoice='+invoice
     });
 }

+ 8 - 3
htdocs/theme/eldy/global.inc.php

@@ -148,9 +148,9 @@ table.liste th.wrapcolumntitle.liste_titre:not(.maxwidthsearch), table.liste td.
 .liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when],
 .liste_titre input[name=search_dtstartday], .liste_titre input[name=search_dtendday], .liste_titre input[name=search_dtstartmonth], .liste_titre input[name=search_dtendmonth],
 select#date_startday, select#date_startmonth, select#date_endday, select#date_endmonth, select#reday, select#remonth,
-input[name=duration_value]
+input[name=duration_value], input[name=durationhour]
 {
-	margin-right: 4px;
+	margin-right: 4px !important;
 }
 input[type=submit], input[type=submit]:hover {
 	margin-left: 5px;
@@ -196,6 +196,7 @@ input, select {
 input.button:focus {
 	border-bottom: 0;
 }
+
 input.button.massactionconfirmed {
     margin: 4px;
 }
@@ -1161,7 +1162,7 @@ table[summary="list_of_modules"] .fa-cog {
 	}
 
 	select.minwidth100imp, select.minwidth100, select.minwidth200, .widthcentpercentminusx {
-		width: calc(100% - 30px) !important;
+		width: calc(100% - 50px) !important;
 		display: inline-block;
 	}
 
@@ -1975,9 +1976,13 @@ div.mainmenu {
 	margin-left: 0px;
 	min-width: 40px;
 }
+
 a.tmenuimage:focus, .mainmenu.topmenuimage:focus {
     outline: none;
 }
+button.ui-button.ui-corner-all.ui-widget:focus {
+    outline: none;
+}
 
 /* For mainmenu, we always load the img */