IO-1914 Add Quantity Handling for inventory.
This commit is contained in:
@@ -3314,6 +3314,27 @@
|
||||
<folder_node>
|
||||
<name>validation</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>inventoryquantity</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>manualinhouse</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -15930,6 +15951,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>markedexported</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>message</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
},
|
||||
}),
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
@@ -140,10 +140,15 @@ export function BilllineAddInventory({
|
||||
<Tooltip title={t("inventory.actions.addtoinventory")}>
|
||||
<Button
|
||||
loading={loading}
|
||||
disabled={disabled || billline?.inventories?.length > 0}
|
||||
disabled={
|
||||
disabled || billline?.inventories?.length >= billline.quantity
|
||||
}
|
||||
onClick={addToInventory}
|
||||
>
|
||||
<FileAddFilled />
|
||||
{billline?.inventories?.length > 0 && (
|
||||
<div>({billline?.inventories?.length} in inv)</div>
|
||||
)}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
);
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user