import rules not applicable in map
This commit is contained in:
		@@ -11,7 +11,7 @@ class BillHistories extends Import
 | 
			
		||||
{
 | 
			
		||||
    public function model(array $row)
 | 
			
		||||
    {
 | 
			
		||||
        // @todo remove after 3.2 release
 | 
			
		||||
        // @todo remove after laravel-excel 3.2 release
 | 
			
		||||
        if ($row['bill_number'] == $this->empty_field) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
@@ -21,9 +21,13 @@ class BillHistories extends Import
 | 
			
		||||
 | 
			
		||||
    public function map($row): array
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->isEmpty($row, 'bill_number')) {
 | 
			
		||||
            return [];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $row = parent::map($row);
 | 
			
		||||
 | 
			
		||||
        $row['bill_id'] = Bill::number($row['bill_number'])->pluck('id')->first();
 | 
			
		||||
        $row['bill_id'] = (int) Bill::number($row['bill_number'])->pluck('id')->first();
 | 
			
		||||
 | 
			
		||||
        $row['notify'] = (int) $row['notify'];
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ class BillItemTaxes extends Import
 | 
			
		||||
{
 | 
			
		||||
    public function model(array $row)
 | 
			
		||||
    {
 | 
			
		||||
        // @todo remove after 3.2 release
 | 
			
		||||
        // @todo remove after laravel-excel 3.2 release
 | 
			
		||||
        if ($row['bill_number'] == $this->empty_field) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
@@ -23,9 +23,13 @@ class BillItemTaxes extends Import
 | 
			
		||||
 | 
			
		||||
    public function map($row): array
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->isEmpty($row, 'bill_number')) {
 | 
			
		||||
            return [];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $row = parent::map($row);
 | 
			
		||||
 | 
			
		||||
        $row['bill_id'] = Bill::number($row['bill_number'])->pluck('id')->first();
 | 
			
		||||
        $row['bill_id'] = (int) Bill::number($row['bill_number'])->pluck('id')->first();
 | 
			
		||||
 | 
			
		||||
        if (empty($row['invoice_item_id']) && !empty($row['item_name'])) {
 | 
			
		||||
            $item_id = Item::name($row['item_name'])->pluck('id')->first();
 | 
			
		||||
 
 | 
			
		||||
@@ -16,9 +16,13 @@ class BillItems extends Import
 | 
			
		||||
 | 
			
		||||
    public function map($row): array
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->isEmpty($row, 'bill_number')) {
 | 
			
		||||
            return [];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $row = parent::map($row);
 | 
			
		||||
 | 
			
		||||
        $row['bill_id'] = Bill::number($row['bill_number'])->pluck('id')->first();
 | 
			
		||||
        $row['bill_id'] = (int) Bill::number($row['bill_number'])->pluck('id')->first();
 | 
			
		||||
 | 
			
		||||
        if (empty($row['item_id']) && !empty($row['item_name'])) {
 | 
			
		||||
            $row['item_id'] = $this->getItemIdFromName($row);
 | 
			
		||||
 
 | 
			
		||||
@@ -16,9 +16,13 @@ class BillTotals extends Import
 | 
			
		||||
 | 
			
		||||
    public function map($row): array
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->isEmpty($row, 'bill_number')) {
 | 
			
		||||
            return [];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $row = parent::map($row);
 | 
			
		||||
 | 
			
		||||
        $row['bill_id'] = Bill::number($row['bill_number'])->pluck('id')->first();
 | 
			
		||||
        $row['bill_id'] = (int) Bill::number($row['bill_number'])->pluck('id')->first();
 | 
			
		||||
 | 
			
		||||
        return $row;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -15,6 +15,10 @@ class BillTransactions extends Import
 | 
			
		||||
 | 
			
		||||
    public function map($row): array
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->isEmpty($row, 'bill_number')) {
 | 
			
		||||
            return [];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $row = parent::map($row);
 | 
			
		||||
 | 
			
		||||
        $row['type'] = 'expense';
 | 
			
		||||
 
 | 
			
		||||
@@ -15,6 +15,10 @@ class Bills extends Import
 | 
			
		||||
 | 
			
		||||
    public function map($row): array
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->isEmpty($row, 'bill_number')) {
 | 
			
		||||
            return [];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $row = parent::map($row);
 | 
			
		||||
 | 
			
		||||
        $row['category_id'] = $this->getCategoryId($row, 'expense');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user