--- resources/import.php.original 2018-11-06 10:32:57.081516878 -0500 +++ resources/import.php 2018-11-06 10:37:04.598727113 -0500 @@ -585,15 +585,15 @@ $resource->setIsbnOrIssn($isbnIssn_values); } array_push($resourceIDs, $resource->resourceID); + + $resourceAcquisition = new ResourceAcquisition(); + $resourceAcquisition->resourceID = $resource->resourceID; + $resourceAcquisition->subscriptionStartDate = date('Y-m-d'); + $resourceAcquisition->subscriptionEndDate = date('Y-m-d'); + $resourceAcquisition->save(); } $inserted++; - $resourceAcquisition = new ResourceAcquisition(); - $resourceAcquisition->resourceID = $resource->resourceID; - $resourceAcquisition->subscriptionStartDate = date('Y-m-d'); - $resourceAcquisition->subscriptionEndDate = date('Y-m-d'); - $resourceAcquisition->save(); - // Create an acquisition line if fund code and cost are defined if (!empty($fundCodeColumn)) { $fundCode = trim($data[$fundCodeColumn]); @@ -601,7 +601,7 @@ if (!empty($costColumn)) { $cost = trim($data[$costColumn]); } - if (isset($fundCode) && isset($cost)) { + if (isset($proceed) && isset($fundCode) && isset($cost)) { $resourcePayment = new ResourcePayment(); $resourcePayment->resourceAcquisitionID = $resourceAcquisition->resourceAcquisitionID; $resourcePayment->paymentAmount = cost_to_integer($cost);