Commit be7a80c7 by Owen Ryan Ang

inherit changes of bpo enabled to bpo enabled

parent 1d8f7f87
import { resetGDE } from "../../script.js";
import { submitElementToSqLite } from "../DataInputWidget/AndroidInterface/androidInterface.js";
import { getDeviceId, submitElementToSqLite } from "../DataInputWidget/AndroidInterface/androidInterface.js";
import { SCHEMA_FILE_PATH } from "../DataInputWidget/config.js";
import { schema } from "../DataInputWidget/generateFields.js";
import { validateInput } from "../DataInputWidget/validateInput.js";
import { goBackToElementListViewer } from "../ElementListWidget/ElementListWidget.js";
import { createLoadingModal, removeLoadingModal } from "../LoadingModal/LoadingModal.js";
......@@ -310,33 +311,48 @@ function saveExceptionToXml(){
section = element.options[element.selectedIndex].text;
continue;
}
}
let xmlData = {
"projCode": PROJECT_CODE,
"userId": sessionStorage.getItem("user_id"),
"elementId": elementId,
"schema": SCHEMA_FILE_PATH,
"totalRec": 1,
"maxRec": "1",
"totalKeystroke": 0,
"procTime": "",
"procDuration": 0,
"eob": "",
"exceptionRemark": selected,
"recordNo": "1",
"totalSubRec": "1",
"maxSubRec": "1",
"imageName": "",
"subRecordNo": "1",
"eor": "N",
"fields": {},
"outputDir": sessionStorage.getItem("element_file_loc") + "/" + (ENCODING_PASS == "PASS1" ? elementId + ".DTA" : elementId + ".DTB"),
"doctype": doctype,
"section": section
}
}
const lookup = schema[doctype][section]
var Frm= document.getElementById("fields");
var Nodes=Frm.elements;
let fields = {};
for (var i = 0; i < Nodes.length; i++) {
var element = Nodes[i];
if (element.classList.contains('deviceid')){
let fid = Nodes[i].id;
let key = Object.keys(lookup[fid]).includes('aka') ? lookup[fid].aka.replace("field", "") : fid;
fields[key] = Nodes[i].value;
}
}
let xmlData = {
"projCode": PROJECT_CODE,
"userId": sessionStorage.getItem("user_id"),
"elementId": elementId,
"schema": SCHEMA_FILE_PATH,
"totalRec": 1,
"maxRec": "1",
"totalKeystroke": 0,
"procTime": "",
"procDuration": 0,
"eob": "",
"exceptionRemark": selected,
"recordNo": "1",
"totalSubRec": "1",
"maxSubRec": "1",
"imageName": "",
"subRecordNo": "1",
"eor": "N",
"fields": fields,
"outputDir": sessionStorage.getItem("element_file_loc") + "/" + (ENCODING_PASS == "PASS1" ? elementId + ".DTA" : elementId + ".DTB"),
"doctype": doctype,
"section": section
}
return updateXMLException(xmlData);
return updateXMLException(xmlData);
// return false;
}
......
......@@ -2466,6 +2466,12 @@ export async function populateFields(inputFieldData) {
console.log("key = " + key + ", value =" + v);
//console.log("validation: " + schema[doctype][section][key].validation.collection);
if (v === "null") {
v = "";
} else if (v == null && schema[doctype][section][key].validation.collection === 'numeric') {
v = 0;
}
fields["field" + k] = v;
if (schema[doctype][section][key].hidden) {
......
......@@ -27,7 +27,7 @@ export const IS_RETRIEVE_FROM_BPO = "N"
export let BPO_URL = DOMAIN + "bpo/";
export let CURRENT_NODE = ""
export const ENCODING_PASS = "PASS1"
export const PROD_OUTPUT_UNIT = "INSPECTION"
export const PROD_OUTPUT_UNIT = "DOC"
export const NEXT_NODE = "INSPECTED"
export const EXCEPTION_NODE = "CANCELLED"
export const SHOW_ELEMENT_LIST_VIEWER = "N"
......
......@@ -65,8 +65,8 @@
"fieldLabel" : "Business Permit No.",
"aka" : "field7",
"validation" : {
"fieldLength" : 10.0,
"collection" : "numeric",
"fieldLength" : 30.0,
"collection" : "alphanumeric",
"mandatory" : true
},
"readOnly" : true
......
{
"_attributes": {
"readOnly":false,
"docTypeHidden":true,
"sectionHidden":true
},
"DOCUMENT": {
"Section": {
"del_receipt1": {
"fieldLabel": "Delivery Receipt Page 1",
"aka": "field2",
"validation": {
"fieldLength": 1.0,
"collection": "image-capture",
"validDate": "",
"mandatory": false
}
},
"del_receipt2": {
"fieldLabel": "Delivery Receipt Page 2",
"aka": "field3",
"validation": {
"fieldLength": 1.0,
"collection": "image-capture",
"validDate": "",
"mandatory": false
}
},
"del_receipt3": {
"fieldLabel": "Delivery Receipt Page 3",
"aka": "field4",
"validation": {
"fieldLength": 1.0,
"collection": "image-capture",
"validDate": "",
"mandatory": false
}
},
"buyer_info": {
"fieldLabel": "Buyer Information Sheet",
"aka": "field5",
"validation": {
"fieldLength": 1.0,
"collection": "image-capture",
"validDate": "",
"mandatory": false
}
},
"ltms1": {
"fieldLabel": "LTMS Page 1",
"aka": "field6",
"validation": {
"fieldLength": 1.0,
"collection": "file-upload",
"validDate": "",
"mandatory": false
}
},
"ltms2": {
"fieldLabel": "LTMS Page 2",
"aka": "field7",
"validation": {
"fieldLength": 1.0,
"collection": "file-upload",
"validDate": "",
"mandatory": false
}
},
"sales_invoice": {
"fieldLabel": "Sales Invoice",
"aka": "field8",
"validation": {
"fieldLength": 1.0,
"collection": "image-capture",
"validDate": "",
"mandatory": false
}
},
"ctpl": {
"fieldLabel": "CTPL",
"aka": "field9",
"validation": {
"fieldLength": 1.0,
"collection": "image-capture",
"validDate": "",
"mandatory": false
}
},
"affidavit": {
"fieldLabel": "Affidavit of Sidecar Attachment",
"aka": "field10",
"validation": {
"fieldLength": 1.0,
"collection": "image-capture",
"validDate": "",
"mandatory": false
}
},
"loan_form1": {
"fieldLabel": "Loan Application Form Page 1",
"aka": "field11",
"validation": {
"fieldLength": 1.0,
"collection": "image-capture",
"validDate": "",
"mandatory": false
}
},
"loan_form2": {
"fieldLabel": "Loan Application Form Page 2",
"aka": "field12",
"validation": {
"fieldLength": 1.0,
"collection": "image-capture",
"validDate": "",
"mandatory": false
}
},
"loan_form3": {
"fieldLabel": "Loan Application Form Page 3",
"aka": "field13",
"validation": {
"fieldLength": 1.0,
"collection": "image-capture",
"validDate": "",
"mandatory": false
}
}
}
}
}
import { resetGDE } from "../../script.js";
import { getDeviceId, submitElementToSqLite } from "../DataInputWidget/AndroidInterface/androidInterface.js";
import { SCHEMA_FILE_PATH } from "../DataInputWidget/config.js";
import { schema } from "../DataInputWidget/generateFields.js";
import { validateInput } from "../DataInputWidget/validateInput.js";
import { goBackToElementListViewer } from "../ElementListWidget/ElementListWidget.js";
import { createLoadingModal, removeLoadingModal } from "../LoadingModal/LoadingModal.js";
......@@ -310,7 +311,9 @@ function saveExceptionToXml(){
section = element.options[element.selectedIndex].text;
continue;
}
}
}
const lookup = schema[doctype][section]
var Frm= document.getElementById("fields");
var Nodes=Frm.elements;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment