diff --git a/appinfo/info.xml b/appinfo/info.xml index 5f014d1..fd4171b 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ Twigs Twigs - 0.1.1 + 0.1.2 agpl William Brawner Twigs diff --git a/lib/Controller/CategoryController.php b/lib/Controller/CategoryController.php index a223497..944056d 100644 --- a/lib/Controller/CategoryController.php +++ b/lib/Controller/CategoryController.php @@ -102,7 +102,7 @@ class CategoryController extends Controller $category->setName($name); $category->setDescription($description); $category->setAmount($amount); - $category->setExpense($expense); + $category->setExpense((int) $expense); $category->setBudgetId($budgetId); return new DataResponse($this->categoryMapper->insert($category)); } @@ -137,7 +137,7 @@ class CategoryController extends Controller $category->setAmount($amount); } if ($expense) { - $category->setExpense($expense); + $category->setExpense((int) $expense); } if ($budgetId) { try { diff --git a/lib/Controller/TransactionController.php b/lib/Controller/TransactionController.php index fd950ec..d79c91c 100644 --- a/lib/Controller/TransactionController.php +++ b/lib/Controller/TransactionController.php @@ -119,7 +119,7 @@ class TransactionController extends Controller $transaction->setName($name); $transaction->setDescription($description); $transaction->setAmount($amount); - $transaction->setExpense($expense); + $transaction->setExpense((int) $expense); $dateTime = DateTime::createFromFormat(self::DATE_FORMAT, $date); if (!$dateTime) { return new DataResponse(["message" => "Invalid date format: '$date'"], Http::STATUS_BAD_REQUEST); @@ -172,7 +172,7 @@ class TransactionController extends Controller $transaction->setName($name); $transaction->setDescription($description); $transaction->setAmount($amount); - $transaction->setExpense($expense); + $transaction->setExpense((int) $expense); $dateTime = DateTime::createFromFormat(self::DATE_FORMAT, $date); if (!$dateTime) { return new DataResponse([], Http::STATUS_BAD_REQUEST); @@ -251,7 +251,7 @@ class TransactionController extends Controller $endDateTime->setDate( $endDateTime->format('Y'), $endDateTime->format('m'), - $endDateTime->format('t'), + $endDateTime->format('t') ); $endDateTime->setTime(23, 59, 59, 999); } else { diff --git a/lib/Migration/Version000102Date20200324194700.php b/lib/Migration/Version000102Date20200324194700.php new file mode 100644 index 0000000..c1abbea --- /dev/null +++ b/lib/Migration/Version000102Date20200324194700.php @@ -0,0 +1,33 @@ +hasTable(CategoryMapper::TABLE_NAME)) { + $table = $schema->getTable(CategoryMapper::TABLE_NAME); + $table->changeColumn('description', [ + 'notnull' => false, + ]); + } + + return $schema; + } +}