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:
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
Reference in New Issue
Block a user