From 949fe2a14a7899881d2a48dc06ebd3c3cb18413e Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 13 Jan 2022 15:10:27 -0600 Subject: [PATCH 1/2] Adds last_audit_date and next_audit_date in the asset importer --- app/Importer/AssetImporter.php | 8 ++++++++ app/Importer/ItemImporter.php | 11 +++++++++++ .../assets/js/components/importer/importer-file.vue | 2 ++ 3 files changed, 21 insertions(+) diff --git a/app/Importer/AssetImporter.php b/app/Importer/AssetImporter.php index 8e6781db7d..bb2d00c1bb 100644 --- a/app/Importer/AssetImporter.php +++ b/app/Importer/AssetImporter.php @@ -96,6 +96,14 @@ class AssetImporter extends ItemImporter $item['rtd_location_id'] = $this->item['location_id']; } + if (isset($this->item['last_audit_date'])) { + $item['last_audit_date'] = $this->item['last_audit_date']; + } + + if (isset($this->item['next_audit_date'])) { + $item['next_audit_date'] = $this->item['next_audit_date']; + } + if ($editingAsset) { $asset->update($item); } else { diff --git a/app/Importer/ItemImporter.php b/app/Importer/ItemImporter.php index 1584539ee2..5c9ef1ee49 100644 --- a/app/Importer/ItemImporter.php +++ b/app/Importer/ItemImporter.php @@ -76,6 +76,17 @@ class ItemImporter extends Importer if ($this->findCsvMatch($row, 'purchase_date') != '') { $this->item['purchase_date'] = date('Y-m-d 00:00:01', strtotime($this->findCsvMatch($row, 'purchase_date'))); } + + $this->item['last_audit_date'] = null; + if ($this->findCsvMatch($row, 'last_audit_date') != '') { + $this->item['last_audit_date'] = date('Y-m-d', strtotime($this->findCsvMatch($row, 'last_audit_date'))); + } + + $this->item['next_audit_date'] = null; + if ($this->findCsvMatch($row, 'next_audit_date') != '') { + $this->item['next_audit_date'] = date('Y-m-d', strtotime($this->findCsvMatch($row, 'next_audit_date'))); + } + $this->item['qty'] = $this->findCsvMatch($row, 'quantity'); $this->item['requestable'] = $this->findCsvMatch($row, 'requestable'); $this->item['user_id'] = $this->user_id; diff --git a/resources/assets/js/components/importer/importer-file.vue b/resources/assets/js/components/importer/importer-file.vue index f051cd9d68..64a90f2c92 100644 --- a/resources/assets/js/components/importer/importer-file.vue +++ b/resources/assets/js/components/importer/importer-file.vue @@ -154,6 +154,8 @@ {id: 'full_name', text: 'Full Name' }, {id: 'status', text: 'Status' }, {id: 'warranty_months', text: 'Warranty Months' }, + {id: 'last_audit_date', text: 'Last Audit Date' }, + {id: 'next_audit_date', text: 'Audit Date' }, ], consumables: [ {id: 'item_no', text: "Item Number"}, From 34819ec5cf6ad443a7e0e6f6e2cd810a4e7ff610 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Wed, 26 Jan 2022 23:00:52 -0600 Subject: [PATCH 2/2] Fixes the appearance of some error messages --- resources/views/depreciations/edit.blade.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/resources/views/depreciations/edit.blade.php b/resources/views/depreciations/edit.blade.php index b4a87e5065..54696a3acc 100755 --- a/resources/views/depreciations/edit.blade.php +++ b/resources/views/depreciations/edit.blade.php @@ -16,21 +16,11 @@ {{ trans('admin/depreciations/general.number_of_months') }}
- + {!! $errors->first('months', '') !!}
- -
- -
- -
- {!! $errors->first('depreciation_min', '') !!} -