refactor!: remove unused field
This commit is contained in:
parent
c5c26400f8
commit
ab91d0923f
3 changed files with 10 additions and 5 deletions
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `vatExcluded` on the `Quotation` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "Quotation" DROP COLUMN "vatExcluded";
|
||||
|
|
@ -1053,7 +1053,6 @@ model Quotation {
|
|||
totalPrice Float
|
||||
totalDiscount Float
|
||||
vat Float
|
||||
vatExcluded Float
|
||||
finalPrice Float
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
|
|
|
|||
|
|
@ -339,8 +339,8 @@ export class QuotationController extends Controller {
|
|||
const price = list.reduce(
|
||||
(a, c) => {
|
||||
const price = c.pricePerUnit * c.amount;
|
||||
const discount = price * c.discount;
|
||||
const vat = (price - discount) * c.vat;
|
||||
const discount = Math.round(price * c.discount * 100) / 100;
|
||||
const vat = Math.round((price - discount) * c.vat * 100) / 100;
|
||||
|
||||
a.totalPrice += price;
|
||||
a.totalDiscount += discount;
|
||||
|
|
@ -353,7 +353,6 @@ export class QuotationController extends Controller {
|
|||
totalPrice: 0,
|
||||
totalDiscount: 0,
|
||||
vat: 0,
|
||||
vatExcluded: 0,
|
||||
finalPrice: 0,
|
||||
},
|
||||
);
|
||||
|
|
@ -547,7 +546,6 @@ export class QuotationController extends Controller {
|
|||
totalPrice: 0,
|
||||
totalDiscount: 0,
|
||||
vat: 0,
|
||||
vatExcluded: 0,
|
||||
finalPrice: 0,
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue