Compare commits
1 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e8ea736c5 |
@@ -145,124 +145,168 @@ export function ShopInfoGeneral({ form, bodyshop }) {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("bodyshop.labels.accountingsetup")} id="accountingsetup">
|
<LayoutFormRow header={t("bodyshop.labels.accountingsetup")} id="accountingsetup">
|
||||||
{HasFeatureAccess({ featureName: "export", bodyshop }) && (
|
{[
|
||||||
<>
|
...(HasFeatureAccess({ featureName: "export", bodyshop })
|
||||||
<Form.Item label={t("bodyshop.labels.qbo")} valuePropName="checked" name={["accountingconfig", "qbo"]}>
|
? [
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
{InstanceRenderManager({
|
|
||||||
imex: (
|
|
||||||
<Form.Item shouldUpdate noStyle>
|
|
||||||
{() => (
|
|
||||||
<Form.Item
|
|
||||||
label={t("bodyshop.labels.qbo_usa")}
|
|
||||||
shouldUpdate
|
|
||||||
valuePropName="checked"
|
|
||||||
name={["accountingconfig", "qbo_usa"]}
|
|
||||||
>
|
|
||||||
<Switch disabled={!form.getFieldValue(["accountingconfig", "qbo"])} />
|
|
||||||
</Form.Item>
|
|
||||||
)}
|
|
||||||
</Form.Item>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
<Form.Item label={t("bodyshop.labels.qbo_departmentid")} name={["accountingconfig", "qbo_departmentid"]}>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("bodyshop.labels.accountingtiers")}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
name={["accountingconfig", "tiers"]}
|
|
||||||
>
|
|
||||||
<Radio.Group>
|
|
||||||
<Radio value={2}>2</Radio>
|
|
||||||
<Radio value={3}>3</Radio>
|
|
||||||
</Radio.Group>
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item shouldUpdate>
|
|
||||||
{() => {
|
|
||||||
return (
|
|
||||||
<Form.Item
|
|
||||||
label={t("bodyshop.labels.2tiersetup")}
|
|
||||||
shouldUpdate
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: form.getFieldValue(["accountingconfig", "tiers"]) === 2
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
name={["accountingconfig", "twotierpref"]}
|
|
||||||
>
|
|
||||||
<Radio.Group disabled={form.getFieldValue(["accountingconfig", "tiers"]) === 3}>
|
|
||||||
<Radio value="name">{t("bodyshop.labels.2tiername")}</Radio>
|
|
||||||
<Radio value="source">{t("bodyshop.labels.2tiersource")}</Radio>
|
|
||||||
</Radio.Group>
|
|
||||||
</Form.Item>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("bodyshop.labels.printlater")}
|
|
||||||
valuePropName="checked"
|
|
||||||
name={["accountingconfig", "printlater"]}
|
|
||||||
>
|
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("bodyshop.labels.emaillater")}
|
|
||||||
valuePropName="checked"
|
|
||||||
name={["accountingconfig", "emaillater"]}
|
|
||||||
>
|
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<Form.Item
|
|
||||||
label={t("bodyshop.fields.inhousevendorid")}
|
|
||||||
name={"inhousevendorid"}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("bodyshop.fields.default_adjustment_rate")}
|
|
||||||
name={"default_adjustment_rate"}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<InputNumber min={0} precision={2} />
|
|
||||||
</Form.Item>
|
|
||||||
{InstanceRenderManager({
|
|
||||||
imex: (
|
|
||||||
<Form.Item label={t("bodyshop.fields.federal_tax_id")} name="federal_tax_id">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
<Form.Item label={t("bodyshop.fields.state_tax_id")} name="state_tax_id">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
{HasFeatureAccess({ featureName: "bills", bodyshop }) && (
|
|
||||||
<>
|
|
||||||
{InstanceRenderManager({
|
|
||||||
imex: (
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("bodyshop.fields.invoice_federal_tax_rate")}
|
key="qbo"
|
||||||
name={["bill_tax_rates", "federal_tax_rate"]}
|
label={t("bodyshop.labels.qbo")}
|
||||||
|
valuePropName="checked"
|
||||||
|
name={["accountingconfig", "qbo"]}
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>,
|
||||||
|
InstanceRenderManager({
|
||||||
|
imex: (
|
||||||
|
<Form.Item key="qbo_usa_wrapper" shouldUpdate noStyle>
|
||||||
|
{() => (
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.labels.qbo_usa")}
|
||||||
|
shouldUpdate
|
||||||
|
valuePropName="checked"
|
||||||
|
name={["accountingconfig", "qbo_usa"]}
|
||||||
|
>
|
||||||
|
<Switch disabled={!form.getFieldValue(["accountingconfig", "qbo"])} />
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
<Form.Item
|
||||||
|
key="qbo_departmentid"
|
||||||
|
label={t("bodyshop.labels.qbo_departmentid")}
|
||||||
|
name={["accountingconfig", "qbo_departmentid"]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="accountingtiers"
|
||||||
|
label={t("bodyshop.labels.accountingtiers")}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
name={["accountingconfig", "tiers"]}
|
||||||
|
>
|
||||||
|
<Radio.Group>
|
||||||
|
<Radio value={2}>2</Radio>
|
||||||
|
<Radio value={3}>3</Radio>
|
||||||
|
</Radio.Group>
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item key="twotierpref_wrapper" shouldUpdate>
|
||||||
|
{() => {
|
||||||
|
return (
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.labels.2tiersetup")}
|
||||||
|
shouldUpdate
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: form.getFieldValue(["accountingconfig", "tiers"]) === 2
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
name={["accountingconfig", "twotierpref"]}
|
||||||
|
>
|
||||||
|
<Radio.Group disabled={form.getFieldValue(["accountingconfig", "tiers"]) === 3}>
|
||||||
|
<Radio value="name">{t("bodyshop.labels.2tiername")}</Radio>
|
||||||
|
<Radio value="source">{t("bodyshop.labels.2tiersource")}</Radio>
|
||||||
|
</Radio.Group>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="printlater"
|
||||||
|
label={t("bodyshop.labels.printlater")}
|
||||||
|
valuePropName="checked"
|
||||||
|
name={["accountingconfig", "printlater"]}
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="emaillater"
|
||||||
|
label={t("bodyshop.labels.emaillater")}
|
||||||
|
valuePropName="checked"
|
||||||
|
name={["accountingconfig", "emaillater"]}
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
]
|
||||||
|
: []),
|
||||||
|
<Form.Item
|
||||||
|
key="inhousevendorid"
|
||||||
|
label={t("bodyshop.fields.inhousevendorid")}
|
||||||
|
name={"inhousevendorid"}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="default_adjustment_rate"
|
||||||
|
label={t("bodyshop.fields.default_adjustment_rate")}
|
||||||
|
name={"default_adjustment_rate"}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<InputNumber min={0} precision={2} />
|
||||||
|
</Form.Item>,
|
||||||
|
InstanceRenderManager({
|
||||||
|
imex: (
|
||||||
|
<Form.Item key="federal_tax_id" label={t("bodyshop.fields.federal_tax_id")} name="federal_tax_id">
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
<Form.Item key="state_tax_id" label={t("bodyshop.fields.state_tax_id")} name="state_tax_id">
|
||||||
|
<Input />
|
||||||
|
</Form.Item>,
|
||||||
|
...(HasFeatureAccess({ featureName: "bills", bodyshop })
|
||||||
|
? [
|
||||||
|
InstanceRenderManager({
|
||||||
|
imex: (
|
||||||
|
<Form.Item
|
||||||
|
key="invoice_federal_tax_rate"
|
||||||
|
label={t("bodyshop.fields.invoice_federal_tax_rate")}
|
||||||
|
name={["bill_tax_rates", "federal_tax_rate"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<InputNumber />
|
||||||
|
</Form.Item>
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
<Form.Item
|
||||||
|
key="invoice_state_tax_rate"
|
||||||
|
label={t("bodyshop.fields.invoice_state_tax_rate")}
|
||||||
|
name={["bill_tax_rates", "state_tax_rate"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<InputNumber />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="invoice_local_tax_rate"
|
||||||
|
label={t("bodyshop.fields.invoice_local_tax_rate")}
|
||||||
|
name={["bill_tax_rates", "local_tax_rate"]}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: true
|
required: true
|
||||||
@@ -272,117 +316,118 @@ export function ShopInfoGeneral({ form, bodyshop }) {
|
|||||||
>
|
>
|
||||||
<InputNumber />
|
<InputNumber />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)
|
]
|
||||||
})}
|
: []),
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("bodyshop.fields.invoice_state_tax_rate")}
|
key="md_payment_types"
|
||||||
name={["bill_tax_rates", "state_tax_rate"]}
|
name={["md_payment_types"]}
|
||||||
rules={[
|
label={t("bodyshop.fields.md_payment_types")}
|
||||||
{
|
rules={[
|
||||||
required: true
|
{
|
||||||
//message: t("general.validation.required"),
|
required: true,
|
||||||
}
|
//message: t("general.validation.required"),
|
||||||
]}
|
type: "array"
|
||||||
>
|
}
|
||||||
<InputNumber />
|
]}
|
||||||
</Form.Item>
|
>
|
||||||
<Form.Item
|
<Select mode="tags" />
|
||||||
label={t("bodyshop.fields.invoice_local_tax_rate")}
|
</Form.Item>,
|
||||||
name={["bill_tax_rates", "local_tax_rate"]}
|
<Form.Item
|
||||||
rules={[
|
key="md_categories"
|
||||||
{
|
name={["md_categories"]}
|
||||||
required: true
|
label={t("bodyshop.fields.md_categories")}
|
||||||
//message: t("general.validation.required"),
|
rules={[
|
||||||
}
|
{
|
||||||
]}
|
//message: t("general.validation.required"),
|
||||||
>
|
type: "array"
|
||||||
<InputNumber />
|
}
|
||||||
</Form.Item>
|
]}
|
||||||
</>
|
>
|
||||||
)}
|
<Select mode="tags" />
|
||||||
<Form.Item
|
</Form.Item>,
|
||||||
name={["md_payment_types"]}
|
...(HasFeatureAccess({ featureName: "export", bodyshop })
|
||||||
label={t("bodyshop.fields.md_payment_types")}
|
? [
|
||||||
rules={[
|
<Form.Item
|
||||||
{
|
key="ReceivableCustomField1"
|
||||||
required: true,
|
name={["accountingconfig", "ReceivableCustomField1"]}
|
||||||
//message: t("general.validation.required"),
|
label={t("bodyshop.fields.ReceivableCustomField", { number: 1 })}
|
||||||
type: "array"
|
>
|
||||||
}
|
{ReceivableCustomFieldSelect}
|
||||||
]}
|
</Form.Item>,
|
||||||
>
|
<Form.Item
|
||||||
<Select mode="tags" />
|
key="ReceivableCustomField2"
|
||||||
</Form.Item>
|
name={["accountingconfig", "ReceivableCustomField2"]}
|
||||||
<Form.Item
|
label={t("bodyshop.fields.ReceivableCustomField", { number: 2 })}
|
||||||
name={["md_categories"]}
|
>
|
||||||
label={t("bodyshop.fields.md_categories")}
|
{ReceivableCustomFieldSelect}
|
||||||
rules={[
|
</Form.Item>,
|
||||||
{
|
<Form.Item
|
||||||
//message: t("general.validation.required"),
|
key="ReceivableCustomField3"
|
||||||
type: "array"
|
name={["accountingconfig", "ReceivableCustomField3"]}
|
||||||
}
|
label={t("bodyshop.fields.ReceivableCustomField", { number: 3 })}
|
||||||
]}
|
>
|
||||||
>
|
{ReceivableCustomFieldSelect}
|
||||||
<Select mode="tags" />
|
</Form.Item>,
|
||||||
</Form.Item>
|
<Form.Item
|
||||||
{HasFeatureAccess({ featureName: "export", bodyshop }) && (
|
key="md_classes"
|
||||||
<>
|
name={["md_classes"]}
|
||||||
<Form.Item
|
label={t("bodyshop.fields.md_classes")}
|
||||||
name={["accountingconfig", "ReceivableCustomField1"]}
|
rules={[
|
||||||
label={t("bodyshop.fields.ReceivableCustomField", { number: 1 })}
|
({ getFieldValue }) => {
|
||||||
>
|
return {
|
||||||
{ReceivableCustomFieldSelect}
|
required: getFieldValue("enforce_class"),
|
||||||
</Form.Item>
|
//message: t("general.validation.required"),
|
||||||
<Form.Item
|
type: "array"
|
||||||
name={["accountingconfig", "ReceivableCustomField2"]}
|
};
|
||||||
label={t("bodyshop.fields.ReceivableCustomField", { number: 2 })}
|
}
|
||||||
>
|
]}
|
||||||
{ReceivableCustomFieldSelect}
|
>
|
||||||
</Form.Item>
|
<Select mode="tags" />
|
||||||
<Form.Item
|
</Form.Item>,
|
||||||
name={["accountingconfig", "ReceivableCustomField3"]}
|
<Form.Item
|
||||||
label={t("bodyshop.fields.ReceivableCustomField", { number: 3 })}
|
key="enforce_class"
|
||||||
>
|
name={["enforce_class"]}
|
||||||
{ReceivableCustomFieldSelect}
|
label={t("bodyshop.fields.enforce_class")}
|
||||||
</Form.Item>
|
valuePropName="checked"
|
||||||
<Form.Item
|
>
|
||||||
name={["md_classes"]}
|
<Switch />
|
||||||
label={t("bodyshop.fields.md_classes")}
|
</Form.Item>,
|
||||||
rules={[
|
...(ClosingPeriod.treatment === "on"
|
||||||
({ getFieldValue }) => {
|
? [
|
||||||
return {
|
<Form.Item
|
||||||
required: getFieldValue("enforce_class"),
|
key="ClosingPeriod"
|
||||||
//message: t("general.validation.required"),
|
name={["accountingconfig", "ClosingPeriod"]}
|
||||||
type: "array"
|
label={t("bodyshop.fields.closingperiod")} //{t("reportcenter.labels.dates")}
|
||||||
};
|
>
|
||||||
}
|
<DatePicker.RangePicker format="MM/DD/YYYY" presets={DatePickerRanges} />
|
||||||
]}
|
</Form.Item>
|
||||||
>
|
]
|
||||||
<Select mode="tags" />
|
: []),
|
||||||
</Form.Item>
|
...(ADPPayroll.treatment === "on"
|
||||||
<Form.Item name={["enforce_class"]} label={t("bodyshop.fields.enforce_class")} valuePropName="checked">
|
? [
|
||||||
<Switch />
|
<Form.Item
|
||||||
</Form.Item>
|
key="companyCode"
|
||||||
{ClosingPeriod.treatment === "on" && (
|
name={["accountingconfig", "companyCode"]}
|
||||||
<Form.Item
|
label={t("bodyshop.fields.companycode")}
|
||||||
name={["accountingconfig", "ClosingPeriod"]}
|
>
|
||||||
label={t("bodyshop.fields.closingperiod")} //{t("reportcenter.labels.dates")}
|
<Input />
|
||||||
>
|
</Form.Item>
|
||||||
<DatePicker.RangePicker format="MM/DD/YYYY" presets={DatePickerRanges} />
|
]
|
||||||
</Form.Item>
|
: []),
|
||||||
)}
|
...(ADPPayroll.treatment === "on"
|
||||||
{ADPPayroll.treatment === "on" && (
|
? [
|
||||||
<Form.Item name={["accountingconfig", "companyCode"]} label={t("bodyshop.fields.companycode")}>
|
<Form.Item
|
||||||
<Input />
|
key="batchID"
|
||||||
</Form.Item>
|
name={["accountingconfig", "batchID"]}
|
||||||
)}
|
label={t("bodyshop.fields.batchid")}
|
||||||
{ADPPayroll.treatment === "on" && (
|
>
|
||||||
<Form.Item name={["accountingconfig", "batchID"]} label={t("bodyshop.fields.batchid")}>
|
<Input />
|
||||||
<Input />
|
</Form.Item>
|
||||||
</Form.Item>
|
]
|
||||||
)}
|
: [])
|
||||||
</>
|
]
|
||||||
)}
|
: [])
|
||||||
|
]}
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<FeatureWrapper featureName="scoreboard" noauth={() => null}>
|
<FeatureWrapper featureName="scoreboard" noauth={() => null}>
|
||||||
<LayoutFormRow header={t("bodyshop.labels.scoreboardsetup")} id="scoreboardsetup">
|
<LayoutFormRow header={t("bodyshop.labels.scoreboardsetup")} id="scoreboardsetup">
|
||||||
@@ -446,211 +491,255 @@ export function ShopInfoGeneral({ form, bodyshop }) {
|
|||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
</FeatureWrapper>
|
</FeatureWrapper>
|
||||||
<LayoutFormRow header={t("bodyshop.labels.systemsettings")} id="systemsettings">
|
<LayoutFormRow header={t("bodyshop.labels.systemsettings")} id="systemsettings">
|
||||||
<Form.Item
|
{[
|
||||||
name={["md_referral_sources"]}
|
<Form.Item
|
||||||
label={t("bodyshop.fields.md_referral_sources")}
|
key="md_referral_sources"
|
||||||
rules={[
|
name={["md_referral_sources"]}
|
||||||
{
|
label={t("bodyshop.fields.md_referral_sources")}
|
||||||
required: true,
|
rules={[
|
||||||
//message: t("general.validation.required"),
|
{
|
||||||
type: "array"
|
required: true,
|
||||||
}
|
//message: t("general.validation.required"),
|
||||||
]}
|
type: "array"
|
||||||
>
|
|
||||||
<Select mode="tags" />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item name={["enforce_referral"]} label={t("bodyshop.fields.enforce_referral")} valuePropName="checked">
|
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
name={["enforce_conversion_csr"]}
|
|
||||||
label={t("bodyshop.fields.enforce_conversion_csr")}
|
|
||||||
valuePropName="checked"
|
|
||||||
>
|
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
name={["enforce_conversion_category"]}
|
|
||||||
label={t("bodyshop.fields.enforce_conversion_category")}
|
|
||||||
valuePropName="checked"
|
|
||||||
>
|
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
name={["target_touchtime"]}
|
|
||||||
label={t("bodyshop.fields.target_touchtime")}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true
|
|
||||||
//message: t("general.validation.required"),
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<InputNumber min={0.1} precision={1} />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label={t("bodyshop.fields.use_fippa")} name={["use_fippa"]} valuePropName="checked">
|
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("bodyshop.fields.md_hour_split.prep")}
|
|
||||||
name={["md_hour_split", "prep"]}
|
|
||||||
dependencies={[["md_hour_split", "paint"]]}
|
|
||||||
rules={[
|
|
||||||
({ getFieldValue }) => ({
|
|
||||||
validator(rule, value) {
|
|
||||||
if (!value && !getFieldValue(["md_hour_split", "paint"])) {
|
|
||||||
return Promise.resolve();
|
|
||||||
}
|
|
||||||
if (value + getFieldValue(["md_hour_split", "paint"]) === 1) {
|
|
||||||
return Promise.resolve();
|
|
||||||
}
|
|
||||||
return Promise.reject(t("bodyshop.validation.larsplit"));
|
|
||||||
}
|
}
|
||||||
})
|
]}
|
||||||
]}
|
>
|
||||||
>
|
<Select mode="tags" />
|
||||||
<InputNumber min={0} max={1} precision={2} />
|
</Form.Item>,
|
||||||
</Form.Item>
|
<Form.Item
|
||||||
<Form.Item
|
key="enforce_referral"
|
||||||
label={t("bodyshop.fields.md_hour_split.paint")}
|
name={["enforce_referral"]}
|
||||||
name={["md_hour_split", "paint"]}
|
label={t("bodyshop.fields.enforce_referral")}
|
||||||
dependencies={[["md_hour_split", "prep"]]}
|
valuePropName="checked"
|
||||||
rules={[
|
>
|
||||||
({ getFieldValue }) => ({
|
<Switch />
|
||||||
validator(rule, value) {
|
</Form.Item>,
|
||||||
if (!value && !getFieldValue(["md_hour_split", "paint"])) {
|
<Form.Item
|
||||||
return Promise.resolve();
|
key="enforce_conversion_csr"
|
||||||
}
|
name={["enforce_conversion_csr"]}
|
||||||
if (value + getFieldValue(["md_hour_split", "prep"]) === 1) {
|
label={t("bodyshop.fields.enforce_conversion_csr")}
|
||||||
return Promise.resolve();
|
valuePropName="checked"
|
||||||
}
|
>
|
||||||
return Promise.reject(t("bodyshop.validation.larsplit"));
|
<Switch />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="enforce_conversion_category"
|
||||||
|
name={["enforce_conversion_category"]}
|
||||||
|
label={t("bodyshop.fields.enforce_conversion_category")}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="target_touchtime"
|
||||||
|
name={["target_touchtime"]}
|
||||||
|
label={t("bodyshop.fields.target_touchtime")}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
//message: t("general.validation.required"),
|
||||||
}
|
}
|
||||||
})
|
]}
|
||||||
]}
|
>
|
||||||
>
|
<InputNumber min={0.1} precision={1} />
|
||||||
<InputNumber min={0} max={1} precision={2} />
|
</Form.Item>,
|
||||||
</Form.Item>
|
<Form.Item key="use_fippa" label={t("bodyshop.fields.use_fippa")} name={["use_fippa"]} valuePropName="checked">
|
||||||
<Form.Item label={t("bodyshop.fields.jc_hourly_rates.mapa")} name={["jc_hourly_rates", "mapa"]}>
|
<Switch />
|
||||||
<CurrencyInput />
|
</Form.Item>,
|
||||||
</Form.Item>
|
<Form.Item
|
||||||
<Form.Item label={t("bodyshop.fields.jc_hourly_rates.mash")} name={["jc_hourly_rates", "mash"]}>
|
key="md_hour_split_prep"
|
||||||
<CurrencyInput />
|
label={t("bodyshop.fields.md_hour_split.prep")}
|
||||||
</Form.Item>
|
name={["md_hour_split", "prep"]}
|
||||||
<Form.Item
|
dependencies={[["md_hour_split", "paint"]]}
|
||||||
name={["use_paint_scale_data"]}
|
rules={[
|
||||||
label={t("bodyshop.fields.use_paint_scale_data")}
|
({ getFieldValue }) => ({
|
||||||
valuePropName="checked"
|
validator(rule, value) {
|
||||||
>
|
if (!value && !getFieldValue(["md_hour_split", "paint"])) {
|
||||||
<Switch />
|
return Promise.resolve();
|
||||||
</Form.Item>
|
}
|
||||||
<Form.Item
|
if (value + getFieldValue(["md_hour_split", "paint"]) === 1) {
|
||||||
name={["attach_pdf_to_email"]}
|
return Promise.resolve();
|
||||||
label={t("bodyshop.fields.attach_pdf_to_email")}
|
}
|
||||||
valuePropName="checked"
|
return Promise.reject(t("bodyshop.validation.larsplit"));
|
||||||
>
|
}
|
||||||
<Switch />
|
})
|
||||||
</Form.Item>
|
]}
|
||||||
<Form.Item
|
>
|
||||||
name={["md_from_emails"]}
|
<InputNumber min={0} max={1} precision={2} />
|
||||||
label={t("bodyshop.fields.md_from_emails")}
|
</Form.Item>,
|
||||||
// rules={[
|
<Form.Item
|
||||||
// {
|
key="md_hour_split_paint"
|
||||||
// //message: t("general.validation.required"),
|
label={t("bodyshop.fields.md_hour_split.paint")}
|
||||||
// type: "array",
|
name={["md_hour_split", "paint"]}
|
||||||
// },
|
dependencies={[["md_hour_split", "prep"]]}
|
||||||
// ]}
|
rules={[
|
||||||
>
|
({ getFieldValue }) => ({
|
||||||
<Select mode="tags" />
|
validator(rule, value) {
|
||||||
</Form.Item>
|
if (!value && !getFieldValue(["md_hour_split", "paint"])) {
|
||||||
<Form.Item
|
return Promise.resolve();
|
||||||
name={["md_email_cc", "parts_order"]}
|
}
|
||||||
label={t("bodyshop.fields.md_email_cc", { template: "parts_orders" })}
|
if (value + getFieldValue(["md_hour_split", "prep"]) === 1) {
|
||||||
rules={[
|
return Promise.resolve();
|
||||||
{
|
}
|
||||||
//message: t("general.validation.required"),
|
return Promise.reject(t("bodyshop.validation.larsplit"));
|
||||||
type: "array"
|
}
|
||||||
}
|
})
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Select mode="tags" />
|
<InputNumber min={0} max={1} precision={2} />
|
||||||
</Form.Item>
|
</Form.Item>,
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={["md_email_cc", "parts_return_slip"]}
|
key="jc_hourly_rates_mapa"
|
||||||
label={t("bodyshop.fields.md_email_cc", { template: "parts_returns" })}
|
label={t("bodyshop.fields.jc_hourly_rates.mapa")}
|
||||||
rules={[
|
name={["jc_hourly_rates", "mapa"]}
|
||||||
{
|
>
|
||||||
//message: t("general.validation.required"),
|
<CurrencyInput />
|
||||||
type: "array"
|
</Form.Item>,
|
||||||
}
|
<Form.Item
|
||||||
]}
|
key="jc_hourly_rates_mash"
|
||||||
>
|
label={t("bodyshop.fields.jc_hourly_rates.mash")}
|
||||||
<Select mode="tags" />
|
name={["jc_hourly_rates", "mash"]}
|
||||||
</Form.Item>
|
>
|
||||||
|
<CurrencyInput />
|
||||||
{HasFeatureAccess({ featureName: "timetickets", bodyshop }) && (
|
</Form.Item>,
|
||||||
<>
|
<Form.Item
|
||||||
<Form.Item
|
key="use_paint_scale_data"
|
||||||
name={["tt_allow_post_to_invoiced"]}
|
name={["use_paint_scale_data"]}
|
||||||
label={t("bodyshop.fields.tt_allow_post_to_invoiced")}
|
label={t("bodyshop.fields.use_paint_scale_data")}
|
||||||
valuePropName="checked"
|
valuePropName="checked"
|
||||||
>
|
>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>,
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={["tt_enforce_hours_for_tech_console"]}
|
key="attach_pdf_to_email"
|
||||||
label={t("bodyshop.fields.tt_enforce_hours_for_tech_console")}
|
name={["attach_pdf_to_email"]}
|
||||||
valuePropName="checked"
|
label={t("bodyshop.fields.attach_pdf_to_email")}
|
||||||
>
|
valuePropName="checked"
|
||||||
<Switch />
|
>
|
||||||
</Form.Item>
|
<Switch />
|
||||||
<Form.Item
|
</Form.Item>,
|
||||||
name={["bill_allow_post_to_closed"]}
|
<Form.Item
|
||||||
label={t("bodyshop.fields.bill_allow_post_to_closed")}
|
key="md_from_emails"
|
||||||
valuePropName="checked"
|
name={["md_from_emails"]}
|
||||||
>
|
label={t("bodyshop.fields.md_from_emails")}
|
||||||
<Switch />
|
// rules={[
|
||||||
</Form.Item>
|
// {
|
||||||
</>
|
// //message: t("general.validation.required"),
|
||||||
)}
|
// type: "array",
|
||||||
<Form.Item
|
// },
|
||||||
name={["md_ded_notes"]}
|
// ]}
|
||||||
label={t("bodyshop.fields.md_ded_notes")}
|
>
|
||||||
rules={[
|
<Select mode="tags" />
|
||||||
{
|
</Form.Item>,
|
||||||
//message: t("general.validation.required"),
|
<Form.Item
|
||||||
type: "array"
|
key="md_email_cc_parts_order"
|
||||||
}
|
name={["md_email_cc", "parts_order"]}
|
||||||
]}
|
label={t("bodyshop.fields.md_email_cc", { template: "parts_orders" })}
|
||||||
>
|
rules={[
|
||||||
<Select mode="tags" />
|
{
|
||||||
</Form.Item>
|
//message: t("general.validation.required"),
|
||||||
<Form.Item
|
type: "array"
|
||||||
label={t("bodyshop.fields.md_functionality_toggles.parts_queue_toggle")}
|
}
|
||||||
name={["md_functionality_toggles", "parts_queue_toggle"]}
|
]}
|
||||||
valuePropName="checked"
|
>
|
||||||
>
|
<Select mode="tags" />
|
||||||
<Switch />
|
</Form.Item>,
|
||||||
</Form.Item>
|
<Form.Item
|
||||||
<Form.Item name={["last_name_first"]} label={t("bodyshop.fields.last_name_first")} valuePropName="checked">
|
key="md_email_cc_parts_return_slip"
|
||||||
<Switch />
|
name={["md_email_cc", "parts_return_slip"]}
|
||||||
</Form.Item>
|
label={t("bodyshop.fields.md_email_cc", { template: "parts_returns" })}
|
||||||
<Form.Item
|
rules={[
|
||||||
name={["uselocalmediaserver"]}
|
{
|
||||||
label={t("bodyshop.fields.uselocalmediaserver")}
|
//message: t("general.validation.required"),
|
||||||
valuePropName="checked"
|
type: "array"
|
||||||
>
|
}
|
||||||
<Switch />
|
]}
|
||||||
</Form.Item>
|
>
|
||||||
<Form.Item name={["localmediaserverhttp"]} label={t("bodyshop.fields.localmediaserverhttp")}>
|
<Select mode="tags" />
|
||||||
<Input />
|
</Form.Item>,
|
||||||
</Form.Item>
|
...(HasFeatureAccess({ featureName: "timetickets", bodyshop })
|
||||||
<Form.Item name={["localmediaservernetwork"]} label={t("bodyshop.fields.localmediaservernetwork")}>
|
? [
|
||||||
<Input />
|
<Form.Item
|
||||||
</Form.Item>
|
key="tt_allow_post_to_invoiced"
|
||||||
<Form.Item name={["localmediatoken"]} label={t("bodyshop.fields.localmediatoken")}>
|
name={["tt_allow_post_to_invoiced"]}
|
||||||
<Input />
|
label={t("bodyshop.fields.tt_allow_post_to_invoiced")}
|
||||||
</Form.Item>
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="tt_enforce_hours_for_tech_console"
|
||||||
|
name={["tt_enforce_hours_for_tech_console"]}
|
||||||
|
label={t("bodyshop.fields.tt_enforce_hours_for_tech_console")}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="bill_allow_post_to_closed"
|
||||||
|
name={["bill_allow_post_to_closed"]}
|
||||||
|
label={t("bodyshop.fields.bill_allow_post_to_closed")}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
]
|
||||||
|
: []),
|
||||||
|
<Form.Item
|
||||||
|
key="md_ded_notes"
|
||||||
|
name={["md_ded_notes"]}
|
||||||
|
label={t("bodyshop.fields.md_ded_notes")}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
type: "array"
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Select mode="tags" />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="parts_queue_toggle"
|
||||||
|
label={t("bodyshop.fields.md_functionality_toggles.parts_queue_toggle")}
|
||||||
|
name={["md_functionality_toggles", "parts_queue_toggle"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="last_name_first"
|
||||||
|
name={["last_name_first"]}
|
||||||
|
label={t("bodyshop.fields.last_name_first")}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="uselocalmediaserver"
|
||||||
|
name={["uselocalmediaserver"]}
|
||||||
|
label={t("bodyshop.fields.uselocalmediaserver")}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="localmediaserverhttp"
|
||||||
|
name={["localmediaserverhttp"]}
|
||||||
|
label={t("bodyshop.fields.localmediaserverhttp")}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item
|
||||||
|
key="localmediaservernetwork"
|
||||||
|
name={["localmediaservernetwork"]}
|
||||||
|
label={t("bodyshop.fields.localmediaservernetwork")}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>,
|
||||||
|
<Form.Item key="localmediatoken" name={["localmediatoken"]} label={t("bodyshop.fields.localmediatoken")}>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
]}
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("bodyshop.labels.shop_enabled_features")} id="sharing">
|
<LayoutFormRow header={t("bodyshop.labels.shop_enabled_features")} id="sharing">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const queries = require("../../graphql-client/queries");
|
|||||||
const { refresh: refreshOauthToken, setNewRefreshToken } = require("./qbo-callback");
|
const { refresh: refreshOauthToken, setNewRefreshToken } = require("./qbo-callback");
|
||||||
const OAuthClient = require("intuit-oauth");
|
const OAuthClient = require("intuit-oauth");
|
||||||
const moment = require("moment-timezone");
|
const moment = require("moment-timezone");
|
||||||
|
const GraphQLClient = require("graphql-request").GraphQLClient;
|
||||||
const {
|
const {
|
||||||
QueryInsuranceCo,
|
QueryInsuranceCo,
|
||||||
InsertInsuranceCo,
|
InsertInsuranceCo,
|
||||||
@@ -27,7 +28,7 @@ exports.default = async (req, res) => {
|
|||||||
clientId: process.env.QBO_CLIENT_ID,
|
clientId: process.env.QBO_CLIENT_ID,
|
||||||
clientSecret: process.env.QBO_SECRET,
|
clientSecret: process.env.QBO_SECRET,
|
||||||
environment: process.env.NODE_ENV === "production" ? "production" : "sandbox",
|
environment: process.env.NODE_ENV === "production" ? "production" : "sandbox",
|
||||||
redirectUri: process.env.QBO_REDIRECT_URI
|
redirectUri: process.env.QBO_REDIRECT_URI,
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
//Fetch the API Access Tokens & Set them for the session.
|
//Fetch the API Access Tokens & Set them for the session.
|
||||||
@@ -130,20 +131,22 @@ exports.default = async (req, res) => {
|
|||||||
|
|
||||||
// //No error. Mark the payment exported & insert export log.
|
// //No error. Mark the payment exported & insert export log.
|
||||||
if (elgen) {
|
if (elgen) {
|
||||||
await client.setHeaders({ Authorization: BearerToken }).request(queries.QBO_MARK_PAYMENT_EXPORTED, {
|
const result = await client
|
||||||
paymentId: payment.id,
|
.setHeaders({ Authorization: BearerToken })
|
||||||
payment: {
|
.request(queries.QBO_MARK_PAYMENT_EXPORTED, {
|
||||||
exportedat: moment().tz(bodyshop.timezone)
|
paymentId: payment.id,
|
||||||
},
|
payment: {
|
||||||
logs: [
|
exportedat: moment().tz(bodyshop.timezone)
|
||||||
{
|
},
|
||||||
bodyshopid: bodyshop.id,
|
logs: [
|
||||||
paymentid: payment.id,
|
{
|
||||||
successful: true,
|
bodyshopid: bodyshop.id,
|
||||||
useremail: req.user.email
|
paymentid: payment.id,
|
||||||
}
|
successful: true,
|
||||||
]
|
useremail: req.user.email
|
||||||
});
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.push({ paymentid: payment.id, success: true });
|
ret.push({ paymentid: payment.id, success: true });
|
||||||
@@ -153,7 +156,7 @@ exports.default = async (req, res) => {
|
|||||||
});
|
});
|
||||||
//Add the export log error.
|
//Add the export log error.
|
||||||
if (elgen) {
|
if (elgen) {
|
||||||
await client.setHeaders({ Authorization: BearerToken }).request(queries.INSERT_EXPORT_LOG, {
|
const result = await client.setHeaders({ Authorization: BearerToken }).request(queries.INSERT_EXPORT_LOG, {
|
||||||
logs: [
|
logs: [
|
||||||
{
|
{
|
||||||
bodyshopid: bodyshop.id,
|
bodyshopid: bodyshop.id,
|
||||||
@@ -187,7 +190,7 @@ exports.default = async (req, res) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function InsertPayment(oauthClient, qbo_realmId, req, payment, parentRef) {
|
async function InsertPayment(oauthClient, qbo_realmId, req, payment, parentRef, bodyshop) {
|
||||||
const { paymentMethods, invoices } = await QueryMetaData(
|
const { paymentMethods, invoices } = await QueryMetaData(
|
||||||
oauthClient,
|
oauthClient,
|
||||||
qbo_realmId,
|
qbo_realmId,
|
||||||
@@ -224,20 +227,20 @@ async function InsertPayment(oauthClient, qbo_realmId, req, payment, parentRef)
|
|||||||
PaymentRefNum: payment.transactionid,
|
PaymentRefNum: payment.transactionid,
|
||||||
...(invoices && invoices.length === 1 && invoices[0]
|
...(invoices && invoices.length === 1 && invoices[0]
|
||||||
? {
|
? {
|
||||||
Line: [
|
Line: [
|
||||||
{
|
{
|
||||||
Amount: Dinero({
|
Amount: Dinero({
|
||||||
amount: Math.round(payment.amount * 100)
|
amount: Math.round(payment.amount * 100)
|
||||||
}).toFormat(DineroQbFormat),
|
}).toFormat(DineroQbFormat),
|
||||||
LinkedTxn: [
|
LinkedTxn: [
|
||||||
{
|
{
|
||||||
TxnId: invoices[0].Id,
|
TxnId: invoices[0].Id,
|
||||||
TxnType: "Invoice"
|
TxnType: "Invoice"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
: {})
|
: {})
|
||||||
};
|
};
|
||||||
logger.log("qbo-payments-objectlog", "DEBUG", req.user.email, payment.id, {
|
logger.log("qbo-payments-objectlog", "DEBUG", req.user.email, payment.id, {
|
||||||
@@ -260,7 +263,7 @@ async function InsertPayment(oauthClient, qbo_realmId, req, payment, parentRef)
|
|||||||
status: result.response?.status,
|
status: result.response?.status,
|
||||||
bodyshopid: payment.job.shopid,
|
bodyshopid: payment.job.shopid,
|
||||||
email: req.user.email
|
email: req.user.email
|
||||||
});
|
})
|
||||||
setNewRefreshToken(req.user.email, result);
|
setNewRefreshToken(req.user.email, result);
|
||||||
return result && result.Bill;
|
return result && result.Bill;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -288,7 +291,7 @@ async function QueryMetaData(oauthClient, qbo_realmId, req, ro_number, isCreditM
|
|||||||
status: invoice.response?.status,
|
status: invoice.response?.status,
|
||||||
bodyshopid,
|
bodyshopid,
|
||||||
email: req.user.email
|
email: req.user.email
|
||||||
});
|
})
|
||||||
const paymentMethods = await oauthClient.makeApiCall({
|
const paymentMethods = await oauthClient.makeApiCall({
|
||||||
url: urlBuilder(qbo_realmId, "query", `select * From PaymentMethod`),
|
url: urlBuilder(qbo_realmId, "query", `select * From PaymentMethod`),
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -303,7 +306,7 @@ async function QueryMetaData(oauthClient, qbo_realmId, req, ro_number, isCreditM
|
|||||||
status: paymentMethods.response?.status,
|
status: paymentMethods.response?.status,
|
||||||
bodyshopid,
|
bodyshopid,
|
||||||
email: req.user.email
|
email: req.user.email
|
||||||
});
|
})
|
||||||
setNewRefreshToken(req.user.email, paymentMethods);
|
setNewRefreshToken(req.user.email, paymentMethods);
|
||||||
|
|
||||||
// const classes = await oauthClient.makeApiCall({
|
// const classes = await oauthClient.makeApiCall({
|
||||||
@@ -355,7 +358,7 @@ async function QueryMetaData(oauthClient, qbo_realmId, req, ro_number, isCreditM
|
|||||||
status: taxCodes.response?.status,
|
status: taxCodes.response?.status,
|
||||||
bodyshopid,
|
bodyshopid,
|
||||||
email: req.user.email
|
email: req.user.email
|
||||||
});
|
})
|
||||||
const items = await oauthClient.makeApiCall({
|
const items = await oauthClient.makeApiCall({
|
||||||
url: urlBuilder(qbo_realmId, "query", `select * From Item`),
|
url: urlBuilder(qbo_realmId, "query", `select * From Item`),
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -370,7 +373,7 @@ async function QueryMetaData(oauthClient, qbo_realmId, req, ro_number, isCreditM
|
|||||||
status: items.response?.status,
|
status: items.response?.status,
|
||||||
bodyshopid,
|
bodyshopid,
|
||||||
email: req.user.email
|
email: req.user.email
|
||||||
});
|
})
|
||||||
setNewRefreshToken(req.user.email, items);
|
setNewRefreshToken(req.user.email, items);
|
||||||
|
|
||||||
const itemMapping = {};
|
const itemMapping = {};
|
||||||
@@ -409,8 +412,8 @@ async function QueryMetaData(oauthClient, qbo_realmId, req, ro_number, isCreditM
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async function InsertCreditMemo(oauthClient, qbo_realmId, req, payment, parentRef) {
|
async function InsertCreditMemo(oauthClient, qbo_realmId, req, payment, parentRef, bodyshop) {
|
||||||
const { invoices, items, taxCodes } = await QueryMetaData(
|
const { paymentMethods, invoices, items, taxCodes } = await QueryMetaData(
|
||||||
oauthClient,
|
oauthClient,
|
||||||
qbo_realmId,
|
qbo_realmId,
|
||||||
req,
|
req,
|
||||||
@@ -446,14 +449,14 @@ async function InsertCreditMemo(oauthClient, qbo_realmId, req, payment, parentRe
|
|||||||
TaxCodeRef: {
|
TaxCodeRef: {
|
||||||
value:
|
value:
|
||||||
taxCodes[
|
taxCodes[
|
||||||
findTaxCode(
|
findTaxCode(
|
||||||
{
|
{
|
||||||
local: false,
|
local: false,
|
||||||
federal: false,
|
federal: false,
|
||||||
state: false
|
state: false
|
||||||
},
|
},
|
||||||
payment.job.bodyshop.md_responsibility_centers.sales_tax_codes
|
payment.job.bodyshop.md_responsibility_centers.sales_tax_codes
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -480,14 +483,12 @@ async function InsertCreditMemo(oauthClient, qbo_realmId, req, payment, parentRe
|
|||||||
status: result.response?.status,
|
status: result.response?.status,
|
||||||
bodyshopid: req.user.bodyshopid,
|
bodyshopid: req.user.bodyshopid,
|
||||||
email: req.user.email
|
email: req.user.email
|
||||||
});
|
})
|
||||||
setNewRefreshToken(req.user.email, result);
|
setNewRefreshToken(req.user.email, result);
|
||||||
return result && result.Bill;
|
return result && result.Bill;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("qbo-payables-error", "DEBUG", req.user.email, payment.id, {
|
logger.log("qbo-payables-error", "DEBUG", req.user.email, payment.id, {
|
||||||
error: error,
|
error: error && error.message,
|
||||||
validationError: JSON.stringify(error?.response?.data),
|
|
||||||
accountmeta: JSON.stringify({ items, taxCodes }),
|
|
||||||
method: "InsertCreditMemo"
|
method: "InsertCreditMemo"
|
||||||
});
|
});
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ const paymentRefund = async (req, res) => {
|
|||||||
|
|
||||||
logger.log("intellipay-refund-success", "DEBUG", req.user?.email, null, {
|
logger.log("intellipay-refund-success", "DEBUG", req.user?.email, null, {
|
||||||
requestOptions: options,
|
requestOptions: options,
|
||||||
response: response?.data,
|
|
||||||
...logResponseMeta
|
...logResponseMeta
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user