Tax excpetion texts

This commit is contained in:
2026-08-11 14:54:33 +02:00
parent 09f9767eb7
commit 5031d3bde0
5 changed files with 179 additions and 33 deletions
+8 -4
View File
@@ -14,12 +14,14 @@ use App\Scopes\CommonModel;
* @property string $name
* @property string $invoice_text
* @property bool $requires_note
* @property int $sort_order
*/
class TaxExemptionReason extends CommonModel
{
public const string SMALL_BUSINESS = 'small_business';
public const string EDUCATION = 'education';
public const string YOUTH_WELFARE = 'youth_welfare';
public const string USTG_19 = 'ustg_19';
public const string USTG_4_24 = 'ustg_4_24';
public const string USTG_4_25A = 'ustg_4_25a';
public const string USTG_4_22A = 'ustg_4_22a';
public const string CUSTOM = 'custom';
protected $table = 'tax_exemption_reasons';
@@ -32,10 +34,12 @@ class TaxExemptionReason extends CommonModel
'name',
'invoice_text',
'requires_note',
'sort_order',
];
protected $casts = [
'requires_note' => 'boolean',
'sort_order' => 'integer',
];
/**
@@ -55,7 +59,7 @@ class TaxExemptionReason extends CommonModel
*/
public static function options(): array
{
return self::all()
return self::orderBy('sort_order')->get()
->map(static fn (self $reason): array => [
'value' => $reason->slug,
'label' => $reason->name,