missing sample import files

This commit is contained in:
denisdulici 2020-01-20 00:21:37 +03:00
parent 9574f154a7
commit de1a090ff6
28 changed files with 97 additions and 56 deletions

View File

@ -3,6 +3,7 @@
namespace App\Exports\Banking; namespace App\Exports\Banking;
use App\Models\Banking\Transaction as Model; use App\Models\Banking\Transaction as Model;
use Jenssegers\Date\Date;
use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
@ -20,14 +21,17 @@ class Transactions implements FromCollection, ShouldAutoSize, WithHeadings, With
{ {
return [ return [
$model->type, $model->type,
$model->account_id, Date::parse($model->paid_at)->format('Y-m-d'),
$model->paid_at,
$model->amount, $model->amount,
$model->currency_code, $model->currency_code,
$model->currency_rate, $model->currency_rate,
$model->account_id,
$model->document_id, $model->document_id,
$model->contact_id, $model->contact_id,
$model->category_id,
$model->description,
$model->payment_method, $model->payment_method,
$model->reference,
$model->reconciled, $model->reconciled,
]; ];
} }
@ -36,14 +40,17 @@ class Transactions implements FromCollection, ShouldAutoSize, WithHeadings, With
{ {
return [ return [
'type', 'type',
'account_id',
'paid_at', 'paid_at',
'amount', 'amount',
'currency_code', 'currency_code',
'currency_rate', 'currency_rate',
'account_id',
'document_id', 'document_id',
'contact_id', 'contact_id',
'category_id',
'description',
'payment_method', 'payment_method',
'reference',
'reconciled', 'reconciled',
]; ];
} }

View File

@ -6,8 +6,8 @@ use App\Exports\Purchases\Sheets\Bills as Base;
use App\Exports\Purchases\Sheets\BillItems; use App\Exports\Purchases\Sheets\BillItems;
use App\Exports\Purchases\Sheets\BillItemTaxes; use App\Exports\Purchases\Sheets\BillItemTaxes;
use App\Exports\Purchases\Sheets\BillHistories; use App\Exports\Purchases\Sheets\BillHistories;
use App\Exports\Purchases\Sheets\BillPayments;
use App\Exports\Purchases\Sheets\BillTotals; use App\Exports\Purchases\Sheets\BillTotals;
use App\Exports\Purchases\Sheets\BillTransactions;
use Maatwebsite\Excel\Concerns\WithMultipleSheets; use Maatwebsite\Excel\Concerns\WithMultipleSheets;
class Bills implements WithMultipleSheets class Bills implements WithMultipleSheets
@ -26,8 +26,8 @@ class Bills implements WithMultipleSheets
'bill_items' => new BillItems($this->ids), 'bill_items' => new BillItems($this->ids),
'bill_item_taxes' => new BillItemTaxes($this->ids), 'bill_item_taxes' => new BillItemTaxes($this->ids),
'bill_histories' => new BillHistories($this->ids), 'bill_histories' => new BillHistories($this->ids),
'bill_payments' => new BillPayments($this->ids),
'bill_totals' => new BillTotals($this->ids), 'bill_totals' => new BillTotals($this->ids),
'bill_transactions' => new BillTransactions($this->ids),
]; ];
} }
} }

View File

@ -3,6 +3,7 @@
namespace App\Exports\Purchases; namespace App\Exports\Purchases;
use App\Models\Banking\Transaction as Model; use App\Models\Banking\Transaction as Model;
use Jenssegers\Date\Date;
use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
@ -32,14 +33,17 @@ class Payments implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
public function map($model): array public function map($model): array
{ {
return [ return [
$model->account_id, Date::parse($model->paid_at)->format('Y-m-d'),
$model->paid_at,
$model->amount, $model->amount,
$model->currency_code, $model->currency_code,
$model->currency_rate, $model->currency_rate,
$model->account_id,
$model->document_id, $model->document_id,
$model->contact_id, $model->contact_id,
$model->category_id,
$model->description,
$model->payment_method, $model->payment_method,
$model->reference,
$model->reconciled, $model->reconciled,
]; ];
} }
@ -47,14 +51,17 @@ class Payments implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
public function headings(): array public function headings(): array
{ {
return [ return [
'account_id',
'paid_at', 'paid_at',
'amount', 'amount',
'currency_code', 'currency_code',
'currency_rate', 'currency_rate',
'account_id',
'document_id', 'document_id',
'contact_id', 'contact_id',
'category_id',
'description',
'payment_method', 'payment_method',
'reference',
'reconciled', 'reconciled',
]; ];
} }

View File

@ -35,6 +35,7 @@ class BillItems implements FromCollection, ShouldAutoSize, WithHeadings, WithMap
$model->bill_id, $model->bill_id,
$model->item_id, $model->item_id,
$model->name, $model->name,
$model->quantity,
$model->price, $model->price,
$model->total, $model->total,
$model->tax, $model->tax,
@ -47,6 +48,7 @@ class BillItems implements FromCollection, ShouldAutoSize, WithHeadings, WithMap
'bill_id', 'bill_id',
'item_id', 'item_id',
'name', 'name',
'quantity',
'price', 'price',
'total', 'total',
'tax', 'tax',

View File

@ -3,13 +3,14 @@
namespace App\Exports\Purchases\Sheets; namespace App\Exports\Purchases\Sheets;
use App\Models\Banking\Transaction as Model; use App\Models\Banking\Transaction as Model;
use Jenssegers\Date\Date;
use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithTitle; use Maatwebsite\Excel\Concerns\WithTitle;
class BillPayments implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping, WithTitle class BillTransactions implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping, WithTitle
{ {
public $bill_ids; public $bill_ids;
@ -23,7 +24,7 @@ class BillPayments implements FromCollection, ShouldAutoSize, WithHeadings, With
$model = Model::type('expense')->isDocument()->usingSearchString(request('search')); $model = Model::type('expense')->isDocument()->usingSearchString(request('search'));
if (!empty($this->bill_ids)) { if (!empty($this->bill_ids)) {
$model->whereIn('bill_id', (array) $this->bill_ids); $model->whereIn('document_id', (array) $this->bill_ids);
} }
return $model->get(); return $model->get();
@ -32,14 +33,17 @@ class BillPayments implements FromCollection, ShouldAutoSize, WithHeadings, With
public function map($model): array public function map($model): array
{ {
return [ return [
$model->account_id, Date::parse($model->paid_at)->format('Y-m-d'),
$model->paid_at,
$model->amount, $model->amount,
$model->currency_code, $model->currency_code,
$model->currency_rate, $model->currency_rate,
$model->account_id,
$model->document_id, $model->document_id,
$model->contact_id, $model->contact_id,
$model->category_id,
$model->description,
$model->payment_method, $model->payment_method,
$model->reference,
$model->reconciled, $model->reconciled,
]; ];
} }
@ -47,20 +51,23 @@ class BillPayments implements FromCollection, ShouldAutoSize, WithHeadings, With
public function headings(): array public function headings(): array
{ {
return [ return [
'account_id',
'paid_at', 'paid_at',
'amount', 'amount',
'currency_code', 'currency_code',
'currency_rate', 'currency_rate',
'account_id',
'document_id', 'document_id',
'contact_id', 'contact_id',
'category_id',
'description',
'payment_method', 'payment_method',
'reference',
'reconciled', 'reconciled',
]; ];
} }
public function title(): string public function title(): string
{ {
return 'bill_payments'; return 'bill_transactions';
} }
} }

View File

@ -3,6 +3,7 @@
namespace App\Exports\Purchases\Sheets; namespace App\Exports\Purchases\Sheets;
use App\Models\Purchase\Bill as Model; use App\Models\Purchase\Bill as Model;
use Jenssegers\Date\Date;
use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
@ -35,11 +36,12 @@ class Bills implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping
$model->bill_number, $model->bill_number,
$model->order_number, $model->order_number,
$model->status, $model->status,
$model->billed_at, Date::parse($model->billed_at)->format('Y-m-d'),
$model->due_at, Date::parse($model->due_at)->format('Y-m-d'),
$model->amount, $model->amount,
$model->currency_code, $model->currency_code,
$model->currency_rate, $model->currency_rate,
$model->category_id,
$model->contact_id, $model->contact_id,
$model->contact_name, $model->contact_name,
$model->contact_email, $model->contact_email,
@ -47,7 +49,6 @@ class Bills implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping
$model->contact_phone, $model->contact_phone,
$model->contact_address, $model->contact_address,
$model->notes, $model->notes,
$model->category_id,
$model->footer, $model->footer,
]; ];
} }
@ -63,6 +64,7 @@ class Bills implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping
'amount', 'amount',
'currency_code', 'currency_code',
'currency_rate', 'currency_rate',
'category_id',
'contact_id', 'contact_id',
'contact_name', 'contact_name',
'contact_email', 'contact_email',
@ -70,7 +72,6 @@ class Bills implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping
'contact_phone', 'contact_phone',
'contact_address', 'contact_address',
'notes', 'notes',
'category_id',
'footer', 'footer',
]; ];
} }

View File

@ -34,7 +34,6 @@ class Vendors implements FromCollection, ShouldAutoSize, WithHeadings, WithMappi
return [ return [
$model->name, $model->name,
$model->email, $model->email,
$model->user_id,
$model->tax_number, $model->tax_number,
$model->phone, $model->phone,
$model->address, $model->address,
@ -42,6 +41,7 @@ class Vendors implements FromCollection, ShouldAutoSize, WithHeadings, WithMappi
$model->currency_code, $model->currency_code,
$model->reference, $model->reference,
$model->enabled, $model->enabled,
$model->user_id,
]; ];
} }
@ -50,7 +50,6 @@ class Vendors implements FromCollection, ShouldAutoSize, WithHeadings, WithMappi
return [ return [
'name', 'name',
'email', 'email',
'user_id',
'tax_number', 'tax_number',
'phone', 'phone',
'address', 'address',
@ -58,6 +57,7 @@ class Vendors implements FromCollection, ShouldAutoSize, WithHeadings, WithMappi
'currency_code', 'currency_code',
'reference', 'reference',
'enabled', 'enabled',
'user_id',
]; ];
} }

View File

@ -34,7 +34,6 @@ class Customers implements FromCollection, ShouldAutoSize, WithHeadings, WithMap
return [ return [
$model->name, $model->name,
$model->email, $model->email,
$model->user_id,
$model->tax_number, $model->tax_number,
$model->phone, $model->phone,
$model->address, $model->address,
@ -42,6 +41,7 @@ class Customers implements FromCollection, ShouldAutoSize, WithHeadings, WithMap
$model->currency_code, $model->currency_code,
$model->reference, $model->reference,
$model->enabled, $model->enabled,
$model->user_id,
]; ];
} }
@ -50,7 +50,6 @@ class Customers implements FromCollection, ShouldAutoSize, WithHeadings, WithMap
return [ return [
'name', 'name',
'email', 'email',
'user_id',
'tax_number', 'tax_number',
'phone', 'phone',
'address', 'address',
@ -58,6 +57,7 @@ class Customers implements FromCollection, ShouldAutoSize, WithHeadings, WithMap
'currency_code', 'currency_code',
'reference', 'reference',
'enabled', 'enabled',
'user_id',
]; ];
} }

View File

@ -6,8 +6,8 @@ use App\Exports\Sales\Sheets\Invoices as Base;
use App\Exports\Sales\Sheets\InvoiceItems; use App\Exports\Sales\Sheets\InvoiceItems;
use App\Exports\Sales\Sheets\InvoiceItemTaxes; use App\Exports\Sales\Sheets\InvoiceItemTaxes;
use App\Exports\Sales\Sheets\InvoiceHistories; use App\Exports\Sales\Sheets\InvoiceHistories;
use App\Exports\Sales\Sheets\InvoicePayments;
use App\Exports\Sales\Sheets\InvoiceTotals; use App\Exports\Sales\Sheets\InvoiceTotals;
use App\Exports\Sales\Sheets\InvoiceTransactions;
use Maatwebsite\Excel\Concerns\WithMultipleSheets; use Maatwebsite\Excel\Concerns\WithMultipleSheets;
class Invoices implements WithMultipleSheets class Invoices implements WithMultipleSheets
@ -26,8 +26,8 @@ class Invoices implements WithMultipleSheets
'invoice_items' => new InvoiceItems($this->ids), 'invoice_items' => new InvoiceItems($this->ids),
'invoice_item_taxes' => new InvoiceItemTaxes($this->ids), 'invoice_item_taxes' => new InvoiceItemTaxes($this->ids),
'invoice_histories' => new InvoiceHistories($this->ids), 'invoice_histories' => new InvoiceHistories($this->ids),
'invoice_payments' => new InvoicePayments($this->ids),
'invoice_totals' => new InvoiceTotals($this->ids), 'invoice_totals' => new InvoiceTotals($this->ids),
'invoice_transactions' => new InvoiceTransactions($this->ids),
]; ];
} }
} }

View File

@ -3,6 +3,7 @@
namespace App\Exports\Sales; namespace App\Exports\Sales;
use App\Models\Banking\Transaction as Model; use App\Models\Banking\Transaction as Model;
use Jenssegers\Date\Date;
use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
@ -32,14 +33,17 @@ class Revenues implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
public function map($model): array public function map($model): array
{ {
return [ return [
$model->account_id, Date::parse($model->paid_at)->format('Y-m-d'),
$model->paid_at,
$model->amount, $model->amount,
$model->currency_code, $model->currency_code,
$model->currency_rate, $model->currency_rate,
$model->account_id,
$model->document_id, $model->document_id,
$model->contact_id, $model->contact_id,
$model->category_id,
$model->description,
$model->payment_method, $model->payment_method,
$model->reference,
$model->reconciled, $model->reconciled,
]; ];
} }
@ -47,14 +51,17 @@ class Revenues implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
public function headings(): array public function headings(): array
{ {
return [ return [
'account_id',
'paid_at', 'paid_at',
'amount', 'amount',
'currency_code', 'currency_code',
'currency_rate', 'currency_rate',
'account_id',
'document_id', 'document_id',
'contact_id', 'contact_id',
'category_id',
'description',
'payment_method', 'payment_method',
'reference',
'reconciled', 'reconciled',
]; ];
} }

View File

@ -35,6 +35,7 @@ class InvoiceItems implements FromCollection, ShouldAutoSize, WithHeadings, With
$model->invoice_id, $model->invoice_id,
$model->item_id, $model->item_id,
$model->name, $model->name,
$model->quantity,
$model->price, $model->price,
$model->total, $model->total,
$model->tax, $model->tax,
@ -47,6 +48,7 @@ class InvoiceItems implements FromCollection, ShouldAutoSize, WithHeadings, With
'invoice_id', 'invoice_id',
'item_id', 'item_id',
'name', 'name',
'quantity',
'price', 'price',
'total', 'total',
'tax', 'tax',

View File

@ -3,13 +3,14 @@
namespace App\Exports\Sales\Sheets; namespace App\Exports\Sales\Sheets;
use App\Models\Banking\Transaction as Model; use App\Models\Banking\Transaction as Model;
use Jenssegers\Date\Date;
use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithTitle; use Maatwebsite\Excel\Concerns\WithTitle;
class InvoicePayments implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping, WithTitle class InvoiceTransactions implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping, WithTitle
{ {
public $invoice_ids; public $invoice_ids;
@ -23,7 +24,7 @@ class InvoicePayments implements FromCollection, ShouldAutoSize, WithHeadings, W
$model = Model::type('income')->isDocument()->usingSearchString(request('search')); $model = Model::type('income')->isDocument()->usingSearchString(request('search'));
if (!empty($this->invoice_ids)) { if (!empty($this->invoice_ids)) {
$model->whereIn('invoice_id', (array) $this->invoice_ids); $model->whereIn('document_id', (array) $this->invoice_ids);
} }
return $model->get(); return $model->get();
@ -32,14 +33,17 @@ class InvoicePayments implements FromCollection, ShouldAutoSize, WithHeadings, W
public function map($model): array public function map($model): array
{ {
return [ return [
$model->account_id, Date::parse($model->paid_at)->format('Y-m-d'),
$model->paid_at,
$model->amount, $model->amount,
$model->currency_code, $model->currency_code,
$model->currency_rate, $model->currency_rate,
$model->account_id,
$model->document_id, $model->document_id,
$model->contact_id, $model->contact_id,
$model->category_id,
$model->description,
$model->payment_method, $model->payment_method,
$model->reference,
$model->reconciled, $model->reconciled,
]; ];
} }
@ -47,20 +51,23 @@ class InvoicePayments implements FromCollection, ShouldAutoSize, WithHeadings, W
public function headings(): array public function headings(): array
{ {
return [ return [
'account_id',
'paid_at', 'paid_at',
'amount', 'amount',
'currency_code', 'currency_code',
'currency_rate', 'currency_rate',
'account_id',
'document_id', 'document_id',
'contact_id', 'contact_id',
'category_id',
'description',
'payment_method', 'payment_method',
'reference',
'reconciled', 'reconciled',
]; ];
} }
public function title(): string public function title(): string
{ {
return 'invoice_payments'; return 'invoice_transactions';
} }
} }

View File

@ -3,6 +3,7 @@
namespace App\Exports\Sales\Sheets; namespace App\Exports\Sales\Sheets;
use App\Models\Sale\Invoice as Model; use App\Models\Sale\Invoice as Model;
use Jenssegers\Date\Date;
use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
@ -35,11 +36,12 @@ class Invoices implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
$model->invoice_number, $model->invoice_number,
$model->order_number, $model->order_number,
$model->status, $model->status,
$model->invoiced_at, Date::parse($model->invoiced_at)->format('Y-m-d'),
$model->due_at, Date::parse($model->due_at)->format('Y-m-d'),
$model->amount, $model->amount,
$model->currency_code, $model->currency_code,
$model->currency_rate, $model->currency_rate,
$model->category_id,
$model->contact_id, $model->contact_id,
$model->contact_name, $model->contact_name,
$model->contact_email, $model->contact_email,
@ -47,7 +49,6 @@ class Invoices implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
$model->contact_phone, $model->contact_phone,
$model->contact_address, $model->contact_address,
$model->notes, $model->notes,
$model->category_id,
$model->footer, $model->footer,
]; ];
} }
@ -63,6 +64,7 @@ class Invoices implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
'amount', 'amount',
'currency_code', 'currency_code',
'currency_rate', 'currency_rate',
'category_id',
'contact_id', 'contact_id',
'contact_name', 'contact_name',
'contact_email', 'contact_email',
@ -70,7 +72,6 @@ class Invoices implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
'contact_phone', 'contact_phone',
'contact_address', 'contact_address',
'notes', 'notes',
'category_id',
'footer', 'footer',
]; ];
} }

View File

@ -182,15 +182,15 @@ class CoreV200 extends Migration
$table->increments('id'); $table->increments('id');
$table->integer('company_id'); $table->integer('company_id');
$table->string('type'); $table->string('type');
$table->integer('account_id');
$table->dateTime('paid_at'); $table->dateTime('paid_at');
$table->double('amount', 15, 4); $table->double('amount', 15, 4);
$table->string('currency_code', 3); $table->string('currency_code', 3);
$table->double('currency_rate', 15, 8); $table->double('currency_rate', 15, 8);
$table->integer('account_id');
$table->integer('document_id')->nullable(); $table->integer('document_id')->nullable();
$table->integer('contact_id')->nullable(); $table->integer('contact_id')->nullable();
$table->text('description')->nullable();
$table->integer('category_id')->default(1); $table->integer('category_id')->default(1);
$table->text('description')->nullable();
$table->string('payment_method'); $table->string('payment_method');
$table->string('reference')->nullable(); $table->string('reference')->nullable();
$table->integer('parent_id')->default(0); $table->integer('parent_id')->default(0);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.