Invoice testing and line item catchup
This commit is contained in:
@@ -5,6 +5,7 @@ use Faker\Generator as Faker;
|
||||
$factory->define(App\Models\Service::class, function (Faker $faker) {
|
||||
return [
|
||||
'account_id'=>1,
|
||||
'active'=>1,
|
||||
];
|
||||
});
|
||||
|
||||
@@ -92,4 +93,17 @@ $factory->afterMakingState(App\Models\Service::class,'3year',function ($service,
|
||||
$invoice_items = factory(App\Models\InvoiceItem::class,1)->state('3year')->make();
|
||||
$service->setRelation('invoice_items',$invoice_items);
|
||||
$service->recur_schedule = 6;
|
||||
});
|
||||
|
||||
// Last Month
|
||||
$factory->afterMakingState(App\Models\Service::class,'next-invoice',function ($service,$faker) {
|
||||
$invoice_items = factory(App\Models\InvoiceItem::class,1)->state('next-invoice')->make();
|
||||
$service->setRelation('invoice_items',$invoice_items);
|
||||
$service->recur_schedule = 1;
|
||||
});
|
||||
|
||||
// New Connect
|
||||
$factory->afterMakingState(App\Models\Service::class,'new-connect',function ($service,$faker) {
|
||||
$service->recur_schedule = 1;
|
||||
$service->date_next_invoice = \Carbon\Carbon::now()->subMonth()->startOfMonth()->addDays(\Carbon\Carbon::now()->subMonth()->daysInMonth/2);
|
||||
});
|
Reference in New Issue
Block a user