/// <summary> /// Deduction total = amortized_amount * amortization /// </summary> public static Deduction CreateAmortized(Salary salary, int amortization, MonetaryValue amortized_amount, Date dt_granted = null, DeductionMode mode = DeductionMode.TEMPORARY) { return(Deduction.Create(salary , amortization , amortized_amount.multipliedBy(amortization) , dt_granted)); }
public static DeductionPayment Create(Deduction deduction, MonetaryValue custom_payment = null) { var record = new DeductionPayment { _employee = deduction.GetEmployee(), _deduction = deduction, // PaidAmount = (custom_payment is null) ? deduction.AmortizedAmount : custom_payment.PreciseValue PaidAmount = custom_payment ?? deduction.AmortizedAmount }; // emit event EventBroker.getInstance().Emit(new EventDeductionPaymentCreated(record, deduction)); return(record); }
/// <summary> /// Given deduction total /// </summary> public static Deduction Create(Salary salary, int amortization, MonetaryValue total, Date dt_granted = null, DeductionMode mode = DeductionMode.TEMPORARY) { var record = new Deduction { _salary = salary , Employee = salary.GetEmployee() , Total = total , _amortization = amortization , DateGranted = dt_granted ?? Date.TryParse(DateTime.Now.ToLongDateString()) , Mode = mode }; EventBroker.getInstance().Emit(new EventSalaryDeductionCreated(record, salary)); return(record); }
public EventSalaryDeductionCreated(Deduction deduction, Salary salary) { this.Deduction = deduction; this.Salary = salary; }
public CommandAddSalaryDeduction(Salary salary, Deduction deduction) { this.Salary = salary; this.Deduction = deduction; }
public EventSalaryDeductionAdded(Salary salary, Deduction deduction) { this.Salary = salary; this.Deduction = deduction; }
public EventDeductionPaymentCreated(DeductionPayment payment, Deduction deduction) { this.Deduction = deduction; this.DeductionPayment = payment; }
public EventDeductionPaymentCreated(PayrollReport pr, Deduction d, DeductionPayment dp) { PayrollReport = pr; Deduction = d; DeductionPayment = dp; }
/// <summary> /// Exclude deduction payment on created payroll report /// </summary> public CommandExcludeDeductionPayment(Employee employee, Deduction deduction, PayrollReport report) { this.Employee = employee; this.Deduction = deduction; this.Report = report; }