._.
This commit is contained in:
parent
1edb99991d
commit
709d72523d
@ -127,7 +127,7 @@ const DeliveryOrderDetails = () => {
|
||||
accessory_name:
|
||||
accessory.accessory_name +
|
||||
Math.round(
|
||||
(accessory.accessory_volume * accessory.count) / 100
|
||||
(accessory.accessory_volume / 100) * totalOrder.count_robots
|
||||
) +
|
||||
"шт.",
|
||||
};
|
||||
@ -139,7 +139,7 @@ const DeliveryOrderDetails = () => {
|
||||
accessory.accessory_name +
|
||||
": " +
|
||||
Math.round(
|
||||
(accessory.accessory_volume * accessory.count) / 100
|
||||
(accessory.accessory_volume / 100) * totalOrder.count_robots
|
||||
) +
|
||||
"шт.",
|
||||
...coords,
|
||||
@ -194,19 +194,19 @@ const DeliveryOrderDetails = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const calculateRecommendedDepartureTime = () => {
|
||||
if (!totalOrder || !orderDuration || !accessoryPeriod) return null;
|
||||
const calculateRecommendedDepartureTime = () => {
|
||||
if (!totalOrder || !orderDuration || !accessoryPeriod) return null;
|
||||
|
||||
const periodInMilliseconds = (accessoryPeriod + 1) * 24 * 60 * 60 * 1000;
|
||||
const orderDurationInMilliseconds = orderDuration * 60 * 1000;
|
||||
const deadlineDate = new Date(totalOrder.deadline);
|
||||
const periodInMilliseconds = (accessoryPeriod + 1) * 24 * 60 * 60 * 1000;
|
||||
const orderDurationInMilliseconds = orderDuration * 60 * 1000;
|
||||
const deadlineDate = new Date(totalOrder.deadline);
|
||||
|
||||
const recommendedDepartureTime = new Date(
|
||||
deadlineDate - periodInMilliseconds - orderDurationInMilliseconds
|
||||
);
|
||||
const recommendedDepartureTime = new Date(
|
||||
deadlineDate - periodInMilliseconds - orderDurationInMilliseconds
|
||||
);
|
||||
|
||||
return recommendedDepartureTime.toLocaleDateString("ru-RU");
|
||||
};
|
||||
return recommendedDepartureTime.toLocaleDateString("ru-RU");
|
||||
};
|
||||
|
||||
const handleBack = () => {
|
||||
navigate("/");
|
||||
@ -258,9 +258,7 @@ const DeliveryOrderDetails = () => {
|
||||
</>
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
{calculateRecommendedDepartureTime()}
|
||||
</td>
|
||||
<td>{calculateRecommendedDepartureTime()}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user