Make array of dispute status a shared constant
This commit is contained in:
parent
ca7e4346f0
commit
fdce9453bc
3 changed files with 12 additions and 5 deletions
|
|
@ -5601,10 +5601,10 @@ if ($action == 'create') {
|
|||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td><td>';
|
||||
$liststatus = array('0' => "None", '1' => "DisputeOpen", '8' => "DisputeLost", '9' => "DisputeWon");
|
||||
$liststatus = Facture::ARRAY_OF_DISPUTE_STATUS;
|
||||
if ($action != 'editdispute_status') {
|
||||
if ($object->dispute_status) {
|
||||
print $langs->trans($liststatus[$object->dispute_status]);
|
||||
print $langs->trans($liststatus[$object->dispute_status]['label']);
|
||||
}
|
||||
} else {
|
||||
print '<form enctype="multipart/form-data" action="'.DOL_URL_ROOT.'/compta/facture/card.php" method="POST">';
|
||||
|
|
|
|||
|
|
@ -1961,7 +1961,7 @@ if (!empty($arrayfields['f.import_key']['checked'])) {
|
|||
// Dispute status
|
||||
if (!empty($arrayfields['f.dispute_status']['checked'])) {
|
||||
print '<td class="liste_titre center parentonrightofpage">';
|
||||
$liststatus = array('0' => "None", '1' => "DisputeOpen", '8' => "DisputeLost", '9' => "DisputeWon");
|
||||
$liststatus = Facture::ARRAY_OF_DISPUTE_STATUS;
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
print $form->selectarray('search_dispute_status', $liststatus, $search_dispute_status, 1, 0, 0, '', 1, 0, 0, '', 'search_status width100 onrightofpage', 1);
|
||||
print '</td>';
|
||||
|
|
@ -3094,8 +3094,8 @@ if ($num > 0) {
|
|||
if (!empty($arrayfields['f.dispute_status']['checked'])) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($facturestatic->dispute_status) {
|
||||
$liststatus = array('0' => "None", '1' => "DisputeOpen", '8' => "DisputeLost", '9' => "DisputeWon");
|
||||
print $langs->trans($liststatus[$facturestatic->dispute_status]);
|
||||
$liststatus = Facture::ARRAY_OF_DISPUTE_STATUS;
|
||||
print $langs->trans($liststatus[$facturestatic->dispute_status]['label']);
|
||||
}
|
||||
print "</td>";
|
||||
if (!$i) {
|
||||
|
|
|
|||
|
|
@ -291,6 +291,13 @@ abstract class CommonInvoice extends CommonObject
|
|||
const CLOSECODE_ABANDONED = 'abandon'; // Abandoned (no payment at all) - other
|
||||
const CLOSECODE_REPLACED = 'replaced'; // Abandoned (no payment at all) - replacedby another invoice (feature disabled by default)
|
||||
|
||||
const ARRAY_OF_DISPUTE_STATUS = array(
|
||||
0 => array('label' => "None"),
|
||||
1 => array('label' => "DisputeOpen"),
|
||||
8 => array('label' => "DisputeLost"),
|
||||
9 => array('label' => "DisputeWon")
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Return remain amount to pay. Property ->id and ->total_ttc must be set.
|
||||
|
|
|
|||
Loading…
Reference in a new issue