@@ -20581,6 +20581,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>date_rentalresp</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>date_scheduled</name>
|
<name>date_scheduled</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -20602,6 +20623,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>date_towin</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>ded_amt</name>
|
<name>ded_amt</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -27371,6 +27413,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>threshhold</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>total_cost</name>
|
<name>total_cost</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Table } from "antd";
|
import { Space, Table } from "antd";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
import React, { useMemo, useState } from "react";
|
import React, { useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -119,7 +119,18 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
<Table.Summary.Row>
|
<Table.Summary.Row>
|
||||||
<Table.Summary.Cell>{t("jobs.labels.mapa")}</Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
|
<Space>
|
||||||
|
{t("jobs.labels.mapa")}
|
||||||
|
{job.materials &&
|
||||||
|
job.materials.mapa &&
|
||||||
|
job.materials.mapa.cal_maxdlr &&
|
||||||
|
job.materials.mapa.cal_maxdlr > 0 &&
|
||||||
|
t("jobs.labels.threshhold", {
|
||||||
|
amount: job.materials.mapa.cal_maxdlr,
|
||||||
|
})}
|
||||||
|
</Space>
|
||||||
|
</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell align="right">
|
<Table.Summary.Cell align="right">
|
||||||
<CurrencyFormatter>
|
<CurrencyFormatter>
|
||||||
{job.job_totals.rates.mapa.rate}
|
{job.job_totals.rates.mapa.rate}
|
||||||
@@ -133,7 +144,18 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
<Table.Summary.Row>
|
<Table.Summary.Row>
|
||||||
<Table.Summary.Cell>{t("jobs.labels.mash")}</Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
|
<Space wrap>
|
||||||
|
{t("jobs.labels.mash")}
|
||||||
|
{job.materials &&
|
||||||
|
job.materials.mash &&
|
||||||
|
job.materials.mash.cal_maxdlr &&
|
||||||
|
job.materials.mash.cal_maxdlr > 0 &&
|
||||||
|
t("jobs.labels.threshhold", {
|
||||||
|
amount: job.materials.mash.cal_maxdlr,
|
||||||
|
})}
|
||||||
|
</Space>
|
||||||
|
</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell align="right">
|
<Table.Summary.Cell align="right">
|
||||||
<CurrencyFormatter>
|
<CurrencyFormatter>
|
||||||
{job.job_totals.rates.mash.rate}
|
{job.job_totals.rates.mash.rate}
|
||||||
|
|||||||
@@ -58,6 +58,15 @@ export default function JobsAdminDatesChange({ job }) {
|
|||||||
>
|
>
|
||||||
<FormDatePicker format="MM/DD/YYYY" />
|
<FormDatePicker format="MM/DD/YYYY" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item label={t("jobs.fields.date_towin")} name="date_towin">
|
||||||
|
<DateTimePicker />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.date_rentalresp")}
|
||||||
|
name="date_rentalresp"
|
||||||
|
>
|
||||||
|
<DateTimePicker />
|
||||||
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.date_open")} name="date_open">
|
<Form.Item label={t("jobs.fields.date_open")} name="date_open">
|
||||||
<DateTimePicker />
|
<DateTimePicker />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
|
|||||||
<Form.Item label={t("jobs.fields.date_open")} name="date_open">
|
<Form.Item label={t("jobs.fields.date_open")} name="date_open">
|
||||||
<DateTimePicker disabled={jobRO} />
|
<DateTimePicker disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item label={t("jobs.fields.date_towin")} name="date_towin">
|
||||||
|
<DateTimePicker disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label={t("jobs.fields.date_rentalresp")} name="date_rentalresp">
|
||||||
|
<DateTimePicker disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
|
|
||||||
<FormRow header={t("jobs.forms.scheddates")}>
|
<FormRow header={t("jobs.forms.scheddates")}>
|
||||||
|
|||||||
@@ -401,6 +401,8 @@ export function JobsDetailHeaderActions({
|
|||||||
job: {
|
job: {
|
||||||
status: bodyshop.md_ro_statuses.default_void,
|
status: bodyshop.md_ro_statuses.default_void,
|
||||||
voided: true,
|
voided: true,
|
||||||
|
scheduled_in: null,
|
||||||
|
inproduction: false,
|
||||||
},
|
},
|
||||||
note: [
|
note: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -595,6 +595,7 @@ export const GET_JOB_BY_PK = gql`
|
|||||||
ca_gst_registrant
|
ca_gst_registrant
|
||||||
ownerid
|
ownerid
|
||||||
ded_note
|
ded_note
|
||||||
|
materials
|
||||||
owner {
|
owner {
|
||||||
id
|
id
|
||||||
ownr_fn
|
ownr_fn
|
||||||
@@ -649,6 +650,8 @@ export const GET_JOB_BY_PK = gql`
|
|||||||
date_invoiced
|
date_invoiced
|
||||||
date_last_contacted
|
date_last_contacted
|
||||||
date_next_contact
|
date_next_contact
|
||||||
|
date_towin
|
||||||
|
date_rentalresp
|
||||||
date_exported
|
date_exported
|
||||||
status
|
status
|
||||||
owner_owing
|
owner_owing
|
||||||
@@ -1097,6 +1100,15 @@ export const VOID_JOB = gql`
|
|||||||
insert_notes(objects: $note) {
|
insert_notes(objects: $note) {
|
||||||
affected_rows
|
affected_rows
|
||||||
}
|
}
|
||||||
|
update_appointments(
|
||||||
|
where: { jobid: { _eq: $jobId } }
|
||||||
|
_set: { canceled: true }
|
||||||
|
) {
|
||||||
|
returning {
|
||||||
|
id
|
||||||
|
canceled
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
@@ -1254,7 +1254,9 @@
|
|||||||
"date_last_contacted": "Last Contacted Date",
|
"date_last_contacted": "Last Contacted Date",
|
||||||
"date_next_contact": "Next Contact Date",
|
"date_next_contact": "Next Contact Date",
|
||||||
"date_open": "Open",
|
"date_open": "Open",
|
||||||
|
"date_rentalresp": "Shop Rental Responsibility Start",
|
||||||
"date_scheduled": "Scheduled",
|
"date_scheduled": "Scheduled",
|
||||||
|
"date_towin": "Towed In",
|
||||||
"ded_amt": "Deductible",
|
"ded_amt": "Deductible",
|
||||||
"ded_note": "Deductible Note",
|
"ded_note": "Deductible Note",
|
||||||
"ded_status": "Deductible Status",
|
"ded_status": "Deductible Status",
|
||||||
@@ -1602,6 +1604,7 @@
|
|||||||
"supplementnote": "The job had a supplement imported.",
|
"supplementnote": "The job had a supplement imported.",
|
||||||
"suspended": "SUSPENDED",
|
"suspended": "SUSPENDED",
|
||||||
"suspense": "Suspense",
|
"suspense": "Suspense",
|
||||||
|
"threshhold": "Max Threshold: ${{amount}}",
|
||||||
"total_cost": "Total Cost",
|
"total_cost": "Total Cost",
|
||||||
"total_cust_payable": "Total Customer Amount Payable",
|
"total_cust_payable": "Total Customer Amount Payable",
|
||||||
"total_repairs": "Total Repairs",
|
"total_repairs": "Total Repairs",
|
||||||
|
|||||||
@@ -1254,7 +1254,9 @@
|
|||||||
"date_last_contacted": "",
|
"date_last_contacted": "",
|
||||||
"date_next_contact": "",
|
"date_next_contact": "",
|
||||||
"date_open": "Abierto",
|
"date_open": "Abierto",
|
||||||
|
"date_rentalresp": "",
|
||||||
"date_scheduled": "Programado",
|
"date_scheduled": "Programado",
|
||||||
|
"date_towin": "",
|
||||||
"ded_amt": "Deducible",
|
"ded_amt": "Deducible",
|
||||||
"ded_note": "",
|
"ded_note": "",
|
||||||
"ded_status": "Estado deducible",
|
"ded_status": "Estado deducible",
|
||||||
@@ -1602,6 +1604,7 @@
|
|||||||
"supplementnote": "",
|
"supplementnote": "",
|
||||||
"suspended": "",
|
"suspended": "",
|
||||||
"suspense": "",
|
"suspense": "",
|
||||||
|
"threshhold": "",
|
||||||
"total_cost": "",
|
"total_cost": "",
|
||||||
"total_cust_payable": "",
|
"total_cust_payable": "",
|
||||||
"total_repairs": "",
|
"total_repairs": "",
|
||||||
|
|||||||
@@ -1254,7 +1254,9 @@
|
|||||||
"date_last_contacted": "",
|
"date_last_contacted": "",
|
||||||
"date_next_contact": "",
|
"date_next_contact": "",
|
||||||
"date_open": "Ouvrir",
|
"date_open": "Ouvrir",
|
||||||
|
"date_rentalresp": "",
|
||||||
"date_scheduled": "Prévu",
|
"date_scheduled": "Prévu",
|
||||||
|
"date_towin": "",
|
||||||
"ded_amt": "Déductible",
|
"ded_amt": "Déductible",
|
||||||
"ded_note": "",
|
"ded_note": "",
|
||||||
"ded_status": "Statut de franchise",
|
"ded_status": "Statut de franchise",
|
||||||
@@ -1602,6 +1604,7 @@
|
|||||||
"supplementnote": "",
|
"supplementnote": "",
|
||||||
"suspended": "",
|
"suspended": "",
|
||||||
"suspense": "",
|
"suspense": "",
|
||||||
|
"threshhold": "",
|
||||||
"total_cost": "",
|
"total_cost": "",
|
||||||
"total_cust_payable": "",
|
"total_cust_payable": "",
|
||||||
"total_repairs": "",
|
"total_repairs": "",
|
||||||
|
|||||||
@@ -2721,7 +2721,9 @@
|
|||||||
- date_last_contacted
|
- date_last_contacted
|
||||||
- date_next_contact
|
- date_next_contact
|
||||||
- date_open
|
- date_open
|
||||||
|
- date_rentalresp
|
||||||
- date_scheduled
|
- date_scheduled
|
||||||
|
- date_towin
|
||||||
- ded_amt
|
- ded_amt
|
||||||
- ded_note
|
- ded_note
|
||||||
- ded_status
|
- ded_status
|
||||||
@@ -2804,6 +2806,7 @@
|
|||||||
- loss_desc
|
- loss_desc
|
||||||
- loss_of_use
|
- loss_of_use
|
||||||
- loss_type
|
- loss_type
|
||||||
|
- materials
|
||||||
- other_amount_payable
|
- other_amount_payable
|
||||||
- owner_owing
|
- owner_owing
|
||||||
- ownerid
|
- ownerid
|
||||||
@@ -2978,7 +2981,9 @@
|
|||||||
- date_last_contacted
|
- date_last_contacted
|
||||||
- date_next_contact
|
- date_next_contact
|
||||||
- date_open
|
- date_open
|
||||||
|
- date_rentalresp
|
||||||
- date_scheduled
|
- date_scheduled
|
||||||
|
- date_towin
|
||||||
- ded_amt
|
- ded_amt
|
||||||
- ded_note
|
- ded_note
|
||||||
- ded_status
|
- ded_status
|
||||||
@@ -3061,6 +3066,7 @@
|
|||||||
- loss_desc
|
- loss_desc
|
||||||
- loss_of_use
|
- loss_of_use
|
||||||
- loss_type
|
- loss_type
|
||||||
|
- materials
|
||||||
- other_amount_payable
|
- other_amount_payable
|
||||||
- owner_owing
|
- owner_owing
|
||||||
- ownerid
|
- ownerid
|
||||||
@@ -3245,7 +3251,9 @@
|
|||||||
- date_last_contacted
|
- date_last_contacted
|
||||||
- date_next_contact
|
- date_next_contact
|
||||||
- date_open
|
- date_open
|
||||||
|
- date_rentalresp
|
||||||
- date_scheduled
|
- date_scheduled
|
||||||
|
- date_towin
|
||||||
- ded_amt
|
- ded_amt
|
||||||
- ded_note
|
- ded_note
|
||||||
- ded_status
|
- ded_status
|
||||||
@@ -3328,6 +3336,7 @@
|
|||||||
- loss_desc
|
- loss_desc
|
||||||
- loss_of_use
|
- loss_of_use
|
||||||
- loss_type
|
- loss_type
|
||||||
|
- materials
|
||||||
- other_amount_payable
|
- other_amount_payable
|
||||||
- owner_owing
|
- owner_owing
|
||||||
- ownerid
|
- ownerid
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."jobs" add column "materials" jsonb
|
||||||
|
-- not null default jsonb_build_object();
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."jobs" add column "materials" jsonb
|
||||||
|
not null default jsonb_build_object();
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."jobs" add column "towin_date" timestamptz
|
||||||
|
-- null;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."jobs" add column "towin_date" timestamptz
|
||||||
|
null;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
alter table "public"."jobs" rename column "date_towin" to "towin_date";
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
alter table "public"."jobs" rename column "towin_date" to "date_towin";
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."jobs" add column "date_rentalresp" timestamptz
|
||||||
|
-- null;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."jobs" add column "date_rentalresp" timestamptz
|
||||||
|
null;
|
||||||
@@ -960,6 +960,7 @@ exports.GET_JOB_BY_PK = ` query GET_JOB_BY_PK($id: uuid!) {
|
|||||||
voided
|
voided
|
||||||
ca_bc_pvrt
|
ca_bc_pvrt
|
||||||
ca_customer_gst
|
ca_customer_gst
|
||||||
|
materials
|
||||||
joblines(where: { removed: { _eq: false } }){
|
joblines(where: { removed: { _eq: false } }){
|
||||||
id
|
id
|
||||||
line_no
|
line_no
|
||||||
|
|||||||
@@ -234,11 +234,30 @@ function CalculateRatesTotals(ratesList) {
|
|||||||
if (!ret[property].total) {
|
if (!ret[property].total) {
|
||||||
ret[property].total = Dinero();
|
ret[property].total = Dinero();
|
||||||
}
|
}
|
||||||
ret[property].total = ret[property].total.add(
|
let threshold;
|
||||||
Dinero({
|
//Check if there is a max for this type.
|
||||||
amount: Math.round((ret[property].rate || 0) * 100),
|
if (ratesList.materials[property]) {
|
||||||
}).multiply(ret[property].hours)
|
//
|
||||||
);
|
if (
|
||||||
|
ratesList.materials[property].cal_maxdlr &&
|
||||||
|
ratesList.materials[property].cal_maxdlr > 0
|
||||||
|
) {
|
||||||
|
//It has an upper threshhold.
|
||||||
|
threshold = Dinero({
|
||||||
|
amount: Math.round(ratesList.materials[property].cal_maxdlr * 100),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const total = Dinero({
|
||||||
|
amount: Math.round((ret[property].rate || 0) * 100),
|
||||||
|
}).multiply(ret[property].hours);
|
||||||
|
|
||||||
|
if (threshold && total.greaterThanOrEqual(threshold)) {
|
||||||
|
ret[property].total = ret[property].total.add(threshold);
|
||||||
|
} else {
|
||||||
|
ret[property].total = ret[property].total.add(total);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
subtotal = subtotal.add(ret[property].total);
|
subtotal = subtotal.add(ret[property].total);
|
||||||
@@ -252,6 +271,7 @@ function CalculateRatesTotals(ratesList) {
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
function CalculatePartsTotals(jobLines) {
|
function CalculatePartsTotals(jobLines) {
|
||||||
const ret = jobLines
|
const ret = jobLines
|
||||||
.filter((jl) => !jl.removed)
|
.filter((jl) => !jl.removed)
|
||||||
|
|||||||
Reference in New Issue
Block a user