@@ -197,7 +197,7 @@ |
||
197 | 197 | $creditnote->fetch($invoiceid); |
198 | 198 | $invoicecredits[] = $creditnote->getNomUrl(1); |
199 | 199 | } |
200 | - print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')'; |
|
200 | + print ' ('.$langs->transnoentities("InvoiceHasAvoir").(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits).')'; |
|
201 | 201 | } |
202 | 202 | /* |
203 | 203 | if ($facidnext > 0) { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | // Action clone object |
200 | 200 | if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) { |
201 | 201 | $objectutil = dol_clone($object, 1); // To avoid to denaturate loaded object when setting some properties for clone. We use native clone to keep this->db valid. |
202 | - '@phan-var-force FactureFournisseur $objectutil'; // Same object type for cloned object |
|
202 | + '@phan-var-force FactureFournisseur $objectutil'; // Same object type for cloned object |
|
203 | 203 | |
204 | 204 | if (GETPOST('newsupplierref', 'alphanohtml')) { |
205 | 205 | $objectutil->ref_supplier = GETPOST('newsupplierref', 'alphanohtml'); |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | $db->begin(); |
785 | 785 | |
786 | 786 | $error = 0; |
787 | - $tmpproject = 0; // Ensure a value |
|
787 | + $tmpproject = 0; // Ensure a value |
|
788 | 788 | |
789 | 789 | // Fill array 'array_options' with data from add form |
790 | 790 | $ret = $extrafields->setOptionalsFromPost(null, $object); |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | $error++; |
793 | 793 | } |
794 | 794 | |
795 | - $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 |
|
795 | + $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 |
|
796 | 796 | $datedue = dol_mktime(0, 0, 0, GETPOSTINT('echmonth'), GETPOSTINT('echday'), GETPOSTINT('echyear'), 'tzserver'); |
797 | 797 | //var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour')); |
798 | 798 | //var_dump(dol_now('tzuserrel').' '.dol_get_last_hour(dol_now('tzuserrel')).' '.dol_print_date(dol_now('tzuserrel'),'dayhour').' '.dol_print_date(dol_get_last_hour(dol_now('tzuserrel')), 'dayhour')); |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); |
832 | 832 | $object->socid = GETPOSTINT('socid'); |
833 | 833 | $object->label = GETPOST('label', 'alphanohtml'); |
834 | - $object->libelle = $object->label; // deprecated |
|
834 | + $object->libelle = $object->label; // deprecated |
|
835 | 835 | $object->date = $dateinvoice; |
836 | 836 | $object->date_echeance = $datedue; |
837 | 837 | $object->note_public = GETPOST('note_public', 'restricthtml'); |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | $object->subtype = GETPOST('subtype', 'alphanohtml'); |
906 | 906 | $object->socid = GETPOSTINT('socid'); |
907 | 907 | $object->label = GETPOST('label', 'alphanohtml'); |
908 | - $object->libelle = $object->label; // Deprecated |
|
908 | + $object->libelle = $object->label; // Deprecated |
|
909 | 909 | $object->date = $dateinvoice; |
910 | 910 | $object->date_echeance = $datedue; |
911 | 911 | $object->note_public = GETPOST('note_public', 'restricthtml'); |
@@ -1015,7 +1015,7 @@ discard block |
||
1015 | 1015 | $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id')); |
1016 | 1016 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
1017 | 1017 | $object->fk_account = GETPOSTINT('fk_account'); |
1018 | - $object->amount = (float) price2num(GETPOST('amount')); // FIXME: FactureFournisseur::$amount is deprecated and not used? |
|
1018 | + $object->amount = (float) price2num(GETPOST('amount')); // FIXME: FactureFournisseur::$amount is deprecated and not used? |
|
1019 | 1019 | //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); |
1020 | 1020 | //$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); |
1021 | 1021 | $object->fk_incoterms = GETPOSTINT('incoterm_id'); |
@@ -1068,28 +1068,28 @@ discard block |
||
1068 | 1068 | $tmpproject = GETPOSTINT('projectid'); |
1069 | 1069 | |
1070 | 1070 | // Creation invoice |
1071 | - $object->socid = GETPOSTINT('socid'); |
|
1072 | - $object->type = GETPOST('type', 'alphanohtml'); |
|
1073 | - $object->subtype = GETPOSTINT('subtype'); |
|
1074 | - $object->ref = GETPOST('ref', 'alphanohtml'); |
|
1075 | - $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); |
|
1071 | + $object->socid = GETPOSTINT('socid'); |
|
1072 | + $object->type = GETPOST('type', 'alphanohtml'); |
|
1073 | + $object->subtype = GETPOSTINT('subtype'); |
|
1074 | + $object->ref = GETPOST('ref', 'alphanohtml'); |
|
1075 | + $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); |
|
1076 | 1076 | $object->socid = GETPOSTINT('socid'); |
1077 | 1077 | $object->label = GETPOST('label', 'alphanohtml'); |
1078 | - $object->libelle = $object->label; // deprecated |
|
1079 | - $object->date = $dateinvoice; |
|
1080 | - $object->date_echeance = $datedue; |
|
1081 | - $object->note_public = GETPOST('note_public', 'restricthtml'); |
|
1082 | - $object->note_private = GETPOST('note_private', 'restricthtml'); |
|
1078 | + $object->libelle = $object->label; // deprecated |
|
1079 | + $object->date = $dateinvoice; |
|
1080 | + $object->date_echeance = $datedue; |
|
1081 | + $object->note_public = GETPOST('note_public', 'restricthtml'); |
|
1082 | + $object->note_private = GETPOST('note_private', 'restricthtml'); |
|
1083 | 1083 | $object->cond_reglement_id = GETPOST('cond_reglement_id'); |
1084 | 1084 | $object->mode_reglement_id = GETPOST('mode_reglement_id'); |
1085 | 1085 | $object->fk_account = GETPOSTINT('fk_account'); |
1086 | 1086 | $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
1087 | 1087 | $object->fk_project = ($tmpproject > 0) ? $tmpproject : null; |
1088 | - $object->fk_incoterms = GETPOSTINT('incoterm_id'); |
|
1088 | + $object->fk_incoterms = GETPOSTINT('incoterm_id'); |
|
1089 | 1089 | $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); |
1090 | 1090 | $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); |
1091 | - $object->multicurrency_tx = GETPOSTINT('originmulticurrency_tx'); |
|
1092 | - $object->transport_mode_id = GETPOSTINT('transport_mode_id'); |
|
1091 | + $object->multicurrency_tx = GETPOSTINT('originmulticurrency_tx'); |
|
1092 | + $object->transport_mode_id = GETPOSTINT('transport_mode_id'); |
|
1093 | 1093 | |
1094 | 1094 | // Auto calculation of date due if not filled by user |
1095 | 1095 | if (empty($object->date_echeance)) { |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | 0, |
1302 | 1302 | $object->lines[0]->date_start, |
1303 | 1303 | $object->lines[0]->date_end, |
1304 | - array(), // array_options |
|
1304 | + array(), // array_options |
|
1305 | 1305 | 0, |
1306 | 1306 | 0, |
1307 | 1307 | '', |
@@ -1438,7 +1438,7 @@ discard block |
||
1438 | 1438 | // Edit line |
1439 | 1439 | $db->begin(); |
1440 | 1440 | |
1441 | - if (! $object->fetch($id) > 0) { |
|
1441 | + if (!$object->fetch($id) > 0) { |
|
1442 | 1442 | dol_print_error($db); |
1443 | 1443 | } |
1444 | 1444 | $object->fetch_thirdparty(); |
@@ -1609,7 +1609,7 @@ discard block |
||
1609 | 1609 | $price_ttc_devise = price2num(GETPOST('multicurrency_price_ttc'), 'CU', 2); |
1610 | 1610 | } |
1611 | 1611 | |
1612 | - $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' |
|
1612 | + $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' |
|
1613 | 1613 | |
1614 | 1614 | $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); |
1615 | 1615 | |
@@ -1755,7 +1755,7 @@ discard block |
||
1755 | 1755 | |
1756 | 1756 | // Get vat rate |
1757 | 1757 | if (!GETPOSTISSET('tva_tx')) { // If vat rate not provided from the form (the form has the priority) |
1758 | - $tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha'); // can be an id of price, or -1, -2, -99 or 'idprod_...' |
|
1758 | + $tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha'); // can be an id of price, or -1, -2, -99 or 'idprod_...' |
|
1759 | 1759 | if (is_numeric($tmpidprodfournprice) && (int) $tmpidprodfournprice > 0) { |
1760 | 1760 | $tmpidprodfournprice = (int) $tmpidprodfournprice; |
1761 | 1761 | } else { |
@@ -2127,7 +2127,7 @@ discard block |
||
2127 | 2127 | // Mode creation |
2128 | 2128 | if ($action == 'create') { |
2129 | 2129 | $facturestatic = new FactureFournisseur($db); |
2130 | - $selectedLines = array(); // Ensure initialised |
|
2130 | + $selectedLines = array(); // Ensure initialised |
|
2131 | 2131 | |
2132 | 2132 | print load_fiche_titre($langs->trans('NewSupplierInvoice'), '', 'supplier_invoice'); |
2133 | 2133 | |
@@ -2321,7 +2321,7 @@ discard block |
||
2321 | 2321 | print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">'; |
2322 | 2322 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
2323 | 2323 | print '<input type="hidden" name="action" value="add">'; |
2324 | - 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 |
|
2324 | + 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 |
|
2325 | 2325 | |
2326 | 2326 | if (!empty($societe->id) && $societe->id > 0) { |
2327 | 2327 | print '<input type="hidden" name="socid" value="'.$societe->id.'">'."\n"; |
@@ -2405,7 +2405,7 @@ discard block |
||
2405 | 2405 | |
2406 | 2406 | $sql = 'SELECT r.rowid, r.titre as title, r.total_ttc'; |
2407 | 2407 | $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_rec as r'; |
2408 | - $sql .= ' WHERE r.fk_soc = '. (int) $invoice_predefined->socid; |
|
2408 | + $sql .= ' WHERE r.fk_soc = '.(int) $invoice_predefined->socid; |
|
2409 | 2409 | |
2410 | 2410 | $resql = $db->query($sql); |
2411 | 2411 | if ($resql) { |
@@ -2472,7 +2472,7 @@ discard block |
||
2472 | 2472 | // Deposit - Down payment |
2473 | 2473 | if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) { |
2474 | 2474 | print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; |
2475 | - $tmp = '<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOSTINT('type') == 3 ? ' checked' : '') . '> '; |
|
2475 | + $tmp = '<input type="radio" id="radio_deposit" name="type" value="3"'.(GETPOSTINT('type') == 3 ? ' checked' : '').'> '; |
|
2476 | 2476 | print '<script type="text/javascript"> |
2477 | 2477 | jQuery(document).ready(function() { |
2478 | 2478 | jQuery("#typestandardinvoice, #valuestandardinvoice").click(function() { |
@@ -2519,7 +2519,7 @@ discard block |
||
2519 | 2519 | print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit', 'aZ09'), 0, 0, 0, '', 1); |
2520 | 2520 | print '</td>'; |
2521 | 2521 | print '<td class="nowrap" style="padding-left: 5px">'; |
2522 | - print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="' . GETPOSTINT('valuedeposit') . '"/>'; |
|
2522 | + print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="'.GETPOSTINT('valuedeposit').'"/>'; |
|
2523 | 2523 | print '</td>'; |
2524 | 2524 | } |
2525 | 2525 | print '</tr></table>'; |
@@ -2769,8 +2769,8 @@ discard block |
||
2769 | 2769 | |
2770 | 2770 | // Vat reverse-charge by default |
2771 | 2771 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
2772 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
2773 | - print '<tr><td>' . $langs->trans('VATReverseCharge') . '</td><td>'; |
|
2772 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
2773 | + print '<tr><td>'.$langs->trans('VATReverseCharge').'</td><td>'; |
|
2774 | 2774 | // Try to propose to use VAT reverse charge even if the VAT reverse charge is not activated in the supplier card, if this corresponds to the context of use, the activation is proposed |
2775 | 2775 | if (GETPOSTISSET('vat_reverse_charge')) { // Check if form was submitted previously |
2776 | 2776 | $vat_reverse_charge = (GETPOST('vat_reverse_charge', 'alpha') == 'on' || GETPOST('vat_reverse_charge', 'alpha') == '1') ? 1 : 0; |
@@ -2780,7 +2780,7 @@ discard block |
||
2780 | 2780 | $vat_reverse_charge = 0; |
2781 | 2781 | } |
2782 | 2782 | |
2783 | - print '<input type="checkbox" name="vat_reverse_charge"'. (!empty($vat_reverse_charge) ? ' checked ' : '') . '>'; |
|
2783 | + print '<input type="checkbox" name="vat_reverse_charge"'.(!empty($vat_reverse_charge) ? ' checked ' : '').'>'; |
|
2784 | 2784 | print '</td></tr>'; |
2785 | 2785 | } |
2786 | 2786 | |
@@ -3349,7 +3349,7 @@ discard block |
||
3349 | 3349 | $creditnote->fetch($invoiceid); |
3350 | 3350 | $invoicecredits[] = $creditnote->getNomUrl(1); |
3351 | 3351 | } |
3352 | - print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits); |
|
3352 | + print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir").(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits); |
|
3353 | 3353 | print '</span>'; |
3354 | 3354 | } |
3355 | 3355 | if (isset($objectidnext) && $objectidnext > 0) { |
@@ -3496,12 +3496,12 @@ discard block |
||
3496 | 3496 | print '<input type="hidden" name="action" value="setvatreversecharge">'; |
3497 | 3497 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
3498 | 3498 | |
3499 | - print '<input type="checkbox" name="vat_reverse_charge"' . ($object->vat_reverse_charge == '1' ? ' checked ' : '') . '>'; |
|
3499 | + print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').'>'; |
|
3500 | 3500 | |
3501 | 3501 | print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
3502 | 3502 | print '</form>'; |
3503 | 3503 | } else { |
3504 | - print '<input type="checkbox" name="vat_reverse_charge"'. ($object->vat_reverse_charge == '1' ? ' checked ' : '') . ' disabled>'; |
|
3504 | + print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').' disabled>'; |
|
3505 | 3505 | } |
3506 | 3506 | print '</td></tr>'; |
3507 | 3507 | } |
@@ -3569,15 +3569,15 @@ discard block |
||
3569 | 3569 | include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php'; |
3570 | 3570 | |
3571 | 3571 | print '<tr>'; |
3572 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
3573 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
3572 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
3573 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
3574 | 3574 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
3575 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
3575 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
3576 | 3576 | } |
3577 | 3577 | print '</tr>'; |
3578 | 3578 | |
3579 | 3579 | print '<tr>'; |
3580 | - print '<td>' . $langs->trans('AmountVAT') . '</td>'; |
|
3580 | + print '<td>'.$langs->trans('AmountVAT').'</td>'; |
|
3581 | 3581 | print '<td class="nowrap amountcard right">'; |
3582 | 3582 | if (GETPOST('calculationrule')) { |
3583 | 3583 | $calculationrule = GETPOST('calculationrule', 'alpha'); |
@@ -3591,40 +3591,40 @@ discard block |
||
3591 | 3591 | } |
3592 | 3592 | // Show link for "recalculate" |
3593 | 3593 | if ($object->getVentilExportCompta() == 0) { |
3594 | - $s = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("ReCalculate") . ' </span>'; |
|
3595 | - $s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=totalofround">' . $langs->trans("Mode1") . '</a>'; |
|
3594 | + $s = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("ReCalculate").' </span>'; |
|
3595 | + $s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>'; |
|
3596 | 3596 | $s .= ' / '; |
3597 | - $s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=roundoftotal">' . $langs->trans("Mode2") . '</a>'; |
|
3597 | + $s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>'; |
|
3598 | 3598 | print '<div class="inline-block">'; |
3599 | - print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum) . '<br>' . $langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate'); |
|
3599 | + print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate'); |
|
3600 | 3600 | print ' '; |
3601 | 3601 | print '</div>'; |
3602 | 3602 | } |
3603 | 3603 | print price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency); |
3604 | 3604 | print '</td>'; |
3605 | 3605 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
3606 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
3606 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
3607 | 3607 | } |
3608 | 3608 | print '</tr>'; |
3609 | 3609 | |
3610 | 3610 | if ($societe->localtax1_assuj == "1") { //Localtax1 |
3611 | 3611 | print '<tr>'; |
3612 | - print '<td>' . $langs->transcountry("AmountLT1", $societe->country_code) . '</td>'; |
|
3613 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
3612 | + print '<td>'.$langs->transcountry("AmountLT1", $societe->country_code).'</td>'; |
|
3613 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
3614 | 3614 | print '</tr>'; |
3615 | 3615 | } |
3616 | 3616 | if ($societe->localtax2_assuj == "1") { //Localtax2 |
3617 | 3617 | print '<tr>'; |
3618 | - print '<td>' . $langs->transcountry("AmountLT2", $societe->country_code) . '</td>'; |
|
3619 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
3618 | + print '<td>'.$langs->transcountry("AmountLT2", $societe->country_code).'</td>'; |
|
3619 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
3620 | 3620 | print '</tr>'; |
3621 | 3621 | } |
3622 | 3622 | |
3623 | 3623 | print '<tr>'; |
3624 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
3625 | - print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
3624 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
3625 | + print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
3626 | 3626 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
3627 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
3627 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
3628 | 3628 | } |
3629 | 3629 | print '</tr>'; |
3630 | 3630 | |
@@ -4166,7 +4166,7 @@ discard block |
||
4166 | 4166 | } |
4167 | 4167 | |
4168 | 4168 | // Clone as predefined / Create template |
4169 | - if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) { |
|
4169 | + if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) { |
|
4170 | 4170 | if (!$objectidnext && count($object->lines) > 0) { |
4171 | 4171 | print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card-rec.php?facid='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>'; |
4172 | 4172 | } |
@@ -1191,8 +1191,8 @@ discard block |
||
1191 | 1191 | $stringtoexport = str_replace('file=js/'.$website->ref.'/', "file=js/__WEBSITE_KEY__/", $stringtoexport); |
1192 | 1192 | $stringtoexport = str_replace('medias/image/'.$website->ref.'/', "medias/image/__WEBSITE_KEY__/", $stringtoexport); |
1193 | 1193 | $stringtoexport = str_replace('medias/js/'.$website->ref.'/', "medias/js/__WEBSITE_KEY__/", $stringtoexport); |
1194 | - $stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content |
|
1195 | - $stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content |
|
1194 | + $stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content |
|
1195 | + $stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content |
|
1196 | 1196 | $stringtoexport = str_replace('"js/'.$website->ref.'/', '"js/__WEBSITE_KEY__/', $stringtoexport); |
1197 | 1197 | $stringtoexport = str_replace('"/js/'.$website->ref.'/', '"/js/__WEBSITE_KEY__/', $stringtoexport); |
1198 | 1198 | |
@@ -1502,7 +1502,7 @@ discard block |
||
1502 | 1502 | foreach ($aliasesarray as $aliasshortcuttocreate) { |
1503 | 1503 | if (trim($aliasshortcuttocreate)) { |
1504 | 1504 | $filealias = $conf->website->dir_output.'/'.$object->ref.'/'.trim($aliasshortcuttocreate).'.php'; |
1505 | - $result = dolSavePageAlias($filealias, $object, $objectpagestatic); // This includes also a copy into sublanguage directories. |
|
1505 | + $result = dolSavePageAlias($filealias, $object, $objectpagestatic); // This includes also a copy into sublanguage directories. |
|
1506 | 1506 | if (!$result) { |
1507 | 1507 | $this->errors[] = 'Failed to write file '.basename($filealias); |
1508 | 1508 | $error++; |
@@ -1523,7 +1523,7 @@ discard block |
||
1523 | 1523 | $filetpl = $pathofwebsite.'/page'.$object->fk_default_home.'.tpl.php'; |
1524 | 1524 | } |
1525 | 1525 | $filewrapper = $pathofwebsite.'/wrapper.php'; |
1526 | - dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories |
|
1526 | + dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories |
|
1527 | 1527 | } |
1528 | 1528 | |
1529 | 1529 | // Erase cache files |
@@ -1976,7 +1976,7 @@ discard block |
||
1976 | 1976 | $destContent = file_get_contents($fileNeeded['fullname']); |
1977 | 1977 | |
1978 | 1978 | $numOfPageDest = $this->extractNumberFromFilename($fileNeeded['name']); |
1979 | - $differences = $this->showDifferences($destContent, $sourceContent, array($numOfPageDest,$numOfPageSource)); |
|
1979 | + $differences = $this->showDifferences($destContent, $sourceContent, array($numOfPageDest, $numOfPageSource)); |
|
1980 | 1980 | $differences['file_destination'] = $fileNeeded; |
1981 | 1981 | } else { |
1982 | 1982 | $differences = array(); |
@@ -2019,10 +2019,10 @@ discard block |
||
2019 | 2019 | $linefound = array(); |
2020 | 2020 | $countNumPage = count($exceptNumPge); |
2021 | 2021 | |
2022 | - for ($i = 0;$i < $countNumPage; $i++) { |
|
2022 | + for ($i = 0; $i < $countNumPage; $i++) { |
|
2023 | 2023 | $linefound[$i] = array(); |
2024 | - $linefound[$i]['meta'] = '/content="' . preg_quote((string) $exceptNumPge[$i], '/') . '" \/>/'; |
|
2025 | - $linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", ' . preg_quote((string) $exceptNumPge[$i], '/') . '\);/'; |
|
2024 | + $linefound[$i]['meta'] = '/content="'.preg_quote((string) $exceptNumPge[$i], '/').'" \/>/'; |
|
2025 | + $linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", '.preg_quote((string) $exceptNumPge[$i], '/').'\);/'; |
|
2026 | 2026 | } |
2027 | 2027 | |
2028 | 2028 | if (isset($linefound[1])) { |
@@ -2045,13 +2045,13 @@ discard block |
||
2045 | 2045 | if ($lineContent1 !== $lineContent2) { |
2046 | 2046 | if (isset($lines1[$lineNum]) && !isset($lines2[$lineNum])) { |
2047 | 2047 | // Ligne deleted de la source |
2048 | - $diff["Supprimée à la ligne " . ($lineNum + 1)] = $lineContent1; |
|
2048 | + $diff["Supprimée à la ligne ".($lineNum + 1)] = $lineContent1; |
|
2049 | 2049 | } elseif (!isset($lines1[$lineNum]) && isset($lines2[$lineNum])) { |
2050 | 2050 | // Nouvelle ligne added dans la destination |
2051 | - $diff["Ajoutée à la ligne " . ($lineNum + 1)] = $lineContent2; |
|
2051 | + $diff["Ajoutée à la ligne ".($lineNum + 1)] = $lineContent2; |
|
2052 | 2052 | } else { |
2053 | 2053 | // Différence found it |
2054 | - $diff["Modifiée à la ligne " . ($lineNum + 1)] = $lineContent2; |
|
2054 | + $diff["Modifiée à la ligne ".($lineNum + 1)] = $lineContent2; |
|
2055 | 2055 | } |
2056 | 2056 | } |
2057 | 2057 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | if ($limit <= 0 || $limit > 100) { |
39 | 39 | $limit = 20; |
40 | 40 | } |
41 | -$cachedelay = GETPOSTINT('cachedelay'); // The delay in second of the cache |
|
41 | +$cachedelay = GETPOSTINT('cachedelay'); // The delay in second of the cache |
|
42 | 42 | |
43 | 43 | // Parameters for RSS |
44 | 44 | $rss = GETPOST('rss', 'aZ09'); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | $sapi_type = php_sapi_name(); |
28 | 28 | $script_file = basename(__FILE__); |
29 | -$path=dirname(__FILE__).'/'; |
|
29 | +$path = dirname(__FILE__).'/'; |
|
30 | 30 | |
31 | 31 | // Test si mode batch |
32 | 32 | $sapi_type = php_sapi_name(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // Recupere root dolibarr |
39 | 39 | //$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]); |
40 | -require __DIR__. '/../../htdocs/master.inc.php'; |
|
40 | +require __DIR__.'/../../htdocs/master.inc.php'; |
|
41 | 41 | require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; |
42 | 42 | require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; |
43 | 43 | |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | mktime(12, 0, 0, 12, 13, $year), |
101 | 101 | ); |
102 | 102 | |
103 | -$ret=$user->fetch('', 'admin'); |
|
104 | -if (! $ret > 0) { |
|
103 | +$ret = $user->fetch('', 'admin'); |
|
104 | +if (!$ret > 0) { |
|
105 | 105 | print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; |
106 | 106 | exit; |
107 | 107 | } |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | -$i=0; |
|
138 | -$result=0; |
|
137 | +$i = 0; |
|
138 | +$result = 0; |
|
139 | 139 | while ($i < GEN_NUMBER_FACTURE && $result >= 0) { |
140 | 140 | $i++; |
141 | 141 | $socid = mt_rand(1, $num_thirdparties); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | $object = new Facture($db); |
146 | 146 | $object->socid = $socids[$socid]; |
147 | - $object->date = $dates[mt_rand(1, count($dates)-1)]; |
|
147 | + $object->date = $dates[mt_rand(1, count($dates) - 1)]; |
|
148 | 148 | $object->cond_reglement_id = 3; |
149 | 149 | $object->mode_reglement_id = 3; |
150 | 150 | |
@@ -152,22 +152,22 @@ discard block |
||
152 | 152 | $fuser->fetch(mt_rand(1, 2)); |
153 | 153 | $fuser->loadRights(); |
154 | 154 | |
155 | - $result=$object->create($fuser); |
|
155 | + $result = $object->create($fuser); |
|
156 | 156 | if ($result >= 0) { |
157 | 157 | $nbp = mt_rand(2, 5); |
158 | 158 | $xnbp = 0; |
159 | 159 | while ($xnbp < $nbp) { |
160 | 160 | $prodid = mt_rand(1, $num_prods); |
161 | - $product=new Product($db); |
|
162 | - $result=$product->fetch($prodids[$prodid]); |
|
163 | - $result=$object->addline($product->description, $product->price, mt_rand(1, 5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); |
|
161 | + $product = new Product($db); |
|
162 | + $result = $product->fetch($prodids[$prodid]); |
|
163 | + $result = $object->addline($product->description, $product->price, mt_rand(1, 5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); |
|
164 | 164 | if ($result < 0) { |
165 | 165 | dol_print_error($db, $propal->error); |
166 | 166 | } |
167 | 167 | $xnbp++; |
168 | 168 | } |
169 | 169 | |
170 | - $result=$object->validate($fuser); |
|
170 | + $result = $object->validate($fuser); |
|
171 | 171 | if ($result) { |
172 | 172 | print " OK with ref ".$object->ref."\n"; |
173 | 173 | ; |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | * @param mixed $v Feature information of a product. |
651 | 651 | * @return bool |
652 | 652 | */ |
653 | - static function ($v) { |
|
653 | + static function($v) { |
|
654 | 654 | return !empty($v); |
655 | 655 | } |
656 | 656 | ); |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | |
858 | 858 | if ($forced_refvar === false) { |
859 | 859 | if (isset($conf->global->PRODUIT_ATTRIBUTES_SEPARATOR)) { |
860 | - $newproduct->ref .= getDolGlobalString('PRODUIT_ATTRIBUTES_SEPARATOR') . $prodattrval->ref; |
|
860 | + $newproduct->ref .= getDolGlobalString('PRODUIT_ATTRIBUTES_SEPARATOR').$prodattrval->ref; |
|
861 | 861 | } else { |
862 | 862 | $newproduct->ref .= '_'.$prodattrval->ref; |
863 | 863 | } |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | $productCombinationLevel->fk_price_level = $i; |
885 | 885 | $productCombinationLevel->variation_price = $price_impact[$i]; |
886 | 886 | |
887 | - $productCombinationLevel->variation_price_percentage = (bool) $price_var_percent[$i] ; |
|
887 | + $productCombinationLevel->variation_price_percentage = (bool) $price_var_percent[$i]; |
|
888 | 888 | |
889 | 889 | $newcomb->combination_price_levels[$i] = $productCombinationLevel; |
890 | 890 | } |
@@ -998,8 +998,8 @@ discard block |
||
998 | 998 | $variation_price = $combination->variation_price; |
999 | 999 | |
1000 | 1000 | if (getDolGlobalInt('PRODUIT_MULTIPRICES') && getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT') > 1) { |
1001 | - $variation_price_percentage = [ ]; |
|
1002 | - $variation_price = [ ]; |
|
1001 | + $variation_price_percentage = []; |
|
1002 | + $variation_price = []; |
|
1003 | 1003 | |
1004 | 1004 | foreach ($combination->combination_price_levels as $productCombinationLevel) { |
1005 | 1005 | $variation_price_percentage[$productCombinationLevel->fk_price_level] = $productCombinationLevel->variation_price_percentage; |
@@ -189,12 +189,12 @@ discard block |
||
189 | 189 | if (!empty($user->email)) { |
190 | 190 | $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; |
191 | 191 | } else { |
192 | - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
192 | + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
193 | 193 | } |
194 | 194 | $replyto = $sendto; |
195 | 195 | $sendtocc = ''; |
196 | 196 | if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { |
197 | - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
197 | + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." should arrive in your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); |
@@ -289,12 +289,12 @@ discard block |
||
289 | 289 | if (!empty($user->email)) { |
290 | 290 | $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; |
291 | 291 | } else { |
292 | - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
292 | + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
293 | 293 | } |
294 | 294 | $replyto = $sendto; |
295 | 295 | $sendtocc = ''; |
296 | 296 | if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { |
297 | - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
297 | + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); |
@@ -339,19 +339,19 @@ discard block |
||
339 | 339 | // Called when making payment with PaymentIntent method ($conf->global->STRIPE_USE_NEW_CHECKOUT is on). |
340 | 340 | |
341 | 341 | //dol_syslog("object = ".var_export($event->data, true)); |
342 | - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; |
|
342 | + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; |
|
343 | 343 | global $stripearrayofkeysbyenv; |
344 | 344 | $error = 0; |
345 | 345 | $object = $event->data->object; |
346 | - $TRANSACTIONID = $object->id; // Example pi_123456789... |
|
346 | + $TRANSACTIONID = $object->id; // Example pi_123456789... |
|
347 | 347 | $ipaddress = $object->metadata->ipaddress; |
348 | 348 | $now = dol_now(); |
349 | 349 | $currencyCodeType = strtoupper($object->currency); |
350 | 350 | $paymentmethodstripeid = $object->payment_method; |
351 | 351 | $customer_id = $object->customer; |
352 | 352 | $invoice_id = ""; |
353 | - $paymentTypeCode = ""; // payment type according to Stripe |
|
354 | - $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr |
|
353 | + $paymentTypeCode = ""; // payment type according to Stripe |
|
354 | + $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr |
|
355 | 355 | $payment_amount = 0; |
356 | 356 | $payment_amountInDolibarr = 0; |
357 | 357 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | $s = new \Stripe\StripeClient($stripeacc); |
417 | 417 | |
418 | 418 | $paymentmethodstripe = $s->paymentMethods->retrieve($paymentmethodstripeid); |
419 | - $paymentTypeCode = $paymentmethodstripe->type; |
|
419 | + $paymentTypeCode = $paymentmethodstripe->type; |
|
420 | 420 | if ($paymentTypeCode == "ban" || $paymentTypeCode == "sepa_debit") { |
421 | 421 | $paymentTypeCode = "PRE"; |
422 | 422 | } elseif ($paymentTypeCode == "card") { |
@@ -442,9 +442,9 @@ discard block |
||
442 | 442 | $paiement->datepaye = $now; |
443 | 443 | $paiement->date = $now; |
444 | 444 | if ($currencyCodeType == $conf->currency) { |
445 | - $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
445 | + $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
446 | 446 | } else { |
447 | - $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
447 | + $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
448 | 448 | |
449 | 449 | $postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')'; |
450 | 450 | $ispostactionok = -1; |
@@ -467,8 +467,8 @@ discard block |
||
467 | 467 | |
468 | 468 | $paiement->num_payment = ''; |
469 | 469 | $paiement->note_public = ''; |
470 | - $paiement->note_private = 'StripeSepa payment received by IPN webhook - ' . dol_print_date($now, 'standard') . ' (TZ server) using servicestatus=' . $servicestatus . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; |
|
471 | - $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
470 | + $paiement->note_private = 'StripeSepa payment received by IPN webhook - '.dol_print_date($now, 'standard').' (TZ server) using servicestatus='.$servicestatus.($ipaddress ? ' from ip '.$ipaddress : '').' - Transaction ID = '.$TRANSACTIONID; |
|
471 | + $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
472 | 472 | $paiement->ext_payment_site = $service; |
473 | 473 | |
474 | 474 | $ispaymentdone = 0; |
@@ -486,20 +486,20 @@ discard block |
||
486 | 486 | $db->begin(); |
487 | 487 | |
488 | 488 | if (!$error && !$ispaymentdone) { |
489 | - dol_syslog('* Record payment type PRE for invoice id ' . $invoice_id . '. It includes closing of invoice and regenerating document.'); |
|
489 | + dol_syslog('* Record payment type PRE for invoice id '.$invoice_id.'. It includes closing of invoice and regenerating document.'); |
|
490 | 490 | |
491 | 491 | // This include closing invoices to 'paid' (and trigger including unsuspending) and regenerating document |
492 | 492 | $paiement_id = $paiement->create($user, 1); |
493 | 493 | if ($paiement_id < 0) { |
494 | - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . implode("<br>\n", $paiement->errors); |
|
494 | + $postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').implode("<br>\n", $paiement->errors); |
|
495 | 495 | $ispostactionok = -1; |
496 | 496 | $error++; |
497 | 497 | |
498 | - dol_syslog("Failed to create the payment for invoice id " . $invoice_id); |
|
498 | + dol_syslog("Failed to create the payment for invoice id ".$invoice_id); |
|
499 | 499 | } else { |
500 | 500 | $postactionmessages[] = 'Payment created'; |
501 | 501 | |
502 | - dol_syslog("The payment has been created for invoice id " . $invoice_id); |
|
502 | + dol_syslog("The payment has been created for invoice id ".$invoice_id); |
|
503 | 503 | } |
504 | 504 | } |
505 | 505 | |
@@ -529,14 +529,14 @@ discard block |
||
529 | 529 | $label = '(CustomerInvoicePayment)'; |
530 | 530 | $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, $customer_id, ''); |
531 | 531 | if ($result < 0) { |
532 | - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . implode("<br>\n", $paiement->errors); |
|
532 | + $postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').implode("<br>\n", $paiement->errors); |
|
533 | 533 | $ispostactionok = -1; |
534 | 534 | $error++; |
535 | 535 | } else { |
536 | 536 | $postactionmessages[] = 'Bank transaction of payment created (by ipn.php file)'; |
537 | 537 | } |
538 | 538 | } else { |
539 | - $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; |
|
539 | + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; |
|
540 | 540 | $ispostactionok = -1; |
541 | 541 | $error++; |
542 | 542 | } |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | $error++; |
702 | 702 | } |
703 | 703 | |
704 | - if (! $error) { |
|
704 | + if (!$error) { |
|
705 | 705 | $db->commit(); |
706 | 706 | } else { |
707 | 707 | $db->rollback(); |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | $companypaymentmode->card_type = $event->data->object->card->branding; |
733 | 733 | |
734 | 734 | $companypaymentmode->owner_name = $event->data->object->billing_details->name; |
735 | - $companypaymentmode->proprio = $companypaymentmode->owner_name; // We may still need this formodulebuilder because name of field is "proprio" |
|
735 | + $companypaymentmode->proprio = $companypaymentmode->owner_name; // We may still need this formodulebuilder because name of field is "proprio" |
|
736 | 736 | |
737 | 737 | $companypaymentmode->exp_date_month = (int) $event->data->object->card->exp_month; |
738 | 738 | $companypaymentmode->exp_date_year = (int) $event->data->object->card->exp_year; |
@@ -824,12 +824,12 @@ discard block |
||
824 | 824 | $paymentmethodstripeid = $object->payment_method; |
825 | 825 | $customer_id = $object->customer; |
826 | 826 | $reason = $object->reason; |
827 | - $amountdisputestripe = $object->amoutndispute; // In stripe format |
|
828 | - $amountdispute = $amountdisputestripe; // In real currency format |
|
827 | + $amountdisputestripe = $object->amoutndispute; // In stripe format |
|
828 | + $amountdispute = $amountdisputestripe; // In real currency format |
|
829 | 829 | |
830 | 830 | $invoice_id = ""; |
831 | - $paymentTypeCode = ""; // payment type according to Stripe |
|
832 | - $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr |
|
831 | + $paymentTypeCode = ""; // payment type according to Stripe |
|
832 | + $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr |
|
833 | 833 | $payment_amount = 0; |
834 | 834 | $payment_amountInDolibarr = 0; |
835 | 835 | |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | $paiement->multicurrency_tx = $multicurrency_tx; // Array with all currency tx of payments dispatching |
905 | 905 | */ |
906 | 906 | $paiement->paiementid = dol_getIdFromCode($db, 'PRE', 'c_paiement', 'code', 'id', 1); |
907 | - $paiement->num_payment = $object->id; // A string like 'du_...' |
|
907 | + $paiement->num_payment = $object->id; // A string like 'du_...' |
|
908 | 908 | $paiement->note_public = 'Fund withdrawn by bank. Reason: '.$reason; |
909 | 909 | $paiement->note_private = ''; |
910 | 910 | $paiement->fk_account = $accountfrom->id; |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | $error++; |
921 | 921 | } |
922 | 922 | |
923 | - if (! $error && $tmpinvoice->status == Facture::STATUS_CLOSED) { |
|
923 | + if (!$error && $tmpinvoice->status == Facture::STATUS_CLOSED) { |
|
924 | 924 | // Switch back the invoice to status validated |
925 | 925 | $result = $tmpinvoice->setStatut(Facture::STATUS_VALIDATED); |
926 | 926 | if ($result < 0) { |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | } |
930 | 930 | } |
931 | 931 | |
932 | - if (! $error) { |
|
932 | + if (!$error) { |
|
933 | 933 | $paiement_id = $paiement->create($user, 0, $tmpinvoice->thirdparty); // This include regenerating documents |
934 | 934 | if ($paiement_id < 0) { |
935 | 935 | $errormsg = $paiement->error.implode(', ', $paiement->errors); |