var deductibleModel = function(model) {
    var self = this;
    //if (model != null) {
        ko.mapping.fromJS(model, {}, self);
    //}
    self.ComputedDeductible = ko.computed(function () {
        if(self.DeductibleIsWaived())
        {
            self.ComputedDeductibleInString(self.WaivedDeductibleInString());
            return self.WaivedDeductible();
            
        }
        else {
            self.ComputedDeductibleInString(self.DeductibleInString());
            return self.Deductible();
        }
    });
 
   
    self.DeductibleIsWaived.subscribe(function (checked) {
        model.DeductibleIsWaived = self.DeductibleIsWaived();
        model.ComputedDeductible = self.ComputedDeductible();
        var url = "updateDeductible";
        $.ajax({
            dataType: "json",
            method: "post",
            url: url,
            cache: false,
            data: {
                dedModel: ko.toJSON(model)
            }
        }).done(function (returnObject) {
            loadPaymentSummary();
        });
    });

};