@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | 'table' => 'asset_depreciation_options_economic', |
81 | 81 | 'fields' => array( |
82 | 82 | 'depreciation_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDepreciationType', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDepreciationTypeLinear', 1 => 'AssetDepreciationOptionDepreciationTypeDegressive', 2 => 'AssetDepreciationOptionDepreciationTypeExceptional'), 'validate' => 1,), |
83 | - 'degressive_coefficient' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionDegressiveRate', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,'enabled_field' => 'economic:depreciation_type:1'), |
|
83 | + 'degressive_coefficient' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionDegressiveRate', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'enabled_field' => 'economic:depreciation_type:1'), |
|
84 | 84 | 'duration' => array('type' => 'integer', 'label' => 'AssetDepreciationOptionDuration', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,), |
85 | 85 | 'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDurationTypeAnnual', 1 => 'AssetDepreciationOptionDurationTypeMonthly'/*, 2=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate' => 1,), |
86 | 86 | 'rate' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionRate', 'enabled' => 1, 'position' => 50, 'visible' => 3, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'computed' => '$object->asset_depreciation_options->getRate("economic")',), |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'enabled_field' => 'economic:accelerated_depreciation_option:1', |
97 | 97 | 'fields' => array( |
98 | 98 | 'depreciation_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDepreciationType', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDepreciationTypeLinear', 1 => 'AssetDepreciationOptionDepreciationTypeDegressive', 2 => 'AssetDepreciationOptionDepreciationTypeExceptional'), 'validate' => 1,), |
99 | - 'degressive_coefficient' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionDegressiveRate', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,'enabled_field' => 'accelerated_depreciation:depreciation_type:1'), |
|
99 | + 'degressive_coefficient' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionDegressiveRate', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'enabled_field' => 'accelerated_depreciation:depreciation_type:1'), |
|
100 | 100 | 'duration' => array('type' => 'integer', 'label' => 'AssetDepreciationOptionDuration', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,), |
101 | 101 | 'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDurationTypeAnnual', 1 => 'AssetDepreciationOptionDurationTypeMonthly'/*, 2=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate' => 1,), |
102 | 102 | 'rate' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionRate', 'enabled' => 1, 'position' => 50, 'visible' => 3, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'computed' => '$object->asset_depreciation_options->getRate("accelerated_depreciation")',), |
@@ -238,9 +238,9 @@ discard block |
||
238 | 238 | continue; |
239 | 239 | } |
240 | 240 | |
241 | - $html_name = $mode_key . '_' . $field_key; |
|
241 | + $html_name = $mode_key.'_'.$field_key; |
|
242 | 242 | if ($field_info['type'] == 'duration') { |
243 | - if (GETPOST($html_name . 'hour') == '' && GETPOST($html_name . 'min') == '') { |
|
243 | + if (GETPOST($html_name.'hour') == '' && GETPOST($html_name.'min') == '') { |
|
244 | 244 | continue; // The field was not submitted to be saved |
245 | 245 | } |
246 | 246 | } else { |
@@ -262,11 +262,11 @@ discard block |
||
262 | 262 | if (in_array($field_info['type'], array('text', 'html'))) { |
263 | 263 | $value = GETPOST($html_name, 'restricthtml'); |
264 | 264 | } elseif ($field_info['type'] == 'date') { |
265 | - $value = dol_mktime(0, 0, 0, GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year'), 'gmt'); // for date without hour, we use gmt |
|
265 | + $value = dol_mktime(0, 0, 0, GETPOSTINT($html_name.'month'), GETPOSTINT($html_name.'day'), GETPOSTINT($html_name.'year'), 'gmt'); // for date without hour, we use gmt |
|
266 | 266 | } elseif ($field_info['type'] == 'datetime') { |
267 | - $value = dol_mktime(GETPOSTINT($html_name . 'hour'), GETPOSTINT($html_name . 'min'), GETPOSTINT($html_name . 'sec'), GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year'), 'tzuserrel'); |
|
267 | + $value = dol_mktime(GETPOSTINT($html_name.'hour'), GETPOSTINT($html_name.'min'), GETPOSTINT($html_name.'sec'), GETPOSTINT($html_name.'month'), GETPOSTINT($html_name.'day'), GETPOSTINT($html_name.'year'), 'tzuserrel'); |
|
268 | 268 | } elseif ($field_info['type'] == 'duration') { |
269 | - $value = 60 * 60 * GETPOSTINT($html_name . 'hour') + 60 * GETPOSTINT($html_name . 'min'); |
|
269 | + $value = 60 * 60 * GETPOSTINT($html_name.'hour') + 60 * GETPOSTINT($html_name.'min'); |
|
270 | 270 | } elseif (preg_match('/^(integer|price|real|double)/', $field_info['type'])) { |
271 | 271 | $value = price2num(GETPOST($html_name, 'alphanohtml')); // To fix decimal separator according to lang setup |
272 | 272 | } elseif ($field_info['type'] == 'boolean') { |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | } elseif ($field_info['type'] == 'reference') { |
275 | 275 | // todo to check |
276 | 276 | $tmparraykey = array(); //array_keys($object->param_list); |
277 | - $value = $tmparraykey[GETPOST($html_name)] . ',' . GETPOST($html_name . '2'); |
|
277 | + $value = $tmparraykey[GETPOST($html_name)].','.GETPOST($html_name.'2'); |
|
278 | 278 | } else { |
279 | 279 | if ($field_key == 'lang') { |
280 | 280 | $value = GETPOST($html_name, 'aZ09') ? GETPOST($html_name, 'aZ09') : ""; |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | public function fetchDeprecationOptions($asset_id = 0, $asset_model_id = 0) |
341 | 341 | { |
342 | 342 | global $langs, $hookmanager; |
343 | - dol_syslog(__METHOD__ . " asset_id=$asset_id, asset_model_id=$asset_model_id"); |
|
343 | + dol_syslog(__METHOD__." asset_id=$asset_id, asset_model_id=$asset_model_id"); |
|
344 | 344 | |
345 | 345 | $error = 0; |
346 | 346 | $this->errors = array(); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $error++; |
364 | 364 | } |
365 | 365 | if ($error) { |
366 | - dol_syslog(__METHOD__ . " Error check parameters: " . $this->errorsToString(), LOG_ERR); |
|
366 | + dol_syslog(__METHOD__." Error check parameters: ".$this->errorsToString(), LOG_ERR); |
|
367 | 367 | return -1; |
368 | 368 | } |
369 | 369 | |
@@ -372,9 +372,9 @@ discard block |
||
372 | 372 | foreach ($this->deprecation_options_fields as $mode_key => $mode_info) { |
373 | 373 | $this->setInfosForMode($mode_key, $class_type); |
374 | 374 | |
375 | - $result = $this->fetchCommon(0, '', " AND " . ($asset_id > 0 ? " fk_asset = " . (int) $asset_id : " fk_asset_model = " . (int) $asset_model_id)); |
|
375 | + $result = $this->fetchCommon(0, '', " AND ".($asset_id > 0 ? " fk_asset = ".(int) $asset_id : " fk_asset_model = ".(int) $asset_model_id)); |
|
376 | 376 | if ($result < 0) { |
377 | - $this->errors = array_merge(array($langs->trans('AssetErrorFetchDepreciationOptionsForMode', $mode_key) . ':'), $this->errors); |
|
377 | + $this->errors = array_merge(array($langs->trans('AssetErrorFetchDepreciationOptionsForMode', $mode_key).':'), $this->errors); |
|
378 | 378 | $error++; |
379 | 379 | } elseif ($result > 0) { |
380 | 380 | foreach ($this->fields as $field_key => $field_info) { |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | } |
397 | 397 | |
398 | 398 | if ($error) { |
399 | - dol_syslog(__METHOD__ . " Error fetch accountancy codes: " . $this->errorsToString(), LOG_ERR); |
|
399 | + dol_syslog(__METHOD__." Error fetch accountancy codes: ".$this->errorsToString(), LOG_ERR); |
|
400 | 400 | return -1; |
401 | 401 | } else { |
402 | 402 | $this->deprecation_options = $deprecation_options; |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | public function getGeneralDepreciationInfoForMode($mode) |
414 | 414 | { |
415 | 415 | global $hookmanager; |
416 | - dol_syslog(__METHOD__ . " mode=$mode"); |
|
416 | + dol_syslog(__METHOD__." mode=$mode"); |
|
417 | 417 | |
418 | 418 | $this->errors = array(); |
419 | 419 | |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | public function updateDeprecationOptions($user, $asset_id = 0, $asset_model_id = 0, $notrigger = 0) |
452 | 452 | { |
453 | 453 | global $langs, $hookmanager; |
454 | - dol_syslog(__METHOD__ . " user_id=".$user->id.", asset_id=".$asset_id.", asset_model_id=".$asset_model_id.", notrigger=".$notrigger); |
|
454 | + dol_syslog(__METHOD__." user_id=".$user->id.", asset_id=".$asset_id.", asset_model_id=".$asset_model_id.", notrigger=".$notrigger); |
|
455 | 455 | |
456 | 456 | $error = 0; |
457 | 457 | $this->errors = array(); |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | $error++; |
474 | 474 | } |
475 | 475 | if ($error) { |
476 | - dol_syslog(__METHOD__ . " Error check parameters: " . $this->errorsToString(), LOG_ERR); |
|
476 | + dol_syslog(__METHOD__." Error check parameters: ".$this->errorsToString(), LOG_ERR); |
|
477 | 477 | return -1; |
478 | 478 | } |
479 | 479 | |
@@ -491,11 +491,11 @@ discard block |
||
491 | 491 | |
492 | 492 | foreach ($this->deprecation_options_fields as $mode_key => $mode_info) { |
493 | 493 | // Delete old accountancy codes |
494 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . $mode_info['table']; |
|
495 | - $sql .= " WHERE " . ($asset_id > 0 ? " fk_asset = " . (int) $asset_id : " fk_asset_model = " . (int) $asset_model_id); |
|
494 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX.$mode_info['table']; |
|
495 | + $sql .= " WHERE ".($asset_id > 0 ? " fk_asset = ".(int) $asset_id : " fk_asset_model = ".(int) $asset_model_id); |
|
496 | 496 | $resql = $this->db->query($sql); |
497 | 497 | if (!$resql) { |
498 | - $this->errors[] = $langs->trans('AssetErrorDeleteDepreciationOptionsForMode', $mode_key) . ': ' . $this->db->lasterror(); |
|
498 | + $this->errors[] = $langs->trans('AssetErrorDeleteDepreciationOptionsForMode', $mode_key).': '.$this->db->lasterror(); |
|
499 | 499 | $error++; |
500 | 500 | } |
501 | 501 | |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | |
512 | 512 | $result = $this->createCommon($user, 1); |
513 | 513 | if ($result < 0) { |
514 | - $this->errors = array_merge(array($langs->trans('AssetErrorInsertDepreciationOptionsForMode', $mode_key) . ':'), $this->errors); |
|
514 | + $this->errors = array_merge(array($langs->trans('AssetErrorInsertDepreciationOptionsForMode', $mode_key).':'), $this->errors); |
|
515 | 515 | $error++; |
516 | 516 | } |
517 | 517 | } |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | |
520 | 520 | if (!$error && $this->fk_asset > 0) { |
521 | 521 | // Calculation of depreciation lines (reversal and future) |
522 | - require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php'; |
|
522 | + require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; |
|
523 | 523 | $asset = new Asset($this->db); |
524 | 524 | $result = $asset->fetch($this->fk_asset); |
525 | 525 | if ($result > 0) { |
@@ -112,10 +112,10 @@ discard block |
||
112 | 112 | $texte .= '<input type="hidden" name="param4" value="COMPANY_DIGITARIA_MASK_NBCHARACTER_CUSTOMER">'; |
113 | 113 | $texte .= '<input type="hidden" name="param5" value="COMPANY_DIGITARIA_CLEAN_WORDS">'; |
114 | 114 | $texte .= '<table class="nobordernopadding centpercent">'; |
115 | - $s1 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value1" value="' . getDolGlobalString('COMPANY_DIGITARIA_MASK_SUPPLIER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
116 | - $s2 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value2" value="' . getDolGlobalString('COMPANY_DIGITARIA_MASK_CUSTOMER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
117 | - $s3 = $form->textwithpicto('<input type="text" class="flat" size="2" name="value3" value="' . getDolGlobalString('COMPANY_DIGITARIA_MASK_NBCHARACTER_SUPPLIER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
118 | - $s4 = $form->textwithpicto('<input type="text" class="flat" size="2" name="value4" value="' . getDolGlobalString('COMPANY_DIGITARIA_MASK_NBCHARACTER_CUSTOMER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
115 | + $s1 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value1" value="'.getDolGlobalString('COMPANY_DIGITARIA_MASK_SUPPLIER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
116 | + $s2 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value2" value="'.getDolGlobalString('COMPANY_DIGITARIA_MASK_CUSTOMER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
117 | + $s3 = $form->textwithpicto('<input type="text" class="flat" size="2" name="value3" value="'.getDolGlobalString('COMPANY_DIGITARIA_MASK_NBCHARACTER_SUPPLIER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
118 | + $s4 = $form->textwithpicto('<input type="text" class="flat" size="2" name="value4" value="'.getDolGlobalString('COMPANY_DIGITARIA_MASK_NBCHARACTER_CUSTOMER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
119 | 119 | $texte .= '<tr><td>'; |
120 | 120 | // trans remove html entities |
121 | 121 | $texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}', '{s4}')."<br>\n"; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | // Apply a regex replacement pattern on code if COMPANY_DIGITARIA_CLEAN_REGEX is set. Value must be a regex with parenthesis. The part into parenthesis is kept, the rest removed. |
130 | 130 | if (getDolGlobalString('COMPANY_DIGITARIA_CLEAN_REGEX')) { |
131 | - $texte .= $langs->trans('COMPANY_DIGITARIA_CLEAN_REGEX').' = ' . getDolGlobalString('COMPANY_DIGITARIA_CLEAN_REGEX')."<br>\n"; |
|
131 | + $texte .= $langs->trans('COMPANY_DIGITARIA_CLEAN_REGEX').' = '.getDolGlobalString('COMPANY_DIGITARIA_CLEAN_REGEX')."<br>\n"; |
|
132 | 132 | } |
133 | 133 | // If value is not unique (if COMPANY_DIGITARIA_UNIQUE_CODE is set to 0), we show this |
134 | 134 | if (!getDolGlobalString('COMPANY_DIGITARIA_UNIQUE_CODE', '1')) { |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | } |
233 | 233 | // Apply a regex replacement pattern on code if COMPANY_DIGITARIA_CLEAN_REGEX is set. Value must be a regex with parenthesis. The part into parenthesis is kept, the rest removed. |
234 | 234 | if (getDolGlobalString('COMPANY_DIGITARIA_CLEAN_REGEX')) { // Example: $conf->global->COMPANY_DIGITARIA_CLEAN_REGEX='^..(..)..'; |
235 | - $codetouse = preg_replace('/' . getDolGlobalString('COMPANY_DIGITARIA_CLEAN_REGEX').'/', '\1\2\3', $codetouse); |
|
235 | + $codetouse = preg_replace('/'.getDolGlobalString('COMPANY_DIGITARIA_CLEAN_REGEX').'/', '\1\2\3', $codetouse); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | $this->code = $prefix.strtoupper(substr($codetouse, 0, (int) $width)); |
@@ -305,11 +305,11 @@ discard block |
||
305 | 305 | } |
306 | 306 | |
307 | 307 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
308 | - $sql = "SELECT " . $typethirdparty . " FROM " . MAIN_DB_PREFIX . "societe_perentity"; |
|
309 | - $sql .= " WHERE " . $typethirdparty . " = '" . $db->escape($code) . "'"; |
|
308 | + $sql = "SELECT ".$typethirdparty." FROM ".MAIN_DB_PREFIX."societe_perentity"; |
|
309 | + $sql .= " WHERE ".$typethirdparty." = '".$db->escape($code)."'"; |
|
310 | 310 | } else { |
311 | - $sql = "SELECT " . $typethirdparty . " FROM " . MAIN_DB_PREFIX . "societe"; |
|
312 | - $sql .= " WHERE " . $typethirdparty . " = '" . $db->escape($code) . "'"; |
|
311 | + $sql = "SELECT ".$typethirdparty." FROM ".MAIN_DB_PREFIX."societe"; |
|
312 | + $sql .= " WHERE ".$typethirdparty." = '".$db->escape($code)."'"; |
|
313 | 313 | } |
314 | 314 | $sql .= " AND entity IN (".getEntity('societe').")"; |
315 | 315 |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | $texte .= '<input type="hidden" name="param1" value="COMPANY_AQUARIUM_MASK_SUPPLIER">'; |
100 | 100 | $texte .= '<input type="hidden" name="param2" value="COMPANY_AQUARIUM_MASK_CUSTOMER">'; |
101 | 101 | $texte .= '<table class="nobordernopadding" width="100%">'; |
102 | - $s1 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value1" value="' . getDolGlobalString('COMPANY_AQUARIUM_MASK_SUPPLIER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
103 | - $s2 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value2" value="' . getDolGlobalString('COMPANY_AQUARIUM_MASK_CUSTOMER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
102 | + $s1 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value1" value="'.getDolGlobalString('COMPANY_AQUARIUM_MASK_SUPPLIER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
103 | + $s2 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value2" value="'.getDolGlobalString('COMPANY_AQUARIUM_MASK_CUSTOMER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); |
|
104 | 104 | $texte .= '<tr><td>'; |
105 | 105 | // trans remove html entities |
106 | 106 | $texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}')."<br>\n"; |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | } |
113 | 113 | //if (!empty($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)) $texte.=$langs->trans('COMPANY_AQUARIUM_REMOVE_ALPHA').' = '.yn($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)."<br>\n"; |
114 | 114 | if (getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX')) { |
115 | - $texte .= $langs->trans('COMPANY_AQUARIUM_CLEAN_REGEX').' = ' . getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX')."<br>\n"; |
|
115 | + $texte .= $langs->trans('COMPANY_AQUARIUM_CLEAN_REGEX').' = '.getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX')."<br>\n"; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | if (getDolGlobalString('COMPANY_AQUARIUM_NO_PREFIX')) { |
119 | - $texte .= $langs->trans('COMPANY_AQUARIUM_NO_PREFIX').' = ' . getDolGlobalString('COMPANY_AQUARIUM_NO_PREFIX')."<br>\n"; |
|
119 | + $texte .= $langs->trans('COMPANY_AQUARIUM_NO_PREFIX').' = '.getDolGlobalString('COMPANY_AQUARIUM_NO_PREFIX')."<br>\n"; |
|
120 | 120 | } |
121 | 121 | $texte .= '</td>'; |
122 | 122 | $texte .= '<td class="right"><input type="submit" class="button button-edit reposition smallpaddingimp" name="modify" value="'.$langs->trans("Modify").'"></td>'; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | // Apply a regex replacement pattern on code if COMPANY_AQUARIUM_CLEAN_REGEX is set. Value must be a regex with parenthesis. The part into parenthesis is kept, the rest removed. |
189 | 189 | if (getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX')) { // Example: $conf->global->COMPANY_AQUARIUM_CLEAN_REGEX='^..(..)..'; |
190 | - $codetouse = preg_replace('/' . getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX').'/', '\1\2\3', $codetouse); |
|
190 | + $codetouse = preg_replace('/'.getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX').'/', '\1\2\3', $codetouse); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | $codetouse = $prefix.strtoupper($codetouse); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | // Parametrage du prefix |
78 | 78 | $texte .= '<tr><td>'.$langs->trans("Mask").':</td>'; |
79 | - $texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskchequereceipts" value="' . getDolGlobalString('CHEQUERECEIPTS_THYME_MASK').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).'</td>'; |
|
79 | + $texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskchequereceipts" value="'.getDolGlobalString('CHEQUERECEIPTS_THYME_MASK').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).'</td>'; |
|
80 | 80 | |
81 | 81 | $texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans("Modify").'"></td>'; |
82 | 82 | |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | { |
98 | 98 | global $db, $langs; |
99 | 99 | |
100 | - require_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php'; |
|
101 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
100 | + require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; |
|
101 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
102 | 102 | |
103 | 103 | $remise = new RemiseCheque($db); |
104 | 104 | $remise->initAsSpecimen(); |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | 'linkedObjectsIds', |
463 | 463 | 'linkedObjects', |
464 | 464 | 'fk_delivery_address', |
465 | - 'projet', // There is already ->fk_project |
|
465 | + 'projet', // There is already ->fk_project |
|
466 | 466 | 'restrictiononfksoc', |
467 | 467 | 'specimen', |
468 | 468 | ); |
@@ -807,10 +807,10 @@ discard block |
||
807 | 807 | if ($resql) { |
808 | 808 | $obj = $this->db->fetch_object($resql); |
809 | 809 | if ($obj) { |
810 | - $this->id = $obj->rowid; |
|
811 | - $this->entity = $obj->entity; |
|
810 | + $this->id = $obj->rowid; |
|
811 | + $this->entity = $obj->entity; |
|
812 | 812 | |
813 | - $this->date_creation = $this->db->jdate($obj->date_creation); |
|
813 | + $this->date_creation = $this->db->jdate($obj->date_creation); |
|
814 | 814 | $this->date_modification = $this->db->jdate($obj->tms); |
815 | 815 | |
816 | 816 | $this->amounts = (float) $obj->amounts; |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | $this->object_version = $obj->object_version; |
829 | 829 | |
830 | 830 | $this->signature = $obj->signature; |
831 | - $this->signature_line = $obj->signature_line; |
|
831 | + $this->signature_line = $obj->signature_line; |
|
832 | 832 | $this->certified = ($obj->certified == 1); |
833 | 833 | |
834 | 834 | return 1; |
@@ -948,7 +948,7 @@ discard block |
||
948 | 948 | |
949 | 949 | $previoushash = $this->getPreviousHash(1, 0); // This get last record and lock database until insert is done and transaction closed |
950 | 950 | |
951 | - $keyforsignature = $this->buildKeyForSignature(); // All the information for the has (meta data + data saved) |
|
951 | + $keyforsignature = $this->buildKeyForSignature(); // All the information for the has (meta data + data saved) |
|
952 | 952 | |
953 | 953 | include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; |
954 | 954 | |
@@ -1115,7 +1115,7 @@ discard block |
||
1115 | 1115 | if (empty($previoussignature)) { |
1116 | 1116 | $sql = "SELECT rowid, signature FROM ".MAIN_DB_PREFIX."blockedlog"; |
1117 | 1117 | if ($beforeid) { |
1118 | - $sql.= $this->db->hintindex('entity_rowid', 1); |
|
1118 | + $sql .= $this->db->hintindex('entity_rowid', 1); |
|
1119 | 1119 | } |
1120 | 1120 | $sql .= " WHERE entity = ".((int) $conf->entity); |
1121 | 1121 | if ($beforeid) { |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | $paramcreditor = 'ONLINE_PAYMENT_CREDITOR'; |
151 | 151 | $paramcreditorlong = 'ONLINE_PAYMENT_CREDITOR_'.$suffix; |
152 | 152 | if (getDolGlobalString($paramcreditorlong)) { |
153 | - $creditor = getDolGlobalString($paramcreditorlong); // use label long of the seller to show |
|
153 | + $creditor = getDolGlobalString($paramcreditorlong); // use label long of the seller to show |
|
154 | 154 | } elseif (getDolGlobalString($paramcreditor)) { |
155 | - $creditor = getDolGlobalString($paramcreditor); // use label short of the seller to show |
|
155 | + $creditor = getDolGlobalString($paramcreditor); // use label short of the seller to show |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | $head = ''; |
209 | 209 | if (getDolGlobalString('ONLINE_PAYMENT_CSS_URL')) { |
210 | - $head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n"; |
|
210 | + $head = '<link rel="stylesheet" type="text/css" href="'.getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n"; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | $conf->dol_hide_topmenu = 1; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | } |
268 | 268 | if (getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT')) { |
269 | 269 | print '<div class="backimagepublicpayment">'; |
270 | - print '<img id="idMAIN_IMAGE_PUBLIC_PAYMENT" src="' . getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT').'">'; |
|
270 | + print '<img id="idMAIN_IMAGE_PUBLIC_PAYMENT" src="'.getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT').'">'; |
|
271 | 271 | print '</div>'; |
272 | 272 | } |
273 | 273 | |
@@ -282,11 +282,11 @@ discard block |
||
282 | 282 | // Get on url call |
283 | 283 | $onlinetoken = $PAYPALTOKEN; |
284 | 284 | $fulltag = $FULLTAG; |
285 | - $payerID = !empty($PAYPALPAYERID) ? $PAYPALPAYERID : ''; |
|
285 | + $payerID = !empty($PAYPALPAYERID) ? $PAYPALPAYERID : ''; |
|
286 | 286 | // Set by newpayment.php |
287 | 287 | $currencyCodeType = $_SESSION['currencyCodeType']; |
288 | 288 | $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; |
289 | - $paymentType = $_SESSION['PaymentType']; // Value can be 'Mark', 'Sole', 'Sale' for example |
|
289 | + $paymentType = $_SESSION['PaymentType']; // Value can be 'Mark', 'Sole', 'Sale' for example |
|
290 | 290 | // From env |
291 | 291 | $ipaddress = $_SESSION['ipaddress']; |
292 | 292 | |
@@ -388,10 +388,10 @@ discard block |
||
388 | 388 | $ipaddress = $_SESSION['ipaddress']; |
389 | 389 | } |
390 | 390 | if (empty($TRANSACTIONID)) { |
391 | - $TRANSACTIONID = empty($_SESSION['TRANSACTIONID']) ? '' :$_SESSION['TRANSACTIONID']; // pi_... or ch_... |
|
391 | + $TRANSACTIONID = empty($_SESSION['TRANSACTIONID']) ? '' : $_SESSION['TRANSACTIONID']; // pi_... or ch_... |
|
392 | 392 | if (empty($TRANSACTIONID) && GETPOST('payment_intent', 'alphanohtml')) { |
393 | 393 | // For the case we use STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 2 |
394 | - $TRANSACTIONID = GETPOST('payment_intent', 'alphanohtml'); |
|
394 | + $TRANSACTIONID = GETPOST('payment_intent', 'alphanohtml'); |
|
395 | 395 | } |
396 | 396 | } |
397 | 397 | if (empty($FinalPaymentAmt)) { |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | if (empty($adht->caneditamount)) { // If we didn't allow members to choose their membership amount (if the amount is allowed in edit mode, no need to check) |
494 | 494 | if ($object->status == $object::STATUS_DRAFT) { // If the member is not yet validated, we check that the amount is the same as expected. |
495 | 495 | $typeid = $object->typeid; |
496 | - $amountbytype = $adht->amountByType(1); // Load the array of amount per type |
|
496 | + $amountbytype = $adht->amountByType(1); // Load the array of amount per type |
|
497 | 497 | |
498 | 498 | // Set amount for the subscription: |
499 | 499 | // - First check the amount of the member type. |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | if (getDolGlobalInt('MEMBER_MIN_AMOUNT')) { |
524 | 524 | if ($FinalPaymentAmt < getDolGlobalInt('MEMBER_MIN_AMOUNT')) { |
525 | 525 | $error++; |
526 | - $errmsg = 'Value of FinalPayment ('.$FinalPaymentAmt.') is lower than the minimum allowed (' . getDolGlobalString('MEMBER_MIN_AMOUNT').'). May be a hack to try to pay a different amount ?'; |
|
526 | + $errmsg = 'Value of FinalPayment ('.$FinalPaymentAmt.') is lower than the minimum allowed ('.getDolGlobalString('MEMBER_MIN_AMOUNT').'). May be a hack to try to pay a different amount ?'; |
|
527 | 527 | $postactionmessages[] = $errmsg; |
528 | 528 | $ispostactionok = -1; |
529 | 529 | dol_syslog("Failed to validate member (amount propagated from payment page is lower than allowed minimum): ".$errmsg, LOG_ERR, 0, '_payment'); |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | dol_syslog("Failed to validate member (bad currency check): ".$errmsg, LOG_ERR, 0, '_payment'); |
540 | 540 | } |
541 | 541 | |
542 | - if (! $error) { |
|
542 | + if (!$error) { |
|
543 | 543 | // We validate the member (no effect if it is already validated) |
544 | 544 | $result = ($object->status == $object::STATUS_EXCLUDED) ? -1 : $object->validate($user); // if membre is excluded (status == -2) the new validation is not possible |
545 | 545 | if ($result < 0 || empty($object->datevalid)) { |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | $thirdparty = new Societe($db); |
707 | 707 | $thirdparty->fetch($thirdparty_id); |
708 | 708 | |
709 | - include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; // This also set $stripearrayofkeysbyenv |
|
709 | + include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; // This also set $stripearrayofkeysbyenv |
|
710 | 710 | $stripe = new Stripe($db); |
711 | 711 | //$stripeacc = $stripe->getStripeAccount($service); Already defined previously |
712 | 712 | |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | |
722 | 722 | if (preg_match('/^pi_/', $TRANSACTIONID)) { |
723 | 723 | // This may throw an error if not found. |
724 | - $chpi = \Stripe\PaymentIntent::retrieve($TRANSACTIONID); // payment_intent (pi_...) |
|
724 | + $chpi = \Stripe\PaymentIntent::retrieve($TRANSACTIONID); // payment_intent (pi_...) |
|
725 | 725 | } else { |
726 | 726 | // This throw an error if not found |
727 | 727 | $chpi = \Stripe\Charge::retrieve($TRANSACTIONID); // old method, contains the charge id (ch_...) |
@@ -780,7 +780,7 @@ discard block |
||
780 | 780 | // Create external user |
781 | 781 | if (getDolGlobalString('ADHERENT_CREATE_EXTERNAL_USER_LOGIN')) { |
782 | 782 | $nuser = new User($db); |
783 | - $tmpuser = dol_clone($object, 0); // $object is type Adherent |
|
783 | + $tmpuser = dol_clone($object, 0); // $object is type Adherent |
|
784 | 784 | |
785 | 785 | // Check if a user login already exists for this member or not |
786 | 786 | $found = 0; |
@@ -945,7 +945,7 @@ discard block |
||
945 | 945 | $paiement->paiementid = $paymentTypeId; |
946 | 946 | $paiement->num_payment = ''; |
947 | 947 | $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress; |
948 | - $paiement->ext_payment_id = $TRANSACTIONID; // TODO LDR May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
948 | + $paiement->ext_payment_id = $TRANSACTIONID; // TODO LDR May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
949 | 949 | //$paiement->ext_payment_id = $TRANSACTIONID.':'.$customer->id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // TODO LDR It would be better if we could store this. Do we have customer->id and publishable_key ? |
950 | 950 | $paiement->ext_payment_site = $service; |
951 | 951 | |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | $ispostactionok = -1; |
1018 | 1018 | } |
1019 | 1019 | } elseif (array_key_exists('ORD', $tmptag) && $tmptag['ORD'] > 0) { |
1020 | - include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; |
|
1020 | + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; |
|
1021 | 1021 | $object = new Commande($db); |
1022 | 1022 | $result = $object->fetch((int) $tmptag['ORD']); |
1023 | 1023 | if ($result) { |
@@ -1052,14 +1052,14 @@ discard block |
||
1052 | 1052 | // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) |
1053 | 1053 | if (isModEnabled('invoice')) { |
1054 | 1054 | if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { |
1055 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
1055 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
1056 | 1056 | $invoice = new Facture($db); |
1057 | 1057 | $result = $invoice->createFromOrder($object, $user); |
1058 | 1058 | if ($result > 0) { |
1059 | 1059 | $object->classifyBilled($user); |
1060 | 1060 | $invoice->validate($user); |
1061 | 1061 | // Creation of payment line |
1062 | - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; |
|
1062 | + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; |
|
1063 | 1063 | $paiement = new Paiement($db); |
1064 | 1064 | $paiement->datepaye = $now; |
1065 | 1065 | if ($currencyCodeType == $conf->currency) { |
@@ -1073,14 +1073,14 @@ discard block |
||
1073 | 1073 | } |
1074 | 1074 | $paiement->paiementid = $paymentTypeId; |
1075 | 1075 | $paiement->num_payment = ''; |
1076 | - $paiement->note_public = 'Online payment ' . dol_print_date($now, 'standard') . ' from ' . $ipaddress; |
|
1077 | - $paiement->ext_payment_id = $TRANSACTIONID; // pi_... for Stripe, ... |
|
1078 | - $paiement->ext_payment_site = $service; // 'StripeLive' or 'Stripe', or ... |
|
1076 | + $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress; |
|
1077 | + $paiement->ext_payment_id = $TRANSACTIONID; // pi_... for Stripe, ... |
|
1078 | + $paiement->ext_payment_site = $service; // 'StripeLive' or 'Stripe', or ... |
|
1079 | 1079 | |
1080 | 1080 | if (!$error) { |
1081 | 1081 | $paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents |
1082 | 1082 | if ($paiement_id < 0) { |
1083 | - $postactionmessages[] = $paiement->error . ' ' . implode("<br>\n", $paiement->errors); |
|
1083 | + $postactionmessages[] = $paiement->error.' '.implode("<br>\n", $paiement->errors); |
|
1084 | 1084 | $ispostactionok = -1; |
1085 | 1085 | $error++; |
1086 | 1086 | } else { |
@@ -1117,7 +1117,7 @@ discard block |
||
1117 | 1117 | } |
1118 | 1118 | $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); |
1119 | 1119 | if ($result < 0) { |
1120 | - $postactionmessages[] = $paiement->error . ' ' . implode("<br>\n", $paiement->errors); |
|
1120 | + $postactionmessages[] = $paiement->error.' '.implode("<br>\n", $paiement->errors); |
|
1121 | 1121 | $ispostactionok = -1; |
1122 | 1122 | $error++; |
1123 | 1123 | } else { |
@@ -1125,7 +1125,7 @@ discard block |
||
1125 | 1125 | $ispostactionok = 1; |
1126 | 1126 | } |
1127 | 1127 | } else { |
1128 | - $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; |
|
1128 | + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; |
|
1129 | 1129 | $ispostactionok = -1; |
1130 | 1130 | $error++; |
1131 | 1131 | } |
@@ -1137,11 +1137,11 @@ discard block |
||
1137 | 1137 | $db->rollback(); |
1138 | 1138 | } |
1139 | 1139 | } else { |
1140 | - $postactionmessages[] = 'Failed to create invoice form order ' . $tmptag['ORD'] . '.'; |
|
1140 | + $postactionmessages[] = 'Failed to create invoice form order '.$tmptag['ORD'].'.'; |
|
1141 | 1141 | $ispostactionok = -1; |
1142 | 1142 | } |
1143 | 1143 | } else { |
1144 | - $postactionmessages[] = 'Failed to get a valid value for "amount paid" (' . $FinalPaymentAmt . ') or "payment type id" (' . $paymentTypeId . ') to record the payment of order ' . $tmptag['ORD'] . '. May be payment was already recorded.'; |
|
1144 | + $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type id" ('.$paymentTypeId.') to record the payment of order '.$tmptag['ORD'].'. May be payment was already recorded.'; |
|
1145 | 1145 | $ispostactionok = -1; |
1146 | 1146 | } |
1147 | 1147 | } else { |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | $ispostactionok = -1; |
1150 | 1150 | } |
1151 | 1151 | } else { |
1152 | - $postactionmessages[] = 'Order paid ' . $tmptag['ORD'] . ' was not found'; |
|
1152 | + $postactionmessages[] = 'Order paid '.$tmptag['ORD'].' was not found'; |
|
1153 | 1153 | $ispostactionok = -1; |
1154 | 1154 | } |
1155 | 1155 | } elseif (array_key_exists('DON', $tmptag) && $tmptag['DON'] > 0) { |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | $paiement->datep = $now; |
1207 | 1207 | $paiement->paymenttype = $paymentTypeId; |
1208 | 1208 | $paiement->num_payment = ''; |
1209 | - $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress; |
|
1209 | + $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress; |
|
1210 | 1210 | $paiement->ext_payment_id = $TRANSACTIONID; |
1211 | 1211 | $paiement->ext_payment_site = $service; |
1212 | 1212 | |
@@ -1423,7 +1423,7 @@ discard block |
||
1423 | 1423 | $db->rollback(); |
1424 | 1424 | } |
1425 | 1425 | |
1426 | - if (! $error) { |
|
1426 | + if (!$error) { |
|
1427 | 1427 | // Sending mail |
1428 | 1428 | $thirdparty = new Societe($db); |
1429 | 1429 | $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc); |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | // Get email content from template |
1442 | 1442 | $arraydefaultmessage = null; |
1443 | 1443 | |
1444 | - $idoftemplatetouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'); // Email to send for Event organization registration |
|
1444 | + $idoftemplatetouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'); // Email to send for Event organization registration |
|
1445 | 1445 | |
1446 | 1446 | if (!empty($idoftemplatetouse)) { |
1447 | 1447 | $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $idoftemplatetouse, 1, ''); |
@@ -1643,18 +1643,18 @@ discard block |
||
1643 | 1643 | } else { |
1644 | 1644 | $booth->status = ConferenceOrBooth::STATUS_SUGGESTED; |
1645 | 1645 | $resultboothupdate = $booth->update($user); |
1646 | - if ($resultboothupdate<0) { |
|
1646 | + if ($resultboothupdate < 0) { |
|
1647 | 1647 | // Finding the thirdparty by getting the invoice |
1648 | 1648 | $invoice = new Facture($db); |
1649 | 1649 | $resultinvoice = $invoice->fetch($ref); |
1650 | - if ($resultinvoice<0) { |
|
1650 | + if ($resultinvoice < 0) { |
|
1651 | 1651 | $postactionmessages[] = 'Could not find the associated invoice.'; |
1652 | 1652 | $ispostactionok = -1; |
1653 | 1653 | $error++; |
1654 | 1654 | } else { |
1655 | 1655 | $thirdparty = new Societe($db); |
1656 | 1656 | $resultthirdparty = $thirdparty->fetch($invoice->socid); |
1657 | - if ($resultthirdparty<0) { |
|
1657 | + if ($resultthirdparty < 0) { |
|
1658 | 1658 | $error++; |
1659 | 1659 | setEventMessages(null, $thirdparty->errors, "errors"); |
1660 | 1660 | } else { |
@@ -1670,7 +1670,7 @@ discard block |
||
1670 | 1670 | // Get email content from template |
1671 | 1671 | $arraydefaultmessage = null; |
1672 | 1672 | |
1673 | - $idoftemplatetouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'); // Email sent after registration for a Booth |
|
1673 | + $idoftemplatetouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'); // Email sent after registration for a Booth |
|
1674 | 1674 | |
1675 | 1675 | if (!empty($idoftemplatetouse)) { |
1676 | 1676 | $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $idoftemplatetouse, 1, ''); |
@@ -1726,7 +1726,7 @@ discard block |
||
1726 | 1726 | $ispostactionok = -1; |
1727 | 1727 | } |
1728 | 1728 | } elseif (array_key_exists('CON', $tmptag) && $tmptag['CON'] > 0) { |
1729 | - include_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; |
|
1729 | + include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; |
|
1730 | 1730 | $object = new Contrat($db); |
1731 | 1731 | $result = $object->fetch((int) $tmptag['CON']); |
1732 | 1732 | if ($result) { |
@@ -1764,14 +1764,14 @@ discard block |
||
1764 | 1764 | // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) |
1765 | 1765 | if (isModEnabled('invoice')) { |
1766 | 1766 | if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { |
1767 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
1767 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
1768 | 1768 | $invoice = new Facture($db); |
1769 | 1769 | $result = $invoice->createFromContract($object, $user, array((int) $contract_lines)); |
1770 | 1770 | if ($result > 0) { |
1771 | 1771 | // $object->classifyBilled($user); |
1772 | 1772 | $invoice->validate($user); |
1773 | 1773 | // Creation of payment line |
1774 | - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; |
|
1774 | + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; |
|
1775 | 1775 | $paiement = new Paiement($db); |
1776 | 1776 | $paiement->datepaye = $now; |
1777 | 1777 | if ($currencyCodeType == $conf->currency) { |
@@ -1785,14 +1785,14 @@ discard block |
||
1785 | 1785 | } |
1786 | 1786 | $paiement->paiementid = $paymentTypeId; |
1787 | 1787 | $paiement->num_payment = ''; |
1788 | - $paiement->note_public = 'Online payment ' . dol_print_date($now, 'standard') . ' from ' . $ipaddress; |
|
1789 | - $paiement->ext_payment_id = $TRANSACTIONID; // pi_... for Stripe, ... |
|
1790 | - $paiement->ext_payment_site = $service; // 'StripeLive' or 'Stripe', or ... |
|
1788 | + $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress; |
|
1789 | + $paiement->ext_payment_id = $TRANSACTIONID; // pi_... for Stripe, ... |
|
1790 | + $paiement->ext_payment_site = $service; // 'StripeLive' or 'Stripe', or ... |
|
1791 | 1791 | |
1792 | 1792 | if (!$error) { |
1793 | 1793 | $paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents |
1794 | 1794 | if ($paiement_id < 0) { |
1795 | - $postactionmessages[] = $paiement->error . ' ' . implode("<br>\n", $paiement->errors); |
|
1795 | + $postactionmessages[] = $paiement->error.' '.implode("<br>\n", $paiement->errors); |
|
1796 | 1796 | $ispostactionok = -1; |
1797 | 1797 | $error++; |
1798 | 1798 | } else { |
@@ -1829,7 +1829,7 @@ discard block |
||
1829 | 1829 | } |
1830 | 1830 | $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); |
1831 | 1831 | if ($result < 0) { |
1832 | - $postactionmessages[] = $paiement->error . ' ' . implode("<br>\n", $paiement->errors); |
|
1832 | + $postactionmessages[] = $paiement->error.' '.implode("<br>\n", $paiement->errors); |
|
1833 | 1833 | $ispostactionok = -1; |
1834 | 1834 | $error++; |
1835 | 1835 | } else { |
@@ -1837,7 +1837,7 @@ discard block |
||
1837 | 1837 | $ispostactionok = 1; |
1838 | 1838 | } |
1839 | 1839 | } else { |
1840 | - $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; |
|
1840 | + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; |
|
1841 | 1841 | $ispostactionok = -1; |
1842 | 1842 | $error++; |
1843 | 1843 | } |
@@ -1849,15 +1849,15 @@ discard block |
||
1849 | 1849 | $db->rollback(); |
1850 | 1850 | } |
1851 | 1851 | } else { |
1852 | - $msg = 'Failed to create invoice form contract ' . $tmptag['CON']; |
|
1852 | + $msg = 'Failed to create invoice form contract '.$tmptag['CON']; |
|
1853 | 1853 | if (!empty($cols)) { |
1854 | - $msg .= ' and col '. $cols .'.'; |
|
1854 | + $msg .= ' and col '.$cols.'.'; |
|
1855 | 1855 | } |
1856 | 1856 | $postactionmessages[] = $msg; |
1857 | 1857 | $ispostactionok = -1; |
1858 | 1858 | } |
1859 | 1859 | } else { |
1860 | - $postactionmessages[] = 'Failed to get a valid value for "amount paid" (' . $FinalPaymentAmt . ') or "payment type id" (' . $paymentTypeId . ') to record the payment of contract ' . $tmptag['CON'] .'. Maybe payment was already recorded.'; |
|
1860 | + $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type id" ('.$paymentTypeId.') to record the payment of contract '.$tmptag['CON'].'. Maybe payment was already recorded.'; |
|
1861 | 1861 | $ispostactionok = -1; |
1862 | 1862 | } |
1863 | 1863 | } else { |
@@ -1865,9 +1865,9 @@ discard block |
||
1865 | 1865 | $ispostactionok = -1; |
1866 | 1866 | } |
1867 | 1867 | } else { |
1868 | - $msg = 'Contract paid ' . $tmptag['CON'] . ' was not found'; |
|
1868 | + $msg = 'Contract paid '.$tmptag['CON'].' was not found'; |
|
1869 | 1869 | if (!empty($cols)) { |
1870 | - $msg .= ' for col '.$tmptag['COL'] .'.'; |
|
1870 | + $msg .= ' for col '.$tmptag['COL'].'.'; |
|
1871 | 1871 | } |
1872 | 1872 | $postactionmessages[] = $msg; |
1873 | 1873 | $ispostactionok = -1; |
@@ -1883,8 +1883,8 @@ discard block |
||
1883 | 1883 | $payerID = empty($PAYPALPAYERID) ? $_SESSION['payerID'] : $PAYPALPAYERID; |
1884 | 1884 | // Set by newpayment.php |
1885 | 1885 | $currencyCodeType = empty($_SESSION['currencyCodeType']) ? '' : $_SESSION['currencyCodeType']; |
1886 | - $FinalPaymentAmt = empty($_SESSION["FinalPaymentAmt"]) ? '': $_SESSION["FinalPaymentAmt"]; |
|
1887 | - $paymentType = empty($_SESSION['PaymentType']) ? '' : $_SESSION['PaymentType']; // Seems used by paypal only |
|
1886 | + $FinalPaymentAmt = empty($_SESSION["FinalPaymentAmt"]) ? '' : $_SESSION["FinalPaymentAmt"]; |
|
1887 | + $paymentType = empty($_SESSION['PaymentType']) ? '' : $_SESSION['PaymentType']; // Seems used by paypal only |
|
1888 | 1888 | |
1889 | 1889 | if (is_object($object) && method_exists($object, 'call_trigger')) { |
1890 | 1890 | // Call trigger |
@@ -2125,16 +2125,16 @@ discard block |
||
2125 | 2125 | // Redirect to a success page |
2126 | 2126 | // Paymentok page must be created for the specific website |
2127 | 2127 | if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) { |
2128 | - $ext_urlok = $ws_virtuelhost . '/paymentok.php?fulltag='.$FULLTAG; |
|
2128 | + $ext_urlok = $ws_virtuelhost.'/paymentok.php?fulltag='.$FULLTAG; |
|
2129 | 2129 | } else { |
2130 | 2130 | $ext_urlok = DOL_URL_ROOT.'/public/website/index.php?website='.urlencode($ws).'&pageref=paymentok&fulltag='.$FULLTAG; |
2131 | 2131 | } |
2132 | - print "<script>window.top.location.href = '".dol_escape_js($ext_urlok) ."';</script>"; |
|
2132 | + print "<script>window.top.location.href = '".dol_escape_js($ext_urlok)."';</script>"; |
|
2133 | 2133 | } else { |
2134 | 2134 | // Redirect to an error page |
2135 | 2135 | // Paymentko page must be created for the specific website |
2136 | 2136 | if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) { |
2137 | - $ext_urlko = $ws_virtuelhost . '/paymentko.php?fulltag='.$FULLTAG; |
|
2137 | + $ext_urlko = $ws_virtuelhost.'/paymentko.php?fulltag='.$FULLTAG; |
|
2138 | 2138 | } else { |
2139 | 2139 | $ext_urlko = DOL_URL_ROOT.'/public/website/index.php?website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG; |
2140 | 2140 | } |