@@ -91,14 +91,14 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | // General $Variables |
| 94 | -$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility |
|
| 94 | +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility |
|
| 95 | 95 | $ref = GETPOST('ref', 'alpha'); |
| 96 | 96 | $socid = GETPOSTINT('socid'); |
| 97 | 97 | $action = GETPOST('action', 'aZ09'); |
| 98 | 98 | $confirm = GETPOST('confirm', 'alpha'); |
| 99 | 99 | $cancel = GETPOST('cancel', 'alpha'); |
| 100 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 101 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 100 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 101 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 102 | 102 | $lineid = GETPOSTINT('lineid'); |
| 103 | 103 | $userid = GETPOSTINT('userid'); |
| 104 | 104 | $search_ref = GETPOST('sf_ref', 'alpha') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | setEventMessages('', $warningMsgLineList, 'warnings'); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result); |
|
| 275 | + header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result); |
|
| 276 | 276 | exit(); |
| 277 | 277 | } else { |
| 278 | 278 | $langs->load("errors"); |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | // Validation |
| 364 | 364 | $object->fetch($id); |
| 365 | 365 | |
| 366 | - if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 366 | + if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 367 | 367 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
| 368 | 368 | ) { |
| 369 | 369 | $object->date = dol_now(); |
@@ -783,8 +783,8 @@ discard block |
||
| 783 | 783 | // We check if invoice has payments |
| 784 | 784 | $totalpaid = 0; |
| 785 | 785 | $sql = 'SELECT pf.amount'; |
| 786 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'paiement_facture as pf'; |
|
| 787 | - $sql .= ' WHERE pf.fk_facture = ' . ((int) $object->id); |
|
| 786 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf'; |
|
| 787 | + $sql .= ' WHERE pf.fk_facture = '.((int) $object->id); |
|
| 788 | 788 | |
| 789 | 789 | $result = $db->query($sql); |
| 790 | 790 | if ($result) { |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | $error++; |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | - $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 1095 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 1096 | 1096 | $date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver'); |
| 1097 | 1097 | |
| 1098 | 1098 | // Replacement invoice |
@@ -1124,7 +1124,7 @@ discard block |
||
| 1124 | 1124 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1125 | 1125 | $object->ref_client = GETPOST('ref_client', 'alphanohtml'); |
| 1126 | 1126 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
| 1127 | - $object->model_pdf = GETPOST('model', 'alphanohtml'); |
|
| 1127 | + $object->model_pdf = GETPOST('model', 'alphanohtml'); |
|
| 1128 | 1128 | $object->fk_project = GETPOSTINT('projectid'); |
| 1129 | 1129 | $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); |
| 1130 | 1130 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
@@ -1185,9 +1185,9 @@ discard block |
||
| 1185 | 1185 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1186 | 1186 | $object->ref_client = GETPOST('ref_client', 'alphanohtml'); |
| 1187 | 1187 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
| 1188 | - $object->model_pdf = GETPOST('model'); |
|
| 1188 | + $object->model_pdf = GETPOST('model'); |
|
| 1189 | 1189 | $object->fk_project = GETPOSTINT('projectid'); |
| 1190 | - $object->cond_reglement_id = 0; // No payment term for a credit note |
|
| 1190 | + $object->cond_reglement_id = 0; // No payment term for a credit note |
|
| 1191 | 1191 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
| 1192 | 1192 | $object->fk_account = GETPOSTINT('fk_account'); |
| 1193 | 1193 | //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); |
@@ -1510,7 +1510,7 @@ discard block |
||
| 1510 | 1510 | $object->note_public = trim(GETPOST('note_public', 'restricthtml')); |
| 1511 | 1511 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1512 | 1512 | $object->ref_client = GETPOST('ref_client'); |
| 1513 | - $object->ref_customer = GETPOST('ref_client'); |
|
| 1513 | + $object->ref_customer = GETPOST('ref_client'); |
|
| 1514 | 1514 | $object->model_pdf = GETPOST('model'); |
| 1515 | 1515 | $object->fk_project = GETPOSTINT('projectid'); |
| 1516 | 1516 | $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id')); |
@@ -1574,7 +1574,7 @@ discard block |
||
| 1574 | 1574 | $element = $subelement = 'expedition'; |
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | - $object->origin = $origin; // deprecated |
|
| 1577 | + $object->origin = $origin; // deprecated |
|
| 1578 | 1578 | $object->origin_type = $origin; |
| 1579 | 1579 | $object->origin_id = $originid; |
| 1580 | 1580 | |
@@ -1609,7 +1609,7 @@ discard block |
||
| 1609 | 1609 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines or deposit lines"); |
| 1610 | 1610 | $result = $srcobject->fetch($object->origin_id); |
| 1611 | 1611 | |
| 1612 | - $i = -1; // Ensure initialised for static analysis, but with invalid idx. |
|
| 1612 | + $i = -1; // Ensure initialised for static analysis, but with invalid idx. |
|
| 1613 | 1613 | // If deposit invoice - down payment with 1 line (fixed amount or percent) |
| 1614 | 1614 | if (GETPOST('type') == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) { |
| 1615 | 1615 | // Define the array $amountdeposit |
@@ -2012,7 +2012,7 @@ discard block |
||
| 2012 | 2012 | if (!empty($origin) && !empty($originid)) { |
| 2013 | 2013 | include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; |
| 2014 | 2014 | |
| 2015 | - $object->origin = $origin; // deprecated |
|
| 2015 | + $object->origin = $origin; // deprecated |
|
| 2016 | 2016 | $object->origin_type = $origin; |
| 2017 | 2017 | $object->origin_id = $originid; |
| 2018 | 2018 | |
@@ -2038,7 +2038,7 @@ discard block |
||
| 2038 | 2038 | $line->fk_prev_id = $line->id; |
| 2039 | 2039 | $line->fetch_optionals(); |
| 2040 | 2040 | if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { |
| 2041 | - $line->situation_percent = 0; // New situation percent must be 0 (No cumulative) |
|
| 2041 | + $line->situation_percent = 0; // New situation percent must be 0 (No cumulative) |
|
| 2042 | 2042 | } else { |
| 2043 | 2043 | $line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note |
| 2044 | 2044 | } |
@@ -2155,7 +2155,7 @@ discard block |
||
| 2155 | 2155 | } else { |
| 2156 | 2156 | $db->rollback(); |
| 2157 | 2157 | $action = 'create'; |
| 2158 | - $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
| 2158 | + $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
| 2159 | 2159 | $_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ? |
| 2160 | 2160 | setEventMessages($object->error, $object->errors, 'errors'); |
| 2161 | 2161 | } |
@@ -2654,7 +2654,7 @@ discard block |
||
| 2654 | 2654 | if ($prod->price_min > $line->subprice) { |
| 2655 | 2655 | $price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto'); |
| 2656 | 2656 | $price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto'); |
| 2657 | - setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings'); |
|
| 2657 | + setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings'); |
|
| 2658 | 2658 | } else { |
| 2659 | 2659 | setEventMessages($prod->error, $prod->errors, 'errors'); |
| 2660 | 2660 | } |
@@ -2763,7 +2763,7 @@ discard block |
||
| 2763 | 2763 | // Define special_code for special lines |
| 2764 | 2764 | $special_code = GETPOSTINT('special_code'); |
| 2765 | 2765 | if ($special_code == 3) { |
| 2766 | - $special_code = 0; // Options should not exists on invoices |
|
| 2766 | + $special_code = 0; // Options should not exists on invoices |
|
| 2767 | 2767 | } |
| 2768 | 2768 | |
| 2769 | 2769 | $line = new FactureLigne($db); |
@@ -3210,7 +3210,7 @@ discard block |
||
| 3210 | 3210 | |
| 3211 | 3211 | |
| 3212 | 3212 | if ($action == 'update_extras' && $permissiontoeditextra) { |
| 3213 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 3213 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 3214 | 3214 | |
| 3215 | 3215 | $attribute_name = GETPOST('attribute', 'aZ09'); |
| 3216 | 3216 | |
@@ -3328,7 +3328,7 @@ discard block |
||
| 3328 | 3328 | $fk_account = GETPOSTINT('fk_account'); |
| 3329 | 3329 | |
| 3330 | 3330 | // Load objectsrc |
| 3331 | - $objectsrc = null; // Initialise |
|
| 3331 | + $objectsrc = null; // Initialise |
|
| 3332 | 3332 | //$remise_absolue = 0; |
| 3333 | 3333 | if (!empty($origin) && !empty($originid)) { |
| 3334 | 3334 | // Parse element/subelement (ex: project_task) |
@@ -3339,7 +3339,7 @@ discard block |
||
| 3339 | 3339 | $subelement = $regs[2]; |
| 3340 | 3340 | } |
| 3341 | 3341 | |
| 3342 | - $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 3342 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 3343 | 3343 | $date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver'); |
| 3344 | 3344 | |
| 3345 | 3345 | if ($element == 'project') { |
@@ -3417,8 +3417,8 @@ discard block |
||
| 3417 | 3417 | $fk_account = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0)); |
| 3418 | 3418 | |
| 3419 | 3419 | if (isModEnabled('multicurrency')) { |
| 3420 | - $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
|
| 3421 | - $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
| 3420 | + $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
|
| 3421 | + $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
| 3422 | 3422 | } |
| 3423 | 3423 | |
| 3424 | 3424 | //Replicate extrafields |
@@ -3511,7 +3511,7 @@ discard block |
||
| 3511 | 3511 | print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">'; |
| 3512 | 3512 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 3513 | 3513 | print '<input type="hidden" name="action" id="formtocreateaction" value="add">'; |
| 3514 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 3514 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 3515 | 3515 | if ($soc->id > 0) { |
| 3516 | 3516 | print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n"; |
| 3517 | 3517 | } |
@@ -3693,7 +3693,7 @@ discard block |
||
| 3693 | 3693 | print $form->selectarray('typestandard', $arraylist, GETPOST('typestandard', 'aZ09'), 0, 0, 0, '', 1); |
| 3694 | 3694 | print '</td>';*/ |
| 3695 | 3695 | if (!getDolGlobalInt('INVOICE_DEPOSIT_INVOICE_ONLY_SAME_LINES')) { |
| 3696 | - print '<span class="opacitymedium marginleftonly">' . $langs->trans('PercentOfOriginalObject') . '</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="' . (GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%') . '"/>'; |
|
| 3696 | + print '<span class="opacitymedium marginleftonly">'.$langs->trans('PercentOfOriginalObject').'</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="'.(GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%').'"/>'; |
|
| 3697 | 3697 | } |
| 3698 | 3698 | } |
| 3699 | 3699 | print '</div></div>'."\n"; |
@@ -4047,8 +4047,8 @@ discard block |
||
| 4047 | 4047 | if ($socid > 0) { |
| 4048 | 4048 | print '<tr><td>'.$langs->trans('DiscountStillRemaining').'</td><td colspan="2">'; |
| 4049 | 4049 | |
| 4050 | - $thirdparty = $soc; // used by object_discounts.tpl.php |
|
| 4051 | - $discount_type = 0; // used by object_discounts.tpl.php |
|
| 4050 | + $thirdparty = $soc; // used by object_discounts.tpl.php |
|
| 4051 | + $discount_type = 0; // used by object_discounts.tpl.php |
|
| 4052 | 4052 | $backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid'))); |
| 4053 | 4053 | include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; |
| 4054 | 4054 | |
@@ -4089,7 +4089,7 @@ discard block |
||
| 4089 | 4089 | if (empty($retained_warranty)) { |
| 4090 | 4090 | if ($objectsrc !== null && property_exists($objectsrc, 'retained_warranty') && !empty($objectsrc->retained_warranty)) { // use previous situation value |
| 4091 | 4091 | // Facture->retained_warranty (does not exist on Expedition) |
| 4092 | - $retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 4092 | + $retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 4093 | 4093 | } |
| 4094 | 4094 | } |
| 4095 | 4095 | $retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT'); |
@@ -4584,7 +4584,7 @@ discard block |
||
| 4584 | 4584 | $nbMandated = 0; |
| 4585 | 4585 | foreach ($object->lines as $line) { |
| 4586 | 4586 | $res = $line->fetch_product(); |
| 4587 | - if ($res > 0) { |
|
| 4587 | + if ($res > 0) { |
|
| 4588 | 4588 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
| 4589 | 4589 | $nbMandated++; |
| 4590 | 4590 | break; |
@@ -4796,7 +4796,7 @@ discard block |
||
| 4796 | 4796 | } |
| 4797 | 4797 | // Ref customer |
| 4798 | 4798 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string', '', 0, 1); |
| 4799 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 4799 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 4800 | 4800 | // Thirdparty |
| 4801 | 4801 | $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer'); |
| 4802 | 4802 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) { |
@@ -5226,45 +5226,45 @@ discard block |
||
| 5226 | 5226 | } |
| 5227 | 5227 | print '<tr>'; |
| 5228 | 5228 | // Amount HT |
| 5229 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
| 5230 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5229 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
| 5230 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5231 | 5231 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 5232 | 5232 | // Multicurrency Amount HT |
| 5233 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5233 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5234 | 5234 | } |
| 5235 | 5235 | print '</tr>'; |
| 5236 | 5236 | |
| 5237 | 5237 | print '<tr>'; |
| 5238 | 5238 | // Amount VAT |
| 5239 | - print '<td>' . $langs->trans('AmountVAT') . '</td>'; |
|
| 5240 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5239 | + print '<td>'.$langs->trans('AmountVAT').'</td>'; |
|
| 5240 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5241 | 5241 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 5242 | 5242 | // Multicurrency Amount VAT |
| 5243 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5243 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5244 | 5244 | } |
| 5245 | 5245 | print '</tr>'; |
| 5246 | 5246 | |
| 5247 | 5247 | // Amount Local Taxes |
| 5248 | 5248 | if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { |
| 5249 | 5249 | print '<tr>'; |
| 5250 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 5251 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5250 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 5251 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5252 | 5252 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 5253 | 5253 | $object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
| 5254 | 5254 | |
| 5255 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5255 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5256 | 5256 | } |
| 5257 | 5257 | print '</tr>'; |
| 5258 | 5258 | } |
| 5259 | 5259 | |
| 5260 | 5260 | if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { |
| 5261 | 5261 | print '<tr>'; |
| 5262 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 5263 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5262 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 5263 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5264 | 5264 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 5265 | 5265 | $object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
| 5266 | 5266 | |
| 5267 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5267 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5268 | 5268 | } |
| 5269 | 5269 | print '</tr>'; |
| 5270 | 5270 | } |
@@ -5324,11 +5324,11 @@ discard block |
||
| 5324 | 5324 | |
| 5325 | 5325 | print '<tr>'; |
| 5326 | 5326 | // Amount TTC |
| 5327 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
| 5328 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5327 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
| 5328 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5329 | 5329 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 5330 | 5330 | // Multicurrency Amount TTC |
| 5331 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5331 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5332 | 5332 | } |
| 5333 | 5333 | print '</tr>'; |
| 5334 | 5334 | |
@@ -5958,10 +5958,10 @@ discard block |
||
| 5958 | 5958 | if (!$objectidnext && $object->is_last_in_cycle()) { |
| 5959 | 5959 | if ($usercanunvalidate) { |
| 5960 | 5960 | unset($params['attr']['title']); |
| 5961 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', true, $params); |
|
| 5961 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', true, $params); |
|
| 5962 | 5962 | } else { |
| 5963 | 5963 | $params['attr']['title'] = $langs->trans('NotEnoughPermissions'); |
| 5964 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', false, $params); |
|
| 5964 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', false, $params); |
|
| 5965 | 5965 | } |
| 5966 | 5966 | } elseif (!$object->is_last_in_cycle()) { |
| 5967 | 5967 | $params['attr']['title'] = $langs->trans('NotLastInCycle'); |
@@ -6002,7 +6002,7 @@ discard block |
||
| 6002 | 6002 | $langs->load("contracts"); |
| 6003 | 6003 | |
| 6004 | 6004 | if ($usercancreatecontract) { |
| 6005 | - print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>'; |
|
| 6005 | + print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>'; |
|
| 6006 | 6006 | } |
| 6007 | 6007 | } |
| 6008 | 6008 | } |
@@ -6228,7 +6228,7 @@ discard block |
||
| 6228 | 6228 | if ($usercandelete || ($usercancreate && $isErasable == 1)) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) |
| 6229 | 6229 | $enableDelete = false; |
| 6230 | 6230 | $deleteHref = '#'; |
| 6231 | - if ($isErasable > 0 && ! $objectidnext) { |
|
| 6231 | + if ($isErasable > 0 && !$objectidnext) { |
|
| 6232 | 6232 | $deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken(); |
| 6233 | 6233 | $enableDelete = true; |
| 6234 | 6234 | } |
@@ -2638,8 +2638,10 @@ |
||
| 2638 | 2638 | $outlangs = $langs; |
| 2639 | 2639 | $margin_rate = GETPOSTISSET('marginforalllines') ? GETPOST('marginforalllines', 'int') : ''; |
| 2640 | 2640 | $mark_rate = GETPOSTISSET('markforalllines') ? GETPOST('markforalllines', 'int') : ''; |
| 2641 | - foreach ($object->lines as &$line) if ($line->subprice > 0) { |
|
| 2641 | + foreach ($object->lines as &$line) { |
|
| 2642 | + if ($line->subprice > 0) { |
|
| 2642 | 2643 | $subprice_multicurrency = $line->subprice; |
| 2644 | + } |
|
| 2643 | 2645 | if (is_numeric($margin_rate) && $margin_rate > 0) { |
| 2644 | 2646 | $line->subprice = floatval(price2num(floatval($line->pa_ht) * (1 + floatval($margin_rate) / 100), 'MU')); |
| 2645 | 2647 | } elseif (is_numeric($mark_rate) && $mark_rate > 0) { |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | $object->delivery_date = $date_delivery; |
| 238 | 238 | foreach ($object->lines as $line) { |
| 239 | 239 | if (isset($line->date_start)) { |
| 240 | - $line->date_start += $difference; |
|
| 240 | + $line->date_start += $difference; |
|
| 241 | 241 | } |
| 242 | 242 | if (isset($line->date_end)) { |
| 243 | 243 | $line->date_end += $difference; |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | |
| 586 | 586 | $classname = ucfirst($subelement); |
| 587 | 587 | $srcobject = new $classname($db); |
| 588 | - '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic |
|
| 588 | + '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic |
|
| 589 | 589 | |
| 590 | 590 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
| 591 | 591 | $result = $srcobject->fetch($object->origin_id); |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | $error++; |
| 776 | 776 | } else { |
| 777 | 777 | // Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded) |
| 778 | - $locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id; |
|
| 778 | + $locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id; |
|
| 779 | 779 | } |
| 780 | 780 | |
| 781 | 781 | $deposit = null; |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | !$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on' |
| 787 | 787 | && !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer') |
| 788 | 788 | ) { |
| 789 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 789 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 790 | 790 | |
| 791 | 791 | $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); |
| 792 | 792 | $forceFields = array(); |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | |
| 800 | 800 | if ($deposit) { |
| 801 | 801 | setEventMessage('DepositGenerated'); |
| 802 | - $locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id; |
|
| 802 | + $locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id; |
|
| 803 | 803 | } else { |
| 804 | 804 | $error++; |
| 805 | 805 | setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors'); |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | if ($locationTarget) { |
| 830 | - header('Location: ' . $locationTarget); |
|
| 830 | + header('Location: '.$locationTarget); |
|
| 831 | 831 | exit; |
| 832 | 832 | } |
| 833 | 833 | } else { |
@@ -1044,7 +1044,7 @@ discard block |
||
| 1044 | 1044 | // $line->subprice = (float) $subprice; |
| 1045 | 1045 | // $line->multicurrency_subprice = $multicurrency_subprice; |
| 1046 | 1046 | } |
| 1047 | - } elseif ( $action == 'addline' && !GETPOST('submitforalllines', 'alpha') |
|
| 1047 | + } elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') |
|
| 1048 | 1048 | && !GETPOST('submitforallmargins', 'alpha') && !GETPOST('markforalllines', 'alpha') |
| 1049 | 1049 | && $usercancreate) { // Add line |
| 1050 | 1050 | // Set if we used free entry or predefined product |
@@ -1568,7 +1568,7 @@ discard block |
||
| 1568 | 1568 | if ($prod->price_min > $line->subprice) { |
| 1569 | 1569 | $price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto'); |
| 1570 | 1570 | $price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto'); |
| 1571 | - setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings'); |
|
| 1571 | + setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings'); |
|
| 1572 | 1572 | } else { |
| 1573 | 1573 | setEventMessages($prod->error, $prod->errors, 'errors'); |
| 1574 | 1574 | } |
@@ -1813,8 +1813,8 @@ discard block |
||
| 1813 | 1813 | } elseif ($action == 'setconditions' && $usercancreate) { |
| 1814 | 1814 | // Terms of payment |
| 1815 | 1815 | $sql = "SELECT code "; |
| 1816 | - $sql .= "FROM " . $db->prefix() . "c_payment_term"; |
|
| 1817 | - $sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int')); |
|
| 1816 | + $sql .= "FROM ".$db->prefix()."c_payment_term"; |
|
| 1817 | + $sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int')); |
|
| 1818 | 1818 | $result = $db->query($sql); |
| 1819 | 1819 | if ($result) { |
| 1820 | 1820 | $obj = $db->fetch_object($result); |
@@ -2000,7 +2000,7 @@ discard block |
||
| 2000 | 2000 | |
| 2001 | 2001 | $classname = ucfirst($subelement); |
| 2002 | 2002 | $objectsrc = new $classname($db); |
| 2003 | - '@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic |
|
| 2003 | + '@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic |
|
| 2004 | 2004 | $objectsrc->fetch($originid); |
| 2005 | 2005 | if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { |
| 2006 | 2006 | $objectsrc->fetch_lines(); |
@@ -2014,7 +2014,7 @@ discard block |
||
| 2014 | 2014 | |
| 2015 | 2015 | $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); |
| 2016 | 2016 | $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); |
| 2017 | - $warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0)); |
|
| 2017 | + $warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0)); |
|
| 2018 | 2018 | |
| 2019 | 2019 | // Replicate extrafields |
| 2020 | 2020 | $objectsrc->fetch_optionals(); |
@@ -2078,7 +2078,7 @@ discard block |
||
| 2078 | 2078 | print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
| 2079 | 2079 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 2080 | 2080 | print '<input type="hidden" name="action" value="add">'; |
| 2081 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 2081 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 2082 | 2082 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
| 2083 | 2083 | if ($origin != 'project' && $originid) { |
| 2084 | 2084 | print '<input type="hidden" name="origin" value="'.$origin.'">'; |
@@ -2472,7 +2472,7 @@ discard block |
||
| 2472 | 2472 | if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { |
| 2473 | 2473 | $formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED))); |
| 2474 | 2474 | } |
| 2475 | - $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace) |
|
| 2475 | + $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace) |
|
| 2476 | 2476 | |
| 2477 | 2477 | if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) { |
| 2478 | 2478 | // This is a hidden option: |
@@ -2482,7 +2482,7 @@ discard block |
||
| 2482 | 2482 | $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); |
| 2483 | 2483 | |
| 2484 | 2484 | if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { |
| 2485 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 2485 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 2486 | 2486 | |
| 2487 | 2487 | $object->fetchObjectLinked(); |
| 2488 | 2488 | |
@@ -2566,7 +2566,7 @@ discard block |
||
| 2566 | 2566 | 'type' => 'onecolumn', |
| 2567 | 2567 | 'value' => ' |
| 2568 | 2568 | <script> |
| 2569 | - let signedValue = ' . $object::STATUS_SIGNED . '; |
|
| 2569 | + let signedValue = ' . $object::STATUS_SIGNED.'; |
|
| 2570 | 2570 | |
| 2571 | 2571 | $(document).ready(function() { |
| 2572 | 2572 | $("[name=generate_deposit]").change(function () { |
@@ -2616,7 +2616,7 @@ discard block |
||
| 2616 | 2616 | if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { |
| 2617 | 2617 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
| 2618 | 2618 | } else { |
| 2619 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
|
| 2619 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
|
| 2620 | 2620 | } |
| 2621 | 2621 | } elseif ($action == 'cancel') { |
| 2622 | 2622 | // Confirm cancel |
@@ -2658,7 +2658,7 @@ discard block |
||
| 2658 | 2658 | $nbMandated = 0; |
| 2659 | 2659 | foreach ($object->lines as $line) { |
| 2660 | 2660 | $res = $line->fetch_product(); |
| 2661 | - if ($res > 0) { |
|
| 2661 | + if ($res > 0) { |
|
| 2662 | 2662 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
| 2663 | 2663 | $nbMandated++; |
| 2664 | 2664 | break; |
@@ -2699,7 +2699,7 @@ discard block |
||
| 2699 | 2699 | $morehtmlref = '<div class="refidno">'; |
| 2700 | 2700 | // Ref customer |
| 2701 | 2701 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); |
| 2702 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 2702 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 2703 | 2703 | // Thirdparty |
| 2704 | 2704 | $morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer'); |
| 2705 | 2705 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) { |
@@ -3041,50 +3041,50 @@ discard block |
||
| 3041 | 3041 | include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php'; |
| 3042 | 3042 | |
| 3043 | 3043 | print '<tr>'; |
| 3044 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
| 3045 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3044 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
| 3045 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 3046 | 3046 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3047 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3047 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3048 | 3048 | } |
| 3049 | 3049 | print '</tr>'; |
| 3050 | 3050 | |
| 3051 | 3051 | print '<tr>'; |
| 3052 | - print '<td>' . $langs->trans('AmountVAT') . '</td>'; |
|
| 3053 | - print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3052 | + print '<td>'.$langs->trans('AmountVAT').'</td>'; |
|
| 3053 | + print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 3054 | 3054 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3055 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3055 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3056 | 3056 | } |
| 3057 | 3057 | print '</tr>'; |
| 3058 | 3058 | |
| 3059 | 3059 | if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { |
| 3060 | 3060 | print '<tr>'; |
| 3061 | - print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 3062 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3061 | + print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 3062 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 3063 | 3063 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3064 | 3064 | $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
| 3065 | 3065 | |
| 3066 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3066 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3067 | 3067 | } |
| 3068 | 3068 | print '</tr>'; |
| 3069 | 3069 | } |
| 3070 | 3070 | |
| 3071 | 3071 | if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { |
| 3072 | 3072 | print '<tr>'; |
| 3073 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 3074 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3073 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 3074 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 3075 | 3075 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3076 | 3076 | $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
| 3077 | 3077 | |
| 3078 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3078 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3079 | 3079 | } |
| 3080 | 3080 | print '</tr>'; |
| 3081 | 3081 | } |
| 3082 | 3082 | |
| 3083 | 3083 | print '<tr>'; |
| 3084 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
| 3085 | - print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3084 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
| 3085 | + print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
| 3086 | 3086 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3087 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3087 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3088 | 3088 | } |
| 3089 | 3089 | print '</tr>'; |
| 3090 | 3090 | |
@@ -3231,7 +3231,7 @@ discard block |
||
| 3231 | 3231 | 'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED), |
| 3232 | 3232 | 'perm' => $usercancreateorder, |
| 3233 | 3233 | 'label' => 'AddOrder', |
| 3234 | - 'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3234 | + 'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3235 | 3235 | ); |
| 3236 | 3236 | /*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) { |
| 3237 | 3237 | if ($usercancreateorder) { |
@@ -3246,7 +3246,7 @@ discard block |
||
| 3246 | 3246 | 'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")), |
| 3247 | 3247 | 'perm' => $usercancreatepurchaseorder, |
| 3248 | 3248 | 'label' => 'AddPurchaseOrder', |
| 3249 | - 'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3249 | + 'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3250 | 3250 | ); |
| 3251 | 3251 | /*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) { |
| 3252 | 3252 | if ($usercancreatepurchaseorder) { |
@@ -3261,7 +3261,7 @@ discard block |
||
| 3261 | 3261 | 'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED), |
| 3262 | 3262 | 'perm' => $usercancreateintervention, |
| 3263 | 3263 | 'label' => 'AddIntervention', |
| 3264 | - 'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3264 | + 'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3265 | 3265 | ); |
| 3266 | 3266 | /*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) { |
| 3267 | 3267 | if ($usercancreateintervention) { |
@@ -3276,7 +3276,7 @@ discard block |
||
| 3276 | 3276 | 'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED), |
| 3277 | 3277 | 'perm' => $usercancreatecontract, |
| 3278 | 3278 | 'label' => 'AddContract', |
| 3279 | - 'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
| 3279 | + 'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
| 3280 | 3280 | ); |
| 3281 | 3281 | /*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) { |
| 3282 | 3282 | $langs->load("contracts"); |
@@ -3302,7 +3302,7 @@ discard block |
||
| 3302 | 3302 | |
| 3303 | 3303 | $actionButtonsParameters = [ |
| 3304 | 3304 | "areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"), |
| 3305 | - "backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id) |
|
| 3305 | + "backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id) |
|
| 3306 | 3306 | ]; |
| 3307 | 3307 | |
| 3308 | 3308 | if ($numlines > 0) { |
@@ -3336,8 +3336,8 @@ discard block |
||
| 3336 | 3336 | } else { |
| 3337 | 3337 | // Set not signed (close) |
| 3338 | 3338 | if ($object->status == Propal::STATUS_DRAFT && $usercanclose) { |
| 3339 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token='.newToken().'&action=closeas&token='.newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"'; |
|
| 3340 | - print '>' . $langs->trans('SetRefusedAndClose') . '</a>'; |
|
| 3339 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"'; |
|
| 3340 | + print '>'.$langs->trans('SetRefusedAndClose').'</a>'; |
|
| 3341 | 3341 | } |
| 3342 | 3342 | } |
| 3343 | 3343 | |
@@ -1552,8 +1552,10 @@ |
||
| 1552 | 1552 | // Define margin |
| 1553 | 1553 | $margin_rate = GETPOSTISSET('marginforalllines') ? GETPOST('marginforalllines', 'int') : ''; |
| 1554 | 1554 | $mark_rate = GETPOSTISSET('markforalllines') ? GETPOST('markforalllines', 'int') : ''; |
| 1555 | - foreach ($object->lines as &$line) if ($line->subprice > 0) { |
|
| 1555 | + foreach ($object->lines as &$line) { |
|
| 1556 | + if ($line->subprice > 0) { |
|
| 1556 | 1557 | $subprice_multicurrency = $line->subprice; |
| 1558 | + } |
|
| 1557 | 1559 | if (is_numeric($margin_rate) && $margin_rate > 0) { |
| 1558 | 1560 | $line->subprice = floatval(price2num(floatval($line->pa_ht) * (1 + floatval($margin_rate) / 100), 'MU')); |
| 1559 | 1561 | } elseif (is_numeric($mark_rate) && $mark_rate > 0) { |
@@ -91,18 +91,18 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | $id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('orderid')); |
| 94 | -$ref = GETPOST('ref', 'alpha'); |
|
| 95 | -$socid = GETPOSTINT('socid'); |
|
| 96 | -$action = GETPOST('action', 'aZ09'); |
|
| 97 | -$cancel = GETPOST('cancel', 'alpha'); |
|
| 98 | -$confirm = GETPOST('confirm', 'alpha'); |
|
| 94 | +$ref = GETPOST('ref', 'alpha'); |
|
| 95 | +$socid = GETPOSTINT('socid'); |
|
| 96 | +$action = GETPOST('action', 'aZ09'); |
|
| 97 | +$cancel = GETPOST('cancel', 'alpha'); |
|
| 98 | +$confirm = GETPOST('confirm', 'alpha'); |
|
| 99 | 99 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 100 | 100 | |
| 101 | -$lineid = GETPOSTINT('lineid'); |
|
| 102 | -$contactid = GETPOSTINT('contactid'); |
|
| 103 | -$projectid = GETPOSTINT('projectid'); |
|
| 104 | -$origin = GETPOST('origin', 'alpha'); |
|
| 105 | -$originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility |
|
| 101 | +$lineid = GETPOSTINT('lineid'); |
|
| 102 | +$contactid = GETPOSTINT('contactid'); |
|
| 103 | +$projectid = GETPOSTINT('projectid'); |
|
| 104 | +$origin = GETPOST('origin', 'alpha'); |
|
| 105 | +$originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility |
|
| 106 | 106 | $rank = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1; |
| 107 | 107 | |
| 108 | 108 | // Type Contact default |
@@ -145,26 +145,26 @@ discard block |
||
| 145 | 145 | $extrafields->fetch_name_optionals_label($object->table_element); |
| 146 | 146 | |
| 147 | 147 | // Load object |
| 148 | -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' |
|
| 148 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' |
|
| 149 | 149 | |
| 150 | 150 | // Permissions / Rights |
| 151 | -$usercanread = $user->hasRight("commande", "lire"); |
|
| 152 | -$usercancreate = $user->hasRight("commande", "creer"); |
|
| 153 | -$usercandelete = $user->hasRight("commande", "supprimer"); |
|
| 151 | +$usercanread = $user->hasRight("commande", "lire"); |
|
| 152 | +$usercancreate = $user->hasRight("commande", "creer"); |
|
| 153 | +$usercandelete = $user->hasRight("commande", "supprimer"); |
|
| 154 | 154 | |
| 155 | 155 | // Advanced permissions |
| 156 | -$usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close'))); |
|
| 157 | -$usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate'))); |
|
| 158 | -$usercancancel = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler'))); |
|
| 159 | -$usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send')); |
|
| 160 | -$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc')); |
|
| 156 | +$usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close'))); |
|
| 157 | +$usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate'))); |
|
| 158 | +$usercancancel = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler'))); |
|
| 159 | +$usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send')); |
|
| 160 | +$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc')); |
|
| 161 | 161 | |
| 162 | 162 | $usermustrespectpricemin = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('produit', 'ignore_price_min_advance')) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS')); |
| 163 | 163 | $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer')); |
| 164 | 164 | |
| 165 | -$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php |
|
| 166 | -$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php |
|
| 167 | -$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 165 | +$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php |
|
| 166 | +$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php |
|
| 167 | +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 168 | 168 | $permissiontoeditextra = $usercancreate; |
| 169 | 169 | if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { |
| 170 | 170 | // For action 'update_extras', is there a specific permission set for the attribute to update |
@@ -215,11 +215,11 @@ discard block |
||
| 215 | 215 | $action = ''; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' |
|
| 218 | + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' |
|
| 219 | 219 | |
| 220 | - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 220 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 221 | 221 | |
| 222 | - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
| 222 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
| 223 | 223 | |
| 224 | 224 | // Action clone object |
| 225 | 225 | if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) { |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | if ($prod->price_min > $line->subprice) { |
| 760 | 760 | $price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto'); |
| 761 | 761 | $price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto'); |
| 762 | - setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings'); |
|
| 762 | + setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings'); |
|
| 763 | 763 | } else { |
| 764 | 764 | setEventMessages($prod->error, $prod->errors, 'errors'); |
| 765 | 765 | } |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | $pu_ht = ''; |
| 806 | 806 | $pu_ttc = ''; |
| 807 | 807 | $pu_ht_devise = ''; |
| 808 | - $pu_ttc_devise = ''; |
|
| 808 | + $pu_ttc_devise = ''; |
|
| 809 | 809 | |
| 810 | 810 | if (GETPOST('price_ht') !== '') { |
| 811 | 811 | $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); |
@@ -946,7 +946,7 @@ discard block |
||
| 946 | 946 | $price_base_type = $custprice_line->price_base_type; |
| 947 | 947 | $tva_tx = $custprice_line->tva_tx; |
| 948 | 948 | if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', (string) $tva_tx)) { |
| 949 | - $tva_tx .= ' (' . $custprice_line->default_vat_code . ')'; |
|
| 949 | + $tva_tx .= ' ('.$custprice_line->default_vat_code.')'; |
|
| 950 | 950 | } |
| 951 | 951 | $tva_npr = $custprice_line->recuperableonly; |
| 952 | 952 | if (empty($tva_tx)) { |
@@ -1012,7 +1012,7 @@ discard block |
||
| 1012 | 1012 | $price_base_type = $custprice_line->price_base_type; |
| 1013 | 1013 | $tva_tx = $custprice_line->tva_tx; |
| 1014 | 1014 | if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
| 1015 | - $tva_tx .= ' (' . $custprice_line->default_vat_code . ')'; |
|
| 1015 | + $tva_tx .= ' ('.$custprice_line->default_vat_code.')'; |
|
| 1016 | 1016 | } |
| 1017 | 1017 | $tva_npr = $custprice_line->recuperableonly; |
| 1018 | 1018 | if (empty($tva_tx)) { |
@@ -1540,7 +1540,7 @@ discard block |
||
| 1540 | 1540 | GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms) |
| 1541 | 1541 | && isModEnabled('invoice') && $user->hasRight('facture', 'creer') |
| 1542 | 1542 | ) { |
| 1543 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 1543 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 1544 | 1544 | |
| 1545 | 1545 | $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); |
| 1546 | 1546 | $forceFields = array(); |
@@ -1553,7 +1553,7 @@ discard block |
||
| 1553 | 1553 | |
| 1554 | 1554 | if ($deposit) { |
| 1555 | 1555 | setEventMessage('DepositGenerated'); |
| 1556 | - $locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id; |
|
| 1556 | + $locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id; |
|
| 1557 | 1557 | } else { |
| 1558 | 1558 | $error++; |
| 1559 | 1559 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1561,7 +1561,7 @@ discard block |
||
| 1561 | 1561 | } |
| 1562 | 1562 | |
| 1563 | 1563 | // Define output language |
| 1564 | - if (! $error) { |
|
| 1564 | + if (!$error) { |
|
| 1565 | 1565 | $db->commit(); |
| 1566 | 1566 | |
| 1567 | 1567 | if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) { |
@@ -1589,7 +1589,7 @@ discard block |
||
| 1589 | 1589 | } |
| 1590 | 1590 | |
| 1591 | 1591 | if ($locationTarget) { |
| 1592 | - header('Location: ' . $locationTarget); |
|
| 1592 | + header('Location: '.$locationTarget); |
|
| 1593 | 1593 | exit; |
| 1594 | 1594 | } |
| 1595 | 1595 | } else { |
@@ -1680,7 +1680,7 @@ discard block |
||
| 1680 | 1680 | } |
| 1681 | 1681 | |
| 1682 | 1682 | if ($action == 'update_extras' && $permissiontoeditextra) { |
| 1683 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 1683 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 1684 | 1684 | |
| 1685 | 1685 | $attribute_name = GETPOST('attribute', 'aZ09'); |
| 1686 | 1686 | |
@@ -1918,7 +1918,7 @@ discard block |
||
| 1918 | 1918 | |
| 1919 | 1919 | $classname = ucfirst($subelement); |
| 1920 | 1920 | $objectsrc = new $classname($db); |
| 1921 | - '@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general |
|
| 1921 | + '@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general |
|
| 1922 | 1922 | $objectsrc->fetch($originid); |
| 1923 | 1923 | if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { |
| 1924 | 1924 | $objectsrc->fetch_lines(); |
@@ -2015,7 +2015,7 @@ discard block |
||
| 2015 | 2015 | print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
| 2016 | 2016 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 2017 | 2017 | print '<input type="hidden" name="action" value="add">'; |
| 2018 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 2018 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 2019 | 2019 | print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">'; |
| 2020 | 2020 | print '<input type="hidden" name="origin" value="'.$origin.'">'; |
| 2021 | 2021 | print '<input type="hidden" name="originid" value="'.$originid.'">'; |
@@ -2197,7 +2197,7 @@ discard block |
||
| 2197 | 2197 | // Other attributes |
| 2198 | 2198 | $parameters = array(); |
| 2199 | 2199 | if (!empty($origin) && !empty($originid) && is_object($objectsrc)) { |
| 2200 | - $parameters['objectsrc'] = $objectsrc; |
|
| 2200 | + $parameters['objectsrc'] = $objectsrc; |
|
| 2201 | 2201 | } |
| 2202 | 2202 | $parameters['socid'] = $socid; |
| 2203 | 2203 | |
@@ -2423,7 +2423,7 @@ discard block |
||
| 2423 | 2423 | $nbMandated = 0; |
| 2424 | 2424 | foreach ($object->lines as $line) { |
| 2425 | 2425 | $res = $line->fetch_product(); |
| 2426 | - if ($res > 0) { |
|
| 2426 | + if ($res > 0) { |
|
| 2427 | 2427 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
| 2428 | 2428 | $nbMandated++; |
| 2429 | 2429 | break; |
@@ -2447,7 +2447,7 @@ discard block |
||
| 2447 | 2447 | $deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); |
| 2448 | 2448 | |
| 2449 | 2449 | if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { |
| 2450 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 2450 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 2451 | 2451 | |
| 2452 | 2452 | $object->fetchObjectLinked(); |
| 2453 | 2453 | |
@@ -2660,7 +2660,7 @@ discard block |
||
| 2660 | 2660 | $morehtmlref = '<div class="refidno">'; |
| 2661 | 2661 | // Ref customer |
| 2662 | 2662 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string', '', 0, 1); |
| 2663 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 2663 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 2664 | 2664 | // Thirdparty |
| 2665 | 2665 | $morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer'); |
| 2666 | 2666 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) { |
@@ -2980,36 +2980,36 @@ discard block |
||
| 2980 | 2980 | |
| 2981 | 2981 | $alert = ''; |
| 2982 | 2982 | if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->order_min_amount) { |
| 2983 | - $alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount)); |
|
| 2983 | + $alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount)); |
|
| 2984 | 2984 | } |
| 2985 | 2985 | |
| 2986 | 2986 | print '<tr>'; |
| 2987 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
| 2988 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 2987 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
| 2988 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 2989 | 2989 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2990 | 2990 | // Multicurrency Amount HT |
| 2991 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 2991 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 2992 | 2992 | } |
| 2993 | 2993 | print '</tr>'; |
| 2994 | 2994 | |
| 2995 | 2995 | print '<tr>'; |
| 2996 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>'; |
|
| 2997 | - print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 2996 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>'; |
|
| 2997 | + print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 2998 | 2998 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 2999 | 2999 | // Multicurrency Amount VAT |
| 3000 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3000 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3001 | 3001 | } |
| 3002 | 3002 | print '</tr>'; |
| 3003 | 3003 | |
| 3004 | 3004 | // Amount Local Taxes |
| 3005 | 3005 | if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { |
| 3006 | 3006 | print '<tr>'; |
| 3007 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 3008 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 3007 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 3008 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 3009 | 3009 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3010 | 3010 | $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
| 3011 | 3011 | |
| 3012 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3012 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3013 | 3013 | } |
| 3014 | 3014 | print '</tr>'; |
| 3015 | 3015 | } |
@@ -3017,22 +3017,22 @@ discard block |
||
| 3017 | 3017 | // Amount Local Taxes |
| 3018 | 3018 | if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { |
| 3019 | 3019 | print '<tr>'; |
| 3020 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 3021 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 3020 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 3021 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 3022 | 3022 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3023 | 3023 | $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
| 3024 | 3024 | |
| 3025 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3025 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3026 | 3026 | } |
| 3027 | 3027 | print '</tr>'; |
| 3028 | 3028 | } |
| 3029 | 3029 | |
| 3030 | 3030 | print '<tr>'; |
| 3031 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
| 3032 | - print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>'; |
|
| 3031 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
| 3032 | + print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>'; |
|
| 3033 | 3033 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 3034 | 3034 | // Multicurrency Amount TTC |
| 3035 | - print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 3035 | + print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 3036 | 3036 | } |
| 3037 | 3037 | print '</tr>'."\n"; |
| 3038 | 3038 | |
@@ -3149,7 +3149,7 @@ discard block |
||
| 3149 | 3149 | if ($usercansend) { |
| 3150 | 3150 | print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); |
| 3151 | 3151 | } else { |
| 3152 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 3152 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 3153 | 3153 | } |
| 3154 | 3154 | } |
| 3155 | 3155 | } |
@@ -3177,7 +3177,7 @@ discard block |
||
| 3177 | 3177 | 'enabled' => (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT), |
| 3178 | 3178 | 'perm' => $usercancreatepurchaseorder, |
| 3179 | 3179 | 'label' => 'AddPurchaseOrder', |
| 3180 | - 'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) |
|
| 3180 | + 'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id) |
|
| 3181 | 3181 | ); |
| 3182 | 3182 | } |
| 3183 | 3183 | |
@@ -3194,7 +3194,7 @@ discard block |
||
| 3194 | 3194 | 'enabled' => (isModEnabled("intervention") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0), |
| 3195 | 3195 | 'perm' => ($user->hasRight('ficheinter', 'creer') == 1), |
| 3196 | 3196 | 'label' => 'AddIntervention', |
| 3197 | - 'url' => '/fichinter/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid, |
|
| 3197 | + 'url' => '/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, |
|
| 3198 | 3198 | ); |
| 3199 | 3199 | } |
| 3200 | 3200 | |
@@ -3216,7 +3216,7 @@ discard block |
||
| 3216 | 3216 | 'enabled' => (isModEnabled("contract") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)), |
| 3217 | 3217 | 'perm' => ($user->hasRight('contrat', 'creer') == 1), |
| 3218 | 3218 | 'label' => 'AddContract', |
| 3219 | - 'url' => '/contrat/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid, |
|
| 3219 | + 'url' => '/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, |
|
| 3220 | 3220 | ); |
| 3221 | 3221 | /*if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { |
| 3222 | 3222 | $langs->load("contracts"); |
@@ -3240,7 +3240,7 @@ discard block |
||
| 3240 | 3240 | 'enabled' => (isModEnabled("shipping") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), |
| 3241 | 3241 | 'perm' => $user->hasRight('expedition', 'creer'), |
| 3242 | 3242 | 'label' => 'CreateShipment', |
| 3243 | - 'url' => '/expedition/shipment.php?id=' . $object->id |
|
| 3243 | + 'url' => '/expedition/shipment.php?id='.$object->id |
|
| 3244 | 3244 | ); |
| 3245 | 3245 | } else { |
| 3246 | 3246 | //c$langs->load("errors"); |
@@ -3250,7 +3250,7 @@ discard block |
||
| 3250 | 3250 | 'enabled' => (isModEnabled("shipping") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), |
| 3251 | 3251 | 'perm' => 0, |
| 3252 | 3252 | 'label' => 'CreateShipment', |
| 3253 | - 'url' => '/expedition/shipment.php?id=' . $object->id |
|
| 3253 | + 'url' => '/expedition/shipment.php?id='.$object->id |
|
| 3254 | 3254 | ); |
| 3255 | 3255 | } |
| 3256 | 3256 | } |
@@ -3262,7 +3262,7 @@ discard block |
||
| 3262 | 3262 | 'enabled' => (isModEnabled('invoice') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0), |
| 3263 | 3263 | 'perm' => ($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')), |
| 3264 | 3264 | 'label' => 'CreateBill', |
| 3265 | - 'url' => '/compta/facture/card.php?action=create&token=' . newToken() . '&origin=' . urlencode($object->element) . '&originid=' . $object->id . '&socid=' . $object->socid |
|
| 3265 | + 'url' => '/compta/facture/card.php?action=create&token='.newToken().'&origin='.urlencode($object->element).'&originid='.$object->id.'&socid='.$object->socid |
|
| 3266 | 3266 | ); |
| 3267 | 3267 | /* |
| 3268 | 3268 | if (isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { |
@@ -3314,7 +3314,7 @@ discard block |
||
| 3314 | 3314 | if ($numshipping == 0) { |
| 3315 | 3315 | print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); |
| 3316 | 3316 | } else { |
| 3317 | - print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 3317 | + print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 3318 | 3318 | } |
| 3319 | 3319 | } |
| 3320 | 3320 | } |
@@ -743,8 +743,10 @@ |
||
| 743 | 743 | // Define margin |
| 744 | 744 | $margin_rate = GETPOSTISSET('marginforalllines') ? GETPOST('marginforalllines', 'int') : ''; |
| 745 | 745 | $mark_rate = GETPOSTISSET('markforalllines') ? GETPOST('markforalllines', 'int') : ''; |
| 746 | - foreach ($object->lines as &$line) if ($line->subprice > 0) { |
|
| 746 | + foreach ($object->lines as &$line) { |
|
| 747 | + if ($line->subprice > 0) { |
|
| 747 | 748 | $subprice_multicurrency = $line->subprice; |
| 749 | + } |
|
| 748 | 750 | if (is_numeric($margin_rate) && $margin_rate > 0) { |
| 749 | 751 | $line->subprice = floatval(price2num(floatval($line->pa_ht) * (1 + floatval($margin_rate) / 100), 'MU')); |
| 750 | 752 | } elseif (is_numeric($mark_rate) && $mark_rate > 0) { |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | $host = 'tls://'.$host; |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | - $hosth = $host; // so for example 'localhost' or 'smtp-relay.gmail.com' |
|
| 528 | + $hosth = $host; // so for example 'localhost' or 'smtp-relay.gmail.com' |
|
| 529 | 529 | |
| 530 | 530 | if (getDolGlobalString('MAIL_SMTP_USE_FROM_FOR_HELO')) { // Note that default value is forced to MAIL_SMTP_USE_FROM_FOR_HELO=2 if not set |
| 531 | 531 | if (!is_numeric(getDolGlobalString('MAIL_SMTP_USE_FROM_FOR_HELO'))) { |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | } |
| 624 | 624 | // Most servers expect a 2nd pass of EHLO after TLS is established to get another time |
| 625 | 625 | // the answer with list of supported AUTH methods. They may differs between non STARTTLS and with STARTTLS. |
| 626 | - if (! $_retVal = $this->socket_send_str('EHLO '.$hosth, '250')) { |
|
| 626 | + if (!$_retVal = $this->socket_send_str('EHLO '.$hosth, '250')) { |
|
| 627 | 627 | $this->_setErr(126, '"'.$hosth.'" does not support authenticated connections or temporary error. Error after 2nd sending EHLO '.$hosth.' : '.$this->lastretval); |
| 628 | 628 | return $_retVal; |
| 629 | 629 | } |
@@ -1798,7 +1798,7 @@ discard block |
||
| 1798 | 1798 | $this->_msgContent['attachment'][$strFileName]['mimeType'] = $strMimeType; |
| 1799 | 1799 | $this->_msgContent['attachment'][$strFileName]['fileName'] = $strFileName; |
| 1800 | 1800 | $this->_msgContent['attachment'][$strFileName]['data'] = $strContent; |
| 1801 | - $this->_msgContent['attachment'][$strFileName]['cid'] = $strCid; // If defined, it means this attachment must be shown inline |
|
| 1801 | + $this->_msgContent['attachment'][$strFileName]['cid'] = $strCid; // If defined, it means this attachment must be shown inline |
|
| 1802 | 1802 | |
| 1803 | 1803 | if ($this->getMD5flag()) { |
| 1804 | 1804 | $this->_msgContent['attachment'][$strFileName]['md5'] = dol_hash($strContent, '3'); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | // Parameters |
| 46 | 46 | $action = GETPOST('action', 'aZ09'); |
| 47 | 47 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 48 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
| 48 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
| 49 | 49 | |
| 50 | 50 | if (empty($action)) { |
| 51 | 51 | $action = 'edit'; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | // List all available features |
| 73 | 73 | $arrayofaifeatures = getListOfAIFeatures(); |
| 74 | 74 | |
| 75 | -$item = $formSetup->newItem('AI_API_SERVICE'); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
| 75 | +$item = $formSetup->newItem('AI_API_SERVICE'); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
| 76 | 76 | $item->setAsSelect($arrayofai); |
| 77 | 77 | $item->cssClass = 'minwidth150'; |
| 78 | 78 | |
@@ -82,14 +82,14 @@ discard block |
||
| 82 | 82 | $item->defaultFieldValue = ''; |
| 83 | 83 | $item->cssClass = 'minwidth500';*/ |
| 84 | 84 | |
| 85 | - $item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_KEY')->setAsSecureKey(); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
| 85 | + $item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_KEY')->setAsSecureKey(); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
| 86 | 86 | $item->nameText = $langs->trans("AI_API_KEY").' ('.$ialabel.')'; |
| 87 | 87 | $item->defaultFieldValue = ''; |
| 88 | 88 | $item->fieldParams['hideGenerateButton'] = 1; |
| 89 | 89 | $item->fieldParams['trClass'] = 'iaservice '.$ia; |
| 90 | 90 | $item->cssClass = 'minwidth500 text-security input'.$ia; |
| 91 | 91 | |
| 92 | - $item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_URL'); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
| 92 | + $item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_URL'); // Name of constant must end with _KEY so it is encrypted when saved into database. |
|
| 93 | 93 | $item->nameText = $langs->trans("AI_API_URL").' ('.$ialabel.')'; |
| 94 | 94 | $item->defaultFieldValue = ''; |
| 95 | 95 | $item->fieldParams['trClass'] = 'iaservice '.$ia; |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $out = ''; |
| 194 | 194 | |
| 195 | 195 | //if ($functioncode) { |
| 196 | - $key = 'textgenerationother'; // The HTML ID of field to fill |
|
| 196 | + $key = 'textgenerationother'; // The HTML ID of field to fill |
|
| 197 | 197 | |
| 198 | 198 | $labeloffeature = empty($arrayofaifeatures[$key]['label']) ? 'Undefined' : $arrayofaifeatures[$key]['label']; |
| 199 | 199 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | $formai = new FormAI($db); |
| 210 | 210 | $formmail = new FormMail($db); |
| 211 | 211 | |
| 212 | - $showlinktoai = $key; // 'textgeneration', 'imagegeneration', ... |
|
| 212 | + $showlinktoai = $key; // 'textgeneration', 'imagegeneration', ... |
|
| 213 | 213 | $showlinktoailabel = $langs->trans("AITestText"); |
| 214 | 214 | $showlinktolayout = 0; |
| 215 | 215 | $htmlname = $key; |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | // Fill $out |
| 218 | 218 | include DOL_DOCUMENT_ROOT.'/core/tpl/formlayoutai.tpl.php'; |
| 219 | 219 | |
| 220 | - $out .= '<br><textarea id="'.$key.'" placeholder="Lore ipsum..." class="quatrevingtpercent" rows="4"></textarea>'; // The div |
|
| 220 | + $out .= '<br><textarea id="'.$key.'" placeholder="Lore ipsum..." class="quatrevingtpercent" rows="4"></textarea>'; // The div |
|
| 221 | 221 | //} |
| 222 | 222 | |
| 223 | 223 | /* |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * \remarks To run this script as CLI: phpunit filename.php |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | -global $conf,$user,$langs,$db,$mysoc; |
|
| 28 | +global $conf, $user, $langs, $db, $mysoc; |
|
| 29 | 29 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
| 30 | 30 | //require_once 'PHPUnit/Autoload.php'; |
| 31 | 31 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
@@ -33,35 +33,35 @@ discard block |
||
| 33 | 33 | require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php'; |
| 34 | 34 | require_once dirname(__FILE__).'/CommonClassTest.class.php'; |
| 35 | 35 | |
| 36 | -if (! defined('NOREQUIREUSER')) { |
|
| 36 | +if (!defined('NOREQUIREUSER')) { |
|
| 37 | 37 | define('NOREQUIREUSER', '1'); |
| 38 | 38 | } |
| 39 | -if (! defined('NOREQUIREDB')) { |
|
| 39 | +if (!defined('NOREQUIREDB')) { |
|
| 40 | 40 | define('NOREQUIREDB', '1'); |
| 41 | 41 | } |
| 42 | -if (! defined('NOREQUIRESOC')) { |
|
| 42 | +if (!defined('NOREQUIRESOC')) { |
|
| 43 | 43 | define('NOREQUIRESOC', '1'); |
| 44 | 44 | } |
| 45 | -if (! defined('NOREQUIRETRAN')) { |
|
| 45 | +if (!defined('NOREQUIRETRAN')) { |
|
| 46 | 46 | define('NOREQUIRETRAN', '1'); |
| 47 | 47 | } |
| 48 | -if (! defined('NOCSRFCHECK')) { |
|
| 48 | +if (!defined('NOCSRFCHECK')) { |
|
| 49 | 49 | define('NOCSRFCHECK', '1'); |
| 50 | 50 | } |
| 51 | -if (! defined('NOTOKENRENEWAL')) { |
|
| 51 | +if (!defined('NOTOKENRENEWAL')) { |
|
| 52 | 52 | define('NOTOKENRENEWAL', '1'); |
| 53 | 53 | } |
| 54 | -if (! defined('NOREQUIREMENU')) { |
|
| 54 | +if (!defined('NOREQUIREMENU')) { |
|
| 55 | 55 | define('NOREQUIREMENU', '1'); // If there is no menu to show |
| 56 | 56 | } |
| 57 | -if (! defined('NOREQUIREHTML')) { |
|
| 57 | +if (!defined('NOREQUIREHTML')) { |
|
| 58 | 58 | define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php |
| 59 | 59 | } |
| 60 | -if (! defined('NOREQUIREAJAX')) { |
|
| 60 | +if (!defined('NOREQUIREAJAX')) { |
|
| 61 | 61 | define('NOREQUIREAJAX', '1'); |
| 62 | 62 | } |
| 63 | -if (! defined("NOLOGIN")) { |
|
| 64 | - define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
| 63 | +if (!defined("NOLOGIN")) { |
|
| 64 | + define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | print "\n".$langs->trans("CurrentTimeZone").' : '.getServerTimeZoneString(); |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public static function setUpBeforeClass(): void |
| 87 | 87 | { |
| 88 | - global $conf,$user,$langs,$db; |
|
| 88 | + global $conf, $user, $langs, $db; |
|
| 89 | 89 | //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
| 90 | 90 | |
| 91 | - if (! function_exists('mb_substr')) { |
|
| 91 | + if (!function_exists('mb_substr')) { |
|
| 92 | 92 | print "\n".__METHOD__." function mb_substr must be enabled.\n"; |
| 93 | 93 | die(1); |
| 94 | 94 | } |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | $sql = forgeSQLFromUniversalSearchCriteria($filter); |
| 257 | 257 | |
| 258 | 258 | if ($db->type == 'mysqli') { |
| 259 | - $this->assertEquals(" AND ((t.fieldstring = 'aaa\'ttt'))", $sql); // with mysql |
|
| 259 | + $this->assertEquals(" AND ((t.fieldstring = 'aaa\'ttt'))", $sql); // with mysql |
|
| 260 | 260 | } else { |
| 261 | - $this->assertEquals(" AND ((t.fieldstring = 'aaa''ttt'))", $sql); // with pgsql |
|
| 261 | + $this->assertEquals(" AND ((t.fieldstring = 'aaa''ttt'))", $sql); // with pgsql |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | $filter = "(t.fk_soc:IN:1,2)"; |
@@ -695,13 +695,13 @@ discard block |
||
| 695 | 695 | $input = 'xxx < br>'; |
| 696 | 696 | $after = dol_textishtml($input); |
| 697 | 697 | $this->assertFalse($after); |
| 698 | - $input = 'xxx <[email protected]>'; // <em> is html, <em... is not |
|
| 698 | + $input = 'xxx <[email protected]>'; // <em> is html, <em... is not |
|
| 699 | 699 | $after = dol_textishtml($input); |
| 700 | 700 | $this->assertFalse($after); |
| 701 | 701 | $input = 'xxx <brstyle="ee">'; |
| 702 | 702 | $after = dol_textishtml($input); |
| 703 | 703 | $this->assertFalse($after); |
| 704 | - $input = 'This is a text with html comments <!-- comment -->'; // we suppose this is not enough to be html content |
|
| 704 | + $input = 'This is a text with html comments <!-- comment -->'; // we suppose this is not enough to be html content |
|
| 705 | 705 | $after = dol_textishtml($input); |
| 706 | 706 | $this->assertFalse($after); |
| 707 | 707 | |
@@ -757,17 +757,17 @@ discard block |
||
| 757 | 757 | public function testDolConcat() |
| 758 | 758 | { |
| 759 | 759 | $text1 = "A string 1"; |
| 760 | - $text2 = "A string 2"; // text 1 and 2 are text, concat need only \n |
|
| 760 | + $text2 = "A string 2"; // text 1 and 2 are text, concat need only \n |
|
| 761 | 761 | $after = dol_concatdesc($text1, $text2); |
| 762 | 762 | $this->assertEquals("A string 1\nA string 2", $after); |
| 763 | 763 | |
| 764 | 764 | $text1 = "A<br>string 1"; |
| 765 | - $text2 = "A string 2"; // text 1 is html, concat need <br>\n |
|
| 765 | + $text2 = "A string 2"; // text 1 is html, concat need <br>\n |
|
| 766 | 766 | $after = dol_concatdesc($text1, $text2); |
| 767 | 767 | $this->assertEquals("A<br>string 1<br>\nA string 2", $after); |
| 768 | 768 | |
| 769 | 769 | $text1 = "A string 1"; |
| 770 | - $text2 = "A <b>string</b> 2"; // text 2 is html, concat need <br>\n |
|
| 770 | + $text2 = "A <b>string</b> 2"; // text 2 is html, concat need <br>\n |
|
| 771 | 771 | $after = dol_concatdesc($text1, $text2); |
| 772 | 772 | $this->assertEquals("A string 1<br>\nA <b>string</b> 2", $after); |
| 773 | 773 | |
@@ -869,19 +869,19 @@ discard block |
||
| 869 | 869 | // Text not already HTML |
| 870 | 870 | |
| 871 | 871 | $input = "A string\nwith a é, &, < and >."; |
| 872 | - $after = dol_htmlentitiesbr($input, 0); // Add <br> before \n |
|
| 872 | + $after = dol_htmlentitiesbr($input, 0); // Add <br> before \n |
|
| 873 | 873 | $this->assertEquals("A string<br>\nwith a é, &, < and >.", $after); |
| 874 | 874 | |
| 875 | 875 | $input = "A string\nwith a é, &, < and >."; |
| 876 | - $after = dol_htmlentitiesbr($input, 1); // Replace \n with <br> |
|
| 876 | + $after = dol_htmlentitiesbr($input, 1); // Replace \n with <br> |
|
| 877 | 877 | $this->assertEquals("A string<br>with a é, &, < and >.", $after); |
| 878 | 878 | |
| 879 | - $input = "A string\nwith a é, &, < and >.\n\n"; // With some \n at end that should be cleaned |
|
| 880 | - $after = dol_htmlentitiesbr($input, 0); // Add <br> before \n |
|
| 879 | + $input = "A string\nwith a é, &, < and >.\n\n"; // With some \n at end that should be cleaned |
|
| 880 | + $after = dol_htmlentitiesbr($input, 0); // Add <br> before \n |
|
| 881 | 881 | $this->assertEquals("A string<br>\nwith a é, &, < and >.", $after); |
| 882 | 882 | |
| 883 | - $input = "A string\nwith a é, &, < and >.\n\n"; // With some \n at end that should be cleaned |
|
| 884 | - $after = dol_htmlentitiesbr($input, 1); // Replace \n with <br> |
|
| 883 | + $input = "A string\nwith a é, &, < and >.\n\n"; // With some \n at end that should be cleaned |
|
| 884 | + $after = dol_htmlentitiesbr($input, 1); // Replace \n with <br> |
|
| 885 | 885 | $this->assertEquals("A string<br>with a é, &, < and >.", $after); |
| 886 | 886 | |
| 887 | 887 | // Text already HTML, so &,<,> should not be converted |
@@ -894,11 +894,11 @@ discard block |
||
| 894 | 894 | $after = dol_htmlentitiesbr($input); |
| 895 | 895 | $this->assertEquals("<li>\nA string with a é, &, < and >.</li>\nAnother string", $after); |
| 896 | 896 | |
| 897 | - $input = "A string<br>\nwith a é, &, < and >.<br>"; // With some <br> at end that should be cleaned |
|
| 897 | + $input = "A string<br>\nwith a é, &, < and >.<br>"; // With some <br> at end that should be cleaned |
|
| 898 | 898 | $after = dol_htmlentitiesbr($input); |
| 899 | 899 | $this->assertEquals("A string<br>\nwith a é, &, < and >.", $after); |
| 900 | 900 | |
| 901 | - $input = "<li>\nA string with a é, &, < and >.</li>\nAnother string<br>"; // With some <br> at end that should be cleaned |
|
| 901 | + $input = "<li>\nA string with a é, &, < and >.</li>\nAnother string<br>"; // With some <br> at end that should be cleaned |
|
| 902 | 902 | $after = dol_htmlentitiesbr($input); |
| 903 | 903 | $this->assertEquals("<li>\nA string with a é, &, < and >.</li>\nAnother string", $after); |
| 904 | 904 | |
@@ -1062,43 +1062,43 @@ discard block |
||
| 1062 | 1062 | date_default_timezone_set('UTC'); |
| 1063 | 1063 | |
| 1064 | 1064 | // Check bad hours |
| 1065 | - $result = dol_mktime(25, 0, 0, 1, 1, 1970, 1, 1); // Error (25 hours) |
|
| 1065 | + $result = dol_mktime(25, 0, 0, 1, 1, 1970, 1, 1); // Error (25 hours) |
|
| 1066 | 1066 | print __METHOD__." result=".$result."\n"; |
| 1067 | 1067 | $this->assertEquals('', $result); |
| 1068 | - $result = dol_mktime(2, 61, 0, 1, 1, 1970, 1, 1); // Error (61 minutes) |
|
| 1068 | + $result = dol_mktime(2, 61, 0, 1, 1, 1970, 1, 1); // Error (61 minutes) |
|
| 1069 | 1069 | print __METHOD__." result=".$result."\n"; |
| 1070 | 1070 | $this->assertEquals('', $result); |
| 1071 | - $result = dol_mktime(2, 1, 61, 1, 1, 1970, 1, 1); // Error (61 seconds) |
|
| 1071 | + $result = dol_mktime(2, 1, 61, 1, 1, 1970, 1, 1); // Error (61 seconds) |
|
| 1072 | 1072 | print __METHOD__." result=".$result."\n"; |
| 1073 | 1073 | $this->assertEquals('', $result); |
| 1074 | - $result = dol_mktime(2, 1, 1, 1, 32, 1970, 1, 1); // Error (day 32) |
|
| 1074 | + $result = dol_mktime(2, 1, 1, 1, 32, 1970, 1, 1); // Error (day 32) |
|
| 1075 | 1075 | print __METHOD__." result=".$result."\n"; |
| 1076 | 1076 | $this->assertEquals('', $result); |
| 1077 | - $result = dol_mktime(2, 1, 1, 13, 1, 1970, 1, 1); // Error (month 13) |
|
| 1077 | + $result = dol_mktime(2, 1, 1, 13, 1, 1970, 1, 1); // Error (month 13) |
|
| 1078 | 1078 | print __METHOD__." result=".$result."\n"; |
| 1079 | 1079 | $this->assertEquals('', $result); |
| 1080 | 1080 | |
| 1081 | - $result = dol_mktime(2, 1, 1, 1, 1, 1970, 1); // 1970-01-01 02:01:01 in GMT area -> 7261 |
|
| 1081 | + $result = dol_mktime(2, 1, 1, 1, 1, 1970, 1); // 1970-01-01 02:01:01 in GMT area -> 7261 |
|
| 1082 | 1082 | print __METHOD__." result=".$result."\n"; |
| 1083 | 1083 | $this->assertEquals(7261, $result); |
| 1084 | 1084 | |
| 1085 | - $result = dol_mktime(2, 0, 0, 1, 1, 1970, 0); // 1970-01-01 02:00:00 = 7200 in local area Europe/Paris = 3600 GMT |
|
| 1085 | + $result = dol_mktime(2, 0, 0, 1, 1, 1970, 0); // 1970-01-01 02:00:00 = 7200 in local area Europe/Paris = 3600 GMT |
|
| 1086 | 1086 | print __METHOD__." result=".$result."\n"; |
| 1087 | - $tz = getServerTimeZoneInt('winter'); // +1 in Europe/Paris at this time (this time is winter) |
|
| 1088 | - $this->assertEquals(7200 - ($tz * 3600), $result); // 7200 if we are at greenwich winter, 7200-($tz*3600) at local winter |
|
| 1087 | + $tz = getServerTimeZoneInt('winter'); // +1 in Europe/Paris at this time (this time is winter) |
|
| 1088 | + $this->assertEquals(7200 - ($tz * 3600), $result); // 7200 if we are at greenwich winter, 7200-($tz*3600) at local winter |
|
| 1089 | 1089 | |
| 1090 | 1090 | // Some test for local TZ Europe/Paris |
| 1091 | 1091 | date_default_timezone_set('Europe/Paris'); |
| 1092 | 1092 | |
| 1093 | 1093 | // Check that tz for paris in winter is used |
| 1094 | - $result = dol_mktime(2, 0, 0, 1, 1, 1970, 'server'); // 1970-01-01 02:00:00 = 7200 in local area Europe/Paris = 3600 GMT |
|
| 1094 | + $result = dol_mktime(2, 0, 0, 1, 1, 1970, 'server'); // 1970-01-01 02:00:00 = 7200 in local area Europe/Paris = 3600 GMT |
|
| 1095 | 1095 | print __METHOD__." result=".$result."\n"; |
| 1096 | - $this->assertEquals(3600, $result); // 7200 if we are at greenwich winter, 3600 at Europe/Paris |
|
| 1096 | + $this->assertEquals(3600, $result); // 7200 if we are at greenwich winter, 3600 at Europe/Paris |
|
| 1097 | 1097 | |
| 1098 | 1098 | // Check that daylight saving time is used |
| 1099 | - $result = dol_mktime(2, 0, 0, 6, 1, 2014, 0); // 2014-06-01 02:00:00 = 1401588000-3600(location)-3600(daylight) in local area Europe/Paris = 1401588000 GMT |
|
| 1099 | + $result = dol_mktime(2, 0, 0, 6, 1, 2014, 0); // 2014-06-01 02:00:00 = 1401588000-3600(location)-3600(daylight) in local area Europe/Paris = 1401588000 GMT |
|
| 1100 | 1100 | print __METHOD__." result=".$result."\n"; |
| 1101 | - $this->assertEquals(1401588000 - 3600 - 3600, $result); // 1401588000 are at greenwich summer, 1401588000-3600(location)-3600(daylight) at Europe/Paris summer |
|
| 1101 | + $this->assertEquals(1401588000 - 3600 - 3600, $result); // 1401588000 are at greenwich summer, 1401588000-3600(location)-3600(daylight) at Europe/Paris summer |
|
| 1102 | 1102 | |
| 1103 | 1103 | date_default_timezone_set($savtz); |
| 1104 | 1104 | } |
@@ -1111,7 +1111,7 @@ discard block |
||
| 1111 | 1111 | */ |
| 1112 | 1112 | public function testDolEscapeJs() |
| 1113 | 1113 | { |
| 1114 | - $input = "x&<b>#</b>,\"'"; // " will be converted into ' |
|
| 1114 | + $input = "x&<b>#</b>,\"'"; // " will be converted into ' |
|
| 1115 | 1115 | $result = dol_escape_js($input); |
| 1116 | 1116 | $this->assertEquals("x&<b>#</b>,\'\'", $result, "Test mode=0"); |
| 1117 | 1117 | |
@@ -1130,27 +1130,27 @@ discard block |
||
| 1130 | 1130 | */ |
| 1131 | 1131 | public function testDolEscapeHtmlTag() |
| 1132 | 1132 | { |
| 1133 | - $input = 'x&<b>#</b>,"'; // & and " are converted into html entities, <b> are removed |
|
| 1133 | + $input = 'x&<b>#</b>,"'; // & and " are converted into html entities, <b> are removed |
|
| 1134 | 1134 | $result = dol_escape_htmltag($input); |
| 1135 | 1135 | $this->assertEquals('x&#,"', $result); |
| 1136 | 1136 | |
| 1137 | - $input = 'x&<b>#</b>,"'; // & and " are converted into html entities, <b> are not removed |
|
| 1137 | + $input = 'x&<b>#</b>,"'; // & and " are converted into html entities, <b> are not removed |
|
| 1138 | 1138 | $result = dol_escape_htmltag($input, 1); |
| 1139 | 1139 | $this->assertEquals('x&<b>#</b>,"', $result); |
| 1140 | 1140 | |
| 1141 | - $input = '<img alt="" src="https://github.githubassets.com/assets/GitHub%20Mark-ea2971cee799.png">'; // & and " are converted into html entities, <b> are not removed |
|
| 1141 | + $input = '<img alt="" src="https://github.githubassets.com/assets/GitHub%20Mark-ea2971cee799.png">'; // & and " are converted into html entities, <b> are not removed |
|
| 1142 | 1142 | $result = dol_escape_htmltag($input, 1, 1, 'common', 0, 1); |
| 1143 | 1143 | $this->assertEquals('<img alt="" src="https://github.githubassets.com/assets/GitHub%20Mark-ea2971cee799.png">', $result); |
| 1144 | 1144 | |
| 1145 | - $input = '<img src="data:image/png;base64, 123/456+789==" style="height: 123px; width:456px">'; // & and " are converted into html entities, <b> are not removed |
|
| 1145 | + $input = '<img src="data:image/png;base64, 123/456+789==" style="height: 123px; width:456px">'; // & and " are converted into html entities, <b> are not removed |
|
| 1146 | 1146 | $result = dol_escape_htmltag($input, 1, 1, 'common'); |
| 1147 | 1147 | $this->assertEquals('<img src="data:image/png;base64, 123/456+789==" style="height: 123px; width:456px">', $result); |
| 1148 | 1148 | |
| 1149 | - $input = '<img src="data:image/png;base64, 123/456+789==" style="height: 123px; width:456px">'; // & and " are converted into html entities, <b> are not removed |
|
| 1149 | + $input = '<img src="data:image/png;base64, 123/456+789==" style="height: 123px; width:456px">'; // & and " are converted into html entities, <b> are not removed |
|
| 1150 | 1150 | $result = dol_escape_htmltag($input, 1); |
| 1151 | 1151 | $this->assertEquals('<img src="data:image/png;base64, 123/456+789==" style="height: 123px; width:456px">', $result); |
| 1152 | 1152 | |
| 1153 | - $input = '<img alt="" src="https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png">'; // & and " are converted into html entities, <b> are not removed |
|
| 1153 | + $input = '<img alt="" src="https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png">'; // & and " are converted into html entities, <b> are not removed |
|
| 1154 | 1154 | $result = dol_escape_htmltag($input, 1, 1, 'common', 0, 1); |
| 1155 | 1155 | $this->assertEquals('<img alt="" src="https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png">', $result); |
| 1156 | 1156 | |
@@ -1175,7 +1175,7 @@ discard block |
||
| 1175 | 1175 | */ |
| 1176 | 1176 | public function testDolFormatAddress() |
| 1177 | 1177 | { |
| 1178 | - global $conf,$user,$langs,$db; |
|
| 1178 | + global $conf, $user, $langs, $db; |
|
| 1179 | 1179 | $conf = $this->savconf; |
| 1180 | 1180 | $user = $this->savuser; |
| 1181 | 1181 | $langs = $this->savlangs; |
@@ -1213,7 +1213,7 @@ discard block |
||
| 1213 | 1213 | */ |
| 1214 | 1214 | public function testDolPrintPhone() |
| 1215 | 1215 | { |
| 1216 | - global $conf,$user,$langs,$db; |
|
| 1216 | + global $conf, $user, $langs, $db; |
|
| 1217 | 1217 | $conf = $this->savconf; |
| 1218 | 1218 | $user = $this->savuser; |
| 1219 | 1219 | $langs = $this->savlangs; |
@@ -1292,13 +1292,13 @@ discard block |
||
| 1292 | 1292 | public function verifCondDataProvider(): array |
| 1293 | 1293 | { |
| 1294 | 1294 | return [ |
| 1295 | - 'Test a true comparison' => ['1==1', true,], |
|
| 1296 | - 'Test a false comparison' => ['1==2', false,], |
|
| 1297 | - 'Test that the conf property of a module reports true when enabled' => ['isModEnabled("facture")', true,], |
|
| 1298 | - 'Test that the conf property of a module reports false when disabled' => ['isModEnabled("moduledummy")', false,], |
|
| 1299 | - 'Test that verifConf(0) returns false' => [0, false,], |
|
| 1300 | - 'Test that verifConf("0") returns false' => ["0", false,], |
|
| 1301 | - 'Test that verifConf("") returns false (special case)' => ['', true,], |
|
| 1295 | + 'Test a true comparison' => ['1==1', true, ], |
|
| 1296 | + 'Test a false comparison' => ['1==2', false, ], |
|
| 1297 | + 'Test that the conf property of a module reports true when enabled' => ['isModEnabled("facture")', true, ], |
|
| 1298 | + 'Test that the conf property of a module reports false when disabled' => ['isModEnabled("moduledummy")', false, ], |
|
| 1299 | + 'Test that verifConf(0) returns false' => [0, false, ], |
|
| 1300 | + 'Test that verifConf("0") returns false' => ["0", false, ], |
|
| 1301 | + 'Test that verifConf("") returns false (special case)' => ['', true, ], |
|
| 1302 | 1302 | ]; |
| 1303 | 1303 | } |
| 1304 | 1304 | |
@@ -1328,7 +1328,7 @@ discard block |
||
| 1328 | 1328 | */ |
| 1329 | 1329 | public function testGetDefaultTva() |
| 1330 | 1330 | { |
| 1331 | - global $conf,$user,$langs,$db; |
|
| 1331 | + global $conf, $user, $langs, $db; |
|
| 1332 | 1332 | $this->savconf = $conf; |
| 1333 | 1333 | $this->savuser = $user; |
| 1334 | 1334 | $this->savlangs = $langs; |
@@ -1431,7 +1431,7 @@ discard block |
||
| 1431 | 1431 | */ |
| 1432 | 1432 | public function testGetDefaultLocalTax() |
| 1433 | 1433 | { |
| 1434 | - global $conf,$user,$langs,$db; |
|
| 1434 | + global $conf, $user, $langs, $db; |
|
| 1435 | 1435 | $this->savconf = $conf; |
| 1436 | 1436 | $this->savuser = $user; |
| 1437 | 1437 | $this->savlangs = $langs; |
@@ -1487,7 +1487,7 @@ discard block |
||
| 1487 | 1487 | $vat1 = get_default_localtax($companyes, $companyes, 1, 0); |
| 1488 | 1488 | $vat2 = get_default_localtax($companyes, $companyes, 2, 0); |
| 1489 | 1489 | $this->assertEquals($vat1, 5.2); |
| 1490 | - $this->assertStringStartsWith((string) $vat2, '-19:-15:-9'); // Can be -19 (old version) or '-19:-15:-9' (new setup) |
|
| 1490 | + $this->assertStringStartsWith((string) $vat2, '-19:-15:-9'); // Can be -19 (old version) or '-19:-15:-9' (new setup) |
|
| 1491 | 1491 | |
| 1492 | 1492 | // Test RULE ES-IT |
| 1493 | 1493 | $vat1 = get_default_localtax($companyes, $companyit, 1, 0); |
@@ -1675,48 +1675,48 @@ discard block |
||
| 1675 | 1675 | |
| 1676 | 1676 | $conf->global->MAIN_START_WEEK = 0; |
| 1677 | 1677 | |
| 1678 | - $tmp = dol_getdate(24 * 60 * 60 + 1, false, 'UTC'); // 2/1/1970 and 1 second = friday |
|
| 1678 | + $tmp = dol_getdate(24 * 60 * 60 + 1, false, 'UTC'); // 2/1/1970 and 1 second = friday |
|
| 1679 | 1679 | $this->assertEquals(5, $tmp['wday'], 'Bad value of day in week'); |
| 1680 | 1680 | |
| 1681 | 1681 | $conf->global->MAIN_START_WEEK = 1; |
| 1682 | 1682 | |
| 1683 | - $tmp = dol_getdate(1, false, 'UTC'); // 1/1/1970 and 1 second = thirday |
|
| 1683 | + $tmp = dol_getdate(1, false, 'UTC'); // 1/1/1970 and 1 second = thirday |
|
| 1684 | 1684 | $this->assertEquals(4, $tmp['wday'], 'Bad value of day in week'); |
| 1685 | 1685 | |
| 1686 | - $tmp = dol_getdate(24 * 60 * 60 + 1, false, 'UTC'); // 2/1/1970 and 1 second = friday |
|
| 1686 | + $tmp = dol_getdate(24 * 60 * 60 + 1, false, 'UTC'); // 2/1/1970 and 1 second = friday |
|
| 1687 | 1687 | $this->assertEquals(5, $tmp['wday'], 'Bad value of day in week'); |
| 1688 | 1688 | |
| 1689 | - $tmp = dol_getdate(1, false, "Europe/Paris"); // 1/1/1970 and 1 second = thirday |
|
| 1689 | + $tmp = dol_getdate(1, false, "Europe/Paris"); // 1/1/1970 and 1 second = thirday |
|
| 1690 | 1690 | $this->assertEquals(1970, $tmp['year']); |
| 1691 | 1691 | $this->assertEquals(1, $tmp['mon']); |
| 1692 | 1692 | $this->assertEquals(1, $tmp['mday']); |
| 1693 | 1693 | $this->assertEquals(4, $tmp['wday']); |
| 1694 | 1694 | $this->assertEquals(0, $tmp['yday']); |
| 1695 | - $this->assertEquals(1, $tmp['hours']); // We are winter, so we are GMT+1 even during summer |
|
| 1695 | + $this->assertEquals(1, $tmp['hours']); // We are winter, so we are GMT+1 even during summer |
|
| 1696 | 1696 | $this->assertEquals(0, $tmp['minutes']); |
| 1697 | 1697 | $this->assertEquals(1, $tmp['seconds']); |
| 1698 | 1698 | |
| 1699 | - $tmp = dol_getdate(15638401, false, "Europe/Paris"); // 1/7/1970 and 1 second = wednesday |
|
| 1699 | + $tmp = dol_getdate(15638401, false, "Europe/Paris"); // 1/7/1970 and 1 second = wednesday |
|
| 1700 | 1700 | $this->assertEquals(1970, $tmp['year']); |
| 1701 | 1701 | $this->assertEquals(7, $tmp['mon']); |
| 1702 | 1702 | $this->assertEquals(1, $tmp['mday']); |
| 1703 | 1703 | $this->assertEquals(3, $tmp['wday']); |
| 1704 | 1704 | $this->assertEquals(181, $tmp['yday']); |
| 1705 | - $this->assertEquals(1, $tmp['hours']); // There is no daylight in 1970, so we are GMT+1 even during summer |
|
| 1705 | + $this->assertEquals(1, $tmp['hours']); // There is no daylight in 1970, so we are GMT+1 even during summer |
|
| 1706 | 1706 | $this->assertEquals(0, $tmp['minutes']); |
| 1707 | 1707 | $this->assertEquals(1, $tmp['seconds']); |
| 1708 | 1708 | |
| 1709 | - $tmp = dol_getdate(1593561601, false, "Europe/Paris"); // 1/7/2020 and 1 second = wednesday |
|
| 1709 | + $tmp = dol_getdate(1593561601, false, "Europe/Paris"); // 1/7/2020 and 1 second = wednesday |
|
| 1710 | 1710 | $this->assertEquals(2020, $tmp['year']); |
| 1711 | 1711 | $this->assertEquals(7, $tmp['mon']); |
| 1712 | 1712 | $this->assertEquals(1, $tmp['mday']); |
| 1713 | 1713 | $this->assertEquals(3, $tmp['wday']); |
| 1714 | - $this->assertEquals(182, $tmp['yday']); // 182 and not 181, due to the 29th february |
|
| 1715 | - $this->assertEquals(2, $tmp['hours']); // There is a daylight, so we are GMT+2 |
|
| 1714 | + $this->assertEquals(182, $tmp['yday']); // 182 and not 181, due to the 29th february |
|
| 1715 | + $this->assertEquals(2, $tmp['hours']); // There is a daylight, so we are GMT+2 |
|
| 1716 | 1716 | $this->assertEquals(0, $tmp['minutes']); |
| 1717 | 1717 | $this->assertEquals(1, $tmp['seconds']); |
| 1718 | 1718 | |
| 1719 | - $tmp = dol_getdate(1, false, 'UTC'); // 1/1/1970 and 1 second = thirday |
|
| 1719 | + $tmp = dol_getdate(1, false, 'UTC'); // 1/1/1970 and 1 second = thirday |
|
| 1720 | 1720 | $this->assertEquals(1970, $tmp['year']); |
| 1721 | 1721 | $this->assertEquals(1, $tmp['mon']); |
| 1722 | 1722 | $this->assertEquals(1, $tmp['mday']); |
@@ -1727,7 +1727,7 @@ discard block |
||
| 1727 | 1727 | $this->assertEquals(0, $tmp['minutes']); |
| 1728 | 1728 | $this->assertEquals(1, $tmp['seconds']); |
| 1729 | 1729 | |
| 1730 | - $tmp = dol_getdate(15638401, false, 'UTC'); // 1/7/1970 and 1 second = wednesday |
|
| 1730 | + $tmp = dol_getdate(15638401, false, 'UTC'); // 1/7/1970 and 1 second = wednesday |
|
| 1731 | 1731 | $this->assertEquals(1970, $tmp['year']); |
| 1732 | 1732 | $this->assertEquals(7, $tmp['mon']); |
| 1733 | 1733 | $this->assertEquals(1, $tmp['mday']); |
@@ -1738,12 +1738,12 @@ discard block |
||
| 1738 | 1738 | $this->assertEquals(0, $tmp['minutes']); |
| 1739 | 1739 | $this->assertEquals(1, $tmp['seconds']); |
| 1740 | 1740 | |
| 1741 | - $tmp = dol_getdate(1593561601, false, 'UTC'); // 1/7/2020 and 1 second = wednesday |
|
| 1741 | + $tmp = dol_getdate(1593561601, false, 'UTC'); // 1/7/2020 and 1 second = wednesday |
|
| 1742 | 1742 | $this->assertEquals(2020, $tmp['year']); |
| 1743 | 1743 | $this->assertEquals(7, $tmp['mon']); |
| 1744 | 1744 | $this->assertEquals(1, $tmp['mday']); |
| 1745 | 1745 | $this->assertEquals(3, $tmp['wday']); |
| 1746 | - $this->assertEquals(182, $tmp['yday']); // 182 and not 181, due to the 29th february |
|
| 1746 | + $this->assertEquals(182, $tmp['yday']); // 182 and not 181, due to the 29th february |
|
| 1747 | 1747 | // We must disable this because on CI, timezone is may be UTC or something else |
| 1748 | 1748 | //$this->assertEquals(2, $tmp['hours']); // There is a daylight, so we are GMT+2 |
| 1749 | 1749 | $this->assertEquals(0, $tmp['minutes']); |
@@ -1933,16 +1933,16 @@ discard block |
||
| 1933 | 1933 | $s = natural_search("t.field", "'abc def' ghi"); |
| 1934 | 1934 | $this->assertEquals(" AND (t.field LIKE '%abc def%' AND t.field LIKE '%ghi%')", $s); |
| 1935 | 1935 | |
| 1936 | - $s = natural_search("t.field", "abc def,ghi", 3); // mode 3 is to provide a list of string separated with coma |
|
| 1936 | + $s = natural_search("t.field", "abc def,ghi", 3); // mode 3 is to provide a list of string separated with coma |
|
| 1937 | 1937 | $this->assertEquals(" AND (t.field IN ('abc def','ghi'))", $s); |
| 1938 | 1938 | |
| 1939 | - $s = natural_search("t.field", "'ab\'c' def','ghi', 'jkl'", 3); // mode 3 is to provide a list of string separated with coma |
|
| 1939 | + $s = natural_search("t.field", "'ab\'c' def','ghi', 'jkl'", 3); // mode 3 is to provide a list of string separated with coma |
|
| 1940 | 1940 | $this->assertEquals(" AND (t.field IN ('abc def','ghi','jkl'))", $s); |
| 1941 | 1941 | |
| 1942 | - $s = natural_search("t.field", "a,b", 3); // mode 3 is to provide a list of string separated with coma |
|
| 1942 | + $s = natural_search("t.field", "a,b", 3); // mode 3 is to provide a list of string separated with coma |
|
| 1943 | 1943 | $this->assertEquals(" AND (t.field IN ('a','b'))", $s); |
| 1944 | 1944 | |
| 1945 | - $s = natural_search("t.field", "A'@%B", 3); // mode 3 is to provide a list of string separated with coma |
|
| 1945 | + $s = natural_search("t.field", "A'@%B", 3); // mode 3 is to provide a list of string separated with coma |
|
| 1946 | 1946 | $this->assertEquals(" AND (t.field IN ('AB'))", $s); |
| 1947 | 1947 | |
| 1948 | 1948 | /* |
@@ -1954,7 +1954,7 @@ discard block |
||
| 1954 | 1954 | var_dump($s); |
| 1955 | 1955 | */ |
| 1956 | 1956 | |
| 1957 | - $s = natural_search("t.field", "KØB", 3); // mode 3 is to provide a list of string separated with coma |
|
| 1957 | + $s = natural_search("t.field", "KØB", 3); // mode 3 is to provide a list of string separated with coma |
|
| 1958 | 1958 | $this->assertEquals(" AND (t.field IN ('KØB'))", $s); |
| 1959 | 1959 | } |
| 1960 | 1960 | |