Пример #1
0
 /// <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));
 }
Пример #2
0
        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);
        }
Пример #3
0
        /// <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);
        }
Пример #4
0
 public EventSalaryDeductionCreated(Deduction deduction, Salary salary)
 {
     this.Deduction = deduction;
     this.Salary    = salary;
 }
Пример #5
0
 public CommandAddSalaryDeduction(Salary salary, Deduction deduction)
 {
     this.Salary    = salary;
     this.Deduction = deduction;
 }
Пример #6
0
 public EventSalaryDeductionAdded(Salary salary, Deduction deduction)
 {
     this.Salary    = salary;
     this.Deduction = deduction;
 }
Пример #7
0
 public EventDeductionPaymentCreated(DeductionPayment payment, Deduction deduction)
 {
     this.Deduction        = deduction;
     this.DeductionPayment = payment;
 }
Пример #8
0
 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;
 }