Skip to content

Commit

Permalink
Fix for 0000-00-00 purchase date
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jul 28, 2015
1 parent 4014f5e commit f99cafc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/commands/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,19 @@ public function fire()

$asset = new Asset();
$asset->name = e($user_asset_name);
if ($user_asset_purchase_date!='') {
$asset->purchase_date = $user_asset_purchase_date;
} else {
$asset->purchase_date = 'null';
}
$asset->serial = e($user_asset_serial);
$asset->asset_tag = e($user_asset_tag);
$asset->model_id = $asset_model->id;
$asset->assigned_to = $user->id;
$asset->rtd_location_id = $location->id;
$asset->user_id = 1;
$asset->status_id = $status_id;
$asset->purchase_date = $user_asset_purchase_date;

$asset->notes = e($user_asset_notes);

if ($asset->save()) {
Expand Down

0 comments on commit f99cafc

Please sign in to comment.