@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | // Get parameters |
86 | 86 | $id = GETPOST('id', 'int'); |
87 | 87 | $ref = GETPOST('ref', 'alpha'); |
88 | -$lineid = GETPOST('lineid', 'int'); |
|
88 | +$lineid = GETPOST('lineid', 'int'); |
|
89 | 89 | |
90 | 90 | $action = GETPOST('action', 'aZ09'); |
91 | 91 | $confirm = GETPOST('confirm', 'alpha'); |
92 | 92 | $cancel = GETPOST('cancel', 'aZ09'); |
93 | 93 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search |
94 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
95 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
94 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
95 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
96 | 96 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
97 | 97 | $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); |
98 | 98 | |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | |
544 | 544 | // Clone |
545 | 545 | if ($permissiontoadd) { |
546 | - print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd); |
|
546 | + print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : '').'&action=clone&token='.newToken(), '', $permissiontoadd); |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | /* |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; |
47 | 47 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
48 | 48 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
49 | -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
|
49 | +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
|
50 | 50 | $confirm = GETPOST('confirm', 'alpha'); |
51 | 51 | |
52 | 52 | $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
@@ -254,12 +254,12 @@ discard block |
||
254 | 254 | foreach ($typeleaves as $key => $val) { |
255 | 255 | $labeltypes[$val['id']] = ($langs->trans($val['code']) != $val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']); |
256 | 256 | } |
257 | - $formquestion [] = array( 'type' => 'other', |
|
257 | + $formquestion [] = array('type' => 'other', |
|
258 | 258 | 'name' => 'typeofholiday', |
259 | 259 | 'label' => $langs->trans("Type"), |
260 | 260 | 'value' => $form->selectarray('typeholiday', $labeltypes, GETPOST('typeholiday', 'alpha'), 1) |
261 | 261 | ); |
262 | - $formquestion [] = array( 'type' => 'other', |
|
262 | + $formquestion [] = array('type' => 'other', |
|
263 | 263 | 'name' => 'nbdaysholydays', |
264 | 264 | 'label' => $langs->trans("NumberDayAddMass"), |
265 | 265 | 'value' => '<input name="nbdaysholidays" class="maxwidth75" id="nbdaysholidays" value="'.GETPOST('nbdaysholidays', 'int').'">' |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | // Show field if not hidden |
967 | 967 | if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { |
968 | 968 | $extratitle = $langs->trans($value); |
969 | - $arrayfields['ef.' . $key] = array('label' => $extratitle, 'checked' => 0, |
|
969 | + $arrayfields['ef.'.$key] = array('label' => $extratitle, 'checked' => 0, |
|
970 | 970 | 'position' => (end($arrayfields)['position'] + 1), |
971 | 971 | 'langfile' => $extrafields->attributes["product_fournisseur_price"]['langfile'][$key], |
972 | 972 | 'help' => $extrafields->attributes["product_fournisseur_price"]['help'][$key]); |
@@ -1079,8 +1079,8 @@ discard block |
||
1079 | 1079 | } else { |
1080 | 1080 | $extratitle = $langs->trans($value); |
1081 | 1081 | } |
1082 | - if (!empty($arrayfields['ef.' . $key]['checked'])) { |
|
1083 | - print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.' . $key, '', $param, '', $sortfield, $sortorder, 'right '); |
|
1082 | + if (!empty($arrayfields['ef.'.$key]['checked'])) { |
|
1083 | + print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.'.$key, '', $param, '', $sortfield, $sortorder, 'right '); |
|
1084 | 1084 | $nbfields++; |
1085 | 1085 | } |
1086 | 1086 | } |
@@ -1089,7 +1089,7 @@ discard block |
||
1089 | 1089 | } |
1090 | 1090 | |
1091 | 1091 | if (is_object($hookmanager)) { |
1092 | - $parameters = array('id_fourn'=>(!empty($id_fourn)?$id_fourn:''), 'prod_id'=>$object->id, 'nbfields'=>$nbfields); |
|
1092 | + $parameters = array('id_fourn'=>(!empty($id_fourn) ? $id_fourn : ''), 'prod_id'=>$object->id, 'nbfields'=>$nbfields); |
|
1093 | 1093 | $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); |
1094 | 1094 | } |
1095 | 1095 | print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); |
@@ -1258,7 +1258,7 @@ discard block |
||
1258 | 1258 | } |
1259 | 1259 | |
1260 | 1260 | if (is_object($hookmanager)) { |
1261 | - $parameters = array('id_pfp'=>$productfourn->product_fourn_price_id, 'id_fourn'=>(!empty($id_fourn)?$id_fourn:''), 'prod_id'=>$object->id); |
|
1261 | + $parameters = array('id_pfp'=>$productfourn->product_fourn_price_id, 'id_fourn'=>(!empty($id_fourn) ? $id_fourn : ''), 'prod_id'=>$object->id); |
|
1262 | 1262 | $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); |
1263 | 1263 | } |
1264 | 1264 |
@@ -201,7 +201,7 @@ |
||
201 | 201 | $tmplotstatic->eatby = $objp->eatby; |
202 | 202 | |
203 | 203 | print '<tr class="oddeven">'; |
204 | - print '<td class="nowraponall">'.img_picto($langs->trans("Ref").' '.$objp->mid, 'movement', 'class="pictofixedwidth"').dol_print_date($db->jdate($objp->datem), 'dayhour').'</td>'; |
|
204 | + print '<td class="nowraponall">'.img_picto($langs->trans("Ref").' '.$objp->mid, 'movement', 'class="pictofixedwidth"').dol_print_date($db->jdate($objp->datem), 'dayhour').'</td>'; |
|
205 | 205 | print '<td class="tdoverflowmax150">'; |
206 | 206 | print $producttmp->getNomUrl(1); |
207 | 207 | print "</td>\n"; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $fk_entrepot = GETPOST('fk_entrepot', 'int'); |
69 | 69 | |
70 | 70 | // List all visible warehouses |
71 | -$resWar = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "entrepot WHERE entity IN (" . $db->sanitize(getEntity('stock')) .")"); |
|
71 | +$resWar = $db->query("SELECT rowid FROM ".MAIN_DB_PREFIX."entrepot WHERE entity IN (".$db->sanitize(getEntity('stock')).")"); |
|
72 | 72 | $listofqualifiedwarehousesid = ""; |
73 | 73 | $count = 0; |
74 | 74 | while ($tmpobj = $db->fetch_object($resWar)) { |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p'; |
362 | 362 | $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product'; |
363 | 363 | $list_warehouse = (empty($listofqualifiedwarehousesid) ? '0' : $listofqualifiedwarehousesid); |
364 | -$sql .= ' AND s.fk_entrepot IN ('.$db->sanitize($list_warehouse) .')'; |
|
364 | +$sql .= ' AND s.fk_entrepot IN ('.$db->sanitize($list_warehouse).')'; |
|
365 | 365 | |
366 | 366 | //$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')'; |
367 | 367 | if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | exit; |
801 | 801 | } |
802 | 802 | |
803 | - $prod->load_stock('warehouseopen, warehouseinternal'.(!$usevirtualstock?', novirtual':''), $draftchecked); |
|
803 | + $prod->load_stock('warehouseopen, warehouseinternal'.(!$usevirtualstock ? ', novirtual' : ''), $draftchecked); |
|
804 | 804 | |
805 | 805 | // Multilangs |
806 | 806 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | // Get parameters |
35 | 35 | $id = GETPOST('id', 'int'); |
36 | -$ref = GETPOST('ref', 'alpha'); |
|
36 | +$ref = GETPOST('ref', 'alpha'); |
|
37 | 37 | $action = GETPOST('action', 'aZ09'); |
38 | 38 | |
39 | 39 | // Initialize technical objects |
@@ -341,9 +341,9 @@ |
||
341 | 341 | $product_static->status_buy = $objp->tobuy; |
342 | 342 | $product_static->status_batch = $objp->tobatch; |
343 | 343 | |
344 | - $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'read'); |
|
344 | + $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('product', 'product_advance', 'read_prices') : $user->hasRight('product', 'read'); |
|
345 | 345 | if ($product_static->isService()) { |
346 | - $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'read'); |
|
346 | + $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('service', 'service_advance', 'read_prices') : $user->hasRight('service', 'read'); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | // Multilangs |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | if ($mode != "_tmp") { |
548 | 548 | // Date document export |
549 | 549 | print '<tr>'; |
550 | - print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>'; |
|
550 | + print '<td class="titlefield">'.$langs->trans("DateExport").'</td>'; |
|
551 | 551 | print '<td>'; |
552 | 552 | print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; |
553 | 553 | print '</td>'; |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | |
556 | 556 | // Date document validation |
557 | 557 | print '<tr>'; |
558 | - print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>'; |
|
558 | + print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>'; |
|
559 | 559 | print '<td>'; |
560 | 560 | print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; |
561 | 561 | print '</td>'; |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | |
613 | 613 | print '<br>'; |
614 | 614 | |
615 | - $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
615 | + $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
616 | 616 | |
617 | 617 | if ($result < 0) { |
618 | 618 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -708,14 +708,14 @@ discard block |
||
708 | 708 | if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { |
709 | 709 | print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); |
710 | 710 | } else { |
711 | - print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">'; |
|
711 | + print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; |
|
712 | 712 | } |
713 | - print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">'; |
|
713 | + print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">'; |
|
714 | 714 | print '</td>'; |
715 | - print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $label_operation . '"/></td>'; |
|
715 | + print '<td><input type="text" class="minwidth200" name="label_operation" value="'.$label_operation.'"/></td>'; |
|
716 | 716 | print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>'; |
717 | 717 | print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>'; |
718 | - print '<td class="center"><input type="submit" class="button small" name="save" value="' . $langs->trans("Add") . '"></td>'; |
|
718 | + print '<td class="center"><input type="submit" class="button small" name="save" value="'.$langs->trans("Add").'"></td>'; |
|
719 | 719 | } |
720 | 720 | } else { |
721 | 721 | print '<!-- td columns in display mode -->'; |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | |
739 | 739 | print '<td class="center nowraponall">'; |
740 | 740 | if (empty($line->date_export) && empty($line->date_validation)) { |
741 | - print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">'; |
|
741 | + print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">'; |
|
742 | 742 | print img_edit('', 0, 'class="marginrightonly"'); |
743 | 743 | print '</a> '; |
744 | 744 | } else { |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | $actiontodelete = 'confirm_delete'; |
754 | 754 | } |
755 | 755 | |
756 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">'; |
|
756 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">'; |
|
757 | 757 | print img_delete(); |
758 | 758 | print '</a>'; |
759 | 759 | } else { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
71 | 71 | $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
72 | 72 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
73 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
73 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
74 | 74 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
75 | 75 | $search_country = GETPOST('search_country', 'alpha'); |
76 | 76 | $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); |
@@ -261,20 +261,20 @@ discard block |
||
261 | 261 | $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; |
262 | 262 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
263 | 263 | if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { |
264 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
264 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
265 | 265 | } |
266 | 266 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; |
267 | 267 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn"; |
268 | 268 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; |
269 | 269 | if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { |
270 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
270 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
271 | 271 | } |
272 | 272 | $alias_societe_perentity = empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED) ? "s" : "spe"; |
273 | 273 | $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p" : "ppe"; |
274 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
275 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
276 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
277 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
274 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON ".$alias_product_perentity.".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
275 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON ".$alias_product_perentity.".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
276 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON ".$alias_product_perentity.".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
277 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON ".$alias_societe_perentity.".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
278 | 278 | $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; |
279 | 279 | $sql .= " AND l.product_type <= 2"; |
280 | 280 | // Define begin binding date |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); |
469 | 469 | |
470 | 470 | if ($massaction == 'set_default_account') { |
471 | - $formquestion[]=array('type' => 'other', |
|
471 | + $formquestion[] = array('type' => 'other', |
|
472 | 472 | 'name' => 'set_default_account', |
473 | 473 | 'label' => $langs->trans("AccountancyCode"), |
474 | 474 | 'value' => $formaccounting->select_account('', 'default_account', 1, array(), 0, 0, 'maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone')); |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | $thirdpartystatic->email = $objp->email; |
571 | 571 | $thirdpartystatic->country_code = $objp->country_code; |
572 | 572 | $thirdpartystatic->tva_intra = $objp->tva_intra; |
573 | - $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
573 | + $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
574 | 574 | |
575 | 575 | $product_static->ref = $objp->product_ref; |
576 | 576 | $product_static->id = $objp->product_id; |
@@ -612,16 +612,16 @@ discard block |
||
612 | 612 | |
613 | 613 | $suggestedid = 0; |
614 | 614 | |
615 | - $return=$accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facturefourn_static, $facturefourn_static_det, $accountingAccountArray, 'supplier'); |
|
616 | - if (!is_array($return) && $return<0) { |
|
615 | + $return = $accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facturefourn_static, $facturefourn_static_det, $accountingAccountArray, 'supplier'); |
|
616 | + if (!is_array($return) && $return < 0) { |
|
617 | 617 | setEventMessage($accountingAccount->error, 'errors'); |
618 | 618 | } else { |
619 | - $suggestedid=$return['suggestedid']; |
|
620 | - $suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor']; |
|
621 | - $suggestedaccountingaccountbydefaultfor=$return['suggestedaccountingaccountbydefaultfor']; |
|
622 | - $code_buy_l=$return['code_l']; |
|
623 | - $code_buy_p=$return['code_p']; |
|
624 | - $code_buy_t=$return['code_t']; |
|
619 | + $suggestedid = $return['suggestedid']; |
|
620 | + $suggestedaccountingaccountfor = $return['suggestedaccountingaccountfor']; |
|
621 | + $suggestedaccountingaccountbydefaultfor = $return['suggestedaccountingaccountbydefaultfor']; |
|
622 | + $code_buy_l = $return['code_l']; |
|
623 | + $code_buy_p = $return['code_p']; |
|
624 | + $code_buy_t = $return['code_t']; |
|
625 | 625 | } |
626 | 626 | //var_dump($return); |
627 | 627 | |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | //if ($objp->vat_tx_l != $objp->vat_tx_p && price2num($objp->vat_tx_p) && price2num($objp->vat_tx_l)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export |
694 | 694 | // $code_vat_differ = 'warning bold'; |
695 | 695 | //} |
696 | - print '<td class="right'.($code_vat_differ?' '.$code_vat_differ:'').'">'; |
|
696 | + print '<td class="right'.($code_vat_differ ? ' '.$code_vat_differ : '').'">'; |
|
697 | 697 | print vatrate($facturefourn_static_det->tva_tx.($facturefourn_static_det->vat_src_code ? ' ('.$facturefourn_static_det->vat_src_code.')' : ''), false, 0, 0, 1); |
698 | 698 | print '</td>'; |
699 | 699 | |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | if (!empty($toselect)) { |
768 | 768 | $ischecked = 0; |
769 | 769 | if (in_array($objp->rowid."_".$i, $toselect)) { |
770 | - $ischecked=1; |
|
770 | + $ischecked = 1; |
|
771 | 771 | } |
772 | 772 | } |
773 | 773 |