diff --git a/database/migrations/2025_03_15_160016_allow_unsigned_item_price.php b/database/migrations/2025_03_15_160016_allow_unsigned_item_price.php new file mode 100644 index 00000000..941b20a7 --- /dev/null +++ b/database/migrations/2025_03_15_160016_allow_unsigned_item_price.php @@ -0,0 +1,28 @@ +bigInteger('price')->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('invoice_items', function (Blueprint $table) { + $table->unsignedBigInteger('price')->change(); + }); + } +}; diff --git a/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue b/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue index 80d6dbf5..0b0dd4c1 100644 --- a/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue +++ b/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue @@ -254,22 +254,12 @@ const quantity = computed({ const price = computed({ get: () => { const price = props.itemData.price - - if (parseFloat(price) > 0) { - return price / 100 - } - - return price + return price / 100 }, set: (newValue) => { - if (parseFloat(newValue) > 0) { - let price = Math.round(newValue * 100) - - updateItemAttribute('price', price) - } else { - updateItemAttribute('price', newValue) - } + let price = Math.round(newValue * 100) + updateItemAttribute('price', price) setDiscount() }, })