IO-1574 Add ignore blocked days to scoreboard.

This commit is contained in:
Patrick Fic
2021-12-28 10:26:41 -08:00
parent 1218deeee7
commit c27e8b9194
6 changed files with 50 additions and 12 deletions

View File

@@ -4000,6 +4000,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>ignoreblockeddays</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>
<name>inhousevendorid</name>
<definition_loaded>false</definition_loaded>

View File

@@ -43,19 +43,28 @@ export function ScoreboardDisplayComponent({
useEffect(() => {
//Update the locals.
async function setMomentSettings() {
const {
data: { appointments },
} = await client.query({
query: GET_BLOCKED_DAYS,
variables: {
start: moment().startOf("month"),
end: moment().endOf("month"),
},
});
let appointments;
if (!bodyshop.scoreboard_target.ignoreblockeddays) {
const { data } = await client.query({
query: GET_BLOCKED_DAYS,
variables: {
start: moment().startOf("month"),
end: moment().endOf("month"),
},
});
appointments = data.appointments;
}
moment.updateLocale("ca", {
workingWeekdays: translateSettingsToWorkingDays(bodyshop.workingdays),
holidays: appointments.map((h) => moment(h.start).format("MM-DD-YYYY")),
...(appointments
? {
holidays: appointments.map((h) =>
moment(h.start).format("MM-DD-YYYY")
),
}
: {}),
holidayFormat: "MM-DD-YYYY",
});
}

View File

@@ -354,6 +354,13 @@ export default function ShopInfoGeneral({ form }) {
>
<InputNumber min={0} max={12} precision={0} />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.ignoreblockeddays")}
name={["scoreboard_target", "ignoreblockeddays"]}
valuePropName="checked"
>
<Switch />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.prodtargethrs")}
name={["prodtargethrs"]}
@@ -472,7 +479,6 @@ export default function ShopInfoGeneral({ form }) {
label={t("bodyshop.fields.md_email_cc", { template: "parts_order" })}
rules={[
{
//message: t("general.validation.required"),
type: "array",
},
@@ -492,7 +498,6 @@ export default function ShopInfoGeneral({ form }) {
label={t("bodyshop.fields.md_ded_notes")}
rules={[
{
//message: t("general.validation.required"),
type: "array",
},

View File

@@ -253,6 +253,7 @@
"enforce_class": "Enforce Class on Conversion?",
"enforce_referral": "Enforce Referrals",
"federal_tax_id": "Federal Tax ID (GST/HST)",
"ignoreblockeddays": "Scoreboard - Ignore Blocked Days",
"inhousevendorid": "In House Vendor ID",
"insurance_vendor_id": "Insurance Vendor ID",
"intake": {

View File

@@ -253,6 +253,7 @@
"enforce_class": "",
"enforce_referral": "",
"federal_tax_id": "",
"ignoreblockeddays": "",
"inhousevendorid": "",
"insurance_vendor_id": "",
"intake": {

View File

@@ -253,6 +253,7 @@
"enforce_class": "",
"enforce_referral": "",
"federal_tax_id": "",
"ignoreblockeddays": "",
"inhousevendorid": "",
"insurance_vendor_id": "",
"intake": {