akaunting 3.0 (the last dance)
This commit is contained in:
@@ -17,6 +17,10 @@ class Items extends Import
|
||||
{
|
||||
$row = parent::map($row);
|
||||
|
||||
$row['sale_information'] = isset($row['sale_price']) ?? false;
|
||||
|
||||
$row['purchase_information'] = isset($row['purchase_price']) ?? false;
|
||||
|
||||
$row['category_id'] = $this->getCategoryId($row, 'item');
|
||||
|
||||
return $row;
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Imports\Purchases;
|
||||
|
||||
use App\Abstracts\Import;
|
||||
use App\Http\Requests\Banking\Transaction as Request;
|
||||
use App\Models\Banking\Transaction as Model;
|
||||
|
||||
class Payments extends Import
|
||||
{
|
||||
public function model(array $row)
|
||||
{
|
||||
return new Model($row);
|
||||
}
|
||||
|
||||
public function map($row): array
|
||||
{
|
||||
$row = parent::map($row);
|
||||
|
||||
$row['type'] = 'expense';
|
||||
$row['account_id'] = $this->getAccountId($row);
|
||||
$row['category_id'] = $this->getCategoryId($row, 'expense');
|
||||
$row['contact_id'] = $this->getContactId($row, 'vendor');
|
||||
$row['document_id'] = $this->getDocumentId($row);
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return (new Request())->rules();
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ class BillTransactions extends Import
|
||||
$row['category_id'] = $this->getCategoryId($row, 'expense');
|
||||
$row['contact_id'] = $this->getContactId($row, 'vendor');
|
||||
$row['document_id'] = $this->getDocumentId($row);
|
||||
$row['number'] = $row['transaction_number'];
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Imports\Sales;
|
||||
|
||||
use App\Abstracts\Import;
|
||||
use App\Http\Requests\Banking\Transaction as Request;
|
||||
use App\Models\Banking\Transaction as Model;
|
||||
|
||||
class Revenues extends Import
|
||||
{
|
||||
public function model(array $row)
|
||||
{
|
||||
return new Model($row);
|
||||
}
|
||||
|
||||
public function map($row): array
|
||||
{
|
||||
$row = parent::map($row);
|
||||
|
||||
$row['type'] = 'income';
|
||||
$row['account_id'] = $this->getAccountId($row);
|
||||
$row['category_id'] = $this->getCategoryId($row, 'income');
|
||||
$row['contact_id'] = $this->getContactId($row, 'customer');
|
||||
$row['document_id'] = $this->getDocumentId($row);
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return (new Request())->rules();
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ class InvoiceTransactions extends Import
|
||||
$row['category_id'] = $this->getCategoryId($row, 'income');
|
||||
$row['contact_id'] = $this->getContactId($row, 'customer');
|
||||
$row['document_id'] = $this->getDocumentId($row);
|
||||
$row['number'] = $row['transaction_number'];
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
20
app/Imports/Settings/Taxes.php
Normal file
20
app/Imports/Settings/Taxes.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Imports\Settings;
|
||||
|
||||
use App\Abstracts\Import;
|
||||
use App\Http\Requests\Setting\Tax as Request;
|
||||
use App\Models\Setting\Tax as Model;
|
||||
|
||||
class Taxes extends Import
|
||||
{
|
||||
public function model(array $row)
|
||||
{
|
||||
return new Model($row);
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return (new Request())->rules();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user