feat(sales): add discount support with ledger accounting
- Add discount_type column to transactions table via migration - Update Sale model to use fillable instead of guarded for better security - Implement discount account ledger creation when discount is applied - Fix net amount calculation to include discount in CreateSaleAction - Remove unused "Exempt" column from sale transaction table - Make discount_type required when discount is enabled in form - Update form data mutation to properly handle discount calculations
This commit is contained in:
@@ -12,7 +12,14 @@ class Sale extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = [];
|
||||
protected $fillable = [
|
||||
'branch_id',
|
||||
'user_id',
|
||||
'client_id',
|
||||
'happened_on',
|
||||
'reference_number',
|
||||
'buyer'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'happened_on' => 'date:Y-m-d',
|
||||
|
||||
Reference in New Issue
Block a user