@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | $month_current = dol_print_date(dol_now(), '%m'); |
| 54 | 54 | $year_start = $year; |
| 55 | 55 | } |
| 56 | -$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
| 57 | -$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
| 56 | +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
| 57 | +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
| 58 | 58 | |
| 59 | 59 | // Quarter |
| 60 | 60 | $q = ''; |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | llxHeader('', $langs->trans("TurnoverReport"), '', '', 0, 0, '', '', $morequerystring); |
| 160 | 160 | |
| 161 | -$exportlink=""; |
|
| 162 | -$namelink=""; |
|
| 161 | +$exportlink = ""; |
|
| 162 | +$namelink = ""; |
|
| 163 | 163 | //print load_fiche_titre($langs->trans("VAT"),""); |
| 164 | 164 | |
| 165 | 165 | //$fsearch.='<br>'; |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | $month_current = dol_print_date(dol_now(), '%m'); |
| 80 | 80 | $year_start = $year; |
| 81 | 81 | } |
| 82 | -$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
| 83 | -$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
| 82 | +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
| 83 | +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
| 84 | 84 | // Quarter |
| 85 | 85 | if (empty($date_start) || empty($date_end)) { // We define date_start and date_end |
| 86 | 86 | $q = GETPOST("q") ?GETPOST("q") : 0; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $headerparams = array_merge($commonparams, $headerparams); |
| 166 | 166 | $tableparams = array_merge($commonparams, $tableparams); |
| 167 | 167 | |
| 168 | -$paramslink=""; |
|
| 168 | +$paramslink = ""; |
|
| 169 | 169 | foreach ($allparams as $key => $value) { |
| 170 | 170 | $paramslink .= '&'.$key.'='.$value; |
| 171 | 171 | } |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | $modecompta = "RECETTES-DEPENSES"; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | -$exportlink=""; |
|
| 190 | -$namelink=""; |
|
| 189 | +$exportlink = ""; |
|
| 190 | +$namelink = ""; |
|
| 191 | 191 | |
| 192 | 192 | // Show report header |
| 193 | 193 | if ($modecompta == "CREANCES-DETTES") { |
@@ -48,8 +48,12 @@ discard block |
||
| 48 | 48 | $offset = $limit * $page; |
| 49 | 49 | $pageprev = $page - 1; |
| 50 | 50 | $pagenext = $page + 1; |
| 51 | -if (!$sortorder) $sortorder = "ASC"; |
|
| 52 | -if (!$sortfield) $sortfield = "name"; |
|
| 51 | +if (!$sortorder) { |
|
| 52 | + $sortorder = "ASC"; |
|
| 53 | +} |
|
| 54 | +if (!$sortfield) { |
|
| 55 | + $sortfield = "name"; |
|
| 56 | +} |
|
| 53 | 57 | //if (! $sortfield) $sortfield="position_name"; |
| 54 | 58 | |
| 55 | 59 | // Initialize technical objects |
@@ -64,7 +68,9 @@ discard block |
||
| 64 | 68 | include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
| 65 | 69 | |
| 66 | 70 | //if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity?$object->entity:$conf->entity] . "/stocktransfer/" . dol_sanitizeFileName($object->id); |
| 67 | -if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity ? $object->entity : $conf->entity]."/stocktransfer/".dol_sanitizeFileName($object->ref); |
|
| 71 | +if ($id > 0 || !empty($ref)) { |
|
| 72 | + $upload_dir = $conf->stocktransfer->multidir_output[$object->entity ? $object->entity : $conf->entity]."/stocktransfer/".dol_sanitizeFileName($object->ref); |
|
| 73 | +} |
|
| 68 | 74 | |
| 69 | 75 | // Security check - Protection if external user |
| 70 | 76 | //if ($user->socid > 0) accessforbidden(); |
@@ -898,8 +898,12 @@ discard block |
||
| 898 | 898 | print dol_get_fiche_head(null, '', '', 0); |
| 899 | 899 | |
| 900 | 900 | $rowspan = 4; |
| 901 | - if (isModEnabled('project')) $rowspan++; |
|
| 902 | - if ($object->fk_account > 0) $rowspan++; |
|
| 901 | + if (isModEnabled('project')) { |
|
| 902 | + $rowspan++; |
|
| 903 | + } |
|
| 904 | + if ($object->fk_account > 0) { |
|
| 905 | + $rowspan++; |
|
| 906 | + } |
|
| 903 | 907 | |
| 904 | 908 | print '<table class="border centpercent">'; |
| 905 | 909 | |
@@ -1576,9 +1580,12 @@ discard block |
||
| 1576 | 1580 | |
| 1577 | 1581 | $parameters = array(); |
| 1578 | 1582 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 1579 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 1580 | - if (empty($reshook)) |
|
| 1581 | - global $senderissupplier; |
|
| 1583 | + if ($reshook < 0) { |
|
| 1584 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 1585 | + } |
|
| 1586 | + if (empty($reshook)) { |
|
| 1587 | + global $senderissupplier; |
|
| 1588 | + } |
|
| 1582 | 1589 | $senderissupplier = 2; |
| 1583 | 1590 | $object->formAddObjectLine(0, $object->thirdparty, $mysoc); // No date selector for template invoice |
| 1584 | 1591 | } |
@@ -32,17 +32,17 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | // Load Dolibarr environment |
| 34 | 34 | require '../../main.inc.php'; |
| 35 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; |
|
| 37 | -require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 38 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; |
|
| 37 | +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 38 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
| 39 | 39 | if (isModEnabled('project')) { |
| 40 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 40 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 41 | 41 | } |
| 42 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 43 | -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 44 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; |
|
| 45 | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
| 42 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 43 | +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 44 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; |
|
| 45 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
| 46 | 46 | |
| 47 | 47 | // Load translation files required by the page |
| 48 | 48 | $langs->loadLangs(array('bills', 'companies', 'compta', 'admin', 'other', 'products', 'banks', 'suppliers')); |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | $page = 0; |
| 82 | 82 | } // If $page is not defined, or '' or -1 |
| 83 | 83 | $offset = $limit * $page; |
| 84 | -if (! $sortorder) { |
|
| 84 | +if (!$sortorder) { |
|
| 85 | 85 | $sortorder = 'DESC'; |
| 86 | 86 | } |
| 87 | -if (! $sortfield) { |
|
| 87 | +if (!$sortfield) { |
|
| 88 | 88 | $sortfield = 'f.titre'; |
| 89 | 89 | } |
| 90 | 90 | $pageprev = $page - 1; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $object = new FactureFournisseurRec($db); |
| 94 | 94 | if (($id > 0 || $title) && $action != 'create' && $action != 'add') { |
| 95 | 95 | $ret = $object->fetch($id, $title); |
| 96 | - if (! $ret) { |
|
| 96 | + if (!$ret) { |
|
| 97 | 97 | setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors'); |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $action = 'list'; |
| 138 | 138 | $massaction = ''; |
| 139 | 139 | } |
| 140 | -if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { |
|
| 140 | +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { |
|
| 141 | 141 | $massaction = ''; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -153,18 +153,18 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | // Selection of new fields |
| 156 | - include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
| 156 | + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
| 157 | 157 | |
| 158 | 158 | // Set note |
| 159 | - include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not include_once |
|
| 159 | + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once |
|
| 160 | 160 | |
| 161 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
| 161 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
| 162 | 162 | |
| 163 | - include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be include, not include_once |
|
| 163 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once |
|
| 164 | 164 | |
| 165 | 165 | // Create predefined invoice |
| 166 | 166 | if ($action == 'add') { |
| 167 | - if (! GETPOST('title', 'alphanohtml')) { |
|
| 167 | + if (!GETPOST('title', 'alphanohtml')) { |
|
| 168 | 168 | setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors'); |
| 169 | 169 | $action = "create"; |
| 170 | 170 | $error++; |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - if (! $error) { |
|
| 190 | + if (!$error) { |
|
| 191 | 191 | $object->titre = GETPOST('title', 'alphanohtml'); // deprecated |
| 192 | 192 | $object->title = GETPOST('title', 'alphanohtml'); |
| 193 | 193 | $object->libelle = GETPOST('libelle', 'alpha'); |
@@ -236,10 +236,10 @@ discard block |
||
| 236 | 236 | $action = "create"; |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - if (! $error) { |
|
| 239 | + if (!$error) { |
|
| 240 | 240 | $db->commit(); |
| 241 | 241 | |
| 242 | - header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id); |
|
| 242 | + header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id); |
|
| 243 | 243 | exit; |
| 244 | 244 | } else { |
| 245 | 245 | $db->rollback(); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && ($user->hasRight("fournisseur", "facture", "supprimer") || $user->hasRight("supplier_invoice", "supprimer"))) { |
| 257 | 257 | $object->delete($user); |
| 258 | 258 | |
| 259 | - header('Location: ' . DOL_URL_ROOT . '/fourn/facture/list-rec.php'); |
|
| 259 | + header('Location: '.DOL_URL_ROOT.'/fourn/facture/list-rec.php'); |
|
| 260 | 260 | exit; |
| 261 | 261 | } |
| 262 | 262 | |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $error++; |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | - if (! $error) { |
|
| 336 | + if (!$error) { |
|
| 337 | 337 | $db->commit(); |
| 338 | 338 | } else { |
| 339 | 339 | $db->rollback(); |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | $error++; |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | - if (! $error) { |
|
| 353 | + if (!$error) { |
|
| 354 | 354 | $db->commit(); |
| 355 | 355 | } else { |
| 356 | 356 | $db->rollback(); |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | $error++; |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | - if (! $error) { |
|
| 412 | + if (!$error) { |
|
| 413 | 413 | $result = $object->insertExtraFields('BILLREC_MODIFY'); |
| 414 | 414 | if ($result < 0) { |
| 415 | 415 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -438,8 +438,8 @@ discard block |
||
| 438 | 438 | $tva_tx = ''; |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | - $qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2); |
|
| 442 | - $remise_percent = price2num(GETPOST('remise_percent' . $predef), '', 2); |
|
| 441 | + $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2); |
|
| 442 | + $remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2); |
|
| 443 | 443 | |
| 444 | 444 | // Extrafields |
| 445 | 445 | $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | if (is_array($extralabelsline)) { |
| 449 | 449 | // Get extra fields |
| 450 | 450 | foreach ($extralabelsline as $key => $value) { |
| 451 | - unset($_POST["options_" . $key . $predef]); |
|
| 451 | + unset($_POST["options_".$key.$predef]); |
|
| 452 | 452 | } |
| 453 | 453 | } |
| 454 | 454 | |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); |
| 461 | 461 | $error++; |
| 462 | 462 | } |
| 463 | - if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (! ($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' |
|
| 463 | + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (!($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' |
|
| 464 | 464 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); |
| 465 | 465 | $error++; |
| 466 | 466 | } |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | - if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { |
|
| 512 | + if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { |
|
| 513 | 513 | $ret = $object->fetch($id); |
| 514 | 514 | if ($ret < 0) { |
| 515 | 515 | dol_print_error($db, $object->error); |
@@ -518,8 +518,8 @@ discard block |
||
| 518 | 518 | $ret = $object->fetch_thirdparty(); |
| 519 | 519 | |
| 520 | 520 | // Clean parameters |
| 521 | - $date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year')); |
|
| 522 | - $date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); |
|
| 521 | + $date_start = dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); |
|
| 522 | + $date_end = dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); |
|
| 523 | 523 | $price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); |
| 524 | 524 | |
| 525 | 525 | // Define special_code for special lines |
@@ -616,23 +616,23 @@ discard block |
||
| 616 | 616 | $outputlangs->load('products'); |
| 617 | 617 | } |
| 618 | 618 | if (!empty($prod->customcode)) { |
| 619 | - $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; |
|
| 619 | + $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; |
|
| 620 | 620 | } |
| 621 | 621 | if (!empty($prod->customcode) && !empty($prod->country_code)) { |
| 622 | 622 | $tmptxt .= ' - '; |
| 623 | 623 | } |
| 624 | 624 | if (!empty($prod->country_code)) { |
| 625 | - $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0); |
|
| 625 | + $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $outputlangs, 0); |
|
| 626 | 626 | } |
| 627 | 627 | } else { |
| 628 | 628 | if (!empty($prod->customcode)) { |
| 629 | - $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; |
|
| 629 | + $tmptxt .= $langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; |
|
| 630 | 630 | } |
| 631 | 631 | if (!empty($prod->customcode) && !empty($prod->country_code)) { |
| 632 | 632 | $tmptxt .= ' - '; |
| 633 | 633 | } |
| 634 | 634 | if (!empty($prod->country_code)) { |
| 635 | - $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); |
|
| 635 | + $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $langs, 0); |
|
| 636 | 636 | } |
| 637 | 637 | } |
| 638 | 638 | $tmptxt .= ')'; |
@@ -658,8 +658,8 @@ discard block |
||
| 658 | 658 | $date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : null; |
| 659 | 659 | |
| 660 | 660 | // Margin |
| 661 | - $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); |
|
| 662 | - $buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value |
|
| 661 | + $fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); |
|
| 662 | + $buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value |
|
| 663 | 663 | |
| 664 | 664 | // Local Taxes |
| 665 | 665 | $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr); |
@@ -725,8 +725,8 @@ discard block |
||
| 725 | 725 | $action = ''; |
| 726 | 726 | } |
| 727 | 727 | } |
| 728 | - } elseif ($action == 'updateline' && $usercancreate && ! GETPOST('cancel', 'alpha')) { |
|
| 729 | - if (! $object->fetch($id) > 0) { |
|
| 728 | + } elseif ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) { |
|
| 729 | + if (!$object->fetch($id) > 0) { |
|
| 730 | 730 | dol_print_error($db); |
| 731 | 731 | } |
| 732 | 732 | $object->fetch_thirdparty(); |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | $objectline->array_options = $array_options; |
| 762 | 762 | $result = $objectline->insertExtraFields(); |
| 763 | 763 | if ($result < 0) { |
| 764 | - setEventMessages($langs->trans('Error') . $result, null, 'errors'); |
|
| 764 | + setEventMessages($langs->trans('Error').$result, null, 'errors'); |
|
| 765 | 765 | } |
| 766 | 766 | } |
| 767 | 767 | |
@@ -771,13 +771,13 @@ discard block |
||
| 771 | 771 | if (is_array($extralabelsline)) { |
| 772 | 772 | // Get extra fields |
| 773 | 773 | foreach ($extralabelsline as $key => $value) { |
| 774 | - unset($_POST["options_" . $key]); |
|
| 774 | + unset($_POST["options_".$key]); |
|
| 775 | 775 | } |
| 776 | 776 | } |
| 777 | 777 | |
| 778 | 778 | // Define special_code for special lines |
| 779 | 779 | $special_code = GETPOST('special_code', 'int'); |
| 780 | - if (! GETPOST('qty', 'alpha')) { |
|
| 780 | + if (!GETPOST('qty', 'alpha')) { |
|
| 781 | 781 | $special_code = 3; |
| 782 | 782 | } |
| 783 | 783 | |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | $date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : 'NULL'; |
| 824 | 824 | |
| 825 | 825 | // Update line |
| 826 | - if (! $error) { |
|
| 826 | + if (!$error) { |
|
| 827 | 827 | $result = $object->updateline(GETPOST('lineid', 'int'), GETPOST('productid', 'int'), $ref_fourn, $label, $description, $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax1_rate, 'HT', $type, $date_start_fill, $date_end_fill, $info_bits, $special_code, -1); |
| 828 | 828 | if ($result >= 0) { |
| 829 | 829 | $object->fetch($object->id); // Reload lines |
@@ -897,10 +897,10 @@ discard block |
||
| 897 | 897 | if ($object->fetch($id) > 0) { |
| 898 | 898 | $result = $object->fetch_lines(); |
| 899 | 899 | |
| 900 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; |
|
| 901 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 900 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
| 901 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 902 | 902 | print '<input type="hidden" name="action" value="add">'; |
| 903 | - print '<input type="hidden" name="facid" value="' . $object->id . '">'; |
|
| 903 | + print '<input type="hidden" name="facid" value="'.$object->id.'">'; |
|
| 904 | 904 | |
| 905 | 905 | print dol_get_fiche_head(null, '', '', 0); |
| 906 | 906 | |
@@ -913,17 +913,17 @@ discard block |
||
| 913 | 913 | $object->fetch_thirdparty(); |
| 914 | 914 | |
| 915 | 915 | // Title |
| 916 | - print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("Title") . '</td><td>'; |
|
| 917 | - print '<input class="flat quatrevingtpercent" type="text" name="title" value="' . dol_escape_htmltag(GETPOST("title", 'alphanohtml')) . '" autofocus>'; |
|
| 916 | + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Title").'</td><td>'; |
|
| 917 | + print '<input class="flat quatrevingtpercent" type="text" name="title" value="'.dol_escape_htmltag(GETPOST("title", 'alphanohtml')).'" autofocus>'; |
|
| 918 | 918 | print '</td></tr>'; |
| 919 | 919 | |
| 920 | 920 | // Ref supplier |
| 921 | - print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("RefSupplier") . '</td><td>'; |
|
| 922 | - print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="' . $object->ref_supplier . '">'; |
|
| 921 | + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("RefSupplier").'</td><td>'; |
|
| 922 | + print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="'.$object->ref_supplier.'">'; |
|
| 923 | 923 | print '</td></tr>'; |
| 924 | 924 | |
| 925 | 925 | // Third party |
| 926 | - print '<tr><td class="titlefieldcreate">' . $langs->trans("Customer") . '</td><td>' . $object->thirdparty->getNomUrl(1, 'customer') . '</td>'; |
|
| 926 | + print '<tr><td class="titlefieldcreate">'.$langs->trans("Customer").'</td><td>'.$object->thirdparty->getNomUrl(1, 'customer').'</td>'; |
|
| 927 | 927 | print '</tr>'; |
| 928 | 928 | |
| 929 | 929 | $note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : $object->note_public; |
@@ -932,30 +932,30 @@ discard block |
||
| 932 | 932 | // Help of substitution key |
| 933 | 933 | $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); |
| 934 | 934 | |
| 935 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m') . ')'; |
|
| 936 | - $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%m') . ')'; |
|
| 937 | - $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m') . ')'; |
|
| 938 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B') . ')'; |
|
| 939 | - $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%B') . ')'; |
|
| 940 | - $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B') . ')'; |
|
| 941 | - $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y') . ')'; |
|
| 942 | - $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%Y') . ')'; |
|
| 943 | - $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y') . ')'; |
|
| 935 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m').')'; |
|
| 936 | + $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%m').')'; |
|
| 937 | + $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m').')'; |
|
| 938 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B').')'; |
|
| 939 | + $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%B').')'; |
|
| 940 | + $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')'; |
|
| 941 | + $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y').')'; |
|
| 942 | + $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%Y').')'; |
|
| 943 | + $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y').')'; |
|
| 944 | 944 | // Only on template invoices |
| 945 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date_when, 'dayhour') . ')'; |
|
| 946 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour') . ')'; |
|
| 945 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')'; |
|
| 946 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')'; |
|
| 947 | 947 | $substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count"); |
| 948 | 948 | $substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber"); |
| 949 | 949 | |
| 950 | - $htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>'; |
|
| 950 | + $htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; |
|
| 951 | 951 | foreach ($substitutionarray as $key => $val) { |
| 952 | - $htmltext .= $key . ' = ' . $langs->trans($val) . '<br>'; |
|
| 952 | + $htmltext .= $key.' = '.$langs->trans($val).'<br>'; |
|
| 953 | 953 | } |
| 954 | 954 | $htmltext .= '</i>'; |
| 955 | 955 | |
| 956 | 956 | // Label |
| 957 | - print '<tr><td class="titlefieldcreate">' . $langs->trans("Label") . '</td><td>'; |
|
| 958 | - print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="' . $object->label . '">'; |
|
| 957 | + print '<tr><td class="titlefieldcreate">'.$langs->trans("Label").'</td><td>'; |
|
| 958 | + print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="'.$object->label.'">'; |
|
| 959 | 959 | print '</td></tr>'; |
| 960 | 960 | |
| 961 | 961 | // Public note |
@@ -980,38 +980,38 @@ discard block |
||
| 980 | 980 | } |
| 981 | 981 | |
| 982 | 982 | // Author |
| 983 | - print "<tr><td>" . $langs->trans("Author") . "</td><td>" . $user->getFullName($langs) . "</td></tr>"; |
|
| 983 | + print "<tr><td>".$langs->trans("Author")."</td><td>".$user->getFullName($langs)."</td></tr>"; |
|
| 984 | 984 | |
| 985 | 985 | // Payment term |
| 986 | - print "<tr><td>" . $langs->trans("PaymentConditions") . "</td><td>"; |
|
| 987 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->cond_reglement_id, 'none'); |
|
| 986 | + print "<tr><td>".$langs->trans("PaymentConditions")."</td><td>"; |
|
| 987 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); |
|
| 988 | 988 | print "</td></tr>"; |
| 989 | 989 | |
| 990 | 990 | // Payment mode |
| 991 | - print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>"; |
|
| 992 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none', '', 1); |
|
| 991 | + print "<tr><td>".$langs->trans("PaymentMode")."</td><td>"; |
|
| 992 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none', '', 1); |
|
| 993 | 993 | print "</td></tr>"; |
| 994 | 994 | |
| 995 | 995 | // Project |
| 996 | 996 | if (isModEnabled('project') && is_object($object->thirdparty) && $object->thirdparty->id > 0) { |
| 997 | 997 | $projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project; |
| 998 | 998 | $langs->load('projects'); |
| 999 | - print '<tr><td>' . $langs->trans('Project') . '</td><td>'; |
|
| 999 | + print '<tr><td>'.$langs->trans('Project').'</td><td>'; |
|
| 1000 | 1000 | $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''); |
| 1001 | - print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $object->thirdparty->id . (!empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . '</a>'; |
|
| 1001 | + print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->thirdparty->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id) ? '&id='.$id : '')).'">'.$langs->trans("AddProject").'</a>'; |
|
| 1002 | 1002 | print '</td></tr>'; |
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | 1005 | // Bank account |
| 1006 | 1006 | if ($object->fk_account > 0) { |
| 1007 | - print "<tr><td>" . $langs->trans('BankAccount') . "</td><td>"; |
|
| 1008 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none'); |
|
| 1007 | + print "<tr><td>".$langs->trans('BankAccount')."</td><td>"; |
|
| 1008 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); |
|
| 1009 | 1009 | print "</td></tr>"; |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | // Model pdf |
| 1013 | - print "<tr><td>" . $langs->trans('Model') . "</td><td>"; |
|
| 1014 | - include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
| 1013 | + print "<tr><td>".$langs->trans('Model')."</td><td>"; |
|
| 1014 | + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
| 1015 | 1015 | $list = ModelePDFSuppliersInvoices::liste_modeles($db); |
| 1016 | 1016 | print $form->selectarray('modelpdf', $list, $conf->global->INVOICE_SUPPLIER_ADDON_PDF); |
| 1017 | 1017 | print "</td></tr>"; |
@@ -1022,37 +1022,37 @@ discard block |
||
| 1022 | 1022 | |
| 1023 | 1023 | // Autogeneration |
| 1024 | 1024 | $title = $langs->trans("Recurrence"); |
| 1025 | - print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"') . $title, '', ''); |
|
| 1025 | + print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', ''); |
|
| 1026 | 1026 | |
| 1027 | 1027 | print dol_get_fiche_head(null, '', '', 0); |
| 1028 | 1028 | |
| 1029 | 1029 | print '<table class="border centpercent">'; |
| 1030 | 1030 | |
| 1031 | 1031 | // Frequency + unit |
| 1032 | - print '<tr><td class="titlefieldcreate">' . $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')) . "</td><td>"; |
|
| 1033 | - print "<input type='text' name='frequency' value='" . GETPOST('frequency', 'int') . "' size='4' /> " . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); |
|
| 1032 | + print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'))."</td><td>"; |
|
| 1033 | + print "<input type='text' name='frequency' value='".GETPOST('frequency', 'int')."' size='4' /> ".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); |
|
| 1034 | 1034 | print "</td></tr>"; |
| 1035 | 1035 | |
| 1036 | 1036 | // Date next run |
| 1037 | - print "<tr><td>" . $langs->trans('NextDateToExecution') . "</td><td>"; |
|
| 1037 | + print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>"; |
|
| 1038 | 1038 | $date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1); |
| 1039 | 1039 | print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1); |
| 1040 | 1040 | print "</td></tr>"; |
| 1041 | 1041 | |
| 1042 | 1042 | // Number max of generation |
| 1043 | - print "<tr><td>" . $langs->trans("MaxPeriodNumber") . "</td><td>"; |
|
| 1044 | - print '<input type="text" name="nb_gen_max" value="' . GETPOST('nb_gen_max') . '" size="5" />'; |
|
| 1043 | + print "<tr><td>".$langs->trans("MaxPeriodNumber")."</td><td>"; |
|
| 1044 | + print '<input type="text" name="nb_gen_max" value="'.GETPOST('nb_gen_max').'" size="5" />'; |
|
| 1045 | 1045 | print "</td></tr>"; |
| 1046 | 1046 | |
| 1047 | 1047 | // Auto validate the invoice |
| 1048 | - print "<tr><td>" . $langs->trans("StatusOfGeneratedInvoices") . "</td><td>"; |
|
| 1048 | + print "<tr><td>".$langs->trans("StatusOfGeneratedInvoices")."</td><td>"; |
|
| 1049 | 1049 | $select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated')); |
| 1050 | 1050 | print $form->selectarray('auto_validate', $select, GETPOST('auto_validate')); |
| 1051 | 1051 | print "</td></tr>"; |
| 1052 | 1052 | |
| 1053 | 1053 | // Auto generate document |
| 1054 | 1054 | if (!empty($conf->global->INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION)) { |
| 1055 | - print "<tr><td>" . $langs->trans("StatusOfGeneratedDocuments") . "</td><td>"; |
|
| 1055 | + print "<tr><td>".$langs->trans("StatusOfGeneratedDocuments")."</td><td>"; |
|
| 1056 | 1056 | $select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc')); |
| 1057 | 1057 | print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); |
| 1058 | 1058 | print "</td></tr>"; |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | |
| 1096 | 1096 | print "</form>\n"; |
| 1097 | 1097 | } else { |
| 1098 | - dol_print_error('', "Error, no invoice " . $object->id); |
|
| 1098 | + dol_print_error('', "Error, no invoice ".$object->id); |
|
| 1099 | 1099 | } |
| 1100 | 1100 | } else { |
| 1101 | 1101 | /* |
@@ -1107,12 +1107,12 @@ discard block |
||
| 1107 | 1107 | |
| 1108 | 1108 | // Confirmation de la suppression d'une ligne produit |
| 1109 | 1109 | if ($action == 'ask_deleteline') { |
| 1110 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); |
|
| 1110 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); |
|
| 1111 | 1111 | } |
| 1112 | 1112 | |
| 1113 | 1113 | // Confirm delete of repeatable invoice |
| 1114 | 1114 | if ($action == 'ask_deleteinvoice') { |
| 1115 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); |
|
| 1115 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); |
|
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | 1118 | print $formconfirm; |
@@ -1126,7 +1126,7 @@ discard block |
||
| 1126 | 1126 | |
| 1127 | 1127 | // Recurring invoice content |
| 1128 | 1128 | |
| 1129 | - $linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/list-rec.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans('BackToList') . '</a>'; |
|
| 1129 | + $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list-rec.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans('BackToList').'</a>'; |
|
| 1130 | 1130 | |
| 1131 | 1131 | $morehtmlref = ''; |
| 1132 | 1132 | if ($action != 'edittitle') { |
@@ -1139,33 +1139,33 @@ discard block |
||
| 1139 | 1139 | $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); |
| 1140 | 1140 | $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); |
| 1141 | 1141 | // Thirdparty |
| 1142 | - $morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); |
|
| 1142 | + $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); |
|
| 1143 | 1143 | |
| 1144 | 1144 | // Project |
| 1145 | 1145 | if (isModEnabled('project')) { |
| 1146 | 1146 | $langs->load('projects'); |
| 1147 | - $morehtmlref .= '<br>' . $langs->trans('Project') . ' '; |
|
| 1147 | + $morehtmlref .= '<br>'.$langs->trans('Project').' '; |
|
| 1148 | 1148 | if ($usercancreate) { |
| 1149 | 1149 | if ($action != 'classify') { |
| 1150 | - $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; |
|
| 1150 | + $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : '; |
|
| 1151 | 1151 | } |
| 1152 | 1152 | if ($action == 'classify') { |
| 1153 | - $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">'; |
|
| 1153 | + $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; |
|
| 1154 | 1154 | $morehtmlref .= '<input type="hidden" name="action" value="classin">'; |
| 1155 | - $morehtmlref .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1155 | + $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1156 | 1156 | $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); |
| 1157 | - $morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 1157 | + $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 1158 | 1158 | $morehtmlref .= '</form>'; |
| 1159 | 1159 | } else { |
| 1160 | - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); |
|
| 1160 | + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); |
|
| 1161 | 1161 | } |
| 1162 | 1162 | } else { |
| 1163 | 1163 | if (!empty($object->fk_project)) { |
| 1164 | 1164 | $project = new Project($db); |
| 1165 | 1165 | $project->fetch($object->fk_project); |
| 1166 | - $morehtmlref .= ' : ' . $project->getNomUrl(1); |
|
| 1166 | + $morehtmlref .= ' : '.$project->getNomUrl(1); |
|
| 1167 | 1167 | if ($project->title) { |
| 1168 | - $morehtmlref .= ' - ' . $project->title; |
|
| 1168 | + $morehtmlref .= ' - '.$project->title; |
|
| 1169 | 1169 | } |
| 1170 | 1170 | } else { |
| 1171 | 1171 | $morehtmlref .= ''; |
@@ -1184,34 +1184,34 @@ discard block |
||
| 1184 | 1184 | |
| 1185 | 1185 | print '<table class="border centpercent tableforfield">'; |
| 1186 | 1186 | |
| 1187 | - print '<tr><td class="titlefield">' . $langs->trans('Author') . '</td><td>'; |
|
| 1187 | + print '<tr><td class="titlefield">'.$langs->trans('Author').'</td><td>'; |
|
| 1188 | 1188 | print $author->getNomUrl(-1); |
| 1189 | 1189 | print "</td></tr>"; |
| 1190 | 1190 | |
| 1191 | 1191 | // Label |
| 1192 | 1192 | print '<tr>'; |
| 1193 | - print '<td>' . $form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>'; |
|
| 1194 | - print '<td>' . $form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>'; |
|
| 1193 | + print '<td>'.$form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>'; |
|
| 1194 | + print '<td>'.$form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>'; |
|
| 1195 | 1195 | print '</tr>'; |
| 1196 | 1196 | |
| 1197 | - print '<tr><td>' . $langs->trans('AmountHT') . '</td>'; |
|
| 1198 | - print '<td>' . price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 1197 | + print '<tr><td>'.$langs->trans('AmountHT').'</td>'; |
|
| 1198 | + print '<td>'.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 1199 | 1199 | print '</tr>'; |
| 1200 | 1200 | |
| 1201 | - print '<tr><td>' . $langs->trans("AmountVAT") . '</td><td>' . price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 1201 | + print '<tr><td>'.$langs->trans("AmountVAT").'</td><td>'.price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 1202 | 1202 | print '</tr>'; |
| 1203 | 1203 | |
| 1204 | 1204 | // Amount Local Taxes |
| 1205 | 1205 | if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { // Localtax1 |
| 1206 | - print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 1207 | - print '<td class="nowrap">' . price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>'; |
|
| 1206 | + print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 1207 | + print '<td class="nowrap">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>'; |
|
| 1208 | 1208 | } |
| 1209 | 1209 | if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { // Localtax2 |
| 1210 | - print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 1211 | - print '<td class=nowrap">' . price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>'; |
|
| 1210 | + print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 1211 | + print '<td class=nowrap">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>'; |
|
| 1212 | 1212 | } |
| 1213 | 1213 | |
| 1214 | - print '<tr><td>' . $langs->trans("AmountTTC") . '</td><td colspan="3">' . price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 1214 | + print '<tr><td>'.$langs->trans("AmountTTC").'</td><td colspan="3">'.price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 1215 | 1215 | print '</tr>'; |
| 1216 | 1216 | |
| 1217 | 1217 | // Payment term |
@@ -1220,14 +1220,14 @@ discard block |
||
| 1220 | 1220 | print $langs->trans('PaymentConditionsShort'); |
| 1221 | 1221 | print '</td>'; |
| 1222 | 1222 | if ($action != 'editconditions' && $usercancreate) { |
| 1223 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>'; |
|
| 1223 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>'; |
|
| 1224 | 1224 | } |
| 1225 | 1225 | print '</tr></table>'; |
| 1226 | 1226 | print '</td><td>'; |
| 1227 | 1227 | if ($action == 'editconditions') { |
| 1228 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id'); |
|
| 1228 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); |
|
| 1229 | 1229 | } else { |
| 1230 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'none'); |
|
| 1230 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none'); |
|
| 1231 | 1231 | } |
| 1232 | 1232 | |
| 1233 | 1233 | print '</td></tr>'; |
@@ -1238,14 +1238,14 @@ discard block |
||
| 1238 | 1238 | print $langs->trans('PaymentMode'); |
| 1239 | 1239 | print '</td>'; |
| 1240 | 1240 | if ($action != 'editmode' && $usercancreate) { |
| 1241 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>'; |
|
| 1241 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>'; |
|
| 1242 | 1242 | } |
| 1243 | 1243 | print '</tr></table>'; |
| 1244 | 1244 | print '</td><td>'; |
| 1245 | 1245 | if ($action == 'editmode') { |
| 1246 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); |
|
| 1246 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); |
|
| 1247 | 1247 | } else { |
| 1248 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'none'); |
|
| 1248 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none'); |
|
| 1249 | 1249 | } |
| 1250 | 1250 | print '</td></tr>'; |
| 1251 | 1251 | |
@@ -1258,12 +1258,12 @@ discard block |
||
| 1258 | 1258 | print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); |
| 1259 | 1259 | print '</td>'; |
| 1260 | 1260 | if ($usercancreate && $action != 'editmulticurrencycode' && $object->suspended == $object::STATUS_SUSPENDED) { |
| 1261 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>'; |
|
| 1261 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>'; |
|
| 1262 | 1262 | } |
| 1263 | 1263 | print '</tr></table>'; |
| 1264 | 1264 | print '</td><td>'; |
| 1265 | 1265 | $htmlname = (($usercancreate && $action == 'editmulticurrencycode') ? 'multicurrency_code' : 'none'); |
| 1266 | - $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname); |
|
| 1266 | + $form->form_multicurrency_code($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_code, $htmlname); |
|
| 1267 | 1267 | print '</td></tr>'; |
| 1268 | 1268 | |
| 1269 | 1269 | // Multicurrency rate |
@@ -1274,7 +1274,7 @@ discard block |
||
| 1274 | 1274 | print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); |
| 1275 | 1275 | print '</td>'; |
| 1276 | 1276 | if ($usercancreate && $action != 'editmulticurrencyrate' && $object->suspended == $object::STATUS_SUSPENDED && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 1277 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>'; |
|
| 1277 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>'; |
|
| 1278 | 1278 | } |
| 1279 | 1279 | print '</tr></table>'; |
| 1280 | 1280 | print '</td><td>'; |
@@ -1282,12 +1282,12 @@ discard block |
||
| 1282 | 1282 | if ($action == 'actualizemulticurrencyrate') { |
| 1283 | 1283 | list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); |
| 1284 | 1284 | } |
| 1285 | - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code); |
|
| 1285 | + $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code); |
|
| 1286 | 1286 | } else { |
| 1287 | - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); |
|
| 1287 | + $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); |
|
| 1288 | 1288 | if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 1289 | 1289 | print '<div class="inline-block"> '; |
| 1290 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=actualizemulticurrencyrate">' . $langs->trans("ActualizeCurrency") . '</a>'; |
|
| 1290 | + print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>'; |
|
| 1291 | 1291 | print '</div>'; |
| 1292 | 1292 | } |
| 1293 | 1293 | } |
@@ -1303,24 +1303,24 @@ discard block |
||
| 1303 | 1303 | |
| 1304 | 1304 | $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); |
| 1305 | 1305 | |
| 1306 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m') . ')'; |
|
| 1307 | - $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%m') . ')'; |
|
| 1308 | - $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m') . ')'; |
|
| 1309 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B') . ')'; |
|
| 1310 | - $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%B') . ')'; |
|
| 1311 | - $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B') . ')'; |
|
| 1312 | - $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y') . ')'; |
|
| 1313 | - $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%Y') . ')'; |
|
| 1314 | - $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y') . ')'; |
|
| 1306 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m').')'; |
|
| 1307 | + $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%m').')'; |
|
| 1308 | + $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m').')'; |
|
| 1309 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B').')'; |
|
| 1310 | + $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%B').')'; |
|
| 1311 | + $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')'; |
|
| 1312 | + $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y').')'; |
|
| 1313 | + $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%Y').')'; |
|
| 1314 | + $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y').')'; |
|
| 1315 | 1315 | // Only on template invoices |
| 1316 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour') . ')'; |
|
| 1317 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour') . ')'; |
|
| 1316 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour').')'; |
|
| 1317 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour').')'; |
|
| 1318 | 1318 | $substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $object->nb_gen_done; |
| 1319 | 1319 | $substitutionarray['__INVOICE_COUNTER_MAX__'] = $object->nb_gen_max; |
| 1320 | 1320 | |
| 1321 | - $htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>'; |
|
| 1321 | + $htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; |
|
| 1322 | 1322 | foreach ($substitutionarray as $key => $val) { |
| 1323 | - $htmltext .= $key . ' = ' . $langs->trans($val) . '<br>'; |
|
| 1323 | + $htmltext .= $key.' = '.$langs->trans($val).'<br>'; |
|
| 1324 | 1324 | } |
| 1325 | 1325 | $htmltext .= '</i>'; |
| 1326 | 1326 | |
@@ -1328,7 +1328,7 @@ discard block |
||
| 1328 | 1328 | print '<tr><td>'; |
| 1329 | 1329 | print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'), 'note_public', $object->note_public, $object, $usercancreate); |
| 1330 | 1330 | print '</td><td class="wordbreak">'; |
| 1331 | - print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $usercancreate, 'textarea:' . ROWS_4 . ':90%', '', null, null, '', 1); |
|
| 1331 | + print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $usercancreate, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1); |
|
| 1332 | 1332 | print '</td>'; |
| 1333 | 1333 | print '</tr>'; |
| 1334 | 1334 | |
@@ -1336,7 +1336,7 @@ discard block |
||
| 1336 | 1336 | print '<tr><td>'; |
| 1337 | 1337 | print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'), 'note_private', $object->note_private, $object, $usercancreate); |
| 1338 | 1338 | print '</td><td class="wordbreak">'; |
| 1339 | - print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $usercancreate, 'textarea:' . ROWS_4 . ':90%', '', null, null, '', 1); |
|
| 1339 | + print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $usercancreate, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1); |
|
| 1340 | 1340 | print '</td>'; |
| 1341 | 1341 | print '</tr>'; |
| 1342 | 1342 | |
@@ -1346,14 +1346,14 @@ discard block |
||
| 1346 | 1346 | print $langs->trans('BankAccount'); |
| 1347 | 1347 | print '<td>'; |
| 1348 | 1348 | if ($action != 'editbankaccount' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) { |
| 1349 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editbankaccount&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetBankAccount'), 1) . '</a></td>'; |
|
| 1349 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>'; |
|
| 1350 | 1350 | } |
| 1351 | 1351 | print '</tr></table>'; |
| 1352 | 1352 | print '</td><td>'; |
| 1353 | 1353 | if ($action == 'editbankaccount') { |
| 1354 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'fk_account', 1); |
|
| 1354 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); |
|
| 1355 | 1355 | } else { |
| 1356 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none'); |
|
| 1356 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); |
|
| 1357 | 1357 | } |
| 1358 | 1358 | print "</td>"; |
| 1359 | 1359 | print '</tr>'; |
@@ -1364,18 +1364,18 @@ discard block |
||
| 1364 | 1364 | print $langs->trans('Model'); |
| 1365 | 1365 | print '<td>'; |
| 1366 | 1366 | if ($action != 'editmodelpdf' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) { |
| 1367 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editmodelpdf&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetModel'), 1) . '</a></td>'; |
|
| 1367 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editmodelpdf&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>'; |
|
| 1368 | 1368 | } |
| 1369 | 1369 | print '</tr></table>'; |
| 1370 | 1370 | print '</td><td>'; |
| 1371 | 1371 | if ($action == 'editmodelpdf') { |
| 1372 | - include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
| 1372 | + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
| 1373 | 1373 | $list = array(); |
| 1374 | 1374 | $models = ModelePDFSuppliersInvoices::liste_modeles($db); |
| 1375 | 1375 | foreach ($models as $k => $model) { |
| 1376 | - $list[] = str_replace(':', '|', $k) . ':' . $model; |
|
| 1376 | + $list[] = str_replace(':', '|', $k).':'.$model; |
|
| 1377 | 1377 | } |
| 1378 | - $select = 'select;' . implode(',', $list); |
|
| 1378 | + $select = 'select;'.implode(',', $list); |
|
| 1379 | 1379 | //TODO : Droits |
| 1380 | 1380 | print $form->editfieldval($langs->trans('Model'), 'modelpdf', $object->model_pdf, $object, $usercancreate, $select); |
| 1381 | 1381 | } else { |
@@ -1386,7 +1386,7 @@ discard block |
||
| 1386 | 1386 | |
| 1387 | 1387 | // Other attributes |
| 1388 | 1388 | $cols = 2; |
| 1389 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 1389 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 1390 | 1390 | |
| 1391 | 1391 | print '</table>'; |
| 1392 | 1392 | |
@@ -1402,7 +1402,7 @@ discard block |
||
| 1402 | 1402 | |
| 1403 | 1403 | print '<table class="border centpercent tableforfield">'; |
| 1404 | 1404 | |
| 1405 | - print '<tr><td colspan="2">' . img_picto('', 'recurring', 'class="pictofixedwidth"') . $title . '</td></tr>'; |
|
| 1405 | + print '<tr><td colspan="2">'.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.'</td></tr>'; |
|
| 1406 | 1406 | |
| 1407 | 1407 | // if "frequency" is empty or = 0, the reccurence is disabled |
| 1408 | 1408 | print '<tr><td style="width: 50%">'; |
@@ -1410,23 +1410,23 @@ discard block |
||
| 1410 | 1410 | print $langs->trans('Frequency'); |
| 1411 | 1411 | print '</td>'; |
| 1412 | 1412 | if ($action != 'editfrequency' && $usercancreate) { |
| 1413 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editfrequency&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>'; |
|
| 1413 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('Edit'), 1).'</a></td>'; |
|
| 1414 | 1414 | } |
| 1415 | 1415 | print '</tr></table>'; |
| 1416 | 1416 | print '</td><td>'; |
| 1417 | 1417 | if ($action == 'editfrequency') { |
| 1418 | - print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '">'; |
|
| 1418 | + print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'">'; |
|
| 1419 | 1419 | print '<input type="hidden" name="action" value="setfrequency">'; |
| 1420 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1420 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1421 | 1421 | print '<table class="nobordernopadding">'; |
| 1422 | 1422 | print '<tr><td>'; |
| 1423 | - print "<input type='text' name='frequency' value='" . $object->frequency . "' size='5' /> " . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); |
|
| 1423 | + print "<input type='text' name='frequency' value='".$object->frequency."' size='5' /> ".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); |
|
| 1424 | 1424 | print '</td>'; |
| 1425 | - print '<td class="left"><input type="submit" class="button button-edit" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 1425 | + print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>'; |
|
| 1426 | 1426 | print '</tr></table></form>'; |
| 1427 | 1427 | } else { |
| 1428 | 1428 | if ($object->frequency > 0) { |
| 1429 | - print $langs->trans('FrequencyPer_' . $object->unit_frequency, $object->frequency); |
|
| 1429 | + print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); |
|
| 1430 | 1430 | } else { |
| 1431 | 1431 | print $langs->trans("NotARecurringInvoiceTemplate"); |
| 1432 | 1432 | } |
@@ -1445,8 +1445,8 @@ discard block |
||
| 1445 | 1445 | print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $usercancreate, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached'); |
| 1446 | 1446 | } |
| 1447 | 1447 | //var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour')); |
| 1448 | - if (! $object->isMaxNbGenReached()) { |
|
| 1449 | - if (! $object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { |
|
| 1448 | + if (!$object->isMaxNbGenReached()) { |
|
| 1449 | + if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { |
|
| 1450 | 1450 | print img_warning($langs->trans("Late")); |
| 1451 | 1451 | } |
| 1452 | 1452 | } else { |
@@ -1479,7 +1479,7 @@ discard block |
||
| 1479 | 1479 | print $langs->trans("StatusOfGeneratedInvoices"); |
| 1480 | 1480 | } |
| 1481 | 1481 | print '</td><td>'; |
| 1482 | - $select = 'select;0:' . $langs->trans('BillStatusDraft') . ',1:' . $langs->trans('BillStatusValidated'); |
|
| 1482 | + $select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated'); |
|
| 1483 | 1483 | if ($action == 'auto_validate' || $object->frequency > 0) { |
| 1484 | 1484 | print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select); |
| 1485 | 1485 | } |
@@ -1495,7 +1495,7 @@ discard block |
||
| 1495 | 1495 | } |
| 1496 | 1496 | print '</td>'; |
| 1497 | 1497 | print '<td>'; |
| 1498 | - $select = 'select;0:' . $langs->trans('DoNotGenerateDoc') . ',1:' . $langs->trans('AutogenerateDoc'); |
|
| 1498 | + $select = 'select;0:'.$langs->trans('DoNotGenerateDoc').',1:'.$langs->trans('AutogenerateDoc'); |
|
| 1499 | 1499 | if ($action == 'generate_pdf' || $object->frequency > 0) { |
| 1500 | 1500 | print $form->editfieldval($langs->trans("StatusOfGeneratedDocuments"), 'generate_pdf', $object->generate_pdf, $object, $usercancreate, $select); |
| 1501 | 1501 | } |
@@ -1519,7 +1519,7 @@ discard block |
||
| 1519 | 1519 | print '<table class="border centpercent tableforfield">'; |
| 1520 | 1520 | |
| 1521 | 1521 | // Nb of generation already done |
| 1522 | - print '<tr><td style="width: 50%">' . $langs->trans("NbOfGenerationDone") . '</td>'; |
|
| 1522 | + print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>'; |
|
| 1523 | 1523 | print '<td>'; |
| 1524 | 1524 | print $object->nb_gen_done ? $object->nb_gen_done : '0'; |
| 1525 | 1525 | print '</td>'; |
@@ -1544,15 +1544,15 @@ discard block |
||
| 1544 | 1544 | print '<div class="clearboth"></div><br>'; |
| 1545 | 1545 | |
| 1546 | 1546 | // Lines |
| 1547 | - print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST"> |
|
| 1548 | - <input type="hidden" name="token" value="' . newToken() . '"> |
|
| 1549 | - <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> |
|
| 1547 | + print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid', 'int')).'" method="POST"> |
|
| 1548 | + <input type="hidden" name="token" value="' . newToken().'"> |
|
| 1549 | + <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'"> |
|
| 1550 | 1550 | <input type="hidden" name="mode" value=""> |
| 1551 | - <input type="hidden" name="id" value="' . $object->id . '"> |
|
| 1551 | + <input type="hidden" name="id" value="' . $object->id.'"> |
|
| 1552 | 1552 | '; |
| 1553 | 1553 | |
| 1554 | 1554 | if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { |
| 1555 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
| 1555 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
| 1556 | 1556 | } |
| 1557 | 1557 | |
| 1558 | 1558 | print '<div class="div-table-responsive-no-min">'; |
@@ -1606,24 +1606,24 @@ discard block |
||
| 1606 | 1606 | if (empty($object->suspended)) { |
| 1607 | 1607 | if ($usercancreate) { |
| 1608 | 1608 | if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { |
| 1609 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1609 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1610 | 1610 | } else { |
| 1611 | 1611 | if (empty($object->frequency) || $object->date_when <= $nowlasthour) { |
| 1612 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/facture/card.php?action=create&socid=' . $object->thirdparty->id . '&fac_rec=' . $object->id . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1612 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->thirdparty->id.'&fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1613 | 1613 | } else { |
| 1614 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1614 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1615 | 1615 | } |
| 1616 | 1616 | } |
| 1617 | 1617 | } else { |
| 1618 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1618 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1619 | 1619 | } |
| 1620 | 1620 | } |
| 1621 | 1621 | |
| 1622 | 1622 | if ($usercancreate) { |
| 1623 | 1623 | if (empty($object->suspended)) { |
| 1624 | - print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=disable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Disable") . '</a></div>'; |
|
| 1624 | + print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=disable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Disable").'</a></div>'; |
|
| 1625 | 1625 | } else { |
| 1626 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=enable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Enable") . '</a></div>'; |
|
| 1626 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=enable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Enable").'</a></div>'; |
|
| 1627 | 1627 | } |
| 1628 | 1628 | } |
| 1629 | 1629 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | if (empty($price) && !empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) { |
| 99 | 99 | // get pmp for subproducts if any |
| 100 | 100 | $producttmp->get_sousproduits_arbo(); |
| 101 | - $prods_arbo=$producttmp->get_arbo_each_prod(); |
|
| 101 | + $prods_arbo = $producttmp->get_arbo_each_prod(); |
|
| 102 | 102 | if (!empty($prods_arbo)) { |
| 103 | 103 | $price = 0; |
| 104 | 104 | foreach ($prods_arbo as $child) { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - $prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() |
|
| 112 | + $prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // Add price for costprice (at end) |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | if (empty($price) && !empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) { |
| 118 | 118 | // get costprice for subproducts if any |
| 119 | 119 | $producttmp->get_sousproduits_arbo(); |
| 120 | - $prods_arbo=$producttmp->get_arbo_each_prod(); |
|
| 120 | + $prods_arbo = $producttmp->get_arbo_each_prod(); |
|
| 121 | 121 | if (!empty($prods_arbo)) { |
| 122 | 122 | $price = 0; |
| 123 | 123 | foreach ($prods_arbo as $child) { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $id_rate_selected = GETPOST('id_rate', 'int'); |
| 48 | 48 | $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); |
| 49 | 49 | $search_date_sync = dol_mktime(0, 0, 0, GETPOST('search_date_syncmonth', 'int'), GETPOST('search_date_syncday', 'int'), GETPOST('search_date_syncyear', 'int')); |
| 50 | -$search_date_sync_end = dol_mktime(0, 0, 0, GETPOST('search_date_sync_endmonth', 'int'), GETPOST('search_date_sync_endday', 'int'), GETPOST('search_date_sync_endyear', 'int')); |
|
| 50 | +$search_date_sync_end = dol_mktime(0, 0, 0, GETPOST('search_date_sync_endmonth', 'int'), GETPOST('search_date_sync_endday', 'int'), GETPOST('search_date_sync_endyear', 'int')); |
|
| 51 | 51 | $search_rate = GETPOST('search_rate', 'alpha'); |
| 52 | 52 | $search_code = GETPOST('search_code', 'alpha'); |
| 53 | 53 | $multicurrency_code = GETPOST('multicurrency_code', 'alpha'); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
| 223 | 223 | $sall = ""; |
| 224 | 224 | $search_date_sync = ""; |
| 225 | - $search_date_sync_end=""; |
|
| 225 | + $search_date_sync_end = ""; |
|
| 226 | 226 | $search_rate = ""; |
| 227 | 227 | $search_code = ""; |
| 228 | 228 | $search_array_options = array(); |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $sql .= ' FROM '.MAIN_DB_PREFIX.'multicurrency_rate as cr '; |
| 301 | 301 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."multicurrency AS m ON cr.fk_multicurrency = m.rowid"; |
| 302 | 302 | if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); |
| 303 | -if ($search_date_sync && $search_date_sync_end ) { |
|
| 303 | +if ($search_date_sync && $search_date_sync_end) { |
|
| 304 | 304 | $sql .= " AND (cr.date_sync BETWEEN '".$db->idate($search_date_sync)."' AND '".$db->idate($search_date_sync_end)."')"; |
| 305 | 305 | } elseif ($search_date_sync && !$search_date_sync_end) { |
| 306 | 306 | $sql .= natural_search('cr.date_sync', $db->idate($search_date_sync)); |
@@ -357,9 +357,9 @@ discard block |
||
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | if ($search_date_sync) $param = "&search_date_sync=".$search_date_sync; |
| 360 | - if ($search_date_sync_end) $param="&search_date_sync_end=".$search_date_sync_end; |
|
| 360 | + if ($search_date_sync_end) $param = "&search_date_sync_end=".$search_date_sync_end; |
|
| 361 | 361 | if ($search_rate) $param = "&search_rate=".urlencode($search_rate); |
| 362 | - if ($search_code != '') $param.="&search_code=".urlencode($search_code); |
|
| 362 | + if ($search_code != '') $param .= "&search_code=".urlencode($search_code); |
|
| 363 | 363 | |
| 364 | 364 | // Add $param from extra fields |
| 365 | 365 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
@@ -486,9 +486,9 @@ discard block |
||
| 486 | 486 | // USER REQUEST UPDATE FOR THIS LINE |
| 487 | 487 | if ($action == "updateRate" && $obj->rowid == $id_rate_selected) { |
| 488 | 488 | // var_dump($obj); |
| 489 | - print ' <td><input class="minwidth200" name="dateinput" value="'. date('Y-m-d', dol_stringtotime($obj->date_sync)) .'" type="date"></td>'; |
|
| 490 | - print '<td>' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . '</td>'; |
|
| 491 | - print ' <td><input type="text" min ="0" step="any" class="minwidth200" name="rateinput" value="' . dol_escape_htmltag($obj->rate) . '"></td>'; |
|
| 489 | + print ' <td><input class="minwidth200" name="dateinput" value="'.date('Y-m-d', dol_stringtotime($obj->date_sync)).'" type="date"></td>'; |
|
| 490 | + print '<td>'.$form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true).'</td>'; |
|
| 491 | + print ' <td><input type="text" min ="0" step="any" class="minwidth200" name="rateinput" value="'.dol_escape_htmltag($obj->rate).'"></td>'; |
|
| 492 | 492 | |
| 493 | 493 | print '<td class="center nowrap ">'; |
| 494 | 494 | print '<input type="hidden" name="page" value="'.dol_escape_htmltag($page).'">'; |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | print ' - <span class="opacitymedium">'.$obj->name.'</span>'; |
| 513 | 513 | print "</td>\n"; |
| 514 | 514 | |
| 515 | - if (! $i) $totalarray['nbfield']++; |
|
| 515 | + if (!$i) $totalarray['nbfield']++; |
|
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | // rate |
@@ -520,13 +520,13 @@ discard block |
||
| 520 | 520 | print '<td class="tdoverflowmax200">'; |
| 521 | 521 | print $obj->rate; |
| 522 | 522 | print "</td>\n"; |
| 523 | - if (! $i) $totalarray['nbfield']++; |
|
| 523 | + if (!$i) $totalarray['nbfield']++; |
|
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | |
| 527 | 527 | // Fields from hook |
| 528 | 528 | $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj); |
| 529 | - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook |
|
| 529 | + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook |
|
| 530 | 530 | print $hookmanager->resPrint; |
| 531 | 531 | |
| 532 | 532 | // Action |
@@ -68,8 +68,12 @@ discard block |
||
| 68 | 68 | $offset = $limit * $page; |
| 69 | 69 | $pageprev = $page - 1; |
| 70 | 70 | $pagenext = $page + 1; |
| 71 | -if (!$sortfield) $sortfield = "cr.date_sync"; |
|
| 72 | -if (!$sortorder) $sortorder = "DESC"; |
|
| 71 | +if (!$sortfield) { |
|
| 72 | + $sortfield = "cr.date_sync"; |
|
| 73 | +} |
|
| 74 | +if (!$sortorder) { |
|
| 75 | + $sortorder = "DESC"; |
|
| 76 | +} |
|
| 73 | 77 | |
| 74 | 78 | |
| 75 | 79 | // Initialize technical objects |
@@ -217,7 +221,9 @@ discard block |
||
| 217 | 221 | |
| 218 | 222 | $parameters = array(); |
| 219 | 223 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
| 220 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 224 | +if ($reshook < 0) { |
|
| 225 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 226 | +} |
|
| 221 | 227 | if (empty($reshook)) { |
| 222 | 228 | // Selection of new fields |
| 223 | 229 | include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
@@ -303,14 +309,20 @@ discard block |
||
| 303 | 309 | $sql .= $hookmanager->resPrint; |
| 304 | 310 | $sql .= ' FROM '.MAIN_DB_PREFIX.'multicurrency_rate as cr '; |
| 305 | 311 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."multicurrency AS m ON cr.fk_multicurrency = m.rowid"; |
| 306 | -if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); |
|
| 312 | +if ($sall) { |
|
| 313 | + $sql .= natural_search(array_keys($fieldstosearchall), $sall); |
|
| 314 | +} |
|
| 307 | 315 | if ($search_date_sync && $search_date_sync_end ) { |
| 308 | 316 | $sql .= " AND (cr.date_sync BETWEEN '".$db->idate($search_date_sync)."' AND '".$db->idate($search_date_sync_end)."')"; |
| 309 | 317 | } elseif ($search_date_sync && !$search_date_sync_end) { |
| 310 | 318 | $sql .= natural_search('cr.date_sync', $db->idate($search_date_sync)); |
| 311 | 319 | } |
| 312 | -if ($search_rate) $sql .= natural_search('cr.rate', $search_rate); |
|
| 313 | -if ($search_code) $sql .= natural_search('m.code', $search_code); |
|
| 320 | +if ($search_rate) { |
|
| 321 | + $sql .= natural_search('cr.rate', $search_rate); |
|
| 322 | +} |
|
| 323 | +if ($search_code) { |
|
| 324 | + $sql .= natural_search('m.code', $search_code); |
|
| 325 | +} |
|
| 314 | 326 | $sql .= " WHERE m.code <> '".$db->escape($conf->currency)."'"; |
| 315 | 327 | |
| 316 | 328 | // Add where from hooks |
@@ -360,10 +372,18 @@ discard block |
||
| 360 | 372 | $param .= "&sall=".urlencode($sall); |
| 361 | 373 | } |
| 362 | 374 | |
| 363 | - if ($search_date_sync) $param = "&search_date_sync=".$search_date_sync; |
|
| 364 | - if ($search_date_sync_end) $param="&search_date_sync_end=".$search_date_sync_end; |
|
| 365 | - if ($search_rate) $param = "&search_rate=".urlencode($search_rate); |
|
| 366 | - if ($search_code != '') $param.="&search_code=".urlencode($search_code); |
|
| 375 | + if ($search_date_sync) { |
|
| 376 | + $param = "&search_date_sync=".$search_date_sync; |
|
| 377 | + } |
|
| 378 | + if ($search_date_sync_end) { |
|
| 379 | + $param="&search_date_sync_end=".$search_date_sync_end; |
|
| 380 | + } |
|
| 381 | + if ($search_rate) { |
|
| 382 | + $param = "&search_rate=".urlencode($search_rate); |
|
| 383 | + } |
|
| 384 | + if ($search_code != '') { |
|
| 385 | + $param.="&search_code=".urlencode($search_code); |
|
| 386 | + } |
|
| 367 | 387 | |
| 368 | 388 | // Add $param from extra fields |
| 369 | 389 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
@@ -506,7 +526,9 @@ discard block |
||
| 506 | 526 | print '<td class="tdoverflowmax200">'; |
| 507 | 527 | print $obj->date_sync; |
| 508 | 528 | print "</td>\n"; |
| 509 | - if (!$i) $totalarray['nbfield']++; |
|
| 529 | + if (!$i) { |
|
| 530 | + $totalarray['nbfield']++; |
|
| 531 | + } |
|
| 510 | 532 | } |
| 511 | 533 | |
| 512 | 534 | // code |
@@ -516,7 +538,9 @@ discard block |
||
| 516 | 538 | print ' - <span class="opacitymedium">'.$obj->name.'</span>'; |
| 517 | 539 | print "</td>\n"; |
| 518 | 540 | |
| 519 | - if (! $i) $totalarray['nbfield']++; |
|
| 541 | + if (! $i) { |
|
| 542 | + $totalarray['nbfield']++; |
|
| 543 | + } |
|
| 520 | 544 | } |
| 521 | 545 | |
| 522 | 546 | // rate |
@@ -524,7 +548,9 @@ discard block |
||
| 524 | 548 | print '<td class="tdoverflowmax200">'; |
| 525 | 549 | print $obj->rate; |
| 526 | 550 | print "</td>\n"; |
| 527 | - if (! $i) $totalarray['nbfield']++; |
|
| 551 | + if (! $i) { |
|
| 552 | + $totalarray['nbfield']++; |
|
| 553 | + } |
|
| 528 | 554 | } |
| 529 | 555 | |
| 530 | 556 | |
@@ -493,7 +493,7 @@ |
||
| 493 | 493 | |
| 494 | 494 | dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread); |
| 495 | 495 | |
| 496 | - $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect |
|
| 496 | + $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect |
|
| 497 | 497 | $result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread); |
| 498 | 498 | $result3 = imap_timeout(IMAP_WRITETIMEOUT, 5); |
| 499 | 499 | $result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $this->rights[$r][0] = 130; |
| 203 | 203 | $this->rights[$r][1] = 'Modify thirdparty information payment'; |
| 204 | 204 | $this->rights[$r][3] = 0; |
| 205 | - $this->rights[$r][4] = 'thirdparty_paymentinformation_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on |
|
| 205 | + $this->rights[$r][4] = 'thirdparty_paymentinformation_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on |
|
| 206 | 206 | $this->rights[$r][5] = 'write'; |
| 207 | 207 | |
| 208 | 208 | // 262 : Restrict access to sales representative |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | } |
| 705 | 705 | // Add profids as criteria to search duplicates |
| 706 | 706 | $langs->load("companies"); |
| 707 | - $i=1; |
|
| 707 | + $i = 1; |
|
| 708 | 708 | while ($i <= 6) { |
| 709 | 709 | if ($i == 1) { |
| 710 | 710 | $this->import_updatekeys_array[$r]['s.siren'] = 'ProfId1'.(empty($mysoc->country_code) ? '' : $mysoc->country_code); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $form = new Form($db); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | -$qtytoconsumeforline = $this->tpl['qty'] / ( !empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 ); |
|
| 31 | +$qtytoconsumeforline = $this->tpl['qty'] / (!empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1); |
|
| 32 | 32 | /*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) { |
| 33 | 33 | $qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom']; |
| 34 | 34 | }*/ |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | if ($res) { |
| 50 | 50 | print $tmpproduct->getNomUrl(1); |
| 51 | 51 | if ($tmpbom->id) { |
| 52 | - print ' ' . $langs->trans("or") . ' '; |
|
| 52 | + print ' '.$langs->trans("or").' '; |
|
| 53 | 53 | print $tmpbom->getNomUrl(1); |
| 54 | - print ' <a class="collapse_bom" id="collapse-' . $line->id . '" href="#">'; |
|
| 54 | + print ' <a class="collapse_bom" id="collapse-'.$line->id.'" href="#">'; |
|
| 55 | 55 | print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open')); |
| 56 | 56 | } |
| 57 | 57 | print '</a>'; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | if ($tmpbom->id > 0) { |
| 84 | 84 | print '<td class="center">'; |
| 85 | - print '<input type="checkbox" name="bomlineid[]" value="' . $line->id . '">'; |
|
| 85 | + print '<input type="checkbox" name="bomlineid[]" value="'.$line->id.'">'; |
|
| 86 | 86 | print '</td>'; |
| 87 | 87 | } else { |
| 88 | 88 | print '<td class="center"></td>'; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | // Select of all the sub-BOM lines |
| 98 | 98 | $sql = 'SELECT rowid, fk_bom_child, fk_product, qty FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl'; |
| 99 | -$sql.= ' WHERE fk_bom ='. (int) $tmpbom->id; |
|
| 99 | +$sql .= ' WHERE fk_bom ='.(int) $tmpbom->id; |
|
| 100 | 100 | $resql = $db->query($sql); |
| 101 | 101 | |
| 102 | 102 | if ($resql) { |