Account for fuel in the finance calculations #313

This commit is contained in:
Nabeel Shahzad
2019-07-23 08:41:20 -04:00
parent ee1c8ee3fa
commit 62a10224a0
31 changed files with 246 additions and 89 deletions

View File

@@ -44,6 +44,10 @@ class Database
{
$imported = [];
$yml = Yaml::parse($yml);
if (empty($yml)) {
return $imported;
}
foreach ($yml as $table => $rows) {
$imported[$table] = 0;
@@ -80,6 +84,10 @@ class Database
$row['password'] = bcrypt($row['password']);
}
if (empty($row)) {
return $row;
}
// if any time fields are == to "now", then insert the right time
foreach ($row as $column => $value) {
if (strtolower($value) === 'now') {
@@ -91,6 +99,7 @@ class Database
DB::table($table)->insert($row);
} catch (QueryException $e) {
Log::error($e);
dd($row);
throw $e;
}