From 760a7a8002bc2b407c49fea5b2e35256bb5246b6 Mon Sep 17 00:00:00 2001 From: Chika Date: Thu, 9 Jun 2022 09:46:50 +0300 Subject: [PATCH] merge release/calc-92_elt-preliminary-kasko_vehicle-date --- .../Components/ELT/Kasko/lib/composeRequest.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client/Containers/Calculation/Components/ELT/Kasko/lib/composeRequest.ts b/src/client/Containers/Calculation/Components/ELT/Kasko/lib/composeRequest.ts index aeb39c3..3ab7b6f 100644 --- a/src/client/Containers/Calculation/Components/ELT/Kasko/lib/composeRequest.ts +++ b/src/client/Containers/Calculation/Components/ELT/Kasko/lib/composeRequest.ts @@ -64,6 +64,12 @@ export default function (this: ICalculationStore) { const isNew = !this.getValue('leaseObjectUsed'); const vehicleYear = this.getValue('leaseObjectYear'); + let vehicleDate; + if (this.getValue('leaseObjectUsed')) { + vehicleDate = new Date(`${vehicleYear}-01-01`); + } + let vehicleDateSpecified = getSpecified(vehicleDate); + const power = this.getValue('leaseObjectMotorPower'); const powerSpecified = getSpecified(power); @@ -226,6 +232,8 @@ export default function (this: ICalculationStore) { isNew, usageStart: currentDate, vehicleYear, + vehicleDate, + vehicleDateSpecified, modification: { power, powerSpecified,