From 502a854ddb830dafebfe41d91cb6fac7c449bb19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 14 Nov 2023 11:43:13 +0100 Subject: [PATCH] clean deprecated --- htdocs/compta/facture/agenda.php | 4 +- htdocs/compta/facture/card-rec.php | 4 +- htdocs/compta/facture/card.php | 84 +++++++++++++-------------- htdocs/compta/facture/contact.php | 4 +- htdocs/compta/facture/document.php | 4 +- htdocs/compta/facture/note.php | 4 +- htdocs/compta/facture/prelevement.php | 4 +- 7 files changed, 54 insertions(+), 54 deletions(-) diff --git a/htdocs/compta/facture/agenda.php b/htdocs/compta/facture/agenda.php index 2f6075fbd52..d6cf7edab31 100644 --- a/htdocs/compta/facture/agenda.php +++ b/htdocs/compta/facture/agenda.php @@ -144,8 +144,8 @@ if ($object->id > 0) { $morehtmlref = '
'; // Ref customer - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 412dd620392..01c09973951 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1254,8 +1254,8 @@ if ($action == 'create') { $morehtmlref .= '
'; // Ref customer - //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->hasRight('facture', 'creer'), 'string', '', 0, 1); - //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->hasRight('facture', 'creer'), 'string', '', null, null, '', 1); + //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, $user->hasRight('facture', 'creer'), 'string', '', 0, 1); + //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $user->hasRight('facture', 'creer'), 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer'); // Project diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 069de0018b1..175782180a5 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -171,7 +171,7 @@ if (!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) { if ($user->socid) { $socid = $user->socid; } -$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); +$isdraft = (($object->status == Facture::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); @@ -234,7 +234,7 @@ if (empty($reshook)) { } elseif ($action == 'reopen' && $usercanreopen) { $result = $object->fetch($id); - if ($object->statut == Facture::STATUS_CLOSED || ($object->statut == Facture::STATUS_ABANDONED && ($object->close_code != 'replaced' || $object->getIdReplacingInvoice() == 0)) || ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted + if ($object->status == Facture::STATUS_CLOSED || ($object->status == Facture::STATUS_ABANDONED && ($object->close_code != 'replaced' || $object->getIdReplacingInvoice() == 0)) || ($object->status == Facture::STATUS_VALIDATED && $object->paye == 1)) { // ($object->status == 1 && $object->paye == 1) should not happened but can be found when data are corrupted $result = $object->setUnpaid($user); if ($result > 0) { header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); @@ -978,7 +978,7 @@ if (empty($reshook)) { } elseif ($action == 'confirm_delete_paiement' && $confirm == 'yes' && $usercanissuepayment) { // Delete payment $object->fetch($id); - if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0) { + if ($object->status == Facture::STATUS_VALIDATED && $object->paye == 0) { $paiement = new Paiement($db); $result = $paiement->fetch(GETPOST('paiement_id', 'int')); if ($result > 0) { @@ -2768,7 +2768,7 @@ if (empty($reshook)) { // Outing situation invoice from cycle $object->fetch($id, '', '', '', true); - if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED)) + if (in_array($object->status, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED)) && $object->type == Facture::TYPE_SITUATION && $usercancreate && !$objectidnext @@ -2866,7 +2866,7 @@ if (empty($reshook)) { } } elseif ($action == 'import_lines_from_object' && $usercancreate - && $object->statut == Facture::STATUS_DRAFT + && $object->status == Facture::STATUS_DRAFT && ($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION)) { // add lines from objectlinked $fromElement = GETPOST('fromelement'); @@ -4184,7 +4184,7 @@ if ($action == 'create') { $text = $langs->trans('ConfirmDeleteBill', $object->ref); $formquestion = array(); - if ($object->type != Facture::TYPE_DEPOSIT && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->statut >= 1) { + if ($object->type != Facture::TYPE_DEPOSIT && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->status >= 1) { $qualified_for_stock_change = 0; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change = $object->hasProductsOrServices(2); @@ -4222,7 +4222,7 @@ if ($action == 'create') { $label = $langs->trans("ConfirmOuting"); $formquestion = array(); // remove situation from cycle - if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED)) + if (in_array($object->status, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED)) && $usercancreate && !$objectidnext && $object->is_last_in_cycle() @@ -4752,7 +4752,7 @@ if ($action == 'create') { $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code); } else { $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); - if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { + if ($object->status == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { print '
        '; print ''.$langs->trans("ActualizeCurrency").''; print '
'; @@ -4818,13 +4818,13 @@ if ($action == 'create') { print ''; - if ($action != 'editretainedwarranty' && $user->hasRight('facture', 'creer') && $object->statut == Facture::STATUS_DRAFT) { + if ($action != 'editretainedwarranty' && $user->hasRight('facture', 'creer') && $object->status == Facture::STATUS_DRAFT) { print ''; } print '
'; print $langs->trans('RetainedWarranty'); print 'id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).'
'; print ''; - if ($action == 'editretainedwarranty' && $object->statut == Facture::STATUS_DRAFT) { + if ($action == 'editretainedwarranty' && $object->status == Facture::STATUS_DRAFT) { print '
'; print ''; print ''; @@ -4842,7 +4842,7 @@ if ($action == 'create') { print ''; - if ($action != 'editretainedwarrantypaymentterms' && $user->hasRight('facture', 'creer') && $object->statut == Facture::STATUS_DRAFT) { + if ($action != 'editretainedwarrantypaymentterms' && $user->hasRight('facture', 'creer') && $object->status == Facture::STATUS_DRAFT) { print ''; } @@ -4853,7 +4853,7 @@ if ($action == 'create') { $defaultDate = $object->date; } - if ($action == 'editretainedwarrantypaymentterms' && $object->statut == Facture::STATUS_DRAFT) { + if ($action == 'editretainedwarrantypaymentterms' && $object->status == Facture::STATUS_DRAFT) { //date('Y-m-d',$object->date_lim_reglement) print ''; print ''; @@ -4878,7 +4878,7 @@ if ($action == 'create') { print '
'; print $langs->trans('PaymentConditionsShortRetainedWarranty'); print 'id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).'
'; - if ($action != 'editretainedwarrantydatelimit' && $user->hasRight('facture', 'creer') && $object->statut == Facture::STATUS_DRAFT) { + if ($action != 'editretainedwarrantydatelimit' && $user->hasRight('facture', 'creer') && $object->status == Facture::STATUS_DRAFT) { print ''; } @@ -4889,7 +4889,7 @@ if ($action == 'create') { $defaultDate = $object->date; } - if ($action == 'editretainedwarrantydatelimit' && $object->statut == Facture::STATUS_DRAFT) { + if ($action == 'editretainedwarrantydatelimit' && $object->status == Facture::STATUS_DRAFT) { //date('Y-m-d',$object->date_lim_reglement) print ''; print ''; @@ -5277,7 +5277,7 @@ if ($action == 'create') { } print ''; print '
'; print $langs->trans('RetainedWarrantyDateLimit'); print 'id.'">'.img_edit($langs->trans('setretainedwarrantyDateLimit'), 1).''.price($sign * $objp->amount).''; - if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0) { + if ($object->status == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0) { print 'rowid.'">'; print img_delete(); print ''; @@ -5352,7 +5352,7 @@ if ($action == 'create') { } // Partially paid 'discount' - if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { + if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { print '
'; print ''; print $form->textwithpicto($langs->trans("Discount"), $langs->trans("HelpEscompte"), - 1); @@ -5362,7 +5362,7 @@ if ($action == 'create') { $cssforamountpaymentcomplete = 'amountpaymentneutral'; } // Partially paid or abandoned 'badcustomer' - if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') { + if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') { print '
'; print ''; print $form->textwithpicto($langs->trans("Abandoned"), $langs->trans("HelpAbandonBadCustomer"), - 1); @@ -5372,7 +5372,7 @@ if ($action == 'create') { $cssforamountpaymentcomplete = 'amountpaymentneutral'; } // Partially paid or abandoned 'product_returned' - if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') { + if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') { print '
'; print ''; print $form->textwithpicto($langs->trans("ProductReturned"), $langs->trans("HelpAbandonProductReturned"), - 1); @@ -5382,7 +5382,7 @@ if ($action == 'create') { $cssforamountpaymentcomplete = 'amountpaymentneutral'; } // Partially paid or abandoned 'abandoned' - if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'abandon') { + if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'abandon') { print '
'; $text = $langs->trans("HelpAbandonOther"); if ($object->close_note) { @@ -5522,7 +5522,7 @@ if ($action == 'create') { // Show global modifiers for situation invoices if (!empty($conf->global->INVOICE_USE_SITUATION)) { - if ($object->situation_cycle_ref && $object->statut == 0) { + if ($object->situation_cycle_ref && $object->status == 0) { print ''."\n"; print '
'; @@ -5572,7 +5572,7 @@ if ($action == 'create') { '; - if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } @@ -5585,7 +5585,7 @@ if ($action == 'create') { } // Form to add new line - if ($object->statut == 0 && $usercancreate && $action != 'valid') { + if ($object->status == 0 && $usercancreate && $action != 'valid') { if ($action != 'editline' && $action != 'selectlines') { // Add free products/services @@ -5622,7 +5622,7 @@ if ($action == 'create') { ) ); // Editer une facture deja validee, sans paiement effectue et pas exporte en compta - if ($object->statut == Facture::STATUS_VALIDATED) { + if ($object->status == Facture::STATUS_VALIDATED) { // We check if lines of invoice are not already transfered into accountancy $ventilExportCompta = $object->getVentilExportCompta(); @@ -5658,7 +5658,7 @@ if ($action == 'create') { || ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id)) || ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id)) || ($object->type == Facture::TYPE_SITUATION && empty($discount->id))) - && ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data + && ($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED || ($object->status == 1 && $object->paye == 1)) // Condition ($object->status == 1 && $object->paye == 1) should not happened but can be found due to corrupted data && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) { // A paid invoice (partially or completely) if ($object->close_code != 'replaced' || (!$objectidnext)) { // Not replaced by another invoice or replaced but the replacement invoice has been deleted $params['attr']['title'] = ''; @@ -5671,7 +5671,7 @@ if ($action == 'create') { // Create contract if (!empty($conf->global->CONTRACT_CREATE_FROM_INVOICE)) { - if (isModEnabled('contrat') && $object->statut == Facture::STATUS_VALIDATED) { + if (isModEnabled('contrat') && $object->status == Facture::STATUS_VALIDATED) { $langs->load("contracts"); if ($usercancreatecontract) { @@ -5681,7 +5681,7 @@ if ($action == 'create') { } // Validate - if ($object->statut == Facture::STATUS_DRAFT && count($object->lines) > 0 && ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION) && (!empty($conf->global->FACTURE_ENABLE_NEGATIVE) || $object->total_ttc >= 0)) || ($object->type == Facture::TYPE_CREDIT_NOTE && $object->total_ttc <= 0))) { + if ($object->status == Facture::STATUS_DRAFT && count($object->lines) > 0 && ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION) && (!empty($conf->global->FACTURE_ENABLE_NEGATIVE) || $object->total_ttc >= 0)) || ($object->type == Facture::TYPE_CREDIT_NOTE && $object->total_ttc <= 0))) { if ($usercanvalidate) { $params['attr']['title'] = ''; print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=valid&token='.newToken(), '', true, $params); @@ -5690,7 +5690,7 @@ if ($action == 'create') { // Send by mail if (empty($user->socid)) { - if (($object->statut == Facture::STATUS_VALIDATED || $object->statut == Facture::STATUS_CLOSED) || !empty($conf->global->FACTURE_SENDBYEMAIL_FOR_ALL_STATUS)) { + if (($object->status == Facture::STATUS_VALIDATED || $object->status == Facture::STATUS_CLOSED) || !empty($conf->global->FACTURE_SENDBYEMAIL_FOR_ALL_STATUS)) { if ($objectidnext) { print ''.$langs->trans('SendMail').''; } else { @@ -5706,7 +5706,7 @@ if ($action == 'create') { } // Request a direct debit order - if ($object->statut > Facture::STATUS_DRAFT && $object->paye == 0 && $num == 0) { + if ($object->status > Facture::STATUS_DRAFT && $object->paye == 0 && $num == 0) { if ($resteapayer > 0) { if ($usercancreatewithdrarequest) { if (!$objectidnext && $object->close_code != 'replaced') { // Not replaced by another invoice @@ -5730,7 +5730,7 @@ if ($action == 'create') { } // Create payment - if ($object->type != Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $usercanissuepayment) { + if ($object->type != Facture::TYPE_CREDIT_NOTE && $object->status == 1 && $object->paye == 0 && $usercanissuepayment) { if ($objectidnext) { print ''.$langs->trans('DoPayment').''; } else { @@ -5753,7 +5753,7 @@ if ($action == 'create') { // Reverse back money or convert to reduction if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) { // For credit note only - if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment) { + if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->status == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment) { if ($resteapayer == 0) { print ''.$langs->trans('DoPaymentBack').''; } else { @@ -5762,17 +5762,17 @@ if ($action == 'create') { } // For standard invoice with excess received - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) && $object->statut == Facture::STATUS_VALIDATED && empty($object->paye) && $resteapayer < 0 && $usercancreate && empty($discount->id)) { + if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) && $object->status == Facture::STATUS_VALIDATED && empty($object->paye) && $resteapayer < 0 && $usercancreate && empty($discount->id)) { print ''.$langs->trans('ConvertExcessReceivedToReduc').''; } // For credit note - if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercancreate + if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->status == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercancreate && (!empty($conf->global->INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED) || $sumofpayment == 0) ) { print ''.$langs->trans('ConvertToReduc').''; } // For down payment invoice (deposit) - if ($object->type == Facture::TYPE_DEPOSIT && $usercancreate && $object->statut > Facture::STATUS_DRAFT && empty($discount->id)) { + if ($object->type == Facture::TYPE_DEPOSIT && $usercancreate && $object->status > Facture::STATUS_DRAFT && empty($discount->id)) { if (price2num($object->total_ttc, 'MT') == price2num($sumofpaymentall, 'MT') || ($object->type == Facture::STATUS_ABANDONED && in_array($object->close_code, array('bankcharge', 'discount_vat', 'other')))) { // We can close a down payment only if paid amount is same than amount of down payment (by definition) print ''.$langs->trans('ConvertToReduc').''; @@ -5783,7 +5783,7 @@ if ($action == 'create') { } // Classify paid - if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment && ( + if ($object->status == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment && ( ($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && ($resteapayer <= 0 || (!empty($conf->global->INVOICE_CAN_SET_PAID_EVEN_IF_PARTIALLY_PAID) && $object->total_ttc == $resteapayer))) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0) || ($object->type == Facture::TYPE_DEPOSIT && $object->total_ttc > 0) @@ -5800,7 +5800,7 @@ if ($action == 'create') { } // Classify 'closed not completely paid' (possible if validated and not yet filed paid) - if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && (empty($conf->global->INVOICE_CAN_SET_PAID_EVEN_IF_PARTIALLY_PAID) || $resteapayer != $object->total_ttc) && $usercanissuepayment) { + if ($object->status == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && (empty($conf->global->INVOICE_CAN_SET_PAID_EVEN_IF_PARTIALLY_PAID) || $resteapayer != $object->total_ttc) && $usercanissuepayment) { if ($totalpaid > 0 || $totalcreditnotes > 0) { // If one payment or one credit note was linked to this invoice print ''.$langs->trans('ClassifyPaidPartially').''; @@ -5816,14 +5816,14 @@ if ($action == 'create') { } // Create a credit note - if (($object->type == Facture::TYPE_STANDARD || ($object->type == Facture::TYPE_DEPOSIT && empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate) { + if (($object->type == Facture::TYPE_STANDARD || ($object->type == Facture::TYPE_DEPOSIT && empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) || $object->type == Facture::TYPE_PROFORMA) && $object->status > 0 && $usercancreate) { if (!$objectidnext) { print ''.$langs->trans("CreateCreditNote").''; } } // For situation invoice with excess received - if ($object->statut > Facture::STATUS_DRAFT + if ($object->status > Facture::STATUS_DRAFT && $object->type == Facture::TYPE_SITUATION && ($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits) > 0 && $usercancreate @@ -5845,7 +5845,7 @@ if ($action == 'create') { } // Clone as predefined / Create template - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut == 0 && $usercancreate) { + if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->status == 0 && $usercancreate) { if (!$objectidnext && count($object->lines) > 0) { $params['attr']['title'] = ''; print dolGetButtonAction($langs->trans('ChangeIntoRepeatableInvoice'), '', 'default', DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$object->id.'&action=create', '', true, $params); @@ -5853,7 +5853,7 @@ if ($action == 'create') { } // Remove situation from cycle - if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED)) + if (in_array($object->status, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED)) && $object->type == Facture::TYPE_SITUATION && $usercancreate && !$objectidnext @@ -5869,7 +5869,7 @@ if ($action == 'create') { } // Create next situation invoice - if ($usercancreate && ($object->type == 5) && ($object->statut == 1 || $object->statut == 2)) { + if ($usercancreate && ($object->type == 5) && ($object->status == 1 || $object->status == 2)) { if ($object->is_last_in_cycle() && $object->situation_final != 1) { print ''.$langs->trans('CreateNextSituationInvoice').''; } elseif (!$object->is_last_in_cycle()) { @@ -5956,7 +5956,7 @@ if ($action == 'create') { $compatibleImportElementsList = false; if ($usercancreate - && $object->statut == Facture::STATUS_DRAFT + && $object->status == Facture::STATUS_DRAFT && ($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION)) { $compatibleImportElementsList = array('commande', 'propal'); // import from linked elements } @@ -5966,7 +5966,7 @@ if ($action == 'create') { // Show online payment link $useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox')); - if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) { + if ($object->status != Facture::STATUS_DRAFT && $useonlinepayment) { print '
'."\n"; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; print showOnlinePaymentUrl('invoice', $object->ref).'
'; diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 38d51f7b8b8..98ca9a5b831 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -135,8 +135,8 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
'; // Ref customer - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); // Project diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index af633e14f90..726ad043880 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -139,8 +139,8 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
'; // Ref customer - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); // Project diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 459d32cde87..a349e18176b 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -117,8 +117,8 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
'; // Ref customer - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); // Project diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 36446a0640b..06fbaa67f30 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -367,8 +367,8 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); } else { - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); } // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1);