From 128e63b48f3f853850c6162ae9ea47ba383aadc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20=C3=87ak=C4=B1rel?= Date: Thu, 28 Jan 2021 15:37:54 +0300 Subject: [PATCH] Fixed document_item_id required error when importing --- app/Imports/Purchases/Sheets/BillItemTaxes.php | 4 ++-- app/Imports/Sales/Sheets/InvoiceItemTaxes.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Imports/Purchases/Sheets/BillItemTaxes.php b/app/Imports/Purchases/Sheets/BillItemTaxes.php index ce40d346e..7f7ebb871 100644 --- a/app/Imports/Purchases/Sheets/BillItemTaxes.php +++ b/app/Imports/Purchases/Sheets/BillItemTaxes.php @@ -31,9 +31,9 @@ class BillItemTaxes extends Import $row['document_id'] = (int) Document::bill()->number($row['bill_number'])->pluck('id')->first(); - if (empty($row['bill_item_id']) && !empty($row['item_name'])) { + if (empty($row['document_item_id']) && !empty($row['item_name'])) { $item_id = Item::name($row['item_name'])->pluck('id')->first(); - $row['bill_item_id'] = DocumentItem::bill()->where('item_id', $item_id)->pluck('id')->first(); + $row['document_item_id'] = DocumentItem::bill()->where('item_id', $item_id)->pluck('id')->first(); } $row['tax_id'] = $this->getTaxId($row); diff --git a/app/Imports/Sales/Sheets/InvoiceItemTaxes.php b/app/Imports/Sales/Sheets/InvoiceItemTaxes.php index cb7ea7186..45dcfdbb8 100644 --- a/app/Imports/Sales/Sheets/InvoiceItemTaxes.php +++ b/app/Imports/Sales/Sheets/InvoiceItemTaxes.php @@ -31,9 +31,9 @@ class InvoiceItemTaxes extends Import $row['document_id'] = (int) Document::invoice()->number($row['invoice_number'])->pluck('id')->first(); - if (empty($row['invoice_item_id']) && !empty($row['item_name'])) { + if (empty($row['document_item_id']) && !empty($row['item_name'])) { $item_id = Item::name($row['item_name'])->pluck('id')->first(); - $row['invoice_item_id'] = DocumentItem::invoice()->where('item_id', $item_id)->pluck('id')->first(); + $row['document_item_id'] = DocumentItem::invoice()->where('item_id', $item_id)->pluck('id')->first(); } $row['tax_id'] = $this->getTaxId($row);