Merge pull request #26589 from frederic34/cleandeprecated

QUAL: clean deprecated
This commit is contained in:
Laurent Destailleur 2024-01-10 12:46:19 +01:00 committed by GitHub
commit 36e12cab1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 57 additions and 56 deletions

View file

@ -144,8 +144,8 @@ if ($object->id > 0) {
$morehtmlref = '<div class="refidno">';
// 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 .= '<br>'.$object->thirdparty->getNomUrl(1);
// Project

View file

@ -1254,8 +1254,8 @@ if ($action == 'create') {
$morehtmlref .= '<div class="refidno">';
// 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

View file

@ -172,7 +172,7 @@ if (getDolGlobalString('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);
@ -235,7 +235,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);
@ -986,7 +986,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) {
@ -2776,7 +2776,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
@ -2874,7 +2874,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');
@ -4195,7 +4195,7 @@ if ($action == 'create') {
$text = $langs->trans('ConfirmDeleteBill', $object->ref);
$formquestion = array();
if ($object->type != Facture::TYPE_DEPOSIT && getDolGlobalString('STOCK_CALCULATE_ON_BILL') && $object->statut >= 1) {
if ($object->type != Facture::TYPE_DEPOSIT && getDolGlobalString('STOCK_CALCULATE_ON_BILL') && $object->status >= 1) {
$qualified_for_stock_change = 0;
if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$qualified_for_stock_change = $object->hasProductsOrServices(2);
@ -4233,7 +4233,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()
@ -4765,7 +4765,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 '<div class="inline-block"> &nbsp; &nbsp; &nbsp; &nbsp; ';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
print '</div>';
@ -4831,13 +4831,13 @@ if ($action == 'create') {
print '<table id="retained-warranty-table" class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('RetainedWarranty');
print '</td>';
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 '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarranty&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).'</a></td>';
}
print '</tr></table>';
print '</td><td>';
if ($action == 'editretainedwarranty' && $object->statut == Facture::STATUS_DRAFT) {
if ($action == 'editretainedwarranty' && $object->status == Facture::STATUS_DRAFT) {
print '<form id="retained-warranty-form" method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
print '<input type="hidden" name="action" value="setretainedwarranty">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -4855,7 +4855,7 @@ if ($action == 'create') {
print '<table id="retained-warranty-cond-reglement-table" class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShortRetainedWarranty');
print '</td>';
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 '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarrantypaymentterms&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).'</a></td>';
}
@ -4866,7 +4866,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 '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
print '<input type="hidden" name="action" value="setretainedwarrantyconditions">';
@ -4891,7 +4891,7 @@ if ($action == 'create') {
print '<table id="retained-warranty-date-limit-table" class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('RetainedWarrantyDateLimit');
print '</td>';
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 '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarrantydatelimit&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('setretainedwarrantyDateLimit'), 1).'</a></td>';
}
@ -4902,7 +4902,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 '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
print '<input type="hidden" name="action" value="setretainedwarrantydatelimit">';
@ -5294,7 +5294,7 @@ if ($action == 'create') {
$paiement = new Paiement($db);
$paiement->fetch($objp->rowid);
if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0 && !$paiement->isReconciled()) {
if ($object->status == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0 && !$paiement->isReconciled()) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepayment&token='.newToken().'&paiement_id='.$objp->rowid.'">';
print img_delete();
print '</a>';
@ -5369,7 +5369,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 '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
print '<span class="opacitymedium">';
print $form->textwithpicto($langs->trans("Discount"), $langs->trans("HelpEscompte"), - 1);
@ -5379,7 +5379,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 '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
print '<span class="opacitymedium">';
print $form->textwithpicto($langs->trans("Abandoned"), $langs->trans("HelpAbandonBadCustomer"), - 1);
@ -5389,7 +5389,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 '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
print '<span class="opacitymedium">';
print $form->textwithpicto($langs->trans("ProductReturned"), $langs->trans("HelpAbandonProductReturned"), - 1);
@ -5399,7 +5399,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 '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
$text = $langs->trans("HelpAbandonOther");
if ($object->close_note) {
@ -5539,7 +5539,7 @@ if ($action == 'create') {
// Show global modifiers for situation invoices
if (getDolGlobalString('INVOICE_USE_SITUATION')) {
if ($object->situation_cycle_ref && $object->statut == 0) {
if ($object->situation_cycle_ref && $object->status == 0) {
print '<!-- Area to change globally the situation percent -->'."\n";
print '<div class="div-table-responsive">';
@ -5589,7 +5589,7 @@ if ($action == 'create') {
<input type="hidden" name="backtopage" value="'.$backtopage.'">
';
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';
}
@ -5602,7 +5602,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
@ -5642,7 +5642,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();
@ -5678,7 +5678,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->statut == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED || ($object->status == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
&& ((!getDolGlobalString('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'] = '';
@ -5691,7 +5691,7 @@ if ($action == 'create') {
// Create contract
if (getDolGlobalString('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) {
@ -5701,7 +5701,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) && (getDolGlobalString('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) && (getDolGlobalString('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);
@ -5710,7 +5710,7 @@ if ($action == 'create') {
// Send by mail
if (empty($user->socid)) {
if (($object->statut == Facture::STATUS_VALIDATED || $object->statut == Facture::STATUS_CLOSED) || getDolGlobalString('FACTURE_SENDBYEMAIL_FOR_ALL_STATUS')) {
if (($object->status == Facture::STATUS_VALIDATED || $object->status == Facture::STATUS_CLOSED) || getDolGlobalString('FACTURE_SENDBYEMAIL_FOR_ALL_STATUS')) {
if ($objectidnext) {
print '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('SendMail').'</span>';
} else {
@ -5726,7 +5726,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
@ -5750,7 +5750,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 '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('DoPayment').'</span>';
} else {
@ -5773,7 +5773,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 '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseRemainderToPayIsZero").'">'.$langs->trans('DoPaymentBack').'</span>';
} else {
@ -5782,17 +5782,18 @@ 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 '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&amp;action=converttoreduc">'.$langs->trans('ConvertExcessReceivedToReduc').'</a>';
}
// 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
&& (getDolGlobalString('INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED') || $sumofpayment == 0) && $object->total_ht < 0
) {
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&amp;action=converttoreduc" title="'.dol_escape_htmltag($langs->trans("ConfirmConvertToReduc2")).'">'.$langs->trans('ConvertToReduc').'</a>';
}
// 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)) {
// We can close a down payment only if paid amount is same than amount of down payment (by definition). We can bypass this if hidden and unstable option DEPOSIT_AS_CREDIT_AVAILABLE_EVEN_UNPAID is set.
if (price2num($object->total_ttc, 'MT') == price2num($sumofpaymentall, 'MT') || getDolGlobalInt('DEPOSIT_AS_CREDIT_AVAILABLE_EVEN_UNPAID') || ($object->type == Facture::STATUS_ABANDONED && in_array($object->close_code, array('bankcharge', 'discount_vat', 'other')))) {
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&amp;action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a>';
@ -5803,10 +5804,10 @@ 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 || (getDolGlobalString('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)
($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0) ||
($object->type == Facture::TYPE_DEPOSIT && $object->total_ttc > 0)
)
) {
if ($object->type == Facture::TYPE_DEPOSIT && price2num($object->total_ttc, 'MT') != price2num($sumofpaymentall, 'MT')) {
@ -5820,7 +5821,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 && (!getDolGlobalString('INVOICE_CAN_SET_PAID_EVEN_IF_PARTIALLY_PAID') || $resteapayer != $object->total_ttc) && $usercanissuepayment) {
if ($object->status == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && (!getDolGlobalString('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 '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&amp;action=paid">'.$langs->trans('ClassifyPaidPartially').'</a>';
@ -5836,14 +5837,14 @@ if ($action == 'create') {
}
// Create a credit note
if (($object->type == Facture::TYPE_STANDARD || ($object->type == Facture::TYPE_DEPOSIT && !getDolGlobalString('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 && !getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) || $object->type == Facture::TYPE_PROFORMA) && $object->status > 0 && $usercancreate) {
if (!$objectidnext) {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&amp;fac_avoir='.$object->id.'&amp;action=create&amp;type=2'.($object->fk_project > 0 ? '&amp;projectid='.$object->fk_project : '').($object->entity > 0 ? '&amp;originentity='.$object->entity : '').'">'.$langs->trans("CreateCreditNote").'</a>';
}
}
// 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
@ -5865,7 +5866,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.'&amp;action=create', '', true, $params);
@ -5873,7 +5874,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
@ -5889,7 +5890,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 '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=create&amp;type=5&amp;origin=facture&amp;originid='.$object->id.'&amp;socid='.$object->socid.'" >'.$langs->trans('CreateNextSituationInvoice').'</a>';
} elseif (!$object->is_last_in_cycle()) {
@ -5976,7 +5977,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
}
@ -5986,7 +5987,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 '<br><!-- Link to pay -->'."\n";
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('invoice', $object->ref).'<br>';

View file

@ -145,8 +145,8 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref = '<div class="refidno">';
// 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 .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
// Project

View file

@ -139,8 +139,8 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref = '<div class="refidno">';
// 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 .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
// Project

View file

@ -117,8 +117,8 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref = '<div class="refidno">';
// 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 .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
// Project

View file

@ -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 .= '<br>'.$object->thirdparty->getNomUrl(1);