1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00

Translate payment terms #1225

This commit is contained in:
Hillel Coren 2017-04-18 10:22:46 +03:00
parent 5180a76971
commit fe27b74938

View File

@ -29,6 +29,11 @@ class PaymentTerm extends EntityModel
return ENTITY_PAYMENT_TERM; return ENTITY_PAYMENT_TERM;
} }
public function getNumDays()
{
return $this->num_days == -1 ? 0 : $this->num_days;
}
public static function getSelectOptions() public static function getSelectOptions()
{ {
$terms = Cache::get('paymentTerms'); $terms = Cache::get('paymentTerms');
@ -37,6 +42,10 @@ class PaymentTerm extends EntityModel
$terms->push($term); $terms->push($term);
} }
foreach ($terms as $term) {
$term->name = trans('texts.payment_terms_net') . ' ' . $term->getNumDays();
}
return $terms->sortBy('num_days'); return $terms->sortBy('num_days');
} }
} }