|
@@ -44,6 +44,65 @@ var GLJ = {
|
|
|
glj.prototype.doAfterUpdate = function(err, data){
|
|
|
// to do
|
|
|
};
|
|
|
+
|
|
|
+ // CSL,2017.05.09
|
|
|
+ glj.prototype.modifyQuantity = function (data, newQuantity) {
|
|
|
+ this.project.beginUpdate('modifyQuantity');
|
|
|
+ data.quantity = newQuantity;
|
|
|
+ data.customQuantity = newQuantity;
|
|
|
+ data.updateType = 'ut_update';
|
|
|
+ this.project.push(this.getSourceType, data);
|
|
|
+ this.project.endUpdate();
|
|
|
+ };
|
|
|
+
|
|
|
+ glj.prototype.modifyPrice = function (data, newPrice) {
|
|
|
+ this.project.beginUpdate('modifyPrice');
|
|
|
+ data.price = newPrice;
|
|
|
+ data.updateType = 'ut_update';
|
|
|
+ this.project.push(this.getSourceType, data);
|
|
|
+ this.project.endUpdate();
|
|
|
+ };
|
|
|
+
|
|
|
+ glj.prototype.deleteGLJ = function (data) {
|
|
|
+ this.project.beginUpdate('deleteGLJ');
|
|
|
+ data.customQuantity = 0;
|
|
|
+ data.quantity = 0;
|
|
|
+ data.rationItemQuantity = 0;
|
|
|
+ data.updateType = 'ut_update';
|
|
|
+ this.project.push(this.getSourceType, data);
|
|
|
+ this.project.endUpdate();
|
|
|
+ };
|
|
|
+
|
|
|
+ glj.prototype.replaceGLJ = function (data, newGLJID) {
|
|
|
+ this.project.beginUpdate('replaceGLJ');
|
|
|
+ data.GLJID = newGLJID;
|
|
|
+ data.updateType = 'ut_update';
|
|
|
+ this.project.push(this.getSourceType, data);
|
|
|
+ this.project.endUpdate();
|
|
|
+ };
|
|
|
+
|
|
|
+ glj.prototype.addGLJ = function (data) {
|
|
|
+ var newGLJ = {};
|
|
|
+ this.project.beginUpdate('addGLJ');
|
|
|
+ newGLJ.projectID = this.project;
|
|
|
+ newGLJ.GLJID = data.GLJID;
|
|
|
+ newGLJ.rGLJID = data.rGLJID;
|
|
|
+ newGLJ.rationID = data.rationID;
|
|
|
+ newGLJ.billsItemID = data.billsItemID;
|
|
|
+ newGLJ.orgRQuantity = data.orgRQuantity;
|
|
|
+ newGLJ.rQuantity = data.rQuantity;
|
|
|
+ newGLJ.quantity = data.quantity;
|
|
|
+ newGLJ.rationPrice = data.rationPrice;
|
|
|
+ newGLJ.adjustPrice = data.adjustPrice;
|
|
|
+ newGLJ.marketPrice = data.marketPrice;
|
|
|
+ newGLJ.price = data.price;
|
|
|
+
|
|
|
+ newGLJ.updateType = 'ut_add';
|
|
|
+ this.project.push(this.getSourceType, newGLJ);
|
|
|
+ this.project.endUpdate();
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
return new glj(project);
|
|
|
}
|
|
|
};
|