2
0
forked from Wavyzz/dolibarr

Replacing invoice integer types with Facture constants

This commit is contained in:
Marcos García de La Fuente
2014-02-26 01:09:22 +01:00
parent 8099d7ff42
commit 0eedadd7f2
2 changed files with 7 additions and 7 deletions

View File

@@ -189,7 +189,7 @@ if ($id > 0 || ! empty($ref))
{ {
if ($absolute_creditnote > 0) // If not linke will be added later if ($absolute_creditnote > 0) // If not linke will be added later
{ {
if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' - '.$addabsolutediscount.'<br>'; if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT) print ' - '.$addabsolutediscount.'<br>';
else print '.'; else print '.';
} }
else print '. '; else print '. ';
@@ -197,9 +197,9 @@ if ($id > 0 || ! empty($ref))
if ($absolute_creditnote > 0) if ($absolute_creditnote > 0)
{ {
// If validated, we show link "add credit note to payment" // If validated, we show link "add credit note to payment"
if ($object->statut != 1 || $object->type == 2 || $object->type == 3) if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT)
{ {
if ($object->statut == 0 && $object->type != 3) if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT)
{ {
$text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)); $text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency));
print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse")); print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse"));
@@ -220,7 +220,7 @@ if ($id > 0 || ! empty($ref))
if (! $absolute_discount && ! $absolute_creditnote) if (! $absolute_discount && ! $absolute_creditnote)
{ {
print $langs->trans("CompanyHasNoAbsoluteDiscount"); print $langs->trans("CompanyHasNoAbsoluteDiscount");
if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' - '.$addabsolutediscount.'<br>'; if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT) print ' - '.$addabsolutediscount.'<br>';
else print '. '; else print '. ';
} }
/*if ($object->statut == 0 && $object->type != 2 && $object->type != 3) /*if ($object->statut == 0 && $object->type != 2 && $object->type != 3)
@@ -242,10 +242,10 @@ if ($id > 0 || ! empty($ref))
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DateMaxPayment'); print $langs->trans('DateMaxPayment');
print '</td>'; print '</td>';
if ($object->type != 2 && $action != 'editpaymentterm' && $object->brouillon && $user->rights->facture->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&amp;facid='.$object->id.'">'.img_edit($langs->trans('SetDate'),1).'</a></td>'; if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && $object->brouillon && $user->rights->facture->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&amp;facid='.$object->id.'">'.img_edit($langs->trans('SetDate'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="5">'; print '</td><td colspan="5">';
if ($object->type != 2) if ($object->type != Facture::TYPE_CREDIT_NOTE)
{ {
if ($action == 'editpaymentterm') if ($action == 'editpaymentterm')
{ {

View File

@@ -68,7 +68,7 @@ class Facture extends CommonInvoice
var $ref_ext; var $ref_ext;
var $ref_int; var $ref_int;
//Check constants for types //Check constants for types
var $type= self::TYPE_STANDARD; var $type = self::TYPE_STANDARD;
//var $amount; //var $amount;
var $remise_absolue; var $remise_absolue;