added import and export recurring bills

This commit is contained in:
Cihan Şentürk
2023-08-14 17:21:40 +03:00
parent 09baf1991f
commit 0bbbe25d7f
31 changed files with 685 additions and 29 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Imports\Purchases\RecurringBills\Sheets;
use App\Abstracts\Import;
use App\Models\Document\Document;
use App\Models\Common\Recurring as Model;
class Recurring extends Import
{
public function model(array $row)
{
return new Model($row);
}
public function map($row): array
{
$row = parent::map($row);
$row['recurable_id'] = (int) Document::where('type', '=', Document::BILL_RECURRING_TYPE)
->number($row['bill_number'])
->pluck('id')
->first();
return $row;
}
}