private ObservableCollection <CDocReceipt> filterItems() { ObservableCollection <CDocReceipt> temp = new ObservableCollection <CDocReceipt>(); MAccountDoc md = (MAccountDoc)dataSource; int i = 0; foreach (MAccountDocReceipt m in pageParam.Items) { CDocReceipt d = new CDocReceipt(m, Lang); d.ItemNo = (pageParam.StartIndex + i).ToString(); d.docType = md.DocumentType; temp.Add(d); i++; } //int left = itemPerPage - temp.Count; for (i = 1; i <= pageParam.PatchRow; i++) { temp.Add(new CDocReceipt(null, Lang)); } return(temp); }
private ObservableCollection <CDocReceipt> filterSingleItems() { ObservableCollection <CDocReceipt> temp = new ObservableCollection <CDocReceipt>(); MAccountDoc md = (MAccountDoc)dataSource; int i = 0; foreach (MAccountDocItem di in pageParam.Items) //มีได้มากกว่า 1 รายการ แยกตาม PO { MAccountDocReceipt m = new MAccountDocReceipt(new Wis.WsClientAPI.CTable("")); double amt = CUtil.StringToDouble(di.RevenueExpenseAmt) + CUtil.StringToDouble(di.VatTaxAmt) - CUtil.StringToDouble(di.WHTaxAmt); m.DocumentNo = md.RefDocNo; m.RefPoNo = di.RefPoNo; m.ProjectCode = di.ProjectCode; m.PricingAmt = di.RevenueExpenseAmt; //di.TotalAfterDiscount; m.FinalDiscount = di.FinalDiscountAvg; m.VatAmt = di.VatTaxAmt; m.WHTaxAmt = di.WHTaxAmt; m.CashReceiptAmt = amt.ToString(); //di.TotalAmt; CDocReceipt d = new CDocReceipt(m, Lang); d.ItemNo = (pageParam.StartIndex + i).ToString(); d.docType = md.DocumentType; temp.Add(d); i++; } for (i = 1; i <= pageParam.PatchRow; i++) { temp.Add(new CDocReceipt(null, Lang)); } return(temp); }