Пример #1
0
 public void InsertSpecialRefitInvoice(SpecialRefitInvoiceDTO specialRefitInvoice)
 {
     Supplier supplier = _supplierRepository.Get(specialRefitInvoice.SupplierId);
     specialRefitInvoice.SupplierName = supplier.CnName;
     SpecialRefitInvoice newSpecialRefitInvoice = MaintainInvoiceFactory.CreateSpecialRefitInvoice();
     newSpecialRefitInvoice.SetInvoiceNumber(GetMaxInvoiceNumber());
     MaintainInvoiceFactory.SetMaintainInvoice(newSpecialRefitInvoice, "0",
         specialRefitInvoice.InvoideCode, specialRefitInvoice.InvoiceDate, specialRefitInvoice.SupplierName,
         specialRefitInvoice.SupplierId,
         specialRefitInvoice.InvoiceValue, specialRefitInvoice.PaidAmount, specialRefitInvoice.OperatorName,
         specialRefitInvoice.Reviewer, specialRefitInvoice.Status, specialRefitInvoice.CurrencyId,
         specialRefitInvoice.DocumentName, specialRefitInvoice.DocumentId,
         specialRefitInvoice.PaymentScheduleLineId,
         specialRefitInvoice.InMaintainTime, specialRefitInvoice.OutMaintainTime);
     if (specialRefitInvoice.MaintainInvoiceLines != null)
     {
         foreach (MaintainInvoiceLineDTO maintainInvoiceLine in specialRefitInvoice.MaintainInvoiceLines)
         {
             MaintainInvoiceLine newMaintainInvoiceLine = MaintainInvoiceFactory.CreateInvoiceLine();
             MaintainInvoiceFactory.SetInvoiceLine(newMaintainInvoiceLine, maintainInvoiceLine.MaintainItem,
                 maintainInvoiceLine.ItemName, 1, maintainInvoiceLine.Amount,
                 maintainInvoiceLine.Note);
             newSpecialRefitInvoice.InvoiceLines.Add(newMaintainInvoiceLine);
         }
     }
     newSpecialRefitInvoice.SetInvoiceValue();
     _invoiceRepository.Add(newSpecialRefitInvoice);
     var maintainCost = new SpecialRefitMaintainCostDTO
     {
         MaintainInvoiceId = newSpecialRefitInvoice.Id,
         Year = newSpecialRefitInvoice.InvoiceDate.Year
     };
     _maintainCostAppService.InsertSpecialRefitMaintainCost(maintainCost);
 }
Пример #2
0
 public void InsertSpecialRefitMaintainCost(SpecialRefitMaintainCostDTO specialRefitMaintainCost)
 {
     SpecialRefitMaintainCost newSpecialRefitMaintainCost = MaintainCostFactory.CreateSpecialRefitMaintainCost();
     MaintainCostFactory.SetSpecialRefitMaintainCost(newSpecialRefitMaintainCost,
         specialRefitMaintainCost.Project, specialRefitMaintainCost.Info,
         specialRefitMaintainCost.DepartmentDeclareAmount,
         specialRefitMaintainCost.Note, specialRefitMaintainCost.FinancialApprovalAmount,
         specialRefitMaintainCost.FinancialApprovalAmountNonTax, specialRefitMaintainCost.MaintainInvoiceId,
         specialRefitMaintainCost.Year);
     _maintainCostRepository.Add(newSpecialRefitMaintainCost);
 }
Пример #3
0
 public void ModifySpecialRefitMaintainCost(SpecialRefitMaintainCostDTO specialRefitMaintainCost)
 {
     var updateSpecialRefitMaintainCost =
         _maintainCostRepository.Get(specialRefitMaintainCost.Id) as SpecialRefitMaintainCost; //获取需要更新的对象。
     MaintainCostFactory.SetSpecialRefitMaintainCost(updateSpecialRefitMaintainCost,
         specialRefitMaintainCost.Project, specialRefitMaintainCost.Info,
         specialRefitMaintainCost.DepartmentDeclareAmount,
         specialRefitMaintainCost.Note, specialRefitMaintainCost.FinancialApprovalAmount,
         specialRefitMaintainCost.FinancialApprovalAmountNonTax, specialRefitMaintainCost.MaintainInvoiceId,
         specialRefitMaintainCost.Year);
     _maintainCostRepository.Modify(updateSpecialRefitMaintainCost);
 }
Пример #4
0
 public void DeleteSpecialRefitMaintainCost(SpecialRefitMaintainCostDTO specialRefitMaintainCost)
 {
     MaintainCost deleteSpecialRefitMaintainCost = _maintainCostRepository.Get(specialRefitMaintainCost.Id);
         //获取需要删除的对象。
     _maintainCostRepository.Remove(deleteSpecialRefitMaintainCost); //删除特修改装维修成。
 }