making serial number logic checked against for new imports

This commit is contained in:
akemidx 2023-06-14 15:32:47 -04:00
parent 0f76eda4af
commit efaed3d02c

View file

@ -31,7 +31,7 @@ class LicenseImporter extends ItemImporter
public function createLicenseIfNotExists(array $row) public function createLicenseIfNotExists(array $row)
{ {
$editingLicense = false; $editingLicense = false;
$license = License::where('name', $this->item['name']) $license = License::where('serial', $this->item['serial'])
->first(); ->first();
if ($license) { if ($license) {
if (! $this->updating) { if (! $this->updating) {
@ -57,6 +57,10 @@ class LicenseImporter extends ItemImporter
$this->item['maintained'] = $this->findCsvMatch($row, 'maintained'); $this->item['maintained'] = $this->findCsvMatch($row, 'maintained');
$this->item['purchase_order'] = $this->findCsvMatch($row, 'purchase_order'); $this->item['purchase_order'] = $this->findCsvMatch($row, 'purchase_order');
$this->item['reassignable'] = $this->findCsvMatch($row, 'reassignable'); $this->item['reassignable'] = $this->findCsvMatch($row, 'reassignable');
if($this->item['reassignable'] == "")
{
$this->item['reassignable'] = 1;
}
$this->item['seats'] = $this->findCsvMatch($row, 'seats'); $this->item['seats'] = $this->findCsvMatch($row, 'seats');
$this->item["termination_date"] = null; $this->item["termination_date"] = null;