using Comal.Classes; using InABox.Core; using InABox.Poster.CSV; using System.Collections.Generic; using System.Text; namespace PRS.Shared { public class BillCSVPoster : ICSVPoster { public CSVPosterSettings Settings { get; set; } public bool BeforePost(IDataModel model) { return true; } public ICSVExport Process(IDataModel model) { var export = new CSVExport(); export.DefineMapping(new() { new("Number", x => x.Number), new("SupplierCode", x => x.SupplierLink.Code), new("Date", x => x.BillDate), new("ExTax", x => x.ExTax), new("Tax", x => x.Tax), new("IncTax", x => x.IncTax) }); foreach (var bill in model.GetTable().ToObjects()) { export.AddSuccess(bill, bill); } return export; } public void AfterPost(IDataModel model, IPostResult result) { } } }