Promotional Items Stock Management Process 20221124
This workflow manages the number of promotional items taken out and the number of items in stock. The number of items in stock can be checked at the time of application for removal. The number of promotional items in stock is automatically updated when the removal of items is completed.
Workers (Number of swimlanes: 3)
Applicant
Promotional Materials Manager
Promotional Materials Manager
Workflow (Workflow diagram complexity: 22)
121. Inventory Number Correction
The Promotional Materials Manager corrects the number of promotional materials in stock.
11. Application for materials
Applicants are required to specify the number of promotional items to be taken out.
31x. [re]Application for materials
The applicant will reapply, specifying the number of promotional items and items to be taken out.
22. Confirmation of removal
The Promotional Materials Supervisor will confirm and record that the removal of the items has been completed.
5x1. Set subject
The workflow platform stores the subject line.
22x1. Inventory count master file backup
The workflow platform backs up the inventory master file.
6x2. Set subject
The workflow platform stores the subject line.
10x2. Acquire master inventory count (TSV)
The workflow platform retrieves the current inventory count master data.
8x3. Set subject
The workflow platform stores the subject line.
17x3. Remove updated source record
The workflow platform deletes the record to be updated in the Stock Count Master (TSV).
16x4. Append update record
The workflow platform appends the record to be updated to the master inventory count (TSV).
24x5. ID column sort
The workflow platform sorts the master inventory count (TSV) using the ID column as the key.
20x6. Generate data for updating
The workflow platform extracts the ID and label columns from the master inventory count (TSV).
21x7. Inventory count master update
The workflow platform updates the inventory count master file (add-on).
This archive contains the BPMN icon, which is only available in the Professional edition.
Notes
Associate the processor settings with the organizational structure during import
Completing a continuous removal in a short period of time (within approx. 1 minute)
Only the last inventory master update out of the continuous processing may be valid.
Workaround: Open the [2. Confirmation of take-out] process and the processing completion interval for at least 1 minute. (If you want to achieve this in an automatic process, please consult with us.)
Arrangement Tips
Additional types of promotional materials
Change the promotional item name master (promotional-item-names.xml) and inventory master (promotional-item-stock.xml) from “App Details > ▼ Apps > Manage Add-ons > Choice Master Used in Selective Data Items”
“1. Application for materials” Process, “Number of items taken out” input check (JavaScript)
1. Application for materials
<script>
let selects;
let stockCount;
let takingOutCount;
let remaindingCount;
function user_setStockCount(e) {
let stockCount_ele = document.getElementsByName("data[3].selects");
stockCount_ele[0].disabled = false;
selects = qbpms.form.get("q_promotional_items");
if (selects.length !== 0){
qbpms.form.set("q_stock_count", selects[0].value);
}
stockCount_ele[0].disabled = true;
}
function user_checkTakingOutCount(e) {
let button_ele = document.getElementById("submitButton");
let remaindingCount_ele = document.getElementsByName("data[20].input");
remaindingCount_ele[0].disabled = false;
remaindingCount = getRemaindingCount();
qbpms.form.set("q_remainding_count" , remaindingCount);
remaindingCount_ele[0].disabled = true;
if (remaindingCount < 0){
alert("Please re-enter the number of items to be taken out. \nNumber of items taken out > Number of items in stock");
button_ele.disabled = true;
}else{
button_ele.disabled = false;
}
}
function user_checkTakingOutCountForSubmit(e) {
let button_ele = document.getElementById("submitButton");
let remaindingCount_ele = document.getElementsByName("data[20].input");
let stockCount_ele = document.getElementsByName("data[3].selects");
remaindingCount_ele[0].disabled = false;
remaindingCount = getRemaindingCount();
qbpms.form.set("q_remainding_count" , remaindingCount);
if (remaindingCount < 0){
alert("Please re-enter the number of items to be taken out.\n Number of items taken out > Number of items in stock");
button_ele.disabled = true;
}else{
button_ele.disabled = false;
stockCount_ele[0].disabled = false;
}
}
function user_readyHandler(e) {
let button_ele = document.getElementById("submitButton");
let remaindingCount_ele = document.getElementsByName("data[20].input");
let stockCount_ele = document.getElementsByName("data[3].selects");
selects = qbpms.form.get("q_promotional_items");
if (selects.length !== 0){
qbpms.form.set("q_stock_count", selects[0].value);
}
stockCount_ele[0].disabled = true;
remaindingCount_ele[0].disabled = true;
button_ele.addEventListener('click', user_checkTakingOutCountForSubmit);
}
function getRemaindingCount(){
selects = qbpms.form.get("q_stock_count");
if (selects.length === 0){
stockCount = 0;
}else{
stockCount = Number(selects[0].display);
}
takingOutCount = Number(qbpms.form.get("q_taking_out_count"));
return stockCount - takingOutCount;
}
qbpms.form.on('ready', user_readyHandler);
qbpms.form.on('change', 'q_promotional_items', user_setStockCount);
qbpms.form.on('change', 'q_taking_out_count', user_checkTakingOutCount);
</script>