mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
clean deprecated
This commit is contained in:
parent
5fdfa4b971
commit
502a854ddb
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 '<div class="inline-block"> ';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
||||
print '</div>';
|
||||
|
|
@ -4818,13 +4818,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().'">';
|
||||
|
|
@ -4842,7 +4842,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>';
|
||||
}
|
||||
|
||||
|
|
@ -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 '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="setretainedwarrantyconditions">';
|
||||
|
|
@ -4878,7 +4878,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>';
|
||||
}
|
||||
|
||||
|
|
@ -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 '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="setretainedwarrantydatelimit">';
|
||||
|
|
@ -5277,7 +5277,7 @@ if ($action == 'create') {
|
|||
}
|
||||
print '<td class="right"><span class="amount">'.price($sign * $objp->amount).'</span></td>';
|
||||
print '<td class="center">';
|
||||
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 '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepayment&token='.newToken().'&paiement_id='.$objp->rowid.'">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
|
|
@ -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 '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
|
||||
print '<span class="opacitymedium">';
|
||||
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 '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
|
||||
print '<span class="opacitymedium">';
|
||||
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 '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
|
||||
print '<span class="opacitymedium">';
|
||||
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 '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
|
||||
$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 '<!-- Area to change globally the situation percent -->'."\n";
|
||||
print '<div class="div-table-responsive">';
|
||||
|
||||
|
|
@ -5572,7 +5572,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';
|
||||
}
|
||||
|
||||
|
|
@ -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 '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('SendMail').'</span>';
|
||||
} 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 '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('DoPayment').'</span>';
|
||||
} 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 '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseRemainderToPayIsZero").'">'.$langs->trans('DoPaymentBack').'</span>';
|
||||
} 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 '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&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
|
||||
&& (!empty($conf->global->INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED) || $sumofpayment == 0)
|
||||
) {
|
||||
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&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)) {
|
||||
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 '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a>';
|
||||
|
|
@ -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 '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaidPartially').'</a>';
|
||||
|
|
@ -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 '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&fac_avoir='.$object->id.'&action=create&type=2'.($object->fk_project > 0 ? '&projectid='.$object->fk_project : '').($object->entity > 0 ? '&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
|
||||
|
|
@ -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 '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=create&type=5&origin=facture&originid='.$object->id.'&socid='.$object->socid.'" >'.$langs->trans('CreateNextSituationInvoice').'</a>';
|
||||
} 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 '<br><!-- Link to pay -->'."\n";
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
print showOnlinePaymentUrl('invoice', $object->ref).'<br>';
|
||||
|
|
|
|||
|
|
@ -135,8 +135,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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user