public static FKTZSServiceEntity Load(ApplyNoEntity applyNoEntity) { FKTZSServiceEntity fktzsServiceEntity = new FKTZSServiceEntity(); fktzsServiceEntity.ApplyNoEntity = applyNoEntity; fktzsServiceEntity.Fktzs_C_HEntitys = FKTZS_C_HEntity.Load(applyNoEntity); fktzsServiceEntity.InvoiceEntitys = InvoiceEntityCollection.Load(applyNoEntity); //2018-8-21 11:57:44改造开票申请取数逻辑。开票申请有偿、无偿的取数表不同 fktzsServiceEntity.KpsqEntitys = KPSQFactory.Create(applyNoEntity).Load(applyNoEntity);//KPSQEntityCollection.Load(applyNoEntity); fktzsServiceEntity.FKTZSZYDEntitys = FKTZSZYDEntityCollection.Load(applyNoEntity); return(fktzsServiceEntity); }
private static InvoiceEntityCollection AggData(DataTable dt) { InvoiceEntityCollection invoices = new InvoiceEntityCollection(); foreach (DataRow item in dt.Rows) { InvoiceEntity invoiceEntity = new InvoiceEntity(); invoiceEntity.InvoiceType = InvoiceTypeFactory.Init(Convert.ToString(item["InvoiceType"])); invoiceEntity.Inv_Code = Convert.ToString(item["INV_CODE"]); invoiceEntity.Inv_No = Convert.ToString(item["INV_NO"]); invoiceEntity.Amount = Convert.ToDecimal(item["AMOUNT"]); invoices.AmountTotal += invoiceEntity.Amount; invoiceEntity.Tax = Convert.ToDecimal(item["TAX"]); invoices.TaxTotal += invoiceEntity.Tax; invoices.Add(invoiceEntity); } //发票集合添加第一条发票的类型、税率 if (invoices.Count != 0) { invoices.InvoiceType = invoices[0].InvoiceType; invoices.TaxTate = invoices[0].TaxRate; } return(invoices); }