BilItemModel.prototype=new MathModel;BilItemModel.Type="BILItm";
BilItemModel.factory=function(c){var a=new BilItemModel;c&&(a.Info=MathModelReference.factory(c.ModelKey),a.ItemCode.setProperties(c.ItemCode),a.RequestComment.setProperties(c.RequestComment),a.ReqRef.setProperties(c.ReqRef),a.Description.setProperties(c.Description),a.Unit.setProperties(c.Unit),a.Quantity.setProperties(c.Quantity),a.CostPrice.setProperties(c.CostPrice),a.CeilingPrice.setProperties(c.CeilingPrice),a.SalesPrice.setProperties(c.SalesPrice),a.CostPriceTotal.setProperties(c.CostPriceTotal),
a.CeilingPriceTotal.setProperties(c.CeilingPriceTotal),a.SalesPriceTotal.setProperties(c.SalesPriceTotal),a.Tax.setProperties(c.Tax),a.TaxValue.setProperties(c.TaxValue),a.ITBIS.setProperties(c.ITBIS),a.ITBISValue.setProperties(c.ITBISValue),a.MontoGrabado.setProperties(c.MontoGrabado),a.ReplyPriceTotal.setProperties(c.ReplyPriceTotal),a.CurrentBid.setProperties(c.CurrentBid),c.NextModelKey&&(a.NextModelInfo=MathModelReference.factory(c.NextModelKey)));$.modelStorage.add(a);return a};
function BilItemModel(c){function a(a,b){var d=b.divide(BigDecimal.HUNDRED,$.settings.Math.Decimal.ProcedureFormat.Intermedium+2,$.settings.Math.Decimal.RoundingMode);return a.multiply(d)}this.init(c);this.RequestComment=MathModelProperty.stringPropertyFactory();this.ItemCode=MathModelProperty.stringPropertyFactory();this.ReqRef=MathModelProperty.stringPropertyFactory();this.Description=MathModelProperty.stringPropertyFactory();this.Unit=MathModelProperty.stringPropertyFactory();this.Quantity=MathModelProperty.decimalPropertyFactory(MathModelProperty.FormatTypes.DecimalIntermedium);
this.CostPrice=MathModelProperty.decimalPropertyFactory(MathModelProperty.FormatTypes.DecimalIntermedium);this.CeilingPrice=MathModelProperty.decimalPropertyFactory(MathModelProperty.FormatTypes.DecimalIntermedium);this.SalesPrice=MathModelProperty.decimalPropertyFactory(MathModelProperty.FormatTypes.DecimalIntermedium);this.CostPriceTotal=MathModelProperty.decimalPropertyFactory();this.CeilingPriceTotal=MathModelProperty.decimalPropertyFactory();this.SalesPriceTotal=MathModelProperty.decimalPropertyFactory();
this.Tax=MathModelProperty.decimalPropertyFactory(MathModelProperty.FormatTypes.DecimalIntermedium);this.TaxValue=MathModelProperty.decimalPropertyFactory();this.ITBIS=MathModelProperty.decimalPropertyFactory(MathModelProperty.FormatTypes.DecimalIntermedium);this.ITBISValue=MathModelProperty.decimalPropertyFactory();this.MontoGrabado=MathModelProperty.decimalPropertyFactory(MathModelProperty.FormatTypes.DecimalIntermedium);this.ReplyPriceTotal=MathModelProperty.decimalPropertyFactory();BilItemModel.prototype._loadProperty=
function(a,b){a===MathModel.Variables.Quantity?this.Quantity.load(b):a===MathModel.Variables.CostPrice?this.CostPrice.load(b):a===MathModel.Variables.CostPriceTotal?this.CostPriceTotal.load(b):a===MathModel.Variables.CeilingPrice?this.CeilingPrice.load(b):a===MathModel.Variables.CeilingPriceTotal?this.CeilingPriceTotal.load(b):a===MathModel.Variables.SalesPrice?this.SalesPrice.load(b):a===MathModel.Variables.SalesPriceTotal?this.SalesPriceTotal.load(b):a==MathModel.Variables.ItemCode?this.ItemCode.load(b):
a==MathModel.Variables.ReqRef?this.ReqRef.load(b):a==MathModel.Variables.Description?this.Description.load(b):a==MathModel.Variables.Unit?this.Unit.load(b):a==MathModel.Variables.RequestComment?this.RequestComment.load(b):a===MathModel.Variables.ITBIS?this.ITBIS.load(b):a===MathModel.Variables.ITBISValue?this.ITBISValue.load(b):a===MathModel.Variables.Tax?this.Tax.load(b):a===MathModel.Variables.TaxValue?this.TaxValue.load(b):a===MathModel.Variables.MontoGrabado?this.MontoGrabado.load(b):a===MathModel.Variables.ReplyPriceTotal?
this.ReplyPriceTotal.load(b):a===MathModel.Variables.CurrentBid&&this.CurrentBid.load(b)};BilItemModel.prototype.calculateCostPriceTotal=function(){var a=this.Quantity.get(BigDecimal.ZERO),b=this.CostPrice.get(BigDecimal.ZERO);return $.multiplyDecimals(a,b)};BilItemModel.prototype.calculateCeilingPriceTotal=function(){var a=this.Quantity.get(BigDecimal.ZERO),b=this.CeilingPrice.get(BigDecimal.ZERO);return $.multiplyDecimals(a,b)};BilItemModel.prototype.calculateSalesPriceTotal=function(){var a=this.Quantity.get(BigDecimal.ZERO),
b=this.SalesPrice.get(BigDecimal.ZERO);return $.multiplyDecimals(a,b)};BilItemModel.prototype.calculateITBISValue=function(){var e=this.ITBIS.get(BigDecimal.ZERO),b=this.MontoGrabado.get(BigDecimal.ZERO),d=this.CeilingPriceTotal.get(BigDecimal.ZERO);this.Quantity.get(BigDecimal.ZERO);return void 0!==this.MontoGrabado.Value?a(b,e):a(d,e)};BilItemModel.prototype.calculateTaxValue=function(){var e=this.Tax.get(BigDecimal.ZERO),b=this.CeilingPriceTotal.get(BigDecimal.ZERO);this.Quantity.get(BigDecimal.ZERO);
return a(b,e)};BilItemModel.prototype.calculateReplyPriceTotal=function(){var a=this.ITBISValue.get(BigDecimal.ZERO),b=this.TaxValue.get(BigDecimal.ZERO);return this.CeilingPriceTotal.get(BigDecimal.ZERO).add(a).add(b)};BilItemModel.prototype.calculateCurrentBid=function(){var a=this.Quantity.get(BigDecimal.ZERO),b=this.CurrentBid.get(BigDecimal.ZERO);return $.divideDecimals(b,a)};BilItemModel.prototype.updateCostPriceTotal=function(){var a=this.CostPriceTotal.get(BigDecimal.ZERO),b=this.calculateCostPriceTotal(),
a=b.subtract(a);this.CostPriceTotal.set(b);return a.isZero()?void 0:a};BilItemModel.prototype.updateCurrentBid=function(){var a=this.CurrentBid.get(BigDecimal.ZERO),b=this.calculateCurrentBid(),a=b.subtract(a);this.CurrentBid.set(b);return a.isZero()?void 0:a};BilItemModel.prototype.updateCeilingPriceTotal=function(){var a=this.CeilingPriceTotal.get(BigDecimal.ZERO),b=this.calculateCeilingPriceTotal(),a=b.subtract(a);this.CeilingPriceTotal.set(b);return a.isZero()?void 0:a};BilItemModel.prototype.updateSalesPriceTotal=
function(){var a=this.SalesPriceTotal.get(BigDecimal.ZERO),b=this.calculateSalesPriceTotal(),a=b.subtract(a);this.SalesPriceTotal.set(b);return a.isZero()?void 0:a};BilItemModel.prototype.updateITBISValue=function(){var a=this.ITBISValue.get(BigDecimal.ZERO),b=this.calculateITBISValue(),a=b.subtract(a);this.ITBISValue.set(b);return a.isZero()?void 0:a};BilItemModel.prototype.updateTaxValue=function(){var a=this.TaxValue.get(BigDecimal.ZERO),b=this.calculateTaxValue(),a=b.subtract(a);this.TaxValue.set(b);
return a.isZero()?void 0:a};BilItemModel.prototype.updateReplyPriceTotal=function(){var a=this.ReplyPriceTotal.get(BigDecimal.ZERO),b=this.calculateReplyPriceTotal(),a=b.subtract(a);this.ReplyPriceTotal.set(b);return a.isZero()?void 0:a};BilItemModel.prototype.createTotalValues=function(){return TotalValuesModel.factory({CstPT:this.CostPriceTotal.get(BigDecimal.ZERO),ClnPT:this.CeilingPriceTotal.get(BigDecimal.ZERO),SlsPT:this.SalesPriceTotal.get(BigDecimal.ZERO),ITBISValue:this.ITBISValue.get(BigDecimal.ZERO),
TaxValue:this.TaxValue.get(BigDecimal.ZERO),ReplyPriceTotal:this.ReplyPriceTotal.get(BigDecimal.ZERO)})};BilItemModel.prototype.updateValues=function(a){a&&(this.Info=MathModelReference.factory(a.ModelKey),this.ItemCode.set(a.ItemCode.Value),this.ReqRef.set(a.ReqRef.Value),this.Description.set(a.Description.Value),this.Unit.set(a.Unit.Value),this.Quantity.set($.bigDecimalFromJSON(a.Quantity.Value)),this.CostPrice.set($.bigDecimalFromJSON(a.CostPrice.Value)),this.CeilingPrice.set($.bigDecimalFromJSON(a.CeilingPrice.Value)),
this.SalesPrice.set($.bigDecimalFromJSON(a.SalesPrice.Value)),this.CostPriceTotal.set($.bigDecimalFromJSON(a.CostPriceTotal.Value)),this.CeilingPriceTotal.set($.bigDecimalFromJSON(a.CeilingPriceTotal.Value)),this.SalesPriceTotal.set($.bigDecimalFromJSON(a.SalesPriceTotal.Value)),this.ITBISValue.set($.bigDecimalFromJSON(a.ITBISValue.Value)),this.TaxValue.set($.bigDecimalFromJSON(a.TaxValue.Value)),this.ReplyPriceTotal.set($.bigDecimalFromJSON(a.ReplyPriceTotal.Value)),this.RequestComment.ElementId=
a.RequestComment.ElementId,this.RequestComment.set(a.RequestComment.Value))}}BilChapterModel.prototype=new MathModel;BilChapterModel.Type="BILChp";
BilChapterModel.factory=function(c){var a=new BilChapterModel;c&&(a.Info=MathModelReference.factory(c.ModelKey),a.ItemCode.setProperties(c.ItemCode),a.Description.setProperties(c.Description),a.CostPriceTotal.setProperties(c.CostPriceTotal),a.CeilingPriceTotal.setProperties(c.CeilingPriceTotal),a.SalesPriceTotal.setProperties(c.SalesPriceTotal),a.ITBISValue.setProperties(c.ITBISValue),a.TaxValue.setProperties(c.TaxValue),a.ReplyPriceTotal.setProperties(c.ReplyPriceTotal),c.NextModelKey&&(a.NextModelInfo=
MathModelReference.factory(c.NextModelKey)));$.modelStorage.add(a);return a};
function BilChapterModel(c){this.init(c);this.ItemCode=MathModelProperty.stringPropertyFactory();this.Description=MathModelProperty.stringPropertyFactory();this.CostPriceTotal=MathModelProperty.decimalPropertyFactory();this.CeilingPriceTotal=MathModelProperty.decimalPropertyFactory();this.SalesPriceTotal=MathModelProperty.decimalPropertyFactory();this.ITBISValue=MathModelProperty.decimalPropertyFactory();this.TaxValue=MathModelProperty.decimalPropertyFactory();this.ReplyPriceTotal=MathModelProperty.decimalPropertyFactory();
BilChapterModel.prototype._loadProperty=function(a,e){a===MathModel.Variables.CostPriceTotal?this.CostPriceTotal.load(e):a===MathModel.Variables.CeilingPriceTotal?this.CeilingPriceTotal.load(e):a===MathModel.Variables.SalesPriceTotal?this.SalesPriceTotal.load(e):a===MathModel.Variables.ITBISValue?this.ITBISValue.load(e):a===MathModel.Variables.TaxValue?this.TaxValue.load(e):a===MathModel.Variables.ReplyPriceTotal?this.ReplyPriceTotal.load(e):a==MathModel.Variables.ItemCode?this.ItemCode.load(e):a==
MathModel.Variables.Description&&this.Description.load(e)};BilChapterModel.prototype.updateCostPriceTotal=function(a){a=this.CostPriceTotal.get(BigDecimal.ZERO).add(a);this.CostPriceTotal.set(a)};BilChapterModel.prototype.updateCeilingPriceTotal=function(a){a=this.CeilingPriceTotal.get(BigDecimal.ZERO).add(a);this.CeilingPriceTotal.set(a)};BilChapterModel.prototype.updateSalesPriceTotal=function(a){a=this.SalesPriceTotal.get(BigDecimal.ZERO).add(a);this.SalesPriceTotal.set(a)};BilChapterModel.prototype.updateITBISValue=
function(a){a=this.ITBISValue.get(BigDecimal.ZERO).add(a);this.ITBISValue.set(a)};BilChapterModel.prototype.updateTaxValue=function(a){a=this.TaxValue.get(BigDecimal.ZERO).add(a);this.TaxValue.set(a)};BilChapterModel.prototype.updateReplyPriceTotal=function(a){a=this.ReplyPriceTotal.get(BigDecimal.ZERO).add(a);this.ReplyPriceTotal.set(a)};BilChapterModel.prototype.add=function(a){this.updateCostPriceTotal(a.CostPriceTotal);this.updateCeilingPriceTotal(a.CeilingPriceTotal);this.updateSalesPriceTotal(a.SalesPriceTotal);
this.updateITBISValue(a.ITBISValue);this.updateTaxValue(a.TaxValue);this.updateReplyPriceTotal(a.ReplyPriceTotal)};BilChapterModel.prototype.subtract=function(a){this.updateCostPriceTotal(a.CostPriceTotal.negate());this.updateCeilingPriceTotal(a.CeilingPriceTotal.negate());this.updateSalesPriceTotal(a.SalesPriceTotal.negate());this.updateITBISValue(a.ITBISValue.negate());this.updateTaxValue(a.TaxValue.negate());this.updateReplyPriceTotal(a.ReplyPriceTotal.negate())};BilChapterModel.prototype.createTotalValues=
function(){return TotalValuesModel.factory({CstPT:this.CostPriceTotal.get(BigDecimal.ZERO),ClnPT:this.CeilingPriceTotal.get(BigDecimal.ZERO),SlsPT:this.SalesPriceTotal.get(BigDecimal.ZERO),ITBISValue:this.ITBISValue.get(BigDecimal.ZERO),TaxValue:this.TaxValue.get(BigDecimal.ZERO),ReplyPriceTotal:this.ReplyPriceTotal.get(BigDecimal.ZERO)})};BilChapterModel.prototype.updateValues=function(a){a&&(this.Info=MathModelReference.factory(a.ModelKey),this.ItemCode.set(a.ItemCode.Value),this.Description.set(a.Description.Value),
this.CostPriceTotal.set(a.CostPriceTotal.Value),this.CeilingPriceTotal.set(a.CeilingPriceTotal.Value),this.SalesPriceTotal.set(a.SalesPriceTotal.Value),this.ITBISValue.set(a.ITBISValue.Value),this.TaxValue.set(a.TaxValue.Value),this.ReplyPriceTotal.set(a.ReplyPriceTotal.Value))}}BilTotalModel.prototype=new MathModel;BilTotalModel.Type="BILTtl";
function BilTotalModel(c){this.init(c);this.CostPriceTotal=MathModelProperty.decimalPropertyFactory();this.CeilingPriceTotal=MathModelProperty.decimalPropertyFactory();this.SalesPriceTotal=MathModelProperty.decimalPropertyFactory();this.ITBISValue=MathModelProperty.decimalPropertyFactory();this.TaxValue=MathModelProperty.decimalPropertyFactory();this.ReplyPriceTotal=MathModelProperty.decimalPropertyFactory();BilTotalModel.prototype._loadProperty=function(a,e){a===MathModel.Variables.CostPriceTotal?
this.CostPriceTotal.load(e):a===MathModel.Variables.CeilingPriceTotal?this.CeilingPriceTotal.load(e):a===MathModel.Variables.SalesPriceTotal?this.SalesPriceTotal.load(e):a===MathModel.Variables.ITBISValue?this.ITBISValue.load(e):a===MathModel.Variables.TaxValue?this.TaxValue.load(e):a===MathModel.Variables.ReplyPriceTotal&&this.ReplyPriceTotal.load(e)};BilTotalModel.prototype.updateCostPriceTotal=function(a){a=this.CostPriceTotal.get(BigDecimal.ZERO).add(a);this.CostPriceTotal.set(a)};BilTotalModel.prototype.updateCeilingPriceTotal=
function(a){a=this.CeilingPriceTotal.get(BigDecimal.ZERO).add(a);this.CeilingPriceTotal.set(a)};BilTotalModel.prototype.updateSalesPriceTotal=function(a){a=this.SalesPriceTotal.get(BigDecimal.ZERO).add(a);this.SalesPriceTotal.set(a)};BilTotalModel.prototype.updateITBISValue=function(a){a=this.ITBISValue.get(BigDecimal.ZERO).add(a);this.ITBISValue.set(a)};BilTotalModel.prototype.updateTaxValue=function(a){a=this.TaxValue.get(BigDecimal.ZERO).add(a);this.TaxValue.set(a)};BilTotalModel.prototype.updateReplyPriceTotal=
function(a){a=this.ReplyPriceTotal.get(BigDecimal.ZERO).add(a);this.ReplyPriceTotal.set(a)};BilTotalModel.prototype.add=function(a){this.updateCostPriceTotal(a.CostPriceTotal);this.updateCeilingPriceTotal(a.CeilingPriceTotal);this.updateSalesPriceTotal(a.SalesPriceTotal);this.updateITBISValue(a.ITBISValue);this.updateTaxValue(a.TaxValue);this.updateReplyPriceTotal(a.ReplyPriceTotal)};BilTotalModel.prototype.subtract=function(a){this.updateCostPriceTotal(a.CostPriceTotal.negate());this.updateCeilingPriceTotal(a.CeilingPriceTotal.negate());
this.updateSalesPriceTotal(a.SalesPriceTotal.negate());this.updateITBISValue(a.ITBISValue.negate());this.updateTaxValue(a.TaxValue.negate());this.updateReplyPriceTotal(a.ReplyPriceTotal.negate())}}BioQuestionModel.prototype=new MathModel;BioQuestionModel.Type="BioQ";
BioQuestionModel.factory=function(c){var a=new BioQuestionModel;c&&(a.TotalValues=TotalValuesModel.factory(c.TotalValues),a.Info=MathModelReference.factory(c.ModelKey),a.NextModelInfo=MathModelReference.factory(c.NextModelKey));$.modelStorage.add(a);return a};BioQuestionModel.removeLots=function(c){var a=$.modelStorage.getByType(BioQuestionModel.Type);if(a)for(var e in a){var b=a[e],d=b.TotalValues.LotCode.get();d!==MathAction.Constants.ALL_LOT_KEY&&$.inArray(d,c)&&b.TotalValues.LotCode.set(MathAction.Constants.ALL_LOT_KEY)}};
function BioQuestionModel(c){this.init(c);this.TotalValues=new TotalValuesModel;BioQuestionModel.prototype.updateCostPriceTotal=function(a){this.TotalValues.updateCostPriceTotal(a)};BioQuestionModel.prototype.updateCeilingPriceTotal=function(a){this.TotalValues.updateCeilingPriceTotal(a)};BioQuestionModel.prototype.updateSalesPriceTotal=function(a){this.TotalValues.updateSalesPriceTotal(a)};BioQuestionModel.prototype.updateITBISValue=function(a){this.TotalValues.updateITBISValue(a)};BioQuestionModel.prototype.updateTaxValue=
function(a){this.TotalValues.updateTaxValue(a)};BioQuestionModel.prototype.updateReplyPriceTotal=function(a){this.TotalValues.updateReplyPriceTotal(a)};BioQuestionModel.prototype.addItemValues=function(a){this.TotalValues.add(a)};BioQuestionModel.prototype.removeItemValues=function(a){this.TotalValues.subtract(a)}}BioSectionModel.prototype=new MathModel;BioSectionModel.Type="BioS";
BioSectionModel.factory=function(c){var a=new BioSectionModel;if(c){a.LotCode.set(c.Lot);if(c.TotalValues)for(var e=0,b=c.TotalValues.length;e<b;e++){var d=TotalValuesModel.factory(c.TotalValues[e]);a.TotalValues[d.LotCode.get()]=d}a.Info=MathModelReference.factory(c.ModelKey);a.NextModelInfo=MathModelReference.factory(c.NextModelKey)}$.modelStorage.add(a);return a};
BioSectionModel.addLot=function(c){var a=$.modelStorage.getByType(BioSectionModel.Type);if(a)for(var e in a)TotalValuesModel.addLot(a[e].TotalValues,c)};BioSectionModel.removeLots=function(c){var a=$.modelStorage.getByType(BioSectionModel.Type);if(a)for(var e in a){var b=a[e],d=b.LotCode.get();TotalValuesModel.removeLots(b.TotalValues,c);d!==MathAction.Constants.ALL_LOT_KEY&&$.inArray(d,c)&&b.LotCode.set(MathAction.Constants.ALL_LOT_KEY)}};
function BioSectionModel(c){this.init(c);this.LotCode=MathModelProperty.stringPropertyFactory();this.TotalValues={};BioSectionModel.prototype.changeLotValues=function(a){var e=this.LotCode.get(),b=this.TotalValues[a];e!==MathAction.Constants.ALL_LOT_KEY&&(e=this.TotalValues[e],e.add(b));a!==MathAction.Constants.ALL_LOT_KEY&&(e=this.TotalValues[a],e.subtract(b))};BioSectionModel.prototype.changeTotalValues=function(a,e){var b={},d=this.TotalValues,c=d[MathAction.Constants.ALL_LOT_KEY];if(e===MathAction.Constants.ALL_LOT_KEY)for(var f in d){if(f!==
MathAction.Constants.ALL_LOT_KEY){var h=d[f],g=h.clone();g.setNegative();h.clearValues();b[f]=g}}else if(a===MathAction.Constants.ALL_LOT_KEY)for(f in d)h=d[f],g=void 0,f===e?(g=c.diff(h),g.LotCode.set(e),h.CostPriceTotal=c.CostPriceTotal,h.CeilingPriceTotal=c.CeilingPriceTotal,h.SalesPriceTotal=c.SalesPriceTotal,h.ReplyPriceTotal=c.ReplyPriceTotal):f!==MathAction.Constants.ALL_LOT_KEY&&(g=h.clone(),g.setNegative(),h.clearValues()),g&&(b[f]=g);else f=d[a],d=d[e],g=f.clone(),g.setNegative(),b[a]=g,
f.clearValues(),d.add(c),g=d.clone(),b[e]=g;return b};BioSectionModel.prototype.changeToLot=function(a){var e=this.LotCode.get(),b=this.TotalValues,d=b[MathAction.Constants.ALL_LOT_KEY];this.LotCode.set(a);if(a===MathAction.Constants.ALL_LOT_KEY)for(var c in b)c!==MathAction.Constants.ALL_LOT_KEY&&b[c].clearValues();else if(e===MathAction.Constants.ALL_LOT_KEY)for(c in b)e=b[c],c===a?(e.CostPriceTotal=d.CostPriceTotal,e.CeilingPriceTotal=d.CeilingPriceTotal,e.SalesPriceTotal=d.SalesPriceTotal,e.ReplyPriceTotal=
d.ReplyPriceTotal):c!==MathAction.Constants.ALL_LOT_KEY&&e.clearValues();else b[e].clearValues(),b[a].add(d)};BioSectionModel.prototype.updateLotValues=function(a,e){var b;b=e.LotCode.get();b!==MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[b],b.add(e));a!==MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[a],b.subtract(e))};BioSectionModel.prototype.updateCostPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateCostPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&
(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateCostPriceTotal(a)))};BioSectionModel.prototype.updateCeilingPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateCeilingPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateCeilingPriceTotal(a)))};BioSectionModel.prototype.updateSalesPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateSalesPriceTotal(a),e!=
MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateSalesPriceTotal(a)))};BioSectionModel.prototype.updateITBISValue=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateITBISValue(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateITBISValue(a)))};BioSectionModel.prototype.updateTaxValue=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateTaxValue(a),e!=
MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateTaxValue(a)))};BioSectionModel.prototype.updateReplyPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateReplyPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateReplyPriceTotal(a)))};BioSectionModel.prototype.addItemValues=function(a){var e,b=a.LotCode.get();void 0!=this.TotalValues&&(e=this.TotalValues[b],
e.add(a),b!=MathAction.Constants.ALL_LOT_KEY&&(e=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],e.add(a)))};BioSectionModel.prototype.addItemTotalValues=function(a){TotalValuesModel.addTotals(this.TotalValues,a)};BioSectionModel.prototype.removeItemValues=function(a){var e,b=a.LotCode.get();void 0!=this.TotalValues&&(e=this.TotalValues[b],e.subtract(a),b!=MathAction.Constants.ALL_LOT_KEY&&(e=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],e.subtract(a)))};BioSectionModel.prototype.removeItemTotalValues=
function(a){TotalValuesModel.subtractTotals(this.TotalValues,a)}}BiocModel.prototype=new MathModel;BiocModel.Type="Bioc";BiocModel.factory=function(c){var a=new BiocModel;if(c){if(c.TotalValues)for(var e=0,b=c.TotalValues.length;e<b;e++){var d=TotalValuesModel.factory(c.TotalValues[e]);a.TotalValues[d.LotCode.get()]=d}a.Info=MathModelReference.factory(c.ModelKey);a.NextModelInfo=MathModelReference.factory(c.NextModelKey)}$.modelStorage.add(a);return a};
BiocModel.addLot=function(c){var a=$.modelStorage.getByType(BiocModel.Type);if(a)for(var e in a)TotalValuesModel.addLot(a[e].TotalValues,c);BioSectionModel.addLot(c)};BiocModel.removeLots=function(c){var a=$.modelStorage.getByType(BiocModel.Type);if(a)for(var e in a)TotalValuesModel.removeLots(a[e].TotalValues,c);BioSectionModel.removeLots(c);BioQuestionModel.removeLots(c)};
function BiocModel(c){this.init(c);this.TotalValues={};BiocModel.prototype.updateCostPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateCostPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateCostPriceTotal(a)))};BiocModel.prototype.updateCeilingPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateCeilingPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],
b.updateCeilingPriceTotal(a)))};BiocModel.prototype.updateSalesPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateSalesPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateSalesPriceTotal(a)))};BiocModel.prototype.updateITBISValue=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateITBISValue(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],
b.updateITBISValue(a)))};BiocModel.prototype.updateTaxValue=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateTaxValue(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateTaxValue(a)))};BiocModel.prototype.updateReplyPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateReplyPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateReplyPriceTotal(a)))};
BiocModel.prototype.updateLotValues=function(a,e){var b;b=e.LotCode.get();b!==MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[b],b.add(e));a!==MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[a],b.subtract(e))};BiocModel.prototype.addItemValues=function(a){var e,b=a.LotCode.get();void 0!=this.TotalValues&&(e=this.TotalValues[b],e.add(a),b!=MathAction.Constants.ALL_LOT_KEY&&(e=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],e.add(a)))};BiocModel.prototype.removeItemValues=function(a){var e,
b=a.LotCode.get();void 0!=this.TotalValues&&(e=this.TotalValues[b],e.subtract(a),b!=MathAction.Constants.ALL_LOT_KEY&&(e=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],e.subtract(a)))};BiocModel.prototype.removeItemTotalValues=function(a){TotalValuesModel.subtractTotals(this.TotalValues,a)};BiocModel.prototype.addItemTotalValues=function(a){TotalValuesModel.addTotals(this.TotalValues,a)}}RequestDataModel.prototype=new MathModel;RequestDataModel.Type="ReqDt";
RequestDataModel.factory=function(c){var a=new RequestDataModel;if(c){if(c.TotalValues)for(var e=0,b=c.TotalValues.length;e<b;e++){var d=TotalValuesModel.factory(c.TotalValues[e]);a.TotalValues[d.LotCode.get()]=d}a.Info=MathModelReference.factory(c.ModelKey);a.NextModelInfo=MathModelReference.factory(c.NextModelKey)}$.modelStorage.add(a);return a};
RequestDataModel.addLot=function(c){var a=$.modelStorage.getByType(RequestDataModel.Type);if(a)for(var e in a)TotalValuesModel.addLot(a[e].TotalValues,c);BiocModel.addLot(c)};RequestDataModel.removeLots=function(c){var a=$.modelStorage.getByType(RequestDataModel.Type);if(a)for(var e in a)TotalValuesModel.removeLots(a[e].TotalValues,c);BiocModel.removeLots(c)};
function RequestDataModel(c){this.init(c);this.TotalValues={};RequestDataModel.prototype.updateCostPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateCostPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateCostPriceTotal(a)))};RequestDataModel.prototype.updateCeilingPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateCeilingPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&
(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateCeilingPriceTotal(a)))};RequestDataModel.prototype.updateSalesPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateSalesPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateSalesPriceTotal(a)))};RequestDataModel.prototype.updateITBISValue=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateITBISValue(a),e!=MathAction.Constants.ALL_LOT_KEY&&
(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateITBISValue(a)))};RequestDataModel.prototype.updateTaxValue=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateTaxValue(a),e!=MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateTaxValue(a)))};RequestDataModel.prototype.updateReplyPriceTotal=function(a,e){var b;void 0!=this.TotalValues&&(b=this.TotalValues[e],b.updateReplyPriceTotal(a),e!=MathAction.Constants.ALL_LOT_KEY&&
(b=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],b.updateReplyPriceTotal(a)))};RequestDataModel.prototype.updateLotValues=function(a,e){var b;b=e.LotCode.get();b!==MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[b],b.add(e));a!==MathAction.Constants.ALL_LOT_KEY&&(b=this.TotalValues[a],b.subtract(e))};RequestDataModel.prototype.addItemValues=function(a){var e,b=a.LotCode.get();void 0!=this.TotalValues&&(e=this.TotalValues[b],e.add(a),b!=MathAction.Constants.ALL_LOT_KEY&&(e=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],
e.add(a)))};RequestDataModel.prototype.removeItemValues=function(a){var e,b=a.LotCode.get();void 0!=this.TotalValues&&(e=this.TotalValues[b],e.subtract(a),b!=MathAction.Constants.ALL_LOT_KEY&&(e=this.TotalValues[MathAction.Constants.ALL_LOT_KEY],e.subtract(a)))};RequestDataModel.prototype.removeItemTotalValues=function(a){TotalValuesModel.subtractTotals(this.TotalValues,a)};RequestDataModel.prototype.addItemTotalValues=function(a){TotalValuesModel.addTotals(this.TotalValues,a)}}
ProcedureRequestModel.prototype=new MathModel;ProcedureRequestModel.Type="PrReq";
ProcedureRequestModel.factory=function(c){var a=new ProcedureRequestModel;if(c&&(a.Info=MathModelReference.factory(c.ModelKey),a.NextModelInfo=MathModelReference.factory(c.NextModelKey),a.BasePrice.setProperties(c.BasePrice),a.DefineBasePrice.setProperties(c.DefineBasePrice),a.DefineLots.setProperties(c.DefineLots),a.DefineLotsBasePrice.setProperties(c.DefineLotsBasePrice),a.UsePriceListValues.setProperties(c.UsePriceListValues),a.LotsBasePrice.setProperties(c.LotsBasePrice),c.Lots))for(var e=0,b=
c.Lots.length;e<b;e++){var d=LotModel.factory(c.Lots[e]);a.Lots.Value[d.Info.ModelId]=d}$.modelStorage.add(a);return a};
function ProcedureRequestModel(c){function a(a,b){var d=a.UsePriceListValues.get(!1),c=a.DefineLots.get(!1),f=a.DefineLotsBasePrice.get(!1);d&&clearViewModelsByName("LotValues");if(c&&f&&a.Lots){var c=BigDecimal.ZERO,h;for(h in a.Lots.get())if(f=a.Lots.get(h))if(d){var g=b.TotalValues[h],c=c.add(g.CeilingPriceTotal);f.BasePrice.set(g.CeilingPriceTotal);f.BasePrice.makeReadOnly()}else f.BasePrice.set(BigDecimal.ZERO),f.BasePrice.removeReadOnly();a.LotsBasePrice.set(c)}}this.init(c);this.BasePrice=
MathModelProperty.decimalPropertyFactory();this.DefineBasePrice=MathModelProperty.booleanPropertyFactory(MathModelProperty.FormatTypes.BooleanRadio);this.DefineLots=MathModelProperty.booleanPropertyFactory(MathModelProperty.FormatTypes.BooleanRadio);this.DefineLotsBasePrice=MathModelProperty.booleanPropertyFactory(MathModelProperty.FormatTypes.BooleanRadio);this.UsePriceListValues=MathModelProperty.booleanPropertyFactory();this.LotsBasePrice=MathModelProperty.decimalPropertyFactory();this.Lots=MathModelProperty.listPropertyFactory();
ProcedureRequestModel.prototype.addLotModel=function(a){var b=a.Info.ModelId;this.Lots.get()[b]=a};ProcedureRequestModel.prototype.removeLots=function(a){for(var b=0,d=a.length;b<d;b++){var c=a[b],f=this.Lots.get(c).BasePrice.get(BigDecimal.ZERO).negate();this.updateBasePrice(f);this.Lots.get()[c]=void 0}};ProcedureRequestModel.prototype.updateBasePrice=function(a){var b=this.DefineBasePrice.get(!1);this.DefineLotsBasePrice.get(!1);this.UsePriceListValues.get(!1);var d;d=this.LotsBasePrice.get(BigDecimal.ZERO);
d=d.add(a);this.LotsBasePrice.set(d);b&&(d=this.BasePrice.get(BigDecimal.ZERO),d=d.add(a),this.BasePrice.set(d))};ProcedureRequestModel.prototype.updateLotBasePrice=function(a,b){if(this.UsePriceListValues.get(!1)){var d=this.BasePrice.get(BigDecimal.ZERO).add(a),c=this.DefineBasePrice.get(!1),f=this.DefineLots.get(!1),h=this.DefineLotsBasePrice.get(!1);f&&h&&b!==MathAction.Constants.ALL_LOT_KEY&&(this.Lots.get(b).updateBasePrice(a),this.LotsBasePrice.set(d));c&&this.BasePrice.set(d)}};ProcedureRequestModel.prototype.updateDefineBasePrice=
function(){var a=this.DefineBasePrice.get(!1),b=this.DefineLotsBasePrice.get(!1);this.UsePriceListValues.get(!1);a&&b&&(a=this.LotsBasePrice.get(BigDecimal.ZERO),this.BasePrice.set(a))};ProcedureRequestModel.prototype.updateDefineLotBasePrice=function(){var e=this.UsePriceListValues.get(!1),b=this.DefineLotsBasePrice.get(!1),d=$.modelStorage.getChildModel(RequestDataModel.Type,this.Info.ModelKey);b?(e?this.BasePrice.set(d.TotalValues[MathAction.Constants.ALL_LOT_KEY].CeilingPriceTotal):(this.LotsBasePrice.set(BigDecimal.ZERO),
this.BasePrice.set(BigDecimal.ZERO)),this.BasePrice.makeReadOnly(),this.BasePrice.removeModelBind(),a(this,d)):e||(this.BasePrice.set(BigDecimal.ZERO),this.BasePrice.removeReadOnly(),this.BasePrice.addModelBind())};ProcedureRequestModel.prototype.updateUsePriceListValues=function(){var e=$.modelStorage.getChildModel(RequestDataModel.Type,this.Info.ModelKey);if(e){a(this,e);var b=this.UsePriceListValues.get(!1),d=this.DefineLotsBasePrice.get(!1);b?(this.BasePrice.set(e.TotalValues[MathAction.Constants.ALL_LOT_KEY].CeilingPriceTotal),
this.BasePrice.makeReadOnly(),this.BasePrice.removeModelBind()):(this.BasePrice.set(BigDecimal.ZERO),d||(this.BasePrice.removeReadOnly(),this.BasePrice.addModelBind()))}};ProcedureRequestModel.prototype.updateLotValues=function(a,b){this.DefineBasePrice.get(!1);var d=this.DefineLots.get(!1),c=this.DefineLotsBasePrice.get(!1),f=this.UsePriceListValues.get(!1),h=b.LotCode.get();f&&d&&c&&(d=b.CeilingPriceTotal,a!==MathAction.Constants.ALL_LOT_KEY&&this.Lots.get(a).addBasePrice(d.negate()),h!==MathAction.Constants.ALL_LOT_KEY&&
this.Lots.get(h).addBasePrice(d))};ProcedureRequestModel.prototype.updateLotTotalValues=function(a){var b=this.DefineBasePrice.get(!1),d=this.DefineLots.get(!1),c=this.DefineLotsBasePrice.get(!1);if(this.UsePriceListValues.get(!1))for(var f in a){var h=a[f].CeilingPriceTotal;f===MathAction.Constants.ALL_LOT_KEY&&b?this.updateBasePrice(h):d&&c&&this.Lots.get(f).addBasePrice(h)}};ProcedureRequestModel.prototype.addItemValues=function(a){var b=this.UsePriceListValues.get(!1),d=a.LotCode.get();a=a.CeilingPriceTotal;
b&&(d!==MathAction.Constants.ALL_LOT_KEY?this.updateLotBasePrice(a,d):this.updateBasePrice(a))};ProcedureRequestModel.prototype.removeItemValues=function(a){var b=this.UsePriceListValues.get(!1),d=a.LotCode.get();a=a.CeilingPriceTotal.negate();b&&(d!==MathAction.Constants.ALL_LOT_KEY?this.updateLotBasePrice(a,d):this.updateBasePrice(a))};ProcedureRequestModel.prototype.removeItemTotalValues=function(a){if(this.UsePriceListValues.get(!1))for(var b in a){var d=a[b].CeilingPriceTotal.negate();this.updateLotBasePrice(d,
b)}};ProcedureRequestModel.prototype.updateValues=function(a){if(a&&(this.BasePrice.set($.bigDecimalFromJSON(a.BasePrice.Value)),this.LotsBasePrice.set($.bigDecimalFromJSON(a.LotsBasePrice.Value)),a.Lots))for(var b=0,d=a.Lots.length;b<d;b++){var c=a.Lots[b],f=this.Lots.get(c.Key);f&&f.BasePrice.set($.bigDecimalFromJSON(c.BasePrice.Value))}}}
function TotalValuesModel(c){this.LotCode=MathModelProperty.stringPropertyFactory();this.ReplyPriceTotal=this.TaxValue=this.ITBISValue=this.SalesPriceTotal=this.CeilingPriceTotal=this.CostPriceTotal=BigDecimal.ZERO;TotalValuesModel.prototype.add=function(a){this.CostPriceTotal=this.CostPriceTotal.add(a.CostPriceTotal);this.CeilingPriceTotal=this.CeilingPriceTotal.add(a.CeilingPriceTotal);this.SalesPriceTotal=this.SalesPriceTotal.add(a.SalesPriceTotal);this.ITBISValue=this.ITBISValue.add(a.ITBISValue);
this.TaxValue=this.TaxValue.add(a.TaxValue);this.ReplyPriceTotal=this.ReplyPriceTotal.add(a.ReplyPriceTotal)};TotalValuesModel.prototype.subtract=function(a){this.CostPriceTotal=this.CostPriceTotal.subtract(a.CostPriceTotal);this.CeilingPriceTotal=this.CeilingPriceTotal.subtract(a.CeilingPriceTotal);this.SalesPriceTotal=this.SalesPriceTotal.subtract(a.SalesPriceTotal);this.ITBISValue=this.ITBISValue.subtract(a.ITBISValue);this.TaxValue=this.TaxValue.subtract(a.TaxValue);this.ReplyPriceTotal=this.ReplyPriceTotal.subtract(a.ReplyPriceTotal)};
TotalValuesModel.prototype.updateCostPriceTotal=function(a){this.CostPriceTotal=this.CostPriceTotal.add(a)};TotalValuesModel.prototype.updateCeilingPriceTotal=function(a){this.CeilingPriceTotal=this.CeilingPriceTotal.add(a)};TotalValuesModel.prototype.updateSalesPriceTotal=function(a){this.SalesPriceTotal=this.SalesPriceTotal.add(a)};TotalValuesModel.prototype.updateITBISValue=function(a){this.ITBISValue=this.ITBISValue.add(a)};TotalValuesModel.prototype.updateTaxValue=function(a){this.TaxValue=this.TaxValue.add(a)};
TotalValuesModel.prototype.updateReplyPriceTotal=function(a){this.ReplyPriceTotal=this.ReplyPriceTotal.add(a)};TotalValuesModel.prototype.clearValues=function(){this.ReplyPriceTotal=this.TaxValue=this.ITBISValue=this.SalesPriceTotal=this.CeilingPriceTotal=this.CostPriceTotal=BigDecimal.ZERO};TotalValuesModel.prototype.diff=function(a){var e;e=this.clone();e.subtract(a);return e};TotalValuesModel.prototype.clone=function(){var a=new TotalValuesModel;a.LotCode.set(this.LotCode.get());a.CostPriceTotal=
this.CostPriceTotal;a.CeilingPriceTotal=this.CeilingPriceTotal;a.SalesPriceTotal=this.SalesPriceTotal;a.ITBISValue=this.ITBISValue;a.TaxValue=this.TaxValue;a.ReplyPriceTotal=this.ReplyPriceTotal;return a};TotalValuesModel.prototype.setNegative=function(){this.CostPriceTotal=this.CostPriceTotal.negate();this.CeilingPriceTotal=this.CeilingPriceTotal.negate();this.SalesPriceTotal=this.SalesPriceTotal.negate();this.ITBISValue=this.ITBISValue.negate();this.TaxValue=this.TaxValue.negate();this.ReplyPriceTotal=
this.ReplyPriceTotal.negate()}}TotalValuesModel.factory=function(c){var a=new TotalValuesModel;c&&(a.LotCode.set(c.Lot),a.CostPriceTotal=$.bigDecimalFromJSON(c.CstPT),a.CeilingPriceTotal=$.bigDecimalFromJSON(c.ClnPT),a.SalesPriceTotal=$.bigDecimalFromJSON(c.SlsPT),a.ITBISValue=$.bigDecimalFromJSON(c.ITBISValue),a.TaxValue=$.bigDecimalFromJSON(c.TaxValue),a.ReplyPriceTotal=$.bigDecimalFromJSON(c.ReplyPriceTotal));return a};
TotalValuesModel.addLot=function(c,a){var e=new TotalValuesModel;e.LotCode.set(a);c[a]=e};TotalValuesModel.removeLots=function(c,a){for(var e=0,b=a.length;e<b;e++)c[a[e]]=void 0};TotalValuesModel.addTotals=function(c,a){if(void 0===c)throw"Argument null exception : totalValues";if(void 0===a)throw"Argument null exception : valuesToAdd";for(var e in a)c[e].add(a[e])};
TotalValuesModel.subtractTotals=function(c,a){if(void 0===c)throw"Argument null exception : totalValues";if(void 0===a)throw"Argument null exception : valuesToRemove";for(var e in a)c[e].subtract(a[e])};LotModel.prototype=new MathModel;LotModel.Type="Lot";
LotModel.factory=function(c){var a=new LotModel;c&&(a.Id=c.Id,a.BasePrice.setProperties(c.BasePrice),a.Key.set(c.Key),a.Info=MathModelReference.factory(c.ModelKey),a.NextModelInfo=MathModelReference.factory(c.NextModelKey));$.modelStorage.add(a);return a};LotModel.getLotKeyFromElement=function(c){c=c.val();return""===c||void 0===c?MathAction.Constants.ALL_LOT_KEY:c.replace(/\./g,"_")};
function LotModel(c){this.init(c);this.BasePrice=MathModelProperty.decimalPropertyFactory();this.Key=MathModelProperty.stringPropertyFactory();LotModel.prototype.addBasePrice=function(a){a=this.BasePrice.get(BigDecimal.ZERO).add(a);this.BasePrice.set(a)};LotModel.prototype.updateBasePrice=function(a){this.addBasePrice(a);this.updateBasePriceViewModel()};LotModel.prototype.updateBasePriceViewModel=function(){updateViewModel("LotValues",null,"DictionaryLotBasePriceValues",this.Key.Value,this.BasePrice.get(BigDecimal.ZERO).toString())}}
BilItemAction.prototype=new MathAction;
function BilItemAction(c){function a(a,b,e){var d=b.updateCostPriceTotal();d&&b.Propagate&&(a=a.createNextAction(MathAction.Types.Update,b))&&(a.MethodKey=MathModel.Variables.CostPriceTotal,a.put(MathModel.Variables.CostPriceTotal,d),e.enqueue(a))}function e(a,b,e){var d=b.updateCeilingPriceTotal();d&&b.Propagate&&(a=a.createNextAction(MathAction.Types.Update,b))&&(a.MethodKey=MathModel.Variables.CeilingPriceTotal,a.put(MathModel.Variables.CeilingPriceTotal,d),e.enqueue(a))}function b(a,b,e){var d=
b.updateSalesPriceTotal(),c;d&&b.Propagate&&c&&(c=a.createNextAction(MathAction.Types.Update,b),c.MethodKey=MathModel.Variables.SalesPriceTotal,c.put(MathModel.Variables.SalesPriceTotal,d),e.enqueue(c))}function d(a,b,e){var d=b.updateITBISValue();d&&b.Propagate&&(a=a.createNextAction(MathAction.Types.Update,b))&&(a.MethodKey=MathModel.Variables.ITBISValue,a.put(MathModel.Variables.ITBISValue,d),e.enqueue(a))}function k(a,b,e){var d=b.updateTaxValue();d&&b.Propagate&&(a=a.createNextAction(MathAction.Types.Update,
b))&&(a.MethodKey=MathModel.Variables.TaxValue,a.put(MathModel.Variables.TaxValue,d),e.enqueue(a))}function f(a,b,e){var d=b.updateReplyPriceTotal();d&&b.Propagate&&(a=a.createNextAction(MathAction.Types.Update,b))&&(a.MethodKey=MathModel.Variables.ReplyPriceTotal,a.put(MathModel.Variables.ReplyPriceTotal,d),e.enqueue(a))}this.init(c);BilItemAction.prototype.itemCodeChanged=function(a,b){a.ItemCode.load(this.ViewElement)};BilItemAction.prototype.reqRefChanged=function(a,b){a.ReqRef.load(this.ViewElement)};
BilItemAction.prototype.descriptionChanged=function(a,b){a.Description.load(this.ViewElement)};BilItemAction.prototype.unitChanged=function(a,b){a.Unit.load(this.ViewElement)};BilItemAction.prototype.quantityChanged=function(c,g){c.Quantity.load(this.ViewElement);a(this,c,g);e(this,c,g);b(this,c,g);d(this,c,g);k(this,c,g);f(this,c,g)};BilItemAction.prototype.costPriceChanged=function(b,e){b.CostPrice.load(this.ViewElement);a(this,b,e)};BilItemAction.prototype.ceilingPriceChanged=function(a,b){a.CeilingPrice.load(this.ViewElement);
e(this,a,b);d(this,a,b);k(this,a,b);f(this,a,b)};BilItemAction.prototype.salesPriceChanged=function(a,e){a.SalesPrice.load(this.ViewElement);b(this,a,e)};BilItemAction.prototype.itbisChanged=function(a,b){a.ITBIS.load(this.ViewElement);d(this,a,b);f(this,a,b)};BilItemAction.prototype.taxChanged=function(a,b){a.Tax.load(this.ViewElement);k(this,a,b);f(this,a,b)};BilItemAction.prototype.montoGrabadoChanged=function(a,b){a.MontoGrabado.load(this.ViewElement);d(this,a,b);f(this,a,b)};BilItemAction.prototype.addItem=
function(a,b){var e=a.createTotalValues(),d=this.createNextAction(MathAction.Types.Add,a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,e);b.enqueue(d)};BilItemAction.prototype.removeItem=function(a,b){var e=a.createTotalValues(),d=this.createNextAction(MathAction.Types.Remove,a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,e);b.enqueue(d);a.Propagate=!1};BilItemAction.prototype.updateModel=function(a,b){var e=this.get(MathModel.Variables.JsonModel),
d=this.createNextAction(MathAction.Types.Add,a),c;c=a.createTotalValues();a.updateValues(e);e=a.createTotalValues().diff(c);d&&(d.MethodKey=MathModel.Variables.ItemValues,d.put(MathModel.Variables.ItemValues,e),b.enqueue(d))};BilItemAction.prototype.createNextAction=function(a,b){var e=b.NextModelInfo;if(e&&e.Type===BilChapterModel.Type)return new BilChapterAction({Type:a,ModelRef:e});if(e&&e.Type===BilTotalModel.Type)return new BilTotalAction({Type:a,ModelRef:e})};BilItemAction.prototype.getAddAction=
function(){return this.addItem};BilItemAction.prototype.getUpdateAction=function(){if(this.MethodKey===MathModel.Variables.Model)return this.updateModel};BilItemAction.prototype.getChangeAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.Quantity)return this.quantityChanged;if(a===MathModel.Variables.CostPrice)return this.costPriceChanged;if(a===MathModel.Variables.CeilingPrice)return this.ceilingPriceChanged;if(a===MathModel.Variables.SalesPrice)return this.salesPriceChanged;if(a===
MathModel.Variables.ITBIS)return this.itbisChanged;if(a===MathModel.Variables.Tax)return this.taxChanged;if(a===MathModel.Variables.MontoGrabado)return this.montoGrabadoChanged;if(a==MathModel.Variables.ItemCode)return this.itemCodeChanged;if(a==MathModel.Variables.ReqRef)return this.reqRefChanged;if(a==MathModel.Variables.Description)return this.descriptionChanged;if(a==MathModel.Variables.Unit)return this.unitChanged};BilItemAction.prototype.getRemoveAction=function(){return this.removeItem}}
BilChapterAction.prototype=new MathAction;
function BilChapterAction(c){this.init(c);BilChapterAction.prototype.itemCodeChanged=function(a,e){a.ItemCode.load(this.ViewElement)};BilChapterAction.prototype.descriptionChanged=function(a,e){a.Description.load(this.ViewElement)};BilChapterAction.prototype.updateCostPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CostPriceTotal),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.CostPriceTotal;d.put(MathModel.Variables.CostPriceTotal,b);a.updateCostPriceTotal(b);
e.enqueue(d)};BilChapterAction.prototype.updateCeilingPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CeilingPriceTotal),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.CeilingPriceTotal;d.put(MathModel.Variables.CeilingPriceTotal,b);a.updateCeilingPriceTotal(b);e.enqueue(d)};BilChapterAction.prototype.updateSalesPriceTotal=function(a,e){var b=this.get(MathModel.Variables.SalesPriceTotal),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=
MathModel.Variables.SalesPriceTotal;d.put(MathModel.Variables.SalesPriceTotal,b);a.updateSalesPriceTotal(b);e.enqueue(d)};BilChapterAction.prototype.updateITBISValue=function(a,e){var b=this.get(MathModel.Variables.ITBISValue),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.ITBISValue;d.put(MathModel.Variables.ITBISValue,b);a.updateITBISValue(b);e.enqueue(d)};BilChapterAction.prototype.updateTaxValue=function(a,e){var b=this.get(MathModel.Variables.TaxValue),d=this.createNextAction(MathAction.Types.Update,
a);d.MethodKey=MathModel.Variables.TaxValue;d.put(MathModel.Variables.TaxValue,b);a.updateTaxValue(b);e.enqueue(d)};BilChapterAction.prototype.updateReplyPriceTotal=function(a,e){var b=this.get(MathModel.Variables.ReplyPriceTotal),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.ReplyPriceTotal;d.put(MathModel.Variables.ReplyPriceTotal,b);a.updateReplyPriceTotal(b);e.enqueue(d)};BilChapterAction.prototype.addItemValues=function(a,e){var b=this.get(MathModel.Variables.ItemValues),
d=this.createNextAction(MathAction.Types.Add,a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,b);a.add(b);e.enqueue(d)};BilChapterAction.prototype.removeItem=function(a,e){var b=a.createTotalValues(),d=this.createNextAction(MathAction.Types.Remove,a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,b);e.enqueue(d)};BilChapterAction.prototype.removeItemValues=function(a,e){var b=this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Remove,
a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,b);a.subtract(b);e.enqueue(d)};BilChapterAction.prototype.updateModel=function(a,e){var b=this.get(MathModel.Variables.JsonModel),d=this.createNextAction(MathAction.Types.Add,a),c;c=a.createTotalValues();a.updateValues(b);b=a.createTotalValues().diff(c);d&&(d.MethodKey=MathModel.Variables.ItemValues,d.put(MathModel.Variables.ItemValues,b),e.enqueue(d))};BilChapterAction.prototype.createNextAction=function(a,e){var b=
e.NextModelInfo;if(b&&b.Type===BilChapterModel.Type)return new BilChapterAction({Type:a,ModelRef:b});if(b&&b.Type===BilTotalModel.Type)return new BilTotalAction({Type:a,ModelRef:b})};BilChapterAction.prototype.getAddAction=function(){if(this.MethodKey===MathModel.Variables.ItemValues)return this.addItemValues};BilChapterAction.prototype.getChangeAction=function(){var a=this.MethodKey;if(a==MathModel.Variables.ItemCode)return this.itemCodeChanged;if(a==MathModel.Variables.Description)return this.descriptionChanged};
BilChapterAction.prototype.getUpdateAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.CostPriceTotals)return this.updateCostPriceTotal;if(a===MathModel.Variables.CeilingPriceTotal)return this.updateCeilingPriceTotal;if(a===MathModel.Variables.SalesPriceTotal)return this.updateSalesPriceTotal;if(a===MathModel.Variables.ITBISValue)return this.updateITBISValue;if(a===MathModel.Variables.TaxValue)return this.updateTaxValue;if(a===MathModel.Variables.ReplyPriceTotal)return this.updateReplyPriceTotal;
if(a===MathModel.Variables.Model)return this.updateModel};BilChapterAction.prototype.getRemoveAction=function(){return this.MethodKey===MathModel.Variables.ItemValues?this.removeItemValues:this.removeItem}}BilTotalAction.prototype=new MathAction;
function BilTotalAction(c){this.init(c);BilTotalAction.prototype.updateCostPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CostPriceTotal),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.CostPriceTotal;d.put(MathModel.Variables.CostPriceTotal,b);a.updateCostPriceTotal(b);e.enqueue(d)};BilTotalAction.prototype.updateCeilingPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CeilingPriceTotal),d=this.createNextAction(MathAction.Types.Update,a);
d.MethodKey=MathModel.Variables.CeilingPriceTotal;d.put(MathModel.Variables.CeilingPriceTotal,b);a.updateCeilingPriceTotal(b);e.enqueue(d)};BilTotalAction.prototype.updateSalesPriceTotal=function(a,e){var b=this.get(MathModel.Variables.SalesPriceTotal),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.SalesPriceTotal;d.put(MathModel.Variables.SalesPriceTotal,b);a.updateSalesPriceTotal(b);e.enqueue(d)};BilTotalAction.prototype.updateITBISValue=function(a,e){var b=this.get(MathModel.Variables.ITBISValue),
d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.ITBISValue;d.put(MathModel.Variables.ITBISValue,b);a.updateITBISValue(b);e.enqueue(d)};BilTotalAction.prototype.updateTaxValue=function(a,e){var b=this.get(MathModel.Variables.TaxValue),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.TaxValue;d.put(MathModel.Variables.TaxValue,b);a.updateTaxValue(b);e.enqueue(d)};BilTotalAction.prototype.updateReplyPriceTotal=function(a,e){var b=this.get(MathModel.Variables.ReplyPriceTotal),
d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.ReplyPriceTotal;d.put(MathModel.Variables.ReplyPriceTotal,b);a.updateReplyPriceTotal(b);e.enqueue(d)};BilTotalAction.prototype.addItemValues=function(a,e){var b=this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Add,a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,b);a.add(b);e.enqueue(d)};BilTotalAction.prototype.removeItemValues=function(a,e){var b=
this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Remove,a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,b);a.subtract(b);e.enqueue(d)};BilTotalAction.prototype.createNextAction=function(a,e){var b=e.NextModelInfo;if(b&&b.Type===BioQuestionModel.Type)return new BioQuestionAction({Type:a,ModelRef:b})};BilTotalAction.prototype.getAddAction=function(){if(this.MethodKey===MathModel.Variables.ItemValues)return this.addItemValues};BilTotalAction.prototype.getUpdateAction=
function(){var a=this.MethodKey;if(a===MathModel.Variables.CostPriceTotal)return this.updateCostPriceTotal;if(a===MathModel.Variables.CeilingPriceTotal)return this.updateCeilingPriceTotal;if(a===MathModel.Variables.SalesPriceTotal)return this.updateSalesPriceTotal;if(a===MathModel.Variables.ITBISValue)return this.updateITBISValue;if(a===MathModel.Variables.TaxValue)return this.updateTaxValue;if(a===MathModel.Variables.ReplyPriceTotal)return this.updateReplyPriceTotal};BilTotalAction.prototype.getRemoveAction=
function(){if(this.MethodKey===MathModel.Variables.ItemValues)return this.removeItemValues}}BioQuestionAction.prototype=new MathAction;
function BioQuestionAction(c){this.init(c);BioQuestionAction.prototype.lotCodeChanged=function(a,e){var b=a.TotalValues.LotCode.get(),d=this.createNextAction(MathAction.Types.Update,a),c=LotModel.getLotKeyFromElement(this.ViewElement);a.TotalValues.LotCode.set(c);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.LotCode,b);d.put(MathModel.Variables.ItemValues,a.TotalValues);e.enqueue(d)};BioQuestionAction.prototype.updateCostPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CostPriceTotal),
d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.CostPriceTotal;d.put(MathModel.Variables.CostPriceTotal,b);d.put(MathModel.Variables.LotCode,a.TotalValues.LotCode.get());a.updateCostPriceTotal(b);e.enqueue(d)};BioQuestionAction.prototype.updateCeilingPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CeilingPriceTotal),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.CeilingPriceTotal;d.put(MathModel.Variables.CeilingPriceTotal,
b);d.put(MathModel.Variables.LotCode,a.TotalValues.LotCode.get());a.updateCeilingPriceTotal(b);e.enqueue(d)};BioQuestionAction.prototype.updateSalesPriceTotal=function(a,e){var b=this.get(MathModel.Variables.SalesPriceTotal),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.SalesPriceTotal;d.put(MathModel.Variables.SalesPriceTotal,b);d.put(MathModel.Variables.LotCode,a.TotalValues.LotCode.get());a.updateSalesPriceTotal(b);e.enqueue(d)};BioQuestionAction.prototype.updateITBISValue=
function(a,e){var b=this.get(MathModel.Variables.ITBISValue),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.ITBISValue;d.put(MathModel.Variables.ITBISValue,b);d.put(MathModel.Variables.LotCode,a.TotalValues.LotCode.get());a.updateITBISValue(b);e.enqueue(d)};BioQuestionAction.prototype.updateTaxValue=function(a,e){var b=this.get(MathModel.Variables.TaxValue),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.TaxValue;d.put(MathModel.Variables.TaxValue,
b);d.put(MathModel.Variables.LotCode,a.TotalValues.LotCode.get());a.updateTaxValue(b);e.enqueue(d)};BioQuestionAction.prototype.updateReplyPriceTotal=function(a,e){var b=this.get(MathModel.Variables.ReplyPriceTotal),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.ReplyPriceTotal;d.put(MathModel.Variables.ReplyPriceTotal,b);d.put(MathModel.Variables.LotCode,a.TotalValues.LotCode.get());a.updateReplyPriceTotal(b);e.enqueue(d)};BioQuestionAction.prototype.addItem=function(a,
e){var b=a.TotalValues,d=this.createNextAction(MathAction.Types.Add,a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,b);e.enqueue(d)};BioQuestionAction.prototype.addItemValues=function(a,e){var b=this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Add,a);b.LotCode.set(a.TotalValues.LotCode.get());d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,b);a.addItemValues(b);e.enqueue(d)};BioQuestionAction.prototype.removeItem=
function(a,e){var b=a.TotalValues,d=this.createNextAction(MathAction.Types.Remove,a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,b);e.enqueue(d)};BioQuestionAction.prototype.removeItemValues=function(a,e){var b=this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Remove,a);b.LotCode.set(a.TotalValues.LotCode.get());d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,b);a.removeItemValues(b);e.enqueue(d)};
BioQuestionAction.prototype.updateModel=function(a,e){var b=this.createNextAction(MathAction.Types.Add,a),d=this.get(MathModel.Variables.JsonModel),c;c=a.TotalValues;if(d=totalsDiff=TotalValuesModel.factory(d.TotalValues).diff(c))b.MethodKey=MathModel.Variables.ItemValues,b.put(MathModel.Variables.ItemValues,d),e.enqueue(b)};BioQuestionAction.prototype.createNextAction=function(a,e){var b=e.NextModelInfo;if(b&&b.Type===BioSectionModel.Type)return new BioSectionAction({Type:a,ModelRef:b});if(b&&b.Type===
BiocModel.Type)return new BiocAction({Type:a,ModelRef:b})};BioQuestionAction.prototype.getAddAction=function(){return this.MethodKey===MathModel.Variables.ItemValues?this.addItemValues:this.addItem};BioQuestionAction.prototype.getChangeAction=function(){if(this.MethodKey===MathModel.Variables.LotCode)return this.lotCodeChanged};BioQuestionAction.prototype.getUpdateAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.CostPriceTotal)return this.updateCostPriceTotal;if(a===MathModel.Variables.CeilingPriceTotal)return this.updateCeilingPriceTotal;
if(a===MathModel.Variables.SalesPriceTotal)return this.updateSalesPriceTotal;if(a===MathModel.Variables.ITBISValue)return this.updateITBISValue;if(a===MathModel.Variables.TaxValue)return this.updateTaxValue;if(a===MathModel.Variables.ReplyPriceTotal)return this.updateReplyPriceTotal;if(a===MathModel.Variables.Model)return this.updateModel};BioQuestionAction.prototype.getRemoveAction=function(){return this.MethodKey===MathModel.Variables.ItemValues?this.removeItemValues:this.removeItem}}
BioSectionAction.prototype=new MathAction;
function BioSectionAction(c){function a(e,b){if(b.Sections)for(var d in b.Sections){var c=b.Sections[d];c.NextModelInfo&&c.NextModelInfo.ModelKey===e&&(c.changeToLot(b.LotCode),a(c.Info.ModelKey,b))}if(b.Questions)for(var f in b.Questions)c=b.Questions[f],c.NextModelInfo&&c.NextModelInfo.ModelKey===e&&c.TotalValues.LotCode.set(b.LotCode)}this.init(c);BioSectionAction.prototype.lotCodeChanged=function(e,b){var d=e.LotCode.get(),c=LotModel.getLotKeyFromElement(this.ViewElement),f=this.createNextAction(MathAction.Types.Update,
e);e.LotCode.set(c);d=e.changeTotalValues(d,c);c={LotCode:e.LotCode.get(),Sections:$.modelStorage.getByType(BioSectionModel.Type),Questions:$.modelStorage.getByType(BioQuestionModel.Type)};(c.Sections||c.Questions)&&a(e.Info.ModelKey,c);f.MethodKey=MathModel.Variables.ItemTotalValues;f.put(MathModel.Variables.ItemTotalValues,d);b.enqueue(f)};BioSectionAction.prototype.updateCostPriceTotal=function(a,b){var d=this.get(MathModel.Variables.CostPriceTotal),c=this.get(MathModel.Variables.LotCode),f=this.createNextAction(MathAction.Types.Update,
a);f.MethodKey=MathModel.Variables.CostPriceTotal;f.put(MathModel.Variables.CostPriceTotal,d);f.put(MathModel.Variables.LotCode,c);a.updateCostPriceTotal(d,c);b.enqueue(f)};BioSectionAction.prototype.updateCeilingPriceTotal=function(a,b){var d=this.get(MathModel.Variables.CeilingPriceTotal),c=this.get(MathModel.Variables.LotCode),f=this.createNextAction(MathAction.Types.Update,a);f.MethodKey=MathModel.Variables.CeilingPriceTotal;f.put(MathModel.Variables.CeilingPriceTotal,d);f.put(MathModel.Variables.LotCode,
c);a.updateCeilingPriceTotal(d,c);b.enqueue(f)};BioSectionAction.prototype.updateSalesPriceTotal=function(a,b){var d=this.get(MathModel.Variables.SalesPriceTotal),c=this.get(MathModel.Variables.LotCode),f=this.createNextAction(MathAction.Types.Update,a);f.MethodKey=MathModel.Variables.SalesPriceTotal;f.put(MathModel.Variables.SalesPriceTotal,d);f.put(MathModel.Variables.LotCode,c);a.updateSalesPriceTotal(d,c);b.enqueue(f)};BioSectionAction.prototype.updateITBISValue=function(a,b){var d=this.get(MathModel.Variables.ITBISValue),
c=this.get(MathModel.Variables.LotCode),f=this.createNextAction(MathAction.Types.Update,a);f.MethodKey=MathModel.Variables.ITBISValue;f.put(MathModel.Variables.ITBISValue,d);f.put(MathModel.Variables.LotCode,c);a.updateITBISValue(d,c);b.enqueue(f)};BioSectionAction.prototype.updateTaxValue=function(a,b){var d=this.get(MathModel.Variables.TaxValue),c=this.get(MathModel.Variables.LotCode),f=this.createNextAction(MathAction.Types.Update,a);f.MethodKey=MathModel.Variables.TaxValue;f.put(MathModel.Variables.TaxValue,
d);f.put(MathModel.Variables.LotCode,c);a.updateTaxValue(d,c);b.enqueue(f)};BioSectionAction.prototype.updateReplyPriceTotal=function(a,b){var d=this.get(MathModel.Variables.ReplyPriceTotal),c=this.get(MathModel.Variables.LotCode),f=this.createNextAction(MathAction.Types.Update,a);f.MethodKey=MathModel.Variables.ReplyPriceTotal;f.put(MathModel.Variables.ReplyPriceTotal,d);f.put(MathModel.Variables.LotCode,c);a.updateReplyPriceTotal(d,c);b.enqueue(f)};BioSectionAction.prototype.updateTotalValue=function(a,
b){var d=this.get(MathModel.Variables.ItemValues),c=this.get(MathModel.Variables.LotCode),f=this.createNextAction(MathAction.Types.Update,a);f.MethodKey=MathModel.Variables.ItemValues;f.put(MathModel.Variables.LotCode,c);f.put(MathModel.Variables.ItemValues,d);a.updateLotValues(c,d);b.enqueue(f)};BioSectionAction.prototype.updateTotalValues=function(a,b){var d=this.get(MathModel.Variables.ItemTotalValues),c=this.createNextAction(MathAction.Types.Update,a);c.MethodKey=MathModel.Variables.ItemTotalValues;
c.put(MathModel.Variables.ItemTotalValues,d);a.addItemTotalValues(d);b.enqueue(c)};BioSectionAction.prototype.addItemValues=function(a,b){var d=this.get(MathModel.Variables.ItemValues),c=this.createNextAction(MathAction.Types.Add,a);c.MethodKey=MathModel.Variables.ItemValues;c.put(MathModel.Variables.ItemValues,d);a.addItemValues(d);b.enqueue(c)};BioSectionAction.prototype.addItem=function(a,b){var d=a.TotalValues,c=this.createNextAction(MathAction.Types.Update,a);c.MethodKey=MathModel.Variables.ItemTotalValues;
c.put(MathModel.Variables.ItemTotalValues,d);b.enqueue(c)};BioSectionAction.prototype.removeItem=function(a,b){var d=a.TotalValues,c=this.createNextAction(MathAction.Types.Remove,a);c.MethodKey=MathModel.Variables.ItemTotalValues;c.put(MathModel.Variables.ItemTotalValues,d);b.enqueue(c)};BioSectionAction.prototype.removeItemValues=function(a,b){var d=this.get(MathModel.Variables.ItemValues),c=this.createNextAction(MathAction.Types.Remove,a);c.MethodKey=MathModel.Variables.ItemValues;c.put(MathModel.Variables.ItemValues,
d);a.removeItemValues(d);b.enqueue(c)};BioSectionAction.prototype.removeItemTotalValues=function(a,b){var d=this.get(MathModel.Variables.ItemTotalValues),c=this.createNextAction(MathAction.Types.Remove,a);c.MethodKey=MathModel.Variables.ItemTotalValues;c.put(MathModel.Variables.ItemTotalValues,d);a.removeItemTotalValues(d);b.enqueue(c)};BioSectionAction.prototype.createNextAction=function(a,b){var d=b.NextModelInfo;if(d&&d.Type===BioSectionModel.Type)return new BioSectionAction({Type:a,ModelRef:d});
if(d&&d.Type===BiocModel.Type)return new BiocAction({Type:a,ModelRef:d})};BioSectionAction.prototype.getChangeAction=function(){if(this.MethodKey===MathModel.Variables.LotCode)return this.lotCodeChanged};BioSectionAction.prototype.getAddAction=function(){return this.MethodKey===MathModel.Variables.ItemValues?this.addItemValues:this.addItem};BioSectionAction.prototype.getUpdateAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.CostPriceTotal)return this.updateCostPriceTotal;if(a===MathModel.Variables.CeilingPriceTotal)return this.updateCeilingPriceTotal;
if(a===MathModel.Variables.SalesPriceTotal)return this.updateSalesPriceTotal;if(a===MathModel.Variables.ITBISValue)return this.updateITBISValue;if(a===MathModel.Variables.TaxValue)return this.updateTaxValue;if(a===MathModel.Variables.ReplyPriceTotal)return this.updateReplyPriceTotal;if(a===MathModel.Variables.ItemValues)return this.updateTotalValue;if(a===MathModel.Variables.ItemTotalValues)return this.updateTotalValues};BioSectionAction.prototype.getRemoveAction=function(){var a=this.MethodKey;return a===
MathModel.Variables.ItemValues?this.removeItemValues:a===MathModel.Variables.ItemTotalValues?this.removeItemTotalValues:this.removeItem}}BiocAction.prototype=new MathAction;
function BiocAction(c){this.init(c);BiocAction.prototype.updateCostPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CostPriceTotal),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);c.MethodKey=MathModel.Variables.CostPriceTotal;c.put(MathModel.Variables.CostPriceTotal,b);c.put(MathModel.Variables.LotCode,d);a.updateCostPriceTotal(b,d);e.enqueue(c)};BiocAction.prototype.updateCeilingPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CeilingPriceTotal),
d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);c.MethodKey=MathModel.Variables.CeilingPriceTotal;c.put(MathModel.Variables.CeilingPriceTotal,b);c.put(MathModel.Variables.LotCode,d);a.updateCeilingPriceTotal(b,d);e.enqueue(c)};BiocAction.prototype.updateSalesPriceTotal=function(a,e){var b=this.get(MathModel.Variables.SalesPriceTotal),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);c.MethodKey=MathModel.Variables.SalesPriceTotal;
c.put(MathModel.Variables.SalesPriceTotal,b);c.put(MathModel.Variables.LotCode,d);a.updateSalesPriceTotal(b,d);e.enqueue(c)};BiocAction.prototype.updateITBISValue=function(a,e){var b=this.get(MathModel.Variables.ITBISValue),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);c.MethodKey=MathModel.Variables.ITBISValue;c.put(MathModel.Variables.ITBISValue,b);c.put(MathModel.Variables.LotCode,d);a.updateITBISValue(b,d);e.enqueue(c)};BiocAction.prototype.updateTaxValue=
function(a,e){var b=this.get(MathModel.Variables.TaxValue),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);c.MethodKey=MathModel.Variables.TaxValue;c.put(MathModel.Variables.TaxValue,b);c.put(MathModel.Variables.LotCode,d);a.updateTaxValue(b,d);e.enqueue(c)};BiocAction.prototype.updateReplyPriceTotal=function(a,e){var b=this.get(MathModel.Variables.ReplyPriceTotal),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);
c.MethodKey=MathModel.Variables.ReplyPriceTotal;c.put(MathModel.Variables.ReplyPriceTotal,b);c.put(MathModel.Variables.LotCode,d);a.updateReplyPriceTotal(b,d);e.enqueue(c)};BiocAction.prototype.updateTotalValue=function(a,e){var b=this.get(MathModel.Variables.ItemValues),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);c.MethodKey=MathModel.Variables.ItemValues;c.put(MathModel.Variables.LotCode,d);c.put(MathModel.Variables.ItemValues,b);a.updateLotValues(d,
b);e.enqueue(c)};BiocAction.prototype.updateTotalValues=function(a,e){var b=this.get(MathModel.Variables.ItemTotalValues),d=this.createNextAction(MathAction.Types.Update,a);d.MethodKey=MathModel.Variables.ItemTotalValues;d.put(MathModel.Variables.ItemTotalValues,b);a.addItemTotalValues(b);e.enqueue(d)};BiocAction.prototype.addItemValues=function(a,e){var b=this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Add,a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,
b);a.addItemValues(b);e.enqueue(d)};BiocAction.prototype.removeItemValues=function(a,e){var b=this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Remove,a);d.MethodKey=MathModel.Variables.ItemValues;d.put(MathModel.Variables.ItemValues,b);a.removeItemValues(b);e.enqueue(d)};BiocAction.prototype.removeItemTotalValues=function(a,e){var b=this.get(MathModel.Variables.ItemTotalValues),d=this.createNextAction(MathAction.Types.Remove,a);d.MethodKey=MathModel.Variables.ItemTotalValues;
d.put(MathModel.Variables.ItemTotalValues,b);a.removeItemTotalValues(b);e.enqueue(d)};BiocAction.prototype.createNextAction=function(a,e){var b=e.NextModelInfo;if(b&&b.Type===RequestDataModel.Type)return new RequestDataAction({Type:a,ModelRef:b})};BiocAction.prototype.getAddAction=function(){if(this.MethodKey===MathModel.Variables.ItemValues)return this.addItemValues};BiocAction.prototype.getUpdateAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.CostPriceTotal)return this.updateCostPriceTotal;
if(a===MathModel.Variables.CeilingPriceTotal)return this.updateCeilingPriceTotal;if(a===MathModel.Variables.SalesPriceTotal)return this.updateSalesPriceTotal;if(a===MathModel.Variables.ITBISValue)return this.updateITBISValue;if(a===MathModel.Variables.TaxValue)return this.updateTaxValue;if(a===MathModel.Variables.ReplyPriceTotal)return this.updateReplyPriceTotal;if(a===MathModel.Variables.ItemValues)return this.updateTotalValue;if(a===MathModel.Variables.ItemTotalValues)return this.updateTotalValues};
BiocAction.prototype.getRemoveAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.ItemValues)return this.removeItemValues;if(a===MathModel.Variables.ItemTotalValues)return this.removeItemTotalValues}}RequestDataAction.prototype=new MathAction;
function RequestDataAction(c){this.init(c);RequestDataAction.prototype.updateCostPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CostPriceTotal);valueLotCode=this.get(MathModel.Variables.LotCode);a.updateCostPriceTotal(b,valueLotCode)};RequestDataAction.prototype.updateCeilingPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CeilingPriceTotal),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);a.updateCeilingPriceTotal(b,d);c&&(c.MethodKey=
MathModel.Variables.CeilingPriceTotal,c.put(MathModel.Variables.LotCode,d),c.put(MathModel.Variables.CeilingPriceTotal,b),e.enqueue(c))};RequestDataAction.prototype.updateSalesPriceTotal=function(a,e){var b=this.get(MathModel.Variables.SalesPriceTotal),d=this.get(MathModel.Variables.LotCode);a.updateSalesPriceTotal(b,d)};RequestDataAction.prototype.updateITBISValue=function(a,e){var b=this.get(MathModel.Variables.ITBISValue),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,
a);a.updateITBISValue(b,d);c&&(c.MethodKey=MathModel.Variables.ITBISValue,c.put(MathModel.Variables.LotCode,d),c.put(MathModel.Variables.ITBISValue,b),e.enqueue(c))};RequestDataAction.prototype.updateTaxValue=function(a,e){var b=this.get(MathModel.Variables.TaxValue),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);a.updateTaxValue(b,d);c&&(c.MethodKey=MathModel.Variables.TaxValue,c.put(MathModel.Variables.LotCode,d),c.put(MathModel.Variables.TaxValue,b),
e.enqueue(c))};RequestDataAction.prototype.updateReplyPriceTotal=function(a,e){var b=this.get(MathModel.Variables.ReplyPriceTotal),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);a.updateReplyPriceTotal(b,d);c&&(c.MethodKey=MathModel.Variables.ReplyPriceTotal,c.put(MathModel.Variables.LotCode,d),c.put(MathModel.Variables.ReplyPriceTotal,b),e.enqueue(c))};RequestDataAction.prototype.updateTotalValue=function(a,e){var b=this.get(MathModel.Variables.ItemValues),
d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);a.updateLotValues(d,b);c&&(c.MethodKey=MathModel.Variables.ItemValues,c.put(MathModel.Variables.LotCode,d),c.put(MathModel.Variables.ItemValues,b),e.enqueue(c))};RequestDataAction.prototype.updateTotalValues=function(a,e){var b=this.get(MathModel.Variables.ItemTotalValues),d=this.createNextAction(MathAction.Types.Update,a);a.addItemTotalValues(b);d&&(d.MethodKey=MathModel.Variables.ItemTotalValues,d.put(MathModel.Variables.ItemTotalValues,
b),e.enqueue(d))};RequestDataAction.prototype.addItemValues=function(a,e){var b=this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Add,a);a.addItemValues(b);d&&(d.MethodKey=MathModel.Variables.ItemValues,d.put(MathModel.Variables.ItemValues,b),e.enqueue(d))};RequestDataAction.prototype.removeItemValues=function(a,e){var b=this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Remove,a);a.removeItemValues(b);d&&(d.MethodKey=MathModel.Variables.ItemValues,
d.put(MathModel.Variables.ItemValues,b),e.enqueue(d))};RequestDataAction.prototype.removeItemTotalValues=function(a,e){var b=this.get(MathModel.Variables.ItemTotalValues),d=this.createNextAction(MathAction.Types.Remove,a);a.removeItemTotalValues(b);d&&(d.MethodKey=MathModel.Variables.ItemTotalValues,d.put(MathModel.Variables.ItemTotalValues,b),e.enqueue(d))};RequestDataAction.prototype.createNextAction=function(a,e){var b=e.NextModelInfo;if(b&&b.Type===ProcedureRequestModel.Type)return new ProcedureRequestAction({Type:a,
ModelRef:b})};RequestDataAction.prototype.getAddAction=function(){if(this.MethodKey===MathModel.Variables.ItemValues)return this.addItemValues};RequestDataAction.prototype.getUpdateAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.CostPriceTotal)return this.updateCostPriceTotal;if(a===MathModel.Variables.CeilingPriceTotal)return this.updateCeilingPriceTotal;if(a===MathModel.Variables.SalesPriceTotal)return this.updateSalesPriceTotal;if(a===MathModel.Variables.ITBISValue)return this.updateITBISValue;
if(a===MathModel.Variables.TaxValue)return this.updateTaxValue;if(a===MathModel.Variables.ReplyPriceTotal)return this.updateReplyPriceTotal;if(a===MathModel.Variables.ItemValues)return this.updateTotalValue;if(a===MathModel.Variables.ItemTotalValues)return this.updateTotalValues};RequestDataAction.prototype.getRemoveAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.ItemValues)return this.removeItemValues;if(a===MathModel.Variables.ItemTotalValues)return this.removeItemTotalValues}}
LotAction.prototype=new MathAction;
function LotAction(c){this.init(c);LotAction.prototype.lotBasePriceChanged=function(a,e){var b=a.BasePrice.get(BigDecimal.ZERO),d=this.createNextAction(MathAction.Types.Update,a);a.BasePrice.load(this.ViewElement);a.updateBasePriceViewModel();b=a.BasePrice.get(BigDecimal.ZERO).subtract(b);d.MethodKey=MathModel.Variables.BasePrice;d.put(MathModel.Variables.LotBasePrice,b);e.enqueue(d)};LotAction.prototype.createNextAction=function(a,e){var b=e.NextModelInfo;if(b&&b.Type===ProcedureRequestModel.Type)return new ProcedureRequestAction({Type:a,
ModelRef:b})};LotAction.prototype.getChangeAction=function(){if(this.MethodKey===MathModel.Variables.LotBasePrice)return this.lotBasePriceChanged}}RequestDataAction.prototype=new MathAction;
function RequestDataAction(c){this.init(c);RequestDataAction.prototype.updateCostPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CostPriceTotal);valueLotCode=this.get(MathModel.Variables.LotCode);a.updateCostPriceTotal(b,valueLotCode)};RequestDataAction.prototype.updateCeilingPriceTotal=function(a,e){var b=this.get(MathModel.Variables.CeilingPriceTotal),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);a.updateCeilingPriceTotal(b,d);c&&(c.MethodKey=
MathModel.Variables.CeilingPriceTotal,c.put(MathModel.Variables.LotCode,d),c.put(MathModel.Variables.CeilingPriceTotal,b),e.enqueue(c))};RequestDataAction.prototype.updateSalesPriceTotal=function(a,e){var b=this.get(MathModel.Variables.SalesPriceTotal),d=this.get(MathModel.Variables.LotCode);a.updateSalesPriceTotal(b,d)};RequestDataAction.prototype.updateITBISValue=function(a,e){var b=this.get(MathModel.Variables.ITBISValue),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,
a);a.updateITBISValue(b,d);c&&(c.MethodKey=MathModel.Variables.ITBISValue,c.put(MathModel.Variables.LotCode,d),c.put(MathModel.Variables.ITBISValue,b),e.enqueue(c))};RequestDataAction.prototype.updateTaxValue=function(a,e){var b=this.get(MathModel.Variables.TaxValue),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);a.updateTaxValue(b,d);c&&(c.MethodKey=MathModel.Variables.TaxValue,c.put(MathModel.Variables.LotCode,d),c.put(MathModel.Variables.TaxValue,b),
e.enqueue(c))};RequestDataAction.prototype.updateReplyPriceTotal=function(a,e){var b=this.get(MathModel.Variables.ReplyPriceTotal),d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);a.updateReplyPriceTotal(b,d);c&&(c.MethodKey=MathModel.Variables.ReplyPriceTotal,c.put(MathModel.Variables.LotCode,d),c.put(MathModel.Variables.ReplyPriceTotal,b),e.enqueue(c))};RequestDataAction.prototype.updateTotalValue=function(a,e){var b=this.get(MathModel.Variables.ItemValues),
d=this.get(MathModel.Variables.LotCode),c=this.createNextAction(MathAction.Types.Update,a);a.updateLotValues(d,b);c&&(c.MethodKey=MathModel.Variables.ItemValues,c.put(MathModel.Variables.LotCode,d),c.put(MathModel.Variables.ItemValues,b),e.enqueue(c))};RequestDataAction.prototype.updateTotalValues=function(a,e){var b=this.get(MathModel.Variables.ItemTotalValues),c=this.createNextAction(MathAction.Types.Update,a);a.addItemTotalValues(b);c&&(c.MethodKey=MathModel.Variables.ItemTotalValues,c.put(MathModel.Variables.ItemTotalValues,
b),e.enqueue(c))};RequestDataAction.prototype.addItemValues=function(a,c){var b=this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Add,a);a.addItemValues(b);d&&(d.MethodKey=MathModel.Variables.ItemValues,d.put(MathModel.Variables.ItemValues,b),c.enqueue(d))};RequestDataAction.prototype.removeItemValues=function(a,c){var b=this.get(MathModel.Variables.ItemValues),d=this.createNextAction(MathAction.Types.Remove,a);a.removeItemValues(b);d&&(d.MethodKey=MathModel.Variables.ItemValues,
d.put(MathModel.Variables.ItemValues,b),c.enqueue(d))};RequestDataAction.prototype.removeItemTotalValues=function(a,c){var b=this.get(MathModel.Variables.ItemTotalValues),d=this.createNextAction(MathAction.Types.Remove,a);a.removeItemTotalValues(b);d&&(d.MethodKey=MathModel.Variables.ItemTotalValues,d.put(MathModel.Variables.ItemTotalValues,b),c.enqueue(d))};RequestDataAction.prototype.createNextAction=function(a,c){var b=c.NextModelInfo;if(b&&b.Type===ProcedureRequestModel.Type)return new ProcedureRequestAction({Type:a,
ModelRef:b})};RequestDataAction.prototype.getAddAction=function(){if(this.MethodKey===MathModel.Variables.ItemValues)return this.addItemValues};RequestDataAction.prototype.getUpdateAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.CostPriceTotal)return this.updateCostPriceTotal;if(a===MathModel.Variables.CeilingPriceTotal)return this.updateCeilingPriceTotal;if(a===MathModel.Variables.SalesPriceTotal)return this.updateSalesPriceTotal;if(a===MathModel.Variables.ItemValues)return this.updateTotalValue;
if(a===MathModel.Variables.ItemTotalValues)return this.updateTotalValues};RequestDataAction.prototype.getRemoveAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.ItemValues)return this.removeItemValues;if(a===MathModel.Variables.ItemTotalValues)return this.removeItemTotalValues}}ProcedureRequestAction.prototype=new MathAction;
function ProcedureRequestAction(c){this.init(c);ProcedureRequestAction.prototype.basePriceChanged=function(a,c){a.BasePrice.load(this.ViewElement)};ProcedureRequestAction.prototype.defineBasePriceChanged=function(a,c){a.DefineBasePrice.load(this.ViewElement);a.updateDefineBasePrice()};ProcedureRequestAction.prototype.defineLotsChanged=function(a,c){a.DefineLots.load(this.ViewElement)};ProcedureRequestAction.prototype.defineLotBasePriceChanged=function(a,c){a.DefineLotsBasePrice.load(this.ViewElement);
a.updateDefineLotBasePrice()};ProcedureRequestAction.prototype.usePriceListValuesChanged=function(a,c){a.UsePriceListValues.load(this.ViewElement);a.updateUsePriceListValues()};ProcedureRequestAction.prototype.addLot=function(a,c){var b=this.get(MathModel.Variables.Lot),b=LotModel.factory(b),d=b.Key.get();a.addLotModel(b);RequestDataModel.addLot(d)};ProcedureRequestAction.prototype.removeLots=function(a,c){var b=this.get(MathModel.Variables.LotCode);0<b.length&&(a.removeLots(b),RequestDataModel.removeLots(b),
$.modelStorage.removeByType(LotModel.Type,b))};ProcedureRequestAction.prototype.addItemValues=function(a,c){var b=this.get(MathModel.Variables.ItemValues);a.addItemValues(b)};ProcedureRequestAction.prototype.updateBasePrice=function(a,c){var b=this.get(MathModel.Variables.LotBasePrice);a.updateBasePrice(b)};ProcedureRequestAction.prototype.updateCeilingPriceTotal=function(a,c){var b=this.get(MathModel.Variables.CeilingPriceTotal),d=this.get(MathModel.Variables.LotCode);a.updateLotBasePrice(b,d)};
ProcedureRequestAction.prototype.updateTotalValue=function(a,c){var b=this.get(MathModel.Variables.ItemValues),d=this.get(MathModel.Variables.LotCode);a.updateLotValues(d,b)};ProcedureRequestAction.prototype.updateTotalValues=function(a,c){var b=this.get(MathModel.Variables.ItemTotalValues);a.updateLotTotalValues(b)};ProcedureRequestAction.prototype.updateModel=function(a,c){var b=this.get(MathModel.Variables.JsonModel);a.updateValues(b)};ProcedureRequestAction.prototype.removeItemValues=function(a,
c){var b=this.get(MathModel.Variables.ItemValues);a.removeItemValues(b)};ProcedureRequestAction.prototype.removeItemTotalValues=function(a,c){var b=this.get(MathModel.Variables.ItemTotalValues);a.removeItemTotalValues(b)};ProcedureRequestAction.prototype.getChangeAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.BasePrice)return this.basePriceChanged;if(a===MathModel.Variables.DefineBasePrice)return this.defineBasePriceChanged;if(a===MathModel.Variables.DefineLots)return this.defineLotsChanged;
if(a===MathModel.Variables.DefineLotsBasePrice)return this.defineLotBasePriceChanged;if(a===MathModel.Variables.UsePriceListValues)return this.usePriceListValuesChanged};ProcedureRequestAction.prototype.getAddAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.Lot)return this.addLot;if(a===MathModel.Variables.ItemValues)return this.addItemValues};ProcedureRequestAction.prototype.getUpdateAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.BasePrice)return this.updateBasePrice;
if(a===MathModel.Variables.CeilingPriceTotal)return this.updateCeilingPriceTotal;if(a===MathModel.Variables.ReplyPriceTotal)return this.updateReplyPriceTotal;if(a===MathModel.Variables.ItemValues)return this.updateTotalValue;if(a===MathModel.Variables.ItemTotalValues)return this.updateTotalValues;if(a===MathModel.Variables.Model)return this.updateModel};ProcedureRequestAction.prototype.getRemoveAction=function(){var a=this.MethodKey;if(a===MathModel.Variables.ItemValues)return this.removeItemValues;
if(a===MathModel.Variables.ItemTotalValues)return this.removeItemTotalValues;if(a===MathModel.Variables.LotCode)return this.removeLots}}ProcedureRequestEngine.prototype=new MathEngine;ProcedureRequestEngine.addLot=function(c,a){var e=new ProcedureRequestEngine,b=e._actionFactory({Type:MathAction.Types.Add,MethodKey:MathModel.Variables.Lot,ModelRef:new MathModelReference(c)});b.put(MathModel.Variables.Lot,a);e.enqueue(b);e.execute()};
ProcedureRequestEngine.removeLots=function(c,a){var e=new ProcedureRequestEngine,b=e._actionFactory({Type:MathAction.Types.Remove,MethodKey:MathModel.Variables.LotCode,ModelRef:new MathModelReference(c)});b.put(MathModel.Variables.LotCode,a);e.enqueue(b);e.execute()};
ProcedureRequestEngine.onChange=function(){var c=$(this),a=new ProcedureRequestEngine,e,b;if(e=MathModelProperty.getPropertyName(c))if(b=MathModel.getModelElement(c),b=a.getModelFromElement(b))c=a._actionFactory({Type:MathAction.Types.Change,Model:b,MethodKey:e,ViewElement:c}),a.enqueue(c),a.execute()};ProcedureRequestEngine.onAdd=function(c){var a=new ProcedureRequestEngine;c=a._actionFactory({Type:MathAction.Types.Add,ModelRef:new MathModelReference(c)});a.enqueue(c);a.execute()};
ProcedureRequestEngine.onRemove=function(){var c=$(this).data("mkey"),a=new ProcedureRequestEngine,c=a._actionFactory({Type:MathAction.Types.Remove,ModelRef:new MathModelReference(c)});a.enqueue(c);a.execute()};ProcedureRequestEngine.removeModels=function(c){if(c){for(var a=new ProcedureRequestEngine,e=0,b=c.length;e<b;e++){var d=a._actionFactory({Type:MathAction.Types.Remove,ModelRef:new MathModelReference(c[e])});a.enqueue(d)}a.execute()}};
ProcedureRequestEngine.onUpdate=function(c,a){var e=$.parseJSON(a),b=new ProcedureRequestEngine,d=b._actionFactory({Type:MathAction.Types.Update,MethodKey:MathModel.Variables.Model,ModelRef:new MathModelReference(c)});d.put(MathModel.Variables.JsonModel,e);b.enqueue(d);b.execute()};ProcedureRequestEngine.loadModel=function(c){(new ProcedureRequestEngine).loadModel(c)};
function ProcedureRequestEngine(){ProcedureRequestEngine.prototype._actionFactory=function(c){var a=void 0,e=c.Model&&c.Model.Info.Type||c.ModelRef&&c.ModelRef.Type;e===BilItemModel.Type?a=new BilItemAction(c):e===BilChapterModel.Type?a=new BilChapterAction(c):e===BilTotalModel.Type?a=new BilTotalAction(c):e===BioQuestionModel.Type?a=new BioQuestionAction(c):e===BioSectionModel.Type?a=new BioSectionAction(c):e===LotModel.Type?a=new LotAction(c):e===ProcedureRequestModel.Type&&(a=new ProcedureRequestAction(c));
return a};ProcedureRequestEngine.prototype._modelFactory=function(c,a){var e=void 0;c===BilItemModel.Type?(e=new BilItemModel,e.load(a)):c===BilChapterModel.Type?(e=new BilChapterModel,e.load(a)):c===BilTotalModel.Type&&(e=new BilTotalModel,e.load(a));return e}};
