feat: extend rate card profiles with brands, terms, and custom HTML, and remove search bar from search index view
This commit is contained in:
@@ -32,18 +32,18 @@ class InvoiceSettings extends Model
|
||||
|
||||
protected $casts = [
|
||||
'invoice_next_number' => 'integer',
|
||||
'default_tax_rate' => 'decimal:2',
|
||||
'default_tax_rate' => 'decimal:2',
|
||||
];
|
||||
|
||||
/** Always return the single settings row, creating it if absent. */
|
||||
public static function instance(): self
|
||||
{
|
||||
return static::firstOrCreate([], [
|
||||
'invoice_prefix' => 'INV',
|
||||
'invoice_prefix' => 'INV',
|
||||
'invoice_next_number' => 1,
|
||||
'accent_color' => '#FFB7C5',
|
||||
'default_tax_rate' => 11,
|
||||
'default_currency' => 'IDR',
|
||||
'accent_color' => '#FFB7C5',
|
||||
'default_tax_rate' => 2.5,
|
||||
'default_currency' => 'IDR',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ class InvoiceSettings extends Model
|
||||
public static function generateNumber(): string
|
||||
{
|
||||
$settings = static::instance();
|
||||
$prefix = rtrim($settings->invoice_prefix, '-');
|
||||
$number = str_pad((string) $settings->invoice_next_number, 3, '0', STR_PAD_LEFT);
|
||||
$prefix = rtrim($settings->invoice_prefix, '-');
|
||||
$number = str_pad((string) $settings->invoice_next_number, 3, '0', STR_PAD_LEFT);
|
||||
$settings->increment('invoice_next_number');
|
||||
return $prefix . '-' . $number;
|
||||
}
|
||||
|
||||
@@ -13,10 +13,15 @@ class RateCardProfile extends Model
|
||||
'ig_handle', 'tiktok_handle', 'youtube_handle', 'email',
|
||||
'logo_path', 'bg_color', 'accent_color', 'text_color',
|
||||
'custom_footer', 'show_prices', 'access_token',
|
||||
'terms_and_conditions',
|
||||
'past_brands',
|
||||
'brand_logo_size',
|
||||
'contact_person_html',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'show_prices' => 'boolean',
|
||||
'past_brands' => 'array',
|
||||
];
|
||||
|
||||
/** Get the singleton profile, creating defaults if needed */
|
||||
|
||||
Reference in New Issue
Block a user