diff --git a/app/Models/PaymentTerm.php b/app/Models/PaymentTerm.php index 899d239e29..c54e8c73f0 100644 --- a/app/Models/PaymentTerm.php +++ b/app/Models/PaymentTerm.php @@ -29,6 +29,11 @@ class PaymentTerm extends EntityModel return ENTITY_PAYMENT_TERM; } + public function getNumDays() + { + return $this->num_days == -1 ? 0 : $this->num_days; + } + public static function getSelectOptions() { $terms = Cache::get('paymentTerms'); @@ -37,6 +42,10 @@ class PaymentTerm extends EntityModel $terms->push($term); } + foreach ($terms as $term) { + $term->name = trans('texts.payment_terms_net') . ' ' . $term->getNumDays(); + } + return $terms->sortBy('num_days'); } }