Fixes purchase date if no purchase date given

This commit is contained in:
snipe 2016-06-10 05:00:49 -07:00
parent 7a9cfb1a8f
commit 6fa4d1252d

View file

@ -113,7 +113,12 @@ class ObjectImportCommand extends Command {
$item_status_name = $this->array_smart_fetch($row, "status"); $item_status_name = $this->array_smart_fetch($row, "status");
$item["item_name"] = $this->array_smart_fetch($row, "item name"); $item["item_name"] = $this->array_smart_fetch($row, "item name");
if ($this->array_smart_fetch($row, "purchase date")!='') {
$item["purchase_date"] = date("Y-m-d 00:00:01", strtotime($this->array_smart_fetch($row, "purchase date"))); $item["purchase_date"] = date("Y-m-d 00:00:01", strtotime($this->array_smart_fetch($row, "purchase date")));
} else {
$item["purchase_date"] = null;
}
$item["purchase_cost"] = $this->array_smart_fetch($row, "purchase cost"); $item["purchase_cost"] = $this->array_smart_fetch($row, "purchase cost");
$item["order_number"] = $this->array_smart_fetch($row, "order number"); $item["order_number"] = $this->array_smart_fetch($row, "order number");
$item["notes"] = $this->array_smart_fetch($row, "notes"); $item["notes"] = $this->array_smart_fetch($row, "notes");