IO-745 Add ins co and class to ccc conversion.
This commit is contained in:
@@ -1,25 +1,26 @@
|
||||
import React, { useState } from "react";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import {
|
||||
Button,
|
||||
Form,
|
||||
InputNumber,
|
||||
notification,
|
||||
Popover,
|
||||
Radio,
|
||||
Form,
|
||||
InputNumber,
|
||||
Select,
|
||||
Space,
|
||||
} from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { INSERT_NEW_JOB } from "../../graphql/jobs.queries";
|
||||
import axios from "axios";
|
||||
import moment from "moment";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { INSERT_NEW_JOB } from "../../graphql/jobs.queries";
|
||||
import {
|
||||
selectBodyshop,
|
||||
selectCurrentUser,
|
||||
} from "../../redux/user/user.selectors";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import axios from "axios";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
@@ -49,8 +50,9 @@ export function ContractConvertToRo({
|
||||
moment(contract.start),
|
||||
"days"
|
||||
);
|
||||
const billingLines = [
|
||||
{
|
||||
const billingLines = [];
|
||||
if (contractLength > 0)
|
||||
billingLines.push({
|
||||
unq_seq: 1,
|
||||
line_no: 1,
|
||||
line_ref: 1,
|
||||
@@ -63,9 +65,7 @@ export function ContractConvertToRo({
|
||||
mod_lb_hrs: 0,
|
||||
db_ref: "io-ccdr",
|
||||
// mod_lbr_ty: "PAL",
|
||||
},
|
||||
];
|
||||
|
||||
});
|
||||
const mileageDiff =
|
||||
contract.kmend - contract.kmstart - contract.dailyfreekm * contractLength;
|
||||
if (mileageDiff > 0) {
|
||||
@@ -139,7 +139,8 @@ export function ContractConvertToRo({
|
||||
federal_tax_rate: bodyshop.bill_tax_rates.federal_tax_rate / 100,
|
||||
state_tax_rate: bodyshop.bill_tax_rates.state_tax_rate / 100,
|
||||
local_tax_rate: bodyshop.bill_tax_rates.local_tax_rate / 100,
|
||||
ins_co_nm: "CC",
|
||||
ins_co_nm: values.ins_co_nm,
|
||||
class: values.class,
|
||||
converted: true,
|
||||
clm_no: contract.job.clm_no ? `${contract.job.clm_no}-CC` : null,
|
||||
ownr_fn: contract.job.owner.ownr_fn,
|
||||
@@ -307,6 +308,42 @@ export function ContractConvertToRo({
|
||||
const popContent = (
|
||||
<div>
|
||||
<Form onFinish={handleFinish}>
|
||||
<Form.Item
|
||||
name={["ins_co_nm"]}
|
||||
label={t("jobs.fields.ins_co_nm")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select>
|
||||
{bodyshop.md_ins_cos.map((s) => (
|
||||
<Select.Option key={s.name} value={s.name}>
|
||||
{s.name}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={"class"}
|
||||
label={t("jobs.fields.class")}
|
||||
rules={[
|
||||
{
|
||||
required: bodyshop.enforce_class,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select>
|
||||
{bodyshop.md_classes.map((s) => (
|
||||
<Select.Option key={s} value={s}>
|
||||
{s}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("contracts.labels.convertform.applycleanupcharge")}
|
||||
rules={[
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Form, Input, InputNumber } from "antd";
|
||||
import { Form, Input, InputNumber, Space } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import ContractLicenseDecodeButton from "../contract-license-decode-button/contract-license-decode-button.component";
|
||||
@@ -102,15 +102,17 @@ export default function ContractFormComponent({
|
||||
</Form.Item>
|
||||
)}
|
||||
</LayoutFormRow>
|
||||
{selectedJobState && (
|
||||
<div>
|
||||
<ContractFormJobPrefill
|
||||
jobId={selectedJobState && selectedJobState[0]}
|
||||
form={form}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<ContractLicenseDecodeButton form={form} />
|
||||
<Space wrap>
|
||||
{selectedJobState && (
|
||||
<div>
|
||||
<ContractFormJobPrefill
|
||||
jobId={selectedJobState && selectedJobState[0]}
|
||||
form={form}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<ContractLicenseDecodeButton form={form} />
|
||||
</Space>
|
||||
<LayoutFormRow>
|
||||
<Form.Item
|
||||
label={t("contracts.fields.driver_dlnumber")}
|
||||
|
||||
@@ -20,8 +20,8 @@ import "./utils/CleanAxios";
|
||||
import "antd/dist/antd.less";
|
||||
require("dotenv").config();
|
||||
|
||||
Dinero.defaultCurrency = "CAD";
|
||||
Dinero.globalLocale = "en-CA";
|
||||
// Dinero.defaultCurrency = "CAD";
|
||||
// Dinero.globalLocale = "en-CA";
|
||||
Dinero.globalRoundingMode = "HALF_UP";
|
||||
|
||||
if (process.env.NODE_ENV !== "development") {
|
||||
|
||||
@@ -2,8 +2,8 @@ const Dinero = require("dinero.js");
|
||||
const queries = require("../graphql-client/queries");
|
||||
const GraphQLClient = require("graphql-request").GraphQLClient;
|
||||
|
||||
Dinero.defaultCurrency = "USD";
|
||||
Dinero.globalLocale = "en-CA";
|
||||
// Dinero.defaultCurrency = "USD";
|
||||
// Dinero.globalLocale = "en-CA";
|
||||
Dinero.globalRoundingMode = "HALF_UP";
|
||||
|
||||
exports.totalsSsu = async function (req, res) {
|
||||
@@ -336,6 +336,7 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
0) * 100
|
||||
)
|
||||
);
|
||||
console.log("A", additionalItemsTax.toJSON());
|
||||
} else {
|
||||
statePartsTax = statePartsTax.add(
|
||||
Dinero({ amount: Math.round((val.act_price || 0) * 100) })
|
||||
@@ -347,6 +348,7 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
0) * 100
|
||||
)
|
||||
);
|
||||
console.log("S", statePartsTax.toJSON());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user