diff --git a/app/Exports/Purchases/Sheets/BillItems.php b/app/Exports/Purchases/Sheets/BillItems.php index 425eb50d6..983e31450 100644 --- a/app/Exports/Purchases/Sheets/BillItems.php +++ b/app/Exports/Purchases/Sheets/BillItems.php @@ -22,6 +22,7 @@ class BillItems extends Export $model->bill_number = $document->document_number; $model->item_name = $model->item->name; + $model->item_description = $model->item->description; $model->item_type = $model->item->type; return parent::map($model); @@ -32,7 +33,7 @@ class BillItems extends Export return [ 'bill_number', 'item_name', - 'item_type', + 'item_description', 'quantity', 'price', 'total', diff --git a/app/Exports/Sales/Sheets/InvoiceItems.php b/app/Exports/Sales/Sheets/InvoiceItems.php index c2f399bce..e10b86623 100644 --- a/app/Exports/Sales/Sheets/InvoiceItems.php +++ b/app/Exports/Sales/Sheets/InvoiceItems.php @@ -22,6 +22,7 @@ class InvoiceItems extends Export $model->invoice_number = $document->document_number; $model->item_name = $model->item->name; + $model->item_description = $model->item->description; $model->item_type = $model->item->type; return parent::map($model); @@ -32,6 +33,7 @@ class InvoiceItems extends Export return [ 'invoice_number', 'item_name', + 'item_description', 'item_type', 'quantity', 'price', diff --git a/app/Imports/Purchases/Sheets/BillItems.php b/app/Imports/Purchases/Sheets/BillItems.php index ebf5ded9f..2ad3356b8 100644 --- a/app/Imports/Purchases/Sheets/BillItems.php +++ b/app/Imports/Purchases/Sheets/BillItems.php @@ -34,6 +34,8 @@ class BillItems extends Import $row['name'] = $row['item_name']; } + $row['description'] = !empty($row['item_description']) ? $row['item_description'] : ''; + $row['tax'] = (double) $row['tax']; $row['tax_id'] = 0; $row['type'] = Document::BILL_TYPE; diff --git a/app/Imports/Sales/Sheets/InvoiceItems.php b/app/Imports/Sales/Sheets/InvoiceItems.php index 10a9411ce..f6e5b94a2 100644 --- a/app/Imports/Sales/Sheets/InvoiceItems.php +++ b/app/Imports/Sales/Sheets/InvoiceItems.php @@ -28,12 +28,14 @@ class InvoiceItems extends Import $row['document_id'] = (int) Document::invoice()->number($row['invoice_number'])->pluck('id')->first(); - if (empty($row['item_id']) && !empty($row['item_name'])) { + if (empty($row['item_id']) && ! empty($row['item_name'])) { $row['item_id'] = $this->getItemIdFromName($row); $row['name'] = $row['item_name']; } + $row['description'] = !empty($row['item_description']) ? $row['item_description'] : ''; + $row['tax'] = (double) $row['tax']; $row['tax_id'] = 0; $row['type'] = Document::INVOICE_TYPE; diff --git a/app/Traits/Import.php b/app/Traits/Import.php index e6e818a39..7629eed8c 100644 --- a/app/Traits/Import.php +++ b/app/Traits/Import.php @@ -332,6 +332,7 @@ trait Import 'company_id' => company_id(), 'type' => $row['item_type'], 'name' => $row['item_name'], + 'description' => !empty($row['item_description']) ? $row['item_description'] : null, 'sale_price' => !empty($row['sale_price']) ? $row['sale_price'] : (!empty($row['price']) ? $row['price'] : 0), 'purchase_price' => !empty($row['purchase_price']) ? $row['purchase_price'] : (!empty($row['price']) ? $row['price'] : 0), 'enabled' => 1,