예제 #1
0
 /// <summary>
 /// Validate business of specific invoice information
 /// </summary>
 /// <param name="doInvoice">invoice information</param>
 /// <param name="validator"></param>
 private void ICS050_ValidateInvoiceBusiness(doInvoice doInvoice, ValidatorUtil validator)
 {
     if (doInvoice.InvoicePaymentStatus == PaymentStatus.C_PAYMENT_STATUS_CANCEL ||
         doInvoice.InvoicePaymentStatus == PaymentStatus.C_PAYMENT_STATUS_PAYMENT_MATCH_CANCELLED ||
         doInvoice.InvoicePaymentStatus == PaymentStatus.C_PAYMENT_STATUS_NOTE_FAIL ||
         doInvoice.InvoicePaymentStatus == PaymentStatus.C_PAYMENT_STATUS_POST_FAIL)
     {
         //Payment status not in (08,18,28,38)
         validator.AddErrorMessage(MessageUtil.MODULE_INCOME, MessageUtil.MessageList.MSG7089
                                   , "InvoiceNo", doInvoice.InvoiceNo);
     }
     else if (doInvoice.InvoicePaymentStatus == PaymentStatus.C_PAYMENT_STATUS_BILLING_EXEMPTION)
     {
         //Payment status not in (19)
         validator.AddErrorMessage(MessageUtil.MODULE_INCOME, MessageUtil.MessageList.MSG7090
                                   , "InvoiceNo", doInvoice.InvoiceNo);
     }
     else
     {
         IIncomeHandler incomeHandler = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler;
         bool           isIssued      = incomeHandler.CheckInvoiceIssuedReceipt(doInvoice.InvoiceNo, doInvoice.InvoiceOCC);
         if (isIssued)
         {
             validator.AddErrorMessage(MessageUtil.MODULE_INCOME, MessageUtil.MessageList.MSG7009
                                       , "InvoiceNo", doInvoice.InvoiceNo);
         }
     }
 }