private void ChoosePayment() { var payment = new IncomingPayment(Program.GetCurrentCompanyDb()); var query = new TableQuery(payment); var choose = new ChooseFromListHelper( paymentView.Columns[IncomingPayment.FieldsName.DocEntry], paymentView.Columns[IncomingPayment.FieldsName.DocNum], query, IncomingPayment.FieldsName.DocEntry, IncomingPayment.FieldsName.DocNum, "Pagamentos"); choose.AfterTryGetRecord += delegate(object sender, ChooseFromListEventArgs e) { var rowSel = paymentView.GetFocusedDataRow(); rowSel.SetField(IncomingPayment.FieldsName.DocEntry, e.Record.Field <String>(IncomingPayment.FieldsName.DocEntry)); rowSel.SetField(IncomingPaymentLine.FieldsName.DocNum, e.Record.Field <String>(IncomingPaymentLine.FieldsName.DocNum)); }; paymentGrid.DataSource = payment.GetData(); }
private TableQuery GetPay(string docentry) { var incomingPayment = new IncomingPayment(Program.GetCurrentCompanyDb()); var queryPayment = new TableQuery(incomingPayment, false, "T0"); var paymentLine = new IncomingPaymentLine(Program.GetCurrentCompanyDb()); var queryLine = new TableQuery(paymentLine, false, "T1"); var joinLinePay = new QueryParam(incomingPayment.Collumns[IncomingPayment.FieldsName.DocEntry]); joinLinePay.Value1Column = new QueryParam(paymentLine.Collumns[IncomingPaymentLine.FieldsName.DocNum]); queryPayment.Fields.Add(incomingPayment.Collumns[IncomingPaymentLine.FieldsName.DocEntry]); queryPayment.Fields.Add(incomingPayment.Collumns[IncomingPaymentLine.FieldsName.DocNum]); queryPayment.Fields.Add(incomingPayment.Collumns[IncomingPayment.FieldsName.BoeSum]); queryPayment.Fields.Add(incomingPayment.Collumns[IncomingPayment.FieldsName.CashSum]); queryPayment.Fields.Add(incomingPayment.Collumns[IncomingPayment.FieldsName.CheckSum]); queryPayment.Fields.Add(incomingPayment.Collumns[IncomingPayment.FieldsName.TrsfrSum]); queryPayment.Fields.Add(incomingPayment.Collumns[IncomingPayment.FieldsName.CreditSum]); queryPayment.Joins.Add(new Join(queryLine, new WhereCollection(joinLinePay))); queryPayment.Where.Add(new QueryParam(paymentLine.Collumns[IncomingPaymentLine.FieldsName.DocEntry], docentry)); incomingPayment.FillCollection <IncomingPaymentLine>(queryPayment); return(queryPayment); }
/// <summary> /// Rapporteer de foute inkomende betalingen /// </summary> /// <param name="paym">Payment param</param> /// <param name="errorCode">Error code param</param> private void ReportErrorIncPaym(IncomingPayment paym, ErrIncPaym errorCode) { Console.WriteLine("\n\n--- Error Report ------------------------------------------ "); Console.WriteLine($"Incoming file : {fullFileName} "); Console.WriteLine($"BIC of bank : {impFileModel.HeaderRecord.BICOfBank} "); Console.WriteLine($"Bank\'s reference of payment : {paym.ReferenceFromBank}"); Console.WriteLine($"Debtor\'s reference of payment : {paym.PaymentReference}"); Console.WriteLine($"Debtor\'s IBAN : {paym.DebtorIBAN}"); Console.WriteLine($"Payment amount : {paym.Amount}"); if (errorCode == ErrIncPaym.InvNotParsable) { Console.WriteLine($"Factuurnummer niet kunnen afleiden uit " + $"import betalingen file, referentie uit import file is {paym.PaymentReference}"); } else if (errorCode == ErrIncPaym.InvNotFound) { bool isParsable = int.TryParse(paym.PaymentReference, out invNumber); Console.WriteLine($"Factuur met nummer {invNumber} niet gevonden"); } else if (errorCode == ErrIncPaym.InvAlreadyPaid) { bool isParsable = int.TryParse(paym.PaymentReference, out invNumber); Console.WriteLine($"Factuur {invNumber} al afgeboekt. Betaling genegeerd."); } Console.WriteLine("--- End of Error report ----------------------------------- "); }
public IActionResult OnGet() { IncomingPayment = new IncomingPayment(); ViewData["PaymentFormId"] = new SelectList(_context.PaymentForms, "Id", "Name"); ViewData["PaymentTypeId"] = new SelectList(_context.PaymentTypes, "Id", "Name"); return(Page()); }
public async Task <IActionResult> OnPostAsync(Guid?incomingPaymentId) { if (incomingPaymentId == null) { return(NotFound()); } IncomingPayment = await _context.IncomingPayments.FindAsync(incomingPaymentId); if (IncomingPayment != null) { _context.IncomingPayments.Remove(IncomingPayment); await _context.SaveChangesAsync(); } return(RedirectToPage("../Index")); }
public async Task <IActionResult> OnGetAsync(Guid?incomingPaymentId) { if (incomingPaymentId == null) { return(NotFound()); } IncomingPayment = await _context.IncomingPayments .Include(i => i.PaymentForm) .Include(i => i.PaymentType) .Include(i => i.Order).FirstOrDefaultAsync(m => m.Id == incomingPaymentId); if (IncomingPayment == null) { return(NotFound()); } return(Page()); }
public async Task<IActionResult> OnGetAsync(Guid? id) { if (id == null) { return NotFound(); } IncomingPayment = await _context.IncomingPayments .Include(p => p.PaymentForm) .Include(p => p.PaymentType) .FirstOrDefaultAsync(m => m.Id == id); if (IncomingPayment == null) { return NotFound(); } ViewData["OrderId"] = TempData.Peek("OrderId"); ViewData["PaymentFormId"] = new SelectList(_context.PaymentForms, "Id", "Name"); ViewData["PaymentTypeId"] = new SelectList(_context.PaymentTypes, "Id", "Name"); return Page(); }