3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-18 11:15:42 +00:00

Updated importers

This commit is contained in:
snipe
2026-08-05 11:49:31 +01:00
parent 29e01933d8
commit 4a2c4557d6
2 changed files with 8 additions and 8 deletions

View File

@ -87,9 +87,11 @@ class AssetImporter extends ItemImporter
// avoid the ItemImporter's shared 'notes' handling.
$this->setItemFromCsvIfPresent($row, 'name', 'item_name');
$this->setItemFromCsvIfPresent($row, 'notes', 'asset_notes');
// order_number is not on the Asset model any more — recorded as
// an Order + OrderItem via recordOrderForImportedRow() after
// the create-branch save below.
// Assets keep order_number on the parent column. AssetObserver's
// created hook writes the matching Order + OrderItem so we
// don't call recordOrderForImportedRow here (that would
// duplicate).
$this->setItemFromCsvIfPresent($row, 'order_number');
$this->setItemFromCsvIfPresent($row, 'purchase_cost');
$this->setItemFromCsvIfPresent($row, 'serial');
@ -325,7 +327,8 @@ class AssetImporter extends ItemImporter
$this->recordUpdated();
} else {
$this->recordCreated();
$this->recordOrderForImportedRow($asset, $row);
// AssetObserver::created already wrote the Order +
// OrderItem from the asset's own columns.
}
// If we have a target to checkout to, lets do so.

View File

@ -138,9 +138,7 @@ class LicenseImporter extends ItemImporter
$this->setItemFromCsvIfPresent($row, 'license_name');
$this->setItemFromCsvIfPresent($row, 'maintained');
$this->setItemFromCsvIfPresent($row, 'purchase_order');
// order_number is not on the License model any more — recorded
// as an Order + OrderItem via recordOrderForImportedRow() after
// the create-branch save below.
$this->setItemFromCsvIfPresent($row, 'order_number');
$this->setItemFromCsvIfPresent($row, 'reassignable');
$this->setItemFromCsvIfPresent($row, 'min_amt');
$this->setItemFromCsvIfPresent($row, 'seats');
@ -179,7 +177,6 @@ class LicenseImporter extends ItemImporter
$this->recordUpdated();
} else {
$this->recordCreated();
$this->recordOrderForImportedRow($license, $row);
}
// Lets try to checkout seats if the fields exist and we have seats.