feat: Shop Supplier Purchase Order get, filter, and add new.
This commit is contained in:
27
static/js/lib/business_objects/business_objects.js
Normal file
27
static/js/lib/business_objects/business_objects.js
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
export default class BusinessObjects {
|
||||
static getOptionJsonFromObjectJsonAndKeys(objectJson, keyText, keyValue, valueSelected = null) {
|
||||
return {
|
||||
text: objectJson[keyText],
|
||||
value: objectJson[keyValue],
|
||||
selected: (objectJson[keyValue] == valueSelected),
|
||||
};
|
||||
}
|
||||
static getOptionJsonFromObjectJson(objectJson, valueSelected = null) {
|
||||
let keyText = objectJson[flagNameAttrOptionText];
|
||||
let keyValue = objectJson[flagNameAttrOptionValue];
|
||||
console.log({objectJson, keyText, keyValue});
|
||||
return BusinessObjects.getOptionJsonFromObjectJsonAndKeys(objectJson, keyText, keyValue, valueSelected);
|
||||
}
|
||||
/*
|
||||
static getOptionJsonFromProductPermutation(permutation) {
|
||||
return {
|
||||
text: permutation
|
||||
};
|
||||
}
|
||||
*/
|
||||
static getObjectText(objectJson) {
|
||||
return objectJson[objectJson[flagNameAttrOptionText]];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user