@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $action = GETPOST('action', 'aZ09'); |
| 58 | 58 | $value = GETPOST('value', 'alpha'); |
| 59 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
| 59 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
| 60 | 60 | |
| 61 | 61 | $label = GETPOST('label', 'alpha'); |
| 62 | 62 | $scandir = GETPOST('scan_dir', 'alpha'); |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | setEventMessages($langs->trans('Error'), null, 'errors'); |
| 263 | 263 | } else { |
| 264 | 264 | setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); |
| 265 | - header("Location: " . $_SERVER["PHP_SELF"]); |
|
| 265 | + header("Location: ".$_SERVER["PHP_SELF"]); |
|
| 266 | 266 | exit(); |
| 267 | 267 | } |
| 268 | 268 | } elseif (preg_match('/del_(.*)/', $action, $reg)) { |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | setEventMessages($langs->trans('Error'), null, 'errors'); |
| 278 | 278 | } else { |
| 279 | 279 | setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); |
| 280 | - header("Location: " . $_SERVER["PHP_SELF"]); |
|
| 280 | + header("Location: ".$_SERVER["PHP_SELF"]); |
|
| 281 | 281 | exit(); |
| 282 | 282 | } |
| 283 | 283 | } |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | print(empty($module->name) ? $name : $module->name); |
| 573 | 573 | print "</td><td>\n"; |
| 574 | 574 | if (method_exists($module, 'info')) { |
| 575 | - print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 575 | + print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 576 | 576 | } else { |
| 577 | 577 | print $module->description; |
| 578 | 578 | } |
@@ -783,8 +783,8 @@ discard block |
||
| 783 | 783 | // Structured communication |
| 784 | 784 | // Specific to Belgium - See core/lib/functions_be.lib.php |
| 785 | 785 | if ($mysoc->country_code == 'BE') { |
| 786 | - print '<tr class="oddeven"><td>' . $langs->trans("InvoicePaymentManageStructuredCommunication") . ' '; |
|
| 787 | - print $form->textwithpicto('', $langs->trans("InvoicePaymentManageStructuredCommunicationHelp"), 1, 'help') . '</td>'; |
|
| 786 | + print '<tr class="oddeven"><td>'.$langs->trans("InvoicePaymentManageStructuredCommunication").' '; |
|
| 787 | + print $form->textwithpicto('', $langs->trans("InvoicePaymentManageStructuredCommunicationHelp"), 1, 'help').'</td>'; |
|
| 788 | 788 | print '<td class="left" colspan="2">'; |
| 789 | 789 | print ajax_constantonoff('INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION'); |
| 790 | 790 | print '</td></tr>'; |
@@ -863,8 +863,8 @@ discard block |
||
| 863 | 863 | print '</form>'; |
| 864 | 864 | |
| 865 | 865 | |
| 866 | -print '<tr class="oddeven"><td>'.$langs->trans("InvoiceCheckPosteriorDate"). ' ' ; |
|
| 867 | -print $form->textwithpicto('', $langs->trans("InvoiceCheckPosteriorDateHelp"), 1, 'help') . '</td>'; |
|
| 866 | +print '<tr class="oddeven"><td>'.$langs->trans("InvoiceCheckPosteriorDate").' '; |
|
| 867 | +print $form->textwithpicto('', $langs->trans("InvoiceCheckPosteriorDateHelp"), 1, 'help').'</td>'; |
|
| 868 | 868 | print '<td class="left" colspan="2">'; |
| 869 | 869 | print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE'); |
| 870 | 870 | print '</td></tr>'; |
@@ -217,7 +217,7 @@ |
||
| 217 | 217 | print '</td>'."\n"; |
| 218 | 218 | |
| 219 | 219 | print '<td class="center">'; |
| 220 | - if (getDolGlobalString('PAYMENT_ADDON') == $file || getDolGlobalString('PAYMENT_ADDON') . '.php' == $file) { |
|
| 220 | + if (getDolGlobalString('PAYMENT_ADDON') == $file || getDolGlobalString('PAYMENT_ADDON').'.php' == $file) { |
|
| 221 | 221 | print img_picto($langs->trans("Activated"), 'switch_on'); |
| 222 | 222 | } else { |
| 223 | 223 | print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.preg_replace('/\.php$/', '', $file).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | } else { |
| 197 | 197 | print ': '; |
| 198 | 198 | } |
| 199 | - if (! empty($object->user_creation) && is_object($object->user_creation)) { // deprecated mode |
|
| 199 | + if (!empty($object->user_creation) && is_object($object->user_creation)) { // deprecated mode |
|
| 200 | 200 | if ($object->user_creation->id) { |
| 201 | 201 | print $object->user_creation->getNomUrl(-1, '', 0, 0, 0); |
| 202 | 202 | } else { |
@@ -610,9 +610,9 @@ discard block |
||
| 610 | 610 | } else { |
| 611 | 611 | print ': '; |
| 612 | 612 | } |
| 613 | - print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 613 | + print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 614 | 614 | if ($deltadateforuser) { |
| 615 | - print ' <span class="opacitymedium">'.$langs->trans("CurrentHour").'</span> / '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').' <span class="opacitymedium">'.$langs->trans("ClientHour").'</span>'; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 615 | + print ' <span class="opacitymedium">'.$langs->trans("CurrentHour").'</span> / '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').' <span class="opacitymedium">'.$langs->trans("ClientHour").'</span>'; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 616 | 616 | } |
| 617 | 617 | if ($usetable) { |
| 618 | 618 | print '</td></tr>'; |
@@ -1128,13 +1128,13 @@ discard block |
||
| 1128 | 1128 | } |
| 1129 | 1129 | } else { // if reset is for a specific month in year, we need year |
| 1130 | 1130 | if (preg_match('/^(.*)\{(m+)\}\{(y+)\}/i', $maskwithonlyymcode, $reg)) { |
| 1131 | - $posy = 3; //index in regex |
|
| 1131 | + $posy = 3; //index in regex |
|
| 1132 | 1132 | $posm = 2; |
| 1133 | 1133 | } elseif (preg_match('/^(.*)\{(y+)\}\{(m+)\}/i', $maskwithonlyymcode, $reg)) { |
| 1134 | - $posy = 2; //index in regex |
|
| 1134 | + $posy = 2; //index in regex |
|
| 1135 | 1135 | $posm = 3; |
| 1136 | 1136 | } elseif (preg_match('/^(.*)\{(y+)\}/i', $maskwithonlyymcode, $reg)) { |
| 1137 | - $posy = 2; //index in regex |
|
| 1137 | + $posy = 2; //index in regex |
|
| 1138 | 1138 | $posm = 0; |
| 1139 | 1139 | } else { |
| 1140 | 1140 | return 'ErrorCantUseRazIfNoYearInMask'; |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | $maskLike = preg_replace('/\{yyyy\}/i', $yearcomp, $maskLike); |
| 1237 | 1237 | $maskLike = preg_replace('/\{yy\}/i', $yearcomp, $maskLike); |
| 1238 | 1238 | $maskLike = preg_replace('/\{y\}/i', $yearcomp, $maskLike); |
| 1239 | - $maskLike = preg_replace('/\{mm\}/i', '__', $maskLike); // we can't include the month in the filter |
|
| 1239 | + $maskLike = preg_replace('/\{mm\}/i', '__', $maskLike); // we can't include the month in the filter |
|
| 1240 | 1240 | } else { |
| 1241 | 1241 | $maskLike = preg_replace('/\{yyyy\}/i', '____', $maskLike); |
| 1242 | 1242 | $maskLike = preg_replace('/\{yy\}/i', '__', $maskLike); |
@@ -1267,14 +1267,14 @@ discard block |
||
| 1267 | 1267 | $counter = 0; |
| 1268 | 1268 | $sql = "SELECT MAX(".$sqlstring.") as val"; |
| 1269 | 1269 | $sql .= " FROM ".MAIN_DB_PREFIX.$db->sanitize($table); |
| 1270 | - $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'"; |
|
| 1270 | + $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'"; |
|
| 1271 | 1271 | $sql .= " AND ".$db->sanitize($field)." NOT LIKE '(PROV%)'"; |
| 1272 | 1272 | |
| 1273 | 1273 | // To ensure that all variables within the MAX() brackets are integers |
| 1274 | 1274 | // This avoid bad detection of max when data are noised with non numeric values at the position of the numero |
| 1275 | 1275 | if (getDolGlobalInt('MAIN_NUMBERING_FILTER_ON_INT_ONLY')) { |
| 1276 | 1276 | // @phan-suppress-next-line PhanPluginSuspiciousParamPosition |
| 1277 | - $sql .= " AND ". $db->regexpsql($sqlstring, '^[0-9]+$', 1); |
|
| 1277 | + $sql .= " AND ".$db->regexpsql($sqlstring, '^[0-9]+$', 1); |
|
| 1278 | 1278 | } |
| 1279 | 1279 | |
| 1280 | 1280 | if ($bentityon) { // only if entity enable |
@@ -1336,7 +1336,7 @@ discard block |
||
| 1336 | 1336 | $ref = ''; |
| 1337 | 1337 | $sql = "SELECT ".$db->sanitize($field)." as ref"; |
| 1338 | 1338 | $sql .= " FROM ".MAIN_DB_PREFIX.$db->sanitize($table); |
| 1339 | - $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'"; |
|
| 1339 | + $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'"; |
|
| 1340 | 1340 | $sql .= " AND ".$db->sanitize($field)." NOT LIKE '%PROV%'"; |
| 1341 | 1341 | if ($bentityon) { // only if entity enable |
| 1342 | 1342 | $sql .= " AND entity IN (".getEntity($sharetable).")"; |
@@ -1399,7 +1399,7 @@ discard block |
||
| 1399 | 1399 | // Get counter in database |
| 1400 | 1400 | $maskrefclient_sql = "SELECT MAX(".$maskrefclient_sqlstring.") as val"; |
| 1401 | 1401 | $maskrefclient_sql .= " FROM ".MAIN_DB_PREFIX.$table; |
| 1402 | - $maskrefclient_sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskrefclient_maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'"; |
|
| 1402 | + $maskrefclient_sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskrefclient_maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'"; |
|
| 1403 | 1403 | if ($bentityon) { // only if entity enable |
| 1404 | 1404 | $maskrefclient_sql .= " AND entity IN (".getEntity($sharetable).")"; |
| 1405 | 1405 | } elseif (!empty($forceentity)) { |
@@ -3030,7 +3030,7 @@ discard block |
||
| 3030 | 3030 | $string = trim($string); |
| 3031 | 3031 | |
| 3032 | 3032 | // If string does not start and end with parenthesis, we return $string as is. |
| 3033 | - if (! preg_match('/^\(.*\)$/', $string)) { |
|
| 3033 | + if (!preg_match('/^\(.*\)$/', $string)) { |
|
| 3034 | 3034 | return $string; |
| 3035 | 3035 | } |
| 3036 | 3036 | |
@@ -3068,15 +3068,15 @@ discard block |
||
| 3068 | 3068 | function getArrayOfEmojiBis() |
| 3069 | 3069 | { |
| 3070 | 3070 | $arrayofcommonemoji = array( |
| 3071 | - 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
| 3072 | - 'ding' => array('2700', '27BF'), // Dingbats |
|
| 3073 | - '????' => array('9989', '9989'), // Variation Selectors |
|
| 3074 | - 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
| 3075 | - 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
| 3076 | - 'emot' => array('1F600', '1F64F'), // Emoticons |
|
| 3077 | - 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
| 3078 | - 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
| 3079 | - 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
| 3071 | + 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
| 3072 | + 'ding' => array('2700', '27BF'), // Dingbats |
|
| 3073 | + '????' => array('9989', '9989'), // Variation Selectors |
|
| 3074 | + 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
| 3075 | + 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
| 3076 | + 'emot' => array('1F600', '1F64F'), // Emoticons |
|
| 3077 | + 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
| 3078 | + 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
| 3079 | + 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
| 3080 | 3080 | ); |
| 3081 | 3081 | |
| 3082 | 3082 | return $arrayofcommonemoji; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | { |
| 105 | 105 | global $db, $langs; |
| 106 | 106 | |
| 107 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; |
|
| 107 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; |
|
| 108 | 108 | |
| 109 | 109 | $bookkeeping = new BookKeeping($db); |
| 110 | 110 | $bookkeeping->initAsSpecimen(); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | // Get entities |
| 142 | 142 | //$entity = getEntity('accountingbookkeeping', 1, $object); |
| 143 | - $entity = $conf->entity; // In accountancy, we can't share entities |
|
| 143 | + $entity = $conf->entity; // In accountancy, we can't share entities |
|
| 144 | 144 | |
| 145 | 145 | $numFinal = get_next_value($db, $mask, 'accounting_bookkeeping', 'ref', '', '', $object->doc_date, 'next', false, null, $entity, $object); |
| 146 | 146 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | // Get entities |
| 126 | 126 | //$entity = getEntity('invoicenumber', 1, $object); |
| 127 | - $entity = $conf->entity; // In accountancy, we never share entities |
|
| 127 | + $entity = $conf->entity; // In accountancy, we never share entities |
|
| 128 | 128 | $numFinal = get_next_value($db, $mask, 'facture', 'ref', $where, null, (empty($object) ? dol_now() : $object->date), $mode, false, null, $entity, $object); |
| 129 | 129 | if (!preg_match('/([0-9])+/', $numFinal)) { |
| 130 | 130 | $this->error = $numFinal; |
@@ -146,6 +146,6 @@ discard block |
||
| 146 | 146 | $docYear = (int) dol_print_date($object->doc_date, '%Y'); |
| 147 | 147 | $docMonth = (int) dol_print_date($object->doc_date, '%m'); |
| 148 | 148 | $docFiscalYear = $docMonth < $fiscalStartMonth ? ($docYear - 1) : $docYear; |
| 149 | - return $docFiscalYear . str_pad($object->code_journal, 3, "0", STR_PAD_LEFT); |
|
| 149 | + return $docFiscalYear.str_pad($object->code_journal, 3, "0", STR_PAD_LEFT); |
|
| 150 | 150 | } |
| 151 | 151 | } |
@@ -34,17 +34,17 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | // Load Dolibarr environment |
| 36 | 36 | require '../../main.inc.php'; |
| 37 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php'; |
|
| 38 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; |
|
| 39 | -require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 40 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
| 37 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php'; |
|
| 38 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; |
|
| 39 | +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 40 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
| 41 | 41 | if (isModEnabled('project')) { |
| 42 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 42 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 43 | 43 | } |
| 44 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 45 | -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 46 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; |
|
| 47 | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
| 44 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 45 | +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 46 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; |
|
| 47 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * @var Conf $conf |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | $cancel = GETPOST('cancel', 'alpha'); |
| 66 | 66 | $toselect = GETPOST('toselect', 'array'); |
| 67 | 67 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'supplierinvoicetemplatelist'; // To manage different context of search |
| 68 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 69 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 68 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 69 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | $id = (GETPOSTINT('facid') ? GETPOSTINT('facid') : GETPOSTINT('id')); |
@@ -95,10 +95,10 @@ discard block |
||
| 95 | 95 | $page = 0; |
| 96 | 96 | } // If $page is not defined, or '' or -1 |
| 97 | 97 | $offset = $limit * $page; |
| 98 | -if (! $sortorder) { |
|
| 98 | +if (!$sortorder) { |
|
| 99 | 99 | $sortorder = 'DESC'; |
| 100 | 100 | } |
| 101 | -if (! $sortfield) { |
|
| 101 | +if (!$sortfield) { |
|
| 102 | 102 | $sortfield = 'f.titre'; |
| 103 | 103 | } |
| 104 | 104 | $pageprev = $page - 1; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $object = new FactureFournisseurRec($db); |
| 108 | 108 | if (($id > 0 || $title) && $action != 'create' && $action != 'add') { |
| 109 | 109 | $ret = $object->fetch($id, $title); |
| 110 | - if (! $ret) { |
|
| 110 | + if (!$ret) { |
|
| 111 | 111 | setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors'); |
| 112 | 112 | } |
| 113 | 113 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $now = dol_now(); |
| 147 | 147 | |
| 148 | 148 | $error = 0; |
| 149 | -$predef = ''; // Legacy? Used in several cards, always '' |
|
| 149 | +$predef = ''; // Legacy? Used in several cards, always '' |
|
| 150 | 150 | |
| 151 | 151 | // Security check |
| 152 | 152 | $result = restrictedArea($user, 'supplier_invoicerec', $object->id, $objecttype); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $cancel = ''; |
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | -if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { |
|
| 168 | +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { |
|
| 169 | 169 | $massaction = ''; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -181,18 +181,18 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | // Selection of new fields |
| 184 | - include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
| 184 | + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
| 185 | 185 | |
| 186 | 186 | // Set note |
| 187 | - include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' |
|
| 187 | + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' |
|
| 188 | 188 | |
| 189 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 189 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 190 | 190 | |
| 191 | - include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
| 191 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
| 192 | 192 | |
| 193 | 193 | // Create predefined invoice |
| 194 | 194 | if ($action == 'add' && $permissiontoadd) { |
| 195 | - if (! GETPOST('title', 'alphanohtml')) { |
|
| 195 | + if (!GETPOST('title', 'alphanohtml')) { |
|
| 196 | 196 | setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors'); |
| 197 | 197 | $action = "create"; |
| 198 | 198 | $error++; |
@@ -215,10 +215,10 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - if (! $error) { |
|
| 218 | + if (!$error) { |
|
| 219 | 219 | $object->subtype = GETPOSTINT('subtype'); |
| 220 | 220 | $object->title = GETPOST('title', 'alphanohtml'); |
| 221 | - $object->libelle = GETPOST('libelle', 'alpha'); // deprecated |
|
| 221 | + $object->libelle = GETPOST('libelle', 'alpha'); // deprecated |
|
| 222 | 222 | $object->label = GETPOST('libelle', 'alpha'); |
| 223 | 223 | $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); |
| 224 | 224 | |
@@ -266,10 +266,10 @@ discard block |
||
| 266 | 266 | $action = "create"; |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - if (! $error) { |
|
| 269 | + if (!$error) { |
|
| 270 | 270 | $db->commit(); |
| 271 | 271 | |
| 272 | - header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id); |
|
| 272 | + header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id); |
|
| 273 | 273 | exit; |
| 274 | 274 | } else { |
| 275 | 275 | $db->rollback(); |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $permissiontodelete) { |
| 285 | 285 | $object->delete($user); |
| 286 | 286 | |
| 287 | - header('Location: ' . DOL_URL_ROOT . '/fourn/facture/list-rec.php'); |
|
| 287 | + header('Location: '.DOL_URL_ROOT.'/fourn/facture/list-rec.php'); |
|
| 288 | 288 | exit; |
| 289 | 289 | } |
| 290 | 290 | |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | $result = $object->setValueFrom('titre', $title, '', null, 'text', '', $user); |
| 315 | 315 | |
| 316 | 316 | if ($result > 0) { |
| 317 | - $object->titre = $title; // deprecated |
|
| 317 | + $object->titre = $title; // deprecated |
|
| 318 | 318 | $object->title = $title; |
| 319 | 319 | $object->ref = $object->title; |
| 320 | 320 | } else { |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | $error++; |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | - if (! $error) { |
|
| 364 | + if (!$error) { |
|
| 365 | 365 | $db->commit(); |
| 366 | 366 | } else { |
| 367 | 367 | $db->rollback(); |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | $error++; |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | - if (! $error) { |
|
| 383 | + if (!$error) { |
|
| 384 | 384 | $db->commit(); |
| 385 | 385 | } else { |
| 386 | 386 | $db->rollback(); |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | setEventMessages($line->error, $line->errors, 'errors'); |
| 432 | 432 | } |
| 433 | 433 | } elseif ($action == 'update_extras' && $permissiontoeditextra) { |
| 434 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 434 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 435 | 435 | |
| 436 | 436 | $attribute_name = GETPOST('attribute', 'aZ09'); |
| 437 | 437 | |
@@ -474,9 +474,9 @@ discard block |
||
| 474 | 474 | $tva_tx = ''; |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - $qty = GETPOST('qty' . $predef, 'alpha'); |
|
| 478 | - $qty = ($qty === '') ? '' : (float) price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2); |
|
| 479 | - $remise_percent = price2num(GETPOST('remise_percent' . $predef), '', 2); |
|
| 477 | + $qty = GETPOST('qty'.$predef, 'alpha'); |
|
| 478 | + $qty = ($qty === '') ? '' : (float) price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2); |
|
| 479 | + $remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2); |
|
| 480 | 480 | |
| 481 | 481 | // Extrafields |
| 482 | 482 | $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | if (is_array($extralabelsline)) { |
| 486 | 486 | // Get extra fields |
| 487 | 487 | foreach ($extralabelsline as $key => $value) { |
| 488 | - unset($_POST["options_" . $key . $predef]); |
|
| 488 | + unset($_POST["options_".$key.$predef]); |
|
| 489 | 489 | } |
| 490 | 490 | } |
| 491 | 491 | |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); |
| 498 | 498 | $error++; |
| 499 | 499 | } |
| 500 | - if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (! ($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' |
|
| 500 | + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (!($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' |
|
| 501 | 501 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); |
| 502 | 502 | $error++; |
| 503 | 503 | } |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | } |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | - if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { |
|
| 550 | + if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { |
|
| 551 | 551 | $ret = $object->fetch($id); |
| 552 | 552 | if ($ret < 0) { |
| 553 | 553 | dol_print_error($db, $object->error); |
@@ -556,8 +556,8 @@ discard block |
||
| 556 | 556 | $ret = $object->fetch_thirdparty(); |
| 557 | 557 | |
| 558 | 558 | // Clean parameters |
| 559 | - $date_start = dol_mktime(GETPOSTINT('date_start' . $predef . 'hour'), GETPOSTINT('date_start' . $predef . 'min'), GETPOSTINT('date_start' . $predef . 'sec'), GETPOSTINT('date_start' . $predef . 'month'), GETPOSTINT('date_start' . $predef . 'day'), GETPOSTINT('date_start' . $predef . 'year')); |
|
| 560 | - $date_end = dol_mktime(GETPOSTINT('date_end' . $predef . 'hour'), GETPOSTINT('date_end' . $predef . 'min'), GETPOSTINT('date_end' . $predef . 'sec'), GETPOSTINT('date_end' . $predef . 'month'), GETPOSTINT('date_end' . $predef . 'day'), GETPOSTINT('date_end' . $predef . 'year')); |
|
| 559 | + $date_start = dol_mktime(GETPOSTINT('date_start'.$predef.'hour'), GETPOSTINT('date_start'.$predef.'min'), GETPOSTINT('date_start'.$predef.'sec'), GETPOSTINT('date_start'.$predef.'month'), GETPOSTINT('date_start'.$predef.'day'), GETPOSTINT('date_start'.$predef.'year')); |
|
| 560 | + $date_end = dol_mktime(GETPOSTINT('date_end'.$predef.'hour'), GETPOSTINT('date_end'.$predef.'min'), GETPOSTINT('date_end'.$predef.'sec'), GETPOSTINT('date_end'.$predef.'month'), GETPOSTINT('date_end'.$predef.'day'), GETPOSTINT('date_end'.$predef.'year')); |
|
| 561 | 561 | $price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); |
| 562 | 562 | |
| 563 | 563 | // Define special_code for special lines |
@@ -643,23 +643,23 @@ discard block |
||
| 643 | 643 | // Define output language |
| 644 | 644 | if (getDolGlobalInt('MAIN_MULTILANGS') && getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
| 645 | 645 | if (!empty($prod->customcode)) { |
| 646 | - $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode; |
|
| 646 | + $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode; |
|
| 647 | 647 | } |
| 648 | 648 | if (!empty($prod->customcode) && !empty($prod->country_code)) { |
| 649 | 649 | $tmptxt .= ' - '; |
| 650 | 650 | } |
| 651 | 651 | if (!empty($prod->country_code)) { |
| 652 | - $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0); |
|
| 652 | + $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0); |
|
| 653 | 653 | } |
| 654 | 654 | } else { |
| 655 | 655 | if (!empty($prod->customcode)) { |
| 656 | - $tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode; |
|
| 656 | + $tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode; |
|
| 657 | 657 | } |
| 658 | 658 | if (!empty($prod->customcode) && !empty($prod->country_code)) { |
| 659 | 659 | $tmptxt .= ' - '; |
| 660 | 660 | } |
| 661 | 661 | if (!empty($prod->country_code)) { |
| 662 | - $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0); |
|
| 662 | + $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0); |
|
| 663 | 663 | } |
| 664 | 664 | } |
| 665 | 665 | $tmptxt .= ')'; |
@@ -685,8 +685,8 @@ discard block |
||
| 685 | 685 | $date_end_fill = GETPOSTINT('date_end_fill'); |
| 686 | 686 | |
| 687 | 687 | // Margin |
| 688 | - $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); |
|
| 689 | - $buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value |
|
| 688 | + $fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); |
|
| 689 | + $buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value |
|
| 690 | 690 | |
| 691 | 691 | // Local Taxes |
| 692 | 692 | $localtax1_tx = get_localtax((string) $tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); |
@@ -753,8 +753,8 @@ discard block |
||
| 753 | 753 | $action = ''; |
| 754 | 754 | } |
| 755 | 755 | } |
| 756 | - } elseif ($action == 'updateline' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) { |
|
| 757 | - if (! $object->fetch($id) > 0) { |
|
| 756 | + } elseif ($action == 'updateline' && $permissiontoadd && !GETPOST('cancel', 'alpha')) { |
|
| 757 | + if (!$object->fetch($id) > 0) { |
|
| 758 | 758 | dol_print_error($db); |
| 759 | 759 | } |
| 760 | 760 | $object->fetch_thirdparty(); |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | $objectline->array_options = $array_options; |
| 791 | 791 | $result = $objectline->insertExtraFields(); |
| 792 | 792 | if ($result < 0) { |
| 793 | - setEventMessages($langs->trans('Error') . $result, null, 'errors'); |
|
| 793 | + setEventMessages($langs->trans('Error').$result, null, 'errors'); |
|
| 794 | 794 | } |
| 795 | 795 | } |
| 796 | 796 | |
@@ -800,13 +800,13 @@ discard block |
||
| 800 | 800 | if (is_array($extralabelsline)) { |
| 801 | 801 | // Get extra fields |
| 802 | 802 | foreach ($extralabelsline as $key => $value) { |
| 803 | - unset($_POST["options_" . $key]); |
|
| 803 | + unset($_POST["options_".$key]); |
|
| 804 | 804 | } |
| 805 | 805 | } |
| 806 | 806 | |
| 807 | 807 | // Define special_code for special lines |
| 808 | 808 | $special_code = GETPOSTINT('special_code'); |
| 809 | - if (! GETPOST('qty', 'alpha')) { |
|
| 809 | + if (!GETPOST('qty', 'alpha')) { |
|
| 810 | 810 | $special_code = 3; |
| 811 | 811 | } |
| 812 | 812 | |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | $date_end_fill = GETPOSTINT('date_end_fill'); |
| 853 | 853 | |
| 854 | 854 | // Update line |
| 855 | - if (! $error) { |
|
| 855 | + if (!$error) { |
|
| 856 | 856 | $result = $object->updateline(GETPOSTINT('lineid'), GETPOSTINT('productid'), $ref_fourn, $label, $description, (float) $pu_ht, (float) $qty, $remise_percent, (float) $vat_rate, $localtax1_rate, $localtax1_rate, 'HT', $type, $date_start_fill, $date_end_fill, $info_bits, $special_code, -1); |
| 857 | 857 | if ($result >= 0) { |
| 858 | 858 | $object->fetch($object->id); // Reload lines |
@@ -929,10 +929,10 @@ discard block |
||
| 929 | 929 | if ($object->fetch($id, $ref) > 0) { |
| 930 | 930 | $result = $object->fetch_lines(); |
| 931 | 931 | |
| 932 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; |
|
| 933 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 932 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
| 933 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 934 | 934 | print '<input type="hidden" name="action" value="add">'; |
| 935 | - print '<input type="hidden" name="facid" value="' . $object->id . '">'; |
|
| 935 | + print '<input type="hidden" name="facid" value="'.$object->id.'">'; |
|
| 936 | 936 | |
| 937 | 937 | print dol_get_fiche_head([], '', '', 0); |
| 938 | 938 | |
@@ -949,17 +949,17 @@ discard block |
||
| 949 | 949 | $object->fetch_thirdparty(); |
| 950 | 950 | |
| 951 | 951 | // Title |
| 952 | - print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("Title") . '</td><td>'; |
|
| 953 | - print '<input class="flat quatrevingtpercent" type="text" name="title" value="' . dol_escape_htmltag(GETPOST("title", 'alphanohtml')) . '" autofocus>'; |
|
| 952 | + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Title").'</td><td>'; |
|
| 953 | + print '<input class="flat quatrevingtpercent" type="text" name="title" value="'.dol_escape_htmltag(GETPOST("title", 'alphanohtml')).'" autofocus>'; |
|
| 954 | 954 | print '</td></tr>'; |
| 955 | 955 | |
| 956 | 956 | // Ref supplier |
| 957 | - print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("RefSupplier") . '</td><td>'; |
|
| 958 | - print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="' . $object->ref_supplier . '">'; |
|
| 957 | + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("RefSupplier").'</td><td>'; |
|
| 958 | + print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="'.$object->ref_supplier.'">'; |
|
| 959 | 959 | print '</td></tr>'; |
| 960 | 960 | |
| 961 | 961 | // Third party |
| 962 | - print '<tr><td class="titlefieldcreate">' . $langs->trans("Supplier") . '</td><td>' . $object->thirdparty->getNomUrl(1, 'supplier') . '</td>'; |
|
| 962 | + print '<tr><td class="titlefieldcreate">'.$langs->trans("Supplier").'</td><td>'.$object->thirdparty->getNomUrl(1, 'supplier').'</td>'; |
|
| 963 | 963 | print '</tr>'; |
| 964 | 964 | |
| 965 | 965 | // Invoice subtype |
@@ -975,42 +975,42 @@ discard block |
||
| 975 | 975 | // Help for substitution key |
| 976 | 976 | $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); |
| 977 | 977 | |
| 978 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m') . ')'; |
|
| 979 | - $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%m') . ')'; |
|
| 980 | - $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m') . ')'; |
|
| 981 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B') . ')'; |
|
| 982 | - $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%B') . ')'; |
|
| 983 | - $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B') . ')'; |
|
| 984 | - $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y') . ')'; |
|
| 985 | - $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%Y') . ')'; |
|
| 986 | - $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y') . ')'; |
|
| 978 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m').')'; |
|
| 979 | + $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%m').')'; |
|
| 980 | + $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m').')'; |
|
| 981 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B').')'; |
|
| 982 | + $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%B').')'; |
|
| 983 | + $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')'; |
|
| 984 | + $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y').')'; |
|
| 985 | + $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%Y').')'; |
|
| 986 | + $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y').')'; |
|
| 987 | 987 | // Only on template invoices |
| 988 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' .dol_print_date($object->date_when, 'dayhour') . ')' : ''); |
|
| 989 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour') . ')' : ''); |
|
| 988 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')' : ''); |
|
| 989 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')' : ''); |
|
| 990 | 990 | $substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count"); |
| 991 | 991 | $substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber"); |
| 992 | 992 | |
| 993 | - $htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>'; |
|
| 993 | + $htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; |
|
| 994 | 994 | foreach ($substitutionarray as $key => $val) { |
| 995 | - $htmltext .= $key . ' = ' . $langs->trans($val) . '<br>'; |
|
| 995 | + $htmltext .= $key.' = '.$langs->trans($val).'<br>'; |
|
| 996 | 996 | } |
| 997 | 997 | $htmltext .= '</i>'; |
| 998 | 998 | |
| 999 | 999 | // Label |
| 1000 | - print '<tr><td class="titlefieldcreate">' . $langs->trans("Label") . '</td><td>'; |
|
| 1001 | - print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="' . $object->label . '">'; |
|
| 1000 | + print '<tr><td class="titlefieldcreate">'.$langs->trans("Label").'</td><td>'; |
|
| 1001 | + print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="'.$object->label.'">'; |
|
| 1002 | 1002 | print '</td></tr>'; |
| 1003 | 1003 | |
| 1004 | 1004 | // Author |
| 1005 | - print "<tr><td>" . $langs->trans("Author") . "</td><td>" . $user->getFullName($langs) . "</td></tr>"; |
|
| 1005 | + print "<tr><td>".$langs->trans("Author")."</td><td>".$user->getFullName($langs)."</td></tr>"; |
|
| 1006 | 1006 | |
| 1007 | 1007 | // Payment term |
| 1008 | - print "<tr><td>" . $langs->trans("PaymentConditions") . "</td><td>"; |
|
| 1008 | + print "<tr><td>".$langs->trans("PaymentConditions")."</td><td>"; |
|
| 1009 | 1009 | print $form->getSelectConditionsPaiements(GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $object->cond_reglement_id, 'cond_reglement_id', -1, 0, 0, ''); |
| 1010 | 1010 | print "</td></tr>"; |
| 1011 | 1011 | |
| 1012 | 1012 | // Payment mode |
| 1013 | - print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>"; |
|
| 1013 | + print "<tr><td>".$langs->trans("PaymentMode")."</td><td>"; |
|
| 1014 | 1014 | print img_picto('', 'payment', 'class="pictofixedwidth"'); |
| 1015 | 1015 | print $form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $object->mode_reglement_id, 'mode_reglement_id', '', 0, 1, 0, 0, 1, '', 1); |
| 1016 | 1016 | print "</td></tr>"; |
@@ -1019,16 +1019,16 @@ discard block |
||
| 1019 | 1019 | if (isModEnabled('project') && $formproject !== null && is_object($object->thirdparty) && $object->thirdparty->id > 0) { |
| 1020 | 1020 | $projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project; |
| 1021 | 1021 | $langs->load('projects'); |
| 1022 | - print '<tr><td>' . $langs->trans('Project') . '</td><td>'; |
|
| 1022 | + print '<tr><td>'.$langs->trans('Project').'</td><td>'; |
|
| 1023 | 1023 | $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''); |
| 1024 | - 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>'; |
|
| 1024 | + 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>'; |
|
| 1025 | 1025 | print '</td></tr>'; |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | 1028 | // Bank account |
| 1029 | 1029 | if ($object->fk_account > 0) { |
| 1030 | - print "<tr><td>" . $langs->trans('BankAccount') . "</td><td>"; |
|
| 1031 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none'); |
|
| 1030 | + print "<tr><td>".$langs->trans('BankAccount')."</td><td>"; |
|
| 1031 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none'); |
|
| 1032 | 1032 | print "</td></tr>"; |
| 1033 | 1033 | } |
| 1034 | 1034 | |
@@ -1045,8 +1045,8 @@ discard block |
||
| 1045 | 1045 | print $object->showOptionals($extrafields, 'create', $parameters); |
| 1046 | 1046 | |
| 1047 | 1047 | // Model pdf |
| 1048 | - print "<tr><td>" . $langs->trans('Model') . "</td><td>"; |
|
| 1049 | - include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
| 1048 | + print "<tr><td>".$langs->trans('Model')."</td><td>"; |
|
| 1049 | + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
| 1050 | 1050 | $list = ModelePDFSuppliersInvoices::liste_modeles($db); |
| 1051 | 1051 | print $form->selectarray('modelpdf', $list, $conf->global->INVOICE_SUPPLIER_ADDON_PDF); |
| 1052 | 1052 | print "</td></tr>"; |
@@ -1078,7 +1078,7 @@ discard block |
||
| 1078 | 1078 | |
| 1079 | 1079 | // Autogeneration |
| 1080 | 1080 | $title = $langs->trans("Recurrence"); |
| 1081 | - print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"') . $title, '', ''); |
|
| 1081 | + print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', ''); |
|
| 1082 | 1082 | |
| 1083 | 1083 | print '<span class="opacitymedium">'.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')).'</span><br><br>'; |
| 1084 | 1084 | |
@@ -1087,30 +1087,30 @@ discard block |
||
| 1087 | 1087 | print '<table class="border centpercent">'; |
| 1088 | 1088 | |
| 1089 | 1089 | // Frequency + unit |
| 1090 | - print '<tr><td class="titlefieldcreate">' . $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')) . "</td><td>"; |
|
| 1091 | - print "<input type='text' class='width50' name='frequency' value='" . GETPOSTINT('frequency') . "' 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')); |
|
| 1090 | + print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'))."</td><td>"; |
|
| 1091 | + print "<input type='text' class='width50' name='frequency' value='".GETPOSTINT('frequency')."' 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')); |
|
| 1092 | 1092 | print "</td></tr>"; |
| 1093 | 1093 | |
| 1094 | 1094 | // Date next run |
| 1095 | - print "<tr><td>" . $langs->trans('NextDateToExecution') . "</td><td>"; |
|
| 1095 | + print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>"; |
|
| 1096 | 1096 | $date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOSTINT('remonth') ? dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')) : -1); |
| 1097 | 1097 | print $form->selectDate($date_next_execution, '', 1, 1, 0, "add", 1, 1); |
| 1098 | 1098 | print "</td></tr>"; |
| 1099 | 1099 | |
| 1100 | 1100 | // Number max of generation |
| 1101 | - print "<tr><td>" . $langs->trans("MaxPeriodNumber") . "</td><td>"; |
|
| 1102 | - print '<input type="text" class="width50" name="nb_gen_max" value="' . GETPOSTINT('nb_gen_max') . '">'; |
|
| 1101 | + print "<tr><td>".$langs->trans("MaxPeriodNumber")."</td><td>"; |
|
| 1102 | + print '<input type="text" class="width50" name="nb_gen_max" value="'.GETPOSTINT('nb_gen_max').'">'; |
|
| 1103 | 1103 | print "</td></tr>"; |
| 1104 | 1104 | |
| 1105 | 1105 | // Auto validate the invoice |
| 1106 | - print "<tr><td>" . $langs->trans("StatusOfAutoGeneratedInvoices") . "</td><td>"; |
|
| 1106 | + print "<tr><td>".$langs->trans("StatusOfAutoGeneratedInvoices")."</td><td>"; |
|
| 1107 | 1107 | $select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated')); |
| 1108 | 1108 | print $form->selectarray('auto_validate', $select, GETPOSTINT('auto_validate')); |
| 1109 | 1109 | print "</td></tr>"; |
| 1110 | 1110 | |
| 1111 | 1111 | // Auto generate document |
| 1112 | 1112 | if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) { |
| 1113 | - print "<tr><td>" . $langs->trans("StatusOfGeneratedDocuments") . "</td><td>"; |
|
| 1113 | + print "<tr><td>".$langs->trans("StatusOfGeneratedDocuments")."</td><td>"; |
|
| 1114 | 1114 | $select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc')); |
| 1115 | 1115 | print $form->selectarray('generate_pdf', $select, GETPOSTINT('generate_pdf')); |
| 1116 | 1116 | print "</td></tr>"; |
@@ -1153,7 +1153,7 @@ discard block |
||
| 1153 | 1153 | |
| 1154 | 1154 | print "</form>\n"; |
| 1155 | 1155 | } else { |
| 1156 | - dol_print_error(null, "Error, no invoice " . $object->id); |
|
| 1156 | + dol_print_error(null, "Error, no invoice ".$object->id); |
|
| 1157 | 1157 | } |
| 1158 | 1158 | } else { |
| 1159 | 1159 | // View mode |
@@ -1165,12 +1165,12 @@ discard block |
||
| 1165 | 1165 | |
| 1166 | 1166 | // Confirmation of deletion of product line |
| 1167 | 1167 | if ($action == 'ask_deleteline') { |
| 1168 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); |
|
| 1168 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); |
|
| 1169 | 1169 | } |
| 1170 | 1170 | |
| 1171 | 1171 | // Confirm delete of repeatable invoice |
| 1172 | 1172 | if ($action == 'ask_deleteinvoice') { |
| 1173 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); |
|
| 1173 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); |
|
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | 1176 | print $formconfirm; |
@@ -1184,7 +1184,7 @@ discard block |
||
| 1184 | 1184 | |
| 1185 | 1185 | // Recurring invoice content |
| 1186 | 1186 | |
| 1187 | - $linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/list-rec.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans('BackToList') . '</a>'; |
|
| 1187 | + $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list-rec.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans('BackToList').'</a>'; |
|
| 1188 | 1188 | |
| 1189 | 1189 | $morehtmlref = ''; |
| 1190 | 1190 | if ($action != 'edittitle') { |
@@ -1197,33 +1197,33 @@ discard block |
||
| 1197 | 1197 | $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, (int) $usercancreate, 'string', '', 0, 1); |
| 1198 | 1198 | $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); |
| 1199 | 1199 | // Thirdparty |
| 1200 | - $morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); |
|
| 1200 | + $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); |
|
| 1201 | 1201 | |
| 1202 | 1202 | // Project |
| 1203 | 1203 | if (isModEnabled('project') && $formproject !== null) { |
| 1204 | 1204 | $langs->load('projects'); |
| 1205 | - $morehtmlref .= '<br>' . $langs->trans('Project') . ' '; |
|
| 1205 | + $morehtmlref .= '<br>'.$langs->trans('Project').' '; |
|
| 1206 | 1206 | if ($usercancreate) { |
| 1207 | 1207 | if ($action != 'classify') { |
| 1208 | - $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; |
|
| 1208 | + $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : '; |
|
| 1209 | 1209 | } |
| 1210 | 1210 | if ($action == 'classify') { |
| 1211 | - $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">'; |
|
| 1211 | + $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; |
|
| 1212 | 1212 | $morehtmlref .= '<input type="hidden" name="action" value="classin">'; |
| 1213 | - $morehtmlref .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1213 | + $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1214 | 1214 | $morehtmlref .= $formproject->select_projects($object->socid, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); |
| 1215 | - $morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 1215 | + $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 1216 | 1216 | $morehtmlref .= '</form>'; |
| 1217 | 1217 | } else { |
| 1218 | - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); |
|
| 1218 | + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); |
|
| 1219 | 1219 | } |
| 1220 | 1220 | } else { |
| 1221 | 1221 | if (!empty($object->fk_project)) { |
| 1222 | 1222 | $project = new Project($db); |
| 1223 | 1223 | $project->fetch($object->fk_project); |
| 1224 | - $morehtmlref .= ' : ' . $project->getNomUrl(1); |
|
| 1224 | + $morehtmlref .= ' : '.$project->getNomUrl(1); |
|
| 1225 | 1225 | if ($project->title) { |
| 1226 | - $morehtmlref .= ' - ' . $project->title; |
|
| 1226 | + $morehtmlref .= ' - '.$project->title; |
|
| 1227 | 1227 | } |
| 1228 | 1228 | } else { |
| 1229 | 1229 | $morehtmlref .= ''; |
@@ -1250,14 +1250,14 @@ discard block |
||
| 1250 | 1250 | } |
| 1251 | 1251 | |
| 1252 | 1252 | // Author |
| 1253 | - print '<tr><td class="titlefield">' . $langs->trans('Author') . '</td><td>'; |
|
| 1253 | + print '<tr><td class="titlefield">'.$langs->trans('Author').'</td><td>'; |
|
| 1254 | 1254 | print $author->getNomUrl(-1); |
| 1255 | 1255 | print "</td></tr>"; |
| 1256 | 1256 | |
| 1257 | 1257 | // Label |
| 1258 | 1258 | print '<tr>'; |
| 1259 | - print '<td>' . $form->editfieldkey("Label", 'libelle', $object->libelle, $object, (int) $usercancreate) . '</td>'; |
|
| 1260 | - print '<td>' . $form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>'; |
|
| 1259 | + print '<td>'.$form->editfieldkey("Label", 'libelle', $object->libelle, $object, (int) $usercancreate).'</td>'; |
|
| 1260 | + print '<td>'.$form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>'; |
|
| 1261 | 1261 | print '</tr>'; |
| 1262 | 1262 | |
| 1263 | 1263 | // Payment term |
@@ -1266,14 +1266,14 @@ discard block |
||
| 1266 | 1266 | print $langs->trans('PaymentConditionsShort'); |
| 1267 | 1267 | print '</td>'; |
| 1268 | 1268 | if ($action != 'editconditions' && $usercancreate) { |
| 1269 | - 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>'; |
|
| 1269 | + 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>'; |
|
| 1270 | 1270 | } |
| 1271 | 1271 | print '</tr></table>'; |
| 1272 | 1272 | print '</td><td>'; |
| 1273 | 1273 | if ($action == 'editconditions') { |
| 1274 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id'); |
|
| 1274 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id'); |
|
| 1275 | 1275 | } else { |
| 1276 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, (string) $object->cond_reglement_id, 'none'); |
|
| 1276 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, (string) $object->cond_reglement_id, 'none'); |
|
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | 1279 | print '</td></tr>'; |
@@ -1284,14 +1284,14 @@ discard block |
||
| 1284 | 1284 | print $langs->trans('PaymentMode'); |
| 1285 | 1285 | print '</td>'; |
| 1286 | 1286 | if ($action != 'editmode' && $usercancreate) { |
| 1287 | - 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>'; |
|
| 1287 | + 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>'; |
|
| 1288 | 1288 | } |
| 1289 | 1289 | print '</tr></table>'; |
| 1290 | 1290 | print '</td><td>'; |
| 1291 | 1291 | if ($action == 'editmode') { |
| 1292 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); |
|
| 1292 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); |
|
| 1293 | 1293 | } else { |
| 1294 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, (string) $object->mode_reglement_id, 'none'); |
|
| 1294 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, (string) $object->mode_reglement_id, 'none'); |
|
| 1295 | 1295 | } |
| 1296 | 1296 | print '</td></tr>'; |
| 1297 | 1297 | |
@@ -1301,14 +1301,14 @@ discard block |
||
| 1301 | 1301 | print $langs->trans('BankAccount'); |
| 1302 | 1302 | print '<td>'; |
| 1303 | 1303 | if ($action != 'editbankaccount' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) { |
| 1304 | - 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>'; |
|
| 1304 | + 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>'; |
|
| 1305 | 1305 | } |
| 1306 | 1306 | print '</tr></table>'; |
| 1307 | 1307 | print '</td><td>'; |
| 1308 | 1308 | if ($action == 'editbankaccount') { |
| 1309 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1); |
|
| 1309 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1); |
|
| 1310 | 1310 | } else { |
| 1311 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none'); |
|
| 1311 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none'); |
|
| 1312 | 1312 | } |
| 1313 | 1313 | print "</td>"; |
| 1314 | 1314 | print '</tr>'; |
@@ -1322,18 +1322,18 @@ discard block |
||
| 1322 | 1322 | print $langs->trans('Model'); |
| 1323 | 1323 | print '<td>'; |
| 1324 | 1324 | if ($action != 'editmodelpdf' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) { |
| 1325 | - 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>'; |
|
| 1325 | + 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>'; |
|
| 1326 | 1326 | } |
| 1327 | 1327 | print '</tr></table>'; |
| 1328 | 1328 | print '</td><td>'; |
| 1329 | 1329 | if ($action == 'editmodelpdf') { |
| 1330 | - include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
| 1330 | + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
| 1331 | 1331 | $list = array(); |
| 1332 | 1332 | $models = ModelePDFSuppliersInvoices::liste_modeles($db); |
| 1333 | 1333 | foreach ($models as $k => $model) { |
| 1334 | - $list[] = str_replace(':', '|', $k) . ':' . $model; |
|
| 1334 | + $list[] = str_replace(':', '|', $k).':'.$model; |
|
| 1335 | 1335 | } |
| 1336 | - $select = 'select;' . implode(',', $list); |
|
| 1336 | + $select = 'select;'.implode(',', $list); |
|
| 1337 | 1337 | //TODO : Droits |
| 1338 | 1338 | print $form->editfieldval($langs->trans('Model'), 'modelpdf', $object->model_pdf, $object, $usercancreate, $select); |
| 1339 | 1339 | } else { |
@@ -1362,28 +1362,28 @@ discard block |
||
| 1362 | 1362 | include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php'; |
| 1363 | 1363 | |
| 1364 | 1364 | // Amount (excl. tax) |
| 1365 | - print '<tr><td>' . $langs->trans('AmountHT') . '</td>'; |
|
| 1366 | - print '<td>' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 1365 | + print '<tr><td>'.$langs->trans('AmountHT').'</td>'; |
|
| 1366 | + print '<td>'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 1367 | 1367 | print '</tr>'; |
| 1368 | 1368 | |
| 1369 | - print '<tr><td>' . $langs->trans("AmountVAT") . '</td><td>' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 1369 | + print '<tr><td>'.$langs->trans("AmountVAT").'</td><td>'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 1370 | 1370 | print '</tr>'; |
| 1371 | 1371 | |
| 1372 | 1372 | // Amount Local Taxes |
| 1373 | 1373 | if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { // Localtax1 |
| 1374 | - print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 1375 | - print '<td class="nowrap">' . price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>'; |
|
| 1374 | + print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 1375 | + print '<td class="nowrap">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>'; |
|
| 1376 | 1376 | } |
| 1377 | 1377 | if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { // Localtax2 |
| 1378 | - print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 1379 | - print '<td class=nowrap">' . price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>'; |
|
| 1378 | + print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 1379 | + print '<td class=nowrap">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>'; |
|
| 1380 | 1380 | } |
| 1381 | 1381 | |
| 1382 | - print '<tr><td>' . $langs->trans("AmountTTC") . '</td><td colspan="3">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 1382 | + print '<tr><td>'.$langs->trans("AmountTTC").'</td><td colspan="3">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 1383 | 1383 | print '</tr>'; |
| 1384 | 1384 | |
| 1385 | 1385 | |
| 1386 | - print '<tr class="liste_titre"><td colspan="2" class="liste_titre">' . img_picto('', 'recurring', 'class="pictofixedwidth"') . $title . '</td></tr>'; |
|
| 1386 | + print '<tr class="liste_titre"><td colspan="2" class="liste_titre">'.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.'</td></tr>'; |
|
| 1387 | 1387 | |
| 1388 | 1388 | // if "frequency" is empty or = 0, the recurrence is disabled |
| 1389 | 1389 | print '<tr><td style="width: 50%">'; |
@@ -1391,23 +1391,23 @@ discard block |
||
| 1391 | 1391 | print $langs->trans('Frequency'); |
| 1392 | 1392 | print '</td>'; |
| 1393 | 1393 | if ($action != 'editfrequency' && $usercancreate) { |
| 1394 | - 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>'; |
|
| 1394 | + 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>'; |
|
| 1395 | 1395 | } |
| 1396 | 1396 | print '</tr></table>'; |
| 1397 | 1397 | print '</td><td>'; |
| 1398 | 1398 | if ($action == 'editfrequency') { |
| 1399 | - print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '">'; |
|
| 1399 | + print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'">'; |
|
| 1400 | 1400 | print '<input type="hidden" name="action" value="setfrequency">'; |
| 1401 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1401 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1402 | 1402 | print '<table class="nobordernopadding">'; |
| 1403 | 1403 | print '<tr><td>'; |
| 1404 | - 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')); |
|
| 1404 | + 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')); |
|
| 1405 | 1405 | print '</td>'; |
| 1406 | - print '<td class="left"><input type="submit" class="button button-edit" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 1406 | + print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>'; |
|
| 1407 | 1407 | print '</tr></table></form>'; |
| 1408 | 1408 | } else { |
| 1409 | 1409 | if ($object->frequency > 0) { |
| 1410 | - print $langs->trans('FrequencyPer_' . $object->unit_frequency, $object->frequency); |
|
| 1410 | + print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); |
|
| 1411 | 1411 | } else { |
| 1412 | 1412 | print '<span class="opacitymedium">'.$langs->trans("NotARecurringInvoiceTemplate").'</span>'; |
| 1413 | 1413 | } |
@@ -1427,8 +1427,8 @@ discard block |
||
| 1427 | 1427 | print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $usercancreate, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached'); |
| 1428 | 1428 | } |
| 1429 | 1429 | //var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour')); |
| 1430 | - if (! $object->isMaxNbGenReached()) { |
|
| 1431 | - if (! $object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { |
|
| 1430 | + if (!$object->isMaxNbGenReached()) { |
|
| 1431 | + if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { |
|
| 1432 | 1432 | print img_warning($langs->trans("Late")); |
| 1433 | 1433 | } |
| 1434 | 1434 | } else { |
@@ -1461,7 +1461,7 @@ discard block |
||
| 1461 | 1461 | print $langs->trans("StatusOfAutoGeneratedInvoices"); |
| 1462 | 1462 | } |
| 1463 | 1463 | print '</td><td>'; |
| 1464 | - $select = 'select;0:' . $langs->trans('BillStatusDraft') . ',1:' . $langs->trans('BillStatusValidated'); |
|
| 1464 | + $select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated'); |
|
| 1465 | 1465 | if ($action == 'auto_validate' || $object->frequency > 0) { |
| 1466 | 1466 | print $form->editfieldval($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select); |
| 1467 | 1467 | } |
@@ -1477,7 +1477,7 @@ discard block |
||
| 1477 | 1477 | } |
| 1478 | 1478 | print '</td>'; |
| 1479 | 1479 | print '<td>'; |
| 1480 | - $select = 'select;0:' . $langs->trans('DoNotGenerateDoc') . ',1:' . $langs->trans('AutogenerateDoc'); |
|
| 1480 | + $select = 'select;0:'.$langs->trans('DoNotGenerateDoc').',1:'.$langs->trans('AutogenerateDoc'); |
|
| 1481 | 1481 | if ($action == 'generate_pdf' || $object->frequency > 0) { |
| 1482 | 1482 | print $form->editfieldval($langs->trans("StatusOfGeneratedDocuments"), 'generate_pdf', $object->generate_pdf, $object, $usercancreate, $select); |
| 1483 | 1483 | } |
@@ -1502,7 +1502,7 @@ discard block |
||
| 1502 | 1502 | print '<table class="border centpercent tableforfield">'; |
| 1503 | 1503 | |
| 1504 | 1504 | // Nb of generation already done |
| 1505 | - print '<tr><td style="width: 50%">' . $langs->trans("NbOfGenerationDone") . '</td>'; |
|
| 1505 | + print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>'; |
|
| 1506 | 1506 | print '<td>'; |
| 1507 | 1507 | print $object->nb_gen_done ? $object->nb_gen_done : '0'; |
| 1508 | 1508 | print '</td>'; |
@@ -1527,15 +1527,15 @@ discard block |
||
| 1527 | 1527 | print '<div class="clearboth"></div><br>'; |
| 1528 | 1528 | |
| 1529 | 1529 | // Lines |
| 1530 | - print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOSTINT('lineid')) . '" method="POST"> |
|
| 1531 | - <input type="hidden" name="token" value="' . newToken() . '"> |
|
| 1532 | - <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> |
|
| 1530 | + print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOSTINT('lineid')).'" method="POST"> |
|
| 1531 | + <input type="hidden" name="token" value="' . newToken().'"> |
|
| 1532 | + <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'"> |
|
| 1533 | 1533 | <input type="hidden" name="mode" value=""> |
| 1534 | - <input type="hidden" name="id" value="' . $object->id . '"> |
|
| 1534 | + <input type="hidden" name="id" value="' . $object->id.'"> |
|
| 1535 | 1535 | '; |
| 1536 | 1536 | |
| 1537 | 1537 | if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { |
| 1538 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
| 1538 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
| 1539 | 1539 | } |
| 1540 | 1540 | |
| 1541 | 1541 | print '<div class="div-table-responsive-no-min">'; |
@@ -1592,24 +1592,24 @@ discard block |
||
| 1592 | 1592 | if (empty($object->suspended)) { |
| 1593 | 1593 | if ($usercancreate) { |
| 1594 | 1594 | if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { |
| 1595 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1595 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1596 | 1596 | } else { |
| 1597 | 1597 | if (empty($object->frequency) || $object->date_when <= $nowlasthour) { |
| 1598 | - 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>'; |
|
| 1598 | + 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>'; |
|
| 1599 | 1599 | } else { |
| 1600 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1600 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1601 | 1601 | } |
| 1602 | 1602 | } |
| 1603 | 1603 | } else { |
| 1604 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>'; |
|
| 1604 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>'; |
|
| 1605 | 1605 | } |
| 1606 | 1606 | } |
| 1607 | 1607 | |
| 1608 | 1608 | if ($usercancreate) { |
| 1609 | 1609 | if (empty($object->suspended)) { |
| 1610 | - 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>'; |
|
| 1610 | + 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>'; |
|
| 1611 | 1611 | } else { |
| 1612 | - 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>'; |
|
| 1612 | + 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>'; |
|
| 1613 | 1613 | } |
| 1614 | 1614 | } |
| 1615 | 1615 | |