mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
- Invoice listing in frontend
This commit is contained in:
@@ -28,7 +28,7 @@ class InvoiceFactory extends Factory
|
||||
'id' => $this->faker->uuid,
|
||||
'user_id' => $this->faker->uuid,
|
||||
'client_id' => $this->faker->uuid,
|
||||
'invoice_type' => $this->faker->randomElement(['invoice', 'advance_invoice']),
|
||||
'invoice_type' => $this->faker->randomElement(['regular_invoice', 'advance_invoice']),
|
||||
'invoice_number' => $this->faker->numberBetween(2120001, 2120999),
|
||||
'variable_number' => $this->faker->numberBetween(2120001, 2120999),
|
||||
'currency' => $this->faker->randomElement(['CZK', 'EUR']),
|
||||
@@ -94,10 +94,6 @@ class InvoiceFactory extends Factory
|
||||
public function configure()
|
||||
{
|
||||
return $this->afterCreating(function (Invoice $invoice) {
|
||||
|
||||
$invoice->delivery_at = $invoice->created_at;
|
||||
$invoice->due_at = Carbon::parse($invoice->created_at)->addWeeks(2);
|
||||
|
||||
if ($invoice->discount_type === 'percent') {
|
||||
$invoice->discount_rate = $this->faker->randomElement([2, 5, 10, 15, 20]);
|
||||
}
|
||||
@@ -106,10 +102,6 @@ class InvoiceFactory extends Factory
|
||||
$invoice->discount_rate = $this->faker->randomElement([20, 10]);
|
||||
}
|
||||
|
||||
$invoice->total_discount = invoice_total_discount($invoice);
|
||||
$invoice->total_net = invoice_total_net($invoice);
|
||||
$invoice->total_tax = invoice_total_tax($invoice);
|
||||
|
||||
$invoice->save();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user