diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 4101a134e..2bf1b9018 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -3314,6 +3314,27 @@ validation + + inventoryquantity + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + manualinhouse false @@ -15930,6 +15951,27 @@ + + markedexported + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + message false diff --git a/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx b/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx index f2f03e90d..b9bbb791b 100644 --- a/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx +++ b/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx @@ -127,7 +127,7 @@ export function BillDetailEditcontainer({ }); billlines.forEach((billline) => { - const { deductedfromlbr, jobline, ...il } = billline; + const { deductedfromlbr, inventories, jobline, ...il } = billline; delete il.__typename; if (il.id) { diff --git a/client/src/components/bill-form/bill-form.lines.component.jsx b/client/src/components/bill-form/bill-form.lines.component.jsx index 71a0e3b72..30aebdfe8 100644 --- a/client/src/components/bill-form/bill-form.lines.component.jsx +++ b/client/src/components/bill-form/bill-form.lines.component.jsx @@ -150,6 +150,24 @@ export function BillEnterModalLinesComponent({ required: true, //message: t("general.validation.required"), }, + ({ getFieldValue }) => ({ + validator(rule, value) { + if ( + value && + getFieldValue("billlines")[field.fieldKey]?.inventories + ?.length > value + ) { + return Promise.reject( + t("bills.validation.inventoryquantity", { + number: + getFieldValue("billlines")[field.fieldKey] + ?.inventories?.length, + }) + ); + } + return Promise.resolve(); + }, + }), ], }; }, diff --git a/client/src/components/billline-add-inventory/billline-add-inventory.component.jsx b/client/src/components/billline-add-inventory/billline-add-inventory.component.jsx index d2cbe92bc..1fea48f5b 100644 --- a/client/src/components/billline-add-inventory/billline-add-inventory.component.jsx +++ b/client/src/components/billline-add-inventory/billline-add-inventory.component.jsx @@ -140,10 +140,15 @@ export function BilllineAddInventory({ ); diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index c40bfe2be..94299f2e5 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -208,6 +208,7 @@ "reexport": "Bill marked for re-export." }, "validation": { + "inventoryquantity": "Quantity must be greater than or equal to what has been added to inventory ({{number}}).", "manualinhouse": "Manual posting to the in house vendor is restricted. ", "unique_invoice_number": "This invoice number has already been entered for this vendor." } @@ -992,6 +993,7 @@ "loadingapp": "Loading $t(titles.app)", "loadingshop": "Loading shop data...", "loggingin": "Authorizing...", + "markedexported": "Manually marked as exported.", "message": "Message", "monday": "Monday", "na": "N/A", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 2793b4bf1..afefc5c9b 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -208,6 +208,7 @@ "reexport": "" }, "validation": { + "inventoryquantity": "", "manualinhouse": "", "unique_invoice_number": "" } @@ -992,6 +993,7 @@ "loadingapp": "Cargando $t(titles.app)", "loadingshop": "Cargando datos de la tienda ...", "loggingin": "Iniciando sesión ...", + "markedexported": "", "message": "", "monday": "", "na": "N / A", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index b7011de21..ccc887091 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -208,6 +208,7 @@ "reexport": "" }, "validation": { + "inventoryquantity": "", "manualinhouse": "", "unique_invoice_number": "" } @@ -992,6 +993,7 @@ "loadingapp": "Chargement de $t(titles.app)", "loadingshop": "Chargement des données de la boutique ...", "loggingin": "Vous connecter ...", + "markedexported": "", "message": "", "monday": "", "na": "N / A", diff --git a/client/src/utils/fcm-handler.js b/client/src/utils/fcm-handler.js index 0b4999b9c..116ae7a21 100644 --- a/client/src/utils/fcm-handler.js +++ b/client/src/utils/fcm-handler.js @@ -1,5 +1,4 @@ export default async function FcmHandler({ client, payload }) { - console.log("Handling payload type", payload); switch (payload.type) { case "messaging-inbound": client.cache.modify({