missing sample import files
This commit is contained in:
		@@ -6,8 +6,8 @@ use App\Exports\Purchases\Sheets\Bills as Base;
 | 
			
		||||
use App\Exports\Purchases\Sheets\BillItems;
 | 
			
		||||
use App\Exports\Purchases\Sheets\BillItemTaxes;
 | 
			
		||||
use App\Exports\Purchases\Sheets\BillHistories;
 | 
			
		||||
use App\Exports\Purchases\Sheets\BillPayments;
 | 
			
		||||
use App\Exports\Purchases\Sheets\BillTotals;
 | 
			
		||||
use App\Exports\Purchases\Sheets\BillTransactions;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
 | 
			
		||||
 | 
			
		||||
class Bills implements WithMultipleSheets
 | 
			
		||||
@@ -26,8 +26,8 @@ class Bills implements WithMultipleSheets
 | 
			
		||||
            'bill_items' => new BillItems($this->ids),
 | 
			
		||||
            'bill_item_taxes' => new BillItemTaxes($this->ids),
 | 
			
		||||
            'bill_histories' => new BillHistories($this->ids),
 | 
			
		||||
            'bill_payments' => new BillPayments($this->ids),
 | 
			
		||||
            'bill_totals' => new BillTotals($this->ids),
 | 
			
		||||
            'bill_transactions' => new BillTransactions($this->ids),
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@
 | 
			
		||||
namespace App\Exports\Purchases;
 | 
			
		||||
 | 
			
		||||
use App\Models\Banking\Transaction as Model;
 | 
			
		||||
use Jenssegers\Date\Date;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\FromCollection;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\WithHeadings;
 | 
			
		||||
@@ -32,14 +33,17 @@ class Payments implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
 | 
			
		||||
    public function map($model): array
 | 
			
		||||
    {
 | 
			
		||||
        return [
 | 
			
		||||
            $model->account_id,
 | 
			
		||||
            $model->paid_at,
 | 
			
		||||
            Date::parse($model->paid_at)->format('Y-m-d'),
 | 
			
		||||
            $model->amount,
 | 
			
		||||
            $model->currency_code,
 | 
			
		||||
            $model->currency_rate,
 | 
			
		||||
            $model->account_id,
 | 
			
		||||
            $model->document_id,
 | 
			
		||||
            $model->contact_id,
 | 
			
		||||
            $model->category_id,
 | 
			
		||||
            $model->description,
 | 
			
		||||
            $model->payment_method,
 | 
			
		||||
            $model->reference,
 | 
			
		||||
            $model->reconciled,
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
@@ -47,14 +51,17 @@ class Payments implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
 | 
			
		||||
    public function headings(): array
 | 
			
		||||
    {
 | 
			
		||||
        return [
 | 
			
		||||
            'account_id',
 | 
			
		||||
            'paid_at',
 | 
			
		||||
            'amount',
 | 
			
		||||
            'currency_code',
 | 
			
		||||
            'currency_rate',
 | 
			
		||||
            'account_id',
 | 
			
		||||
            'document_id',
 | 
			
		||||
            'contact_id',
 | 
			
		||||
            'category_id',
 | 
			
		||||
            'description',
 | 
			
		||||
            'payment_method',
 | 
			
		||||
            'reference',
 | 
			
		||||
            'reconciled',
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
@@ -63,4 +70,4 @@ class Payments implements FromCollection, ShouldAutoSize, WithHeadings, WithMapp
 | 
			
		||||
    {
 | 
			
		||||
        return 'payments';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -55,4 +55,4 @@ class BillItemTaxes implements FromCollection, ShouldAutoSize, WithHeadings, Wit
 | 
			
		||||
    {
 | 
			
		||||
        return 'bill_item_taxes';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -35,6 +35,7 @@ class BillItems implements FromCollection, ShouldAutoSize, WithHeadings, WithMap
 | 
			
		||||
            $model->bill_id,
 | 
			
		||||
            $model->item_id,
 | 
			
		||||
            $model->name,
 | 
			
		||||
            $model->quantity,
 | 
			
		||||
            $model->price,
 | 
			
		||||
            $model->total,
 | 
			
		||||
            $model->tax,
 | 
			
		||||
@@ -47,6 +48,7 @@ class BillItems implements FromCollection, ShouldAutoSize, WithHeadings, WithMap
 | 
			
		||||
            'bill_id',
 | 
			
		||||
            'item_id',
 | 
			
		||||
            'name',
 | 
			
		||||
            'quantity',
 | 
			
		||||
            'price',
 | 
			
		||||
            'total',
 | 
			
		||||
            'tax',
 | 
			
		||||
@@ -57,4 +59,4 @@ class BillItems implements FromCollection, ShouldAutoSize, WithHeadings, WithMap
 | 
			
		||||
    {
 | 
			
		||||
        return 'bill_items';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -55,4 +55,4 @@ class BillTotals implements FromCollection, ShouldAutoSize, WithHeadings, WithMa
 | 
			
		||||
    {
 | 
			
		||||
        return 'bill_totals';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,13 +3,14 @@
 | 
			
		||||
namespace App\Exports\Purchases\Sheets;
 | 
			
		||||
 | 
			
		||||
use App\Models\Banking\Transaction as Model;
 | 
			
		||||
use Jenssegers\Date\Date;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\FromCollection;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\WithHeadings;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\WithMapping;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\WithTitle;
 | 
			
		||||
 | 
			
		||||
class BillPayments implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping, WithTitle
 | 
			
		||||
class BillTransactions implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping, WithTitle
 | 
			
		||||
{
 | 
			
		||||
    public $bill_ids;
 | 
			
		||||
 | 
			
		||||
@@ -23,7 +24,7 @@ class BillPayments implements FromCollection, ShouldAutoSize, WithHeadings, With
 | 
			
		||||
        $model = Model::type('expense')->isDocument()->usingSearchString(request('search'));
 | 
			
		||||
 | 
			
		||||
        if (!empty($this->bill_ids)) {
 | 
			
		||||
            $model->whereIn('bill_id', (array) $this->bill_ids);
 | 
			
		||||
            $model->whereIn('document_id', (array) $this->bill_ids);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $model->get();
 | 
			
		||||
@@ -32,14 +33,17 @@ class BillPayments implements FromCollection, ShouldAutoSize, WithHeadings, With
 | 
			
		||||
    public function map($model): array
 | 
			
		||||
    {
 | 
			
		||||
        return [
 | 
			
		||||
            $model->account_id,
 | 
			
		||||
            $model->paid_at,
 | 
			
		||||
            Date::parse($model->paid_at)->format('Y-m-d'),
 | 
			
		||||
            $model->amount,
 | 
			
		||||
            $model->currency_code,
 | 
			
		||||
            $model->currency_rate,
 | 
			
		||||
            $model->account_id,
 | 
			
		||||
            $model->document_id,
 | 
			
		||||
            $model->contact_id,
 | 
			
		||||
            $model->category_id,
 | 
			
		||||
            $model->description,
 | 
			
		||||
            $model->payment_method,
 | 
			
		||||
            $model->reference,
 | 
			
		||||
            $model->reconciled,
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
@@ -47,20 +51,23 @@ class BillPayments implements FromCollection, ShouldAutoSize, WithHeadings, With
 | 
			
		||||
    public function headings(): array
 | 
			
		||||
    {
 | 
			
		||||
        return [
 | 
			
		||||
            'account_id',
 | 
			
		||||
            'paid_at',
 | 
			
		||||
            'amount',
 | 
			
		||||
            'currency_code',
 | 
			
		||||
            'currency_rate',
 | 
			
		||||
            'account_id',
 | 
			
		||||
            'document_id',
 | 
			
		||||
            'contact_id',
 | 
			
		||||
            'category_id',
 | 
			
		||||
            'description',
 | 
			
		||||
            'payment_method',
 | 
			
		||||
            'reference',
 | 
			
		||||
            'reconciled',
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function title(): string
 | 
			
		||||
    {
 | 
			
		||||
        return 'bill_payments';
 | 
			
		||||
        return 'bill_transactions';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
@@ -3,6 +3,7 @@
 | 
			
		||||
namespace App\Exports\Purchases\Sheets;
 | 
			
		||||
 | 
			
		||||
use App\Models\Purchase\Bill as Model;
 | 
			
		||||
use Jenssegers\Date\Date;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\FromCollection;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
 | 
			
		||||
use Maatwebsite\Excel\Concerns\WithHeadings;
 | 
			
		||||
@@ -35,11 +36,12 @@ class Bills implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping
 | 
			
		||||
            $model->bill_number,
 | 
			
		||||
            $model->order_number,
 | 
			
		||||
            $model->status,
 | 
			
		||||
            $model->billed_at,
 | 
			
		||||
            $model->due_at,
 | 
			
		||||
            Date::parse($model->billed_at)->format('Y-m-d'),
 | 
			
		||||
            Date::parse($model->due_at)->format('Y-m-d'),
 | 
			
		||||
            $model->amount,
 | 
			
		||||
            $model->currency_code,
 | 
			
		||||
            $model->currency_rate,
 | 
			
		||||
            $model->category_id,
 | 
			
		||||
            $model->contact_id,
 | 
			
		||||
            $model->contact_name,
 | 
			
		||||
            $model->contact_email,
 | 
			
		||||
@@ -47,7 +49,6 @@ class Bills implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping
 | 
			
		||||
            $model->contact_phone,
 | 
			
		||||
            $model->contact_address,
 | 
			
		||||
            $model->notes,
 | 
			
		||||
            $model->category_id,
 | 
			
		||||
            $model->footer,
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
@@ -63,6 +64,7 @@ class Bills implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping
 | 
			
		||||
            'amount',
 | 
			
		||||
            'currency_code',
 | 
			
		||||
            'currency_rate',
 | 
			
		||||
            'category_id',
 | 
			
		||||
            'contact_id',
 | 
			
		||||
            'contact_name',
 | 
			
		||||
            'contact_email',
 | 
			
		||||
@@ -70,7 +72,6 @@ class Bills implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping
 | 
			
		||||
            'contact_phone',
 | 
			
		||||
            'contact_address',
 | 
			
		||||
            'notes',
 | 
			
		||||
            'category_id',
 | 
			
		||||
            'footer',
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,6 @@ class Vendors implements FromCollection, ShouldAutoSize, WithHeadings, WithMappi
 | 
			
		||||
        return [
 | 
			
		||||
            $model->name,
 | 
			
		||||
            $model->email,
 | 
			
		||||
            $model->user_id,
 | 
			
		||||
            $model->tax_number,
 | 
			
		||||
            $model->phone,
 | 
			
		||||
            $model->address,
 | 
			
		||||
@@ -42,6 +41,7 @@ class Vendors implements FromCollection, ShouldAutoSize, WithHeadings, WithMappi
 | 
			
		||||
            $model->currency_code,
 | 
			
		||||
            $model->reference,
 | 
			
		||||
            $model->enabled,
 | 
			
		||||
            $model->user_id,
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -50,7 +50,6 @@ class Vendors implements FromCollection, ShouldAutoSize, WithHeadings, WithMappi
 | 
			
		||||
        return [
 | 
			
		||||
            'name',
 | 
			
		||||
            'email',
 | 
			
		||||
            'user_id',
 | 
			
		||||
            'tax_number',
 | 
			
		||||
            'phone',
 | 
			
		||||
            'address',
 | 
			
		||||
@@ -58,6 +57,7 @@ class Vendors implements FromCollection, ShouldAutoSize, WithHeadings, WithMappi
 | 
			
		||||
            'currency_code',
 | 
			
		||||
            'reference',
 | 
			
		||||
            'enabled',
 | 
			
		||||
            'user_id',
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -65,4 +65,4 @@ class Vendors implements FromCollection, ShouldAutoSize, WithHeadings, WithMappi
 | 
			
		||||
    {
 | 
			
		||||
        return 'vendors';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user