public ShipmentListForm() { InitializeComponent(); form = this; Load += ShipmentListLoad; btnView.Click += (sender, args) => LoadGrid(); ShipmentView.RowCellStyle += ChangeColor; ShipmentView.CustomColumnDisplayText += NumberGrid; btnExcel.Click += (sender, args) => { var p = FilterVoid(); var shipments = new ShipmentDataManager().ShipmentListExport(p); GridExport.DataSource = shipments; ExportExcel(GridExport); }; GridShipment.DoubleClick += (o, args) => { var rows = ShipmentView.GetSelectedRows(); if (rows.Count() > 0) { BaseControl.OpenRelatedForm(new TrackingViewForm(), ShipmentView.GetRowCellValue(rows[0], "Code").ToString(), CallingCommand); } }; Shown += ShipmentListShow; }
public ShipmentModel(ShipmentView entityView, bool forIndex) { if (entityView != null) { this.Id = entityView.Id; this.CreateBy = entityView.CreateBy; this.CreateDate = entityView.CreateDate; this.DeliveryDate = entityView.DeliveryDate; this.Id = entityView.Id; this.LineId = entityView.LineId; this.LocatorId = entityView.LocatorId; this.LotNoId = entityView.LotNoId; this.OrderId = entityView.OrderId; this.Quantity = entityView.Quantity; this.SerialNo = entityView.SerialNo; this.SOBId = entityView.SOBId; this.UpdateBy = entityView.UpdateBy; this.UpdateDate = entityView.UpdateDate; this.WarehouseId = entityView.WarehouseId; this.CompanyId = entityView.CompanyId; this.DeliveryNo = entityView.DeliveryNo; this.OrderNo = entityView.OrderNo; this.CustomerName = entityView.CustomerName; this.CustomerSiteName = entityView.CustomerSiteName; } }
public async Task <IActionResult> AddShipments([FromBody] ShipmentView shipmentCreation) { ShipmentModule ShipmentsMod = new ShipmentModule(); Shipment newShipment = await ShipmentsMod.Shipment.Query().GetShipmentBySalesOrder(shipmentCreation); List <ShipmentDetail> newShipmentsDetails = await ShipmentsMod.ShipmentDetail.Query().GetShipmentDetailBySalesOrder(shipmentCreation); newShipment = await ShipmentsMod.Shipment.Query().CalculatedAmountsByDetails(newShipment, newShipmentsDetails); //TODO Calculate the amount, duty, taxes, shipping cost //decimal taxes = await ShipmentsMod.Shipments.Query().CalculateTaxes(newShipments); //decimal shippingCost = await ShipmentsMod.Shipments.Query().CalculateShippingCost(newShipments); //decimal codCost=await ShipmentsMod.Shipments.Query().CalculateCodCost(newShipments); //decimal duty=await ShipmentsMod.Shipments.Query().CalculateDuty(newShipments); ShipmentsMod.Shipment.AddShipment(newShipment).Apply(); Shipment lookupShipments = await ShipmentsMod.Shipment.Query().GetEntityByNumber(newShipment.ShipmentNumber); newShipmentsDetails.ForEach(m => m.ShipmentId = lookupShipments.ShipmentId); ShipmentsMod.ShipmentDetail.AddShipmentDetails(newShipmentsDetails).Apply(); ShipmentsMod.SalesOrderDetail.UpdateSalesOrderDetailByShipmentsDetail(newShipmentsDetails).Apply(); ShipmentsMod.SalesOrder.UpdateSalesOrderAmountByShipmentsDetail(newShipment, newShipmentsDetails.Sum(e => e.Amount)).Apply(); ShipmentView newView = await ShipmentsMod.Shipment.Query().GetViewByNumber(newShipment.ShipmentNumber); return(Ok(newView)); }
public async Task <IActionResult> GetShipmentsView(long shipmentsId) { ShipmentModule invMod = new ShipmentModule(); ShipmentView view = await invMod.Shipment.Query().GetViewById(shipmentsId); return(Ok(view)); }
public async Task TestShipmentsView() { ShipmentModule invMod = new ShipmentModule(); long ShipmentsId = 21; ShipmentView view = await invMod.Shipment.Query().GetViewById(ShipmentsId); Assert.NotNull(view); }
public async Task <IActionResult> DeleteShipments([FromBody] ShipmentView view) { ShipmentModule invMod = new ShipmentModule(); Shipment shipments = await invMod.Shipment.Query().MapToEntity(view); invMod.Shipment.DeleteShipment(shipments).Apply(); return(Ok(view)); }
protected override void PopulateForm(FranchiseDropPointModel model) { ClearForm(); tbxDate.DateTime = model.PickupDate; tbxSearch_Code.Text = model.Code; var data = new FranchiseDropPointDetailDataManager().GetPickupDropPoint(model.Id); GridShipment.DataSource = data; ShipmentView.RefreshData(); }
public override void New() { base.New(); ClearForm(); EnabledForm(true); GridShipment.DataSource = null; ShipmentView.RefreshData(); rbData_Save.Enabled = true; tbxDate.DateTime = DateTime.Now; tbxDate.Focus(); }
public async Task <IActionResult> UpdateShipments([FromBody] ShipmentView view) { ShipmentModule invMod = new ShipmentModule(); Shipment shipment = await invMod.Shipment.Query().MapToEntity(view); invMod.Shipment.UpdateShipment(shipment).Apply(); ShipmentView retView = await invMod.Shipment.Query().GetViewById(shipment.ShipmentId); return(Ok(retView)); }
public async Task TestAddUpdatDeleteShipments() { SalesOrderModule salesOrderMod = new SalesOrderModule(); Udc orderType = await salesOrderMod.SalesOrder.Query().GetUdc("ORDER_TYPE", SalesOrderEnum.CASH_SALES.ToString()); Udc paymentTerms = await salesOrderMod.SalesOrder.Query().GetUdc("PAYMENTTERMS", PaymentTermsEnum.Net_2_10_30.ToString()); NextNumber nnSalesOrder = await salesOrderMod.SalesOrder.Query().GetNextNumber(); SalesOrderView view = new SalesOrderView() { Taxes = 0, Amount = 0, OrderType = orderType.KeyCode.ToString(), CustomerId = 2, TakenBy = "David Nishimoto", FreightAmount = 0, PaymentInstrument = "Check", PaymentTerms = paymentTerms.KeyCode.ToString() }; List <SalesOrderDetailView> detailViews = new List <SalesOrderDetailView>() { new SalesOrderDetailView() { ItemId = 11, Description = "Flower Bent Rod", Quantity = 4, QuantityOpen = 4, Amount = 31.52M, AmountOpen = 31.52M, UnitOfMeasure = "Each", UnitPrice = 7.88M, AccountId = 5, ScheduledShipDate = DateTime.Parse("5/21/2019"), PromisedDate = DateTime.Parse("5/23/2019"), GLDate = DateTime.Parse("5/21/2019"), InvoiceDate = (DateTime?)null, ShippedDate = (DateTime?)null, GrossWeight = 4.1000M * 4M, GrossWeightUnitOfMeasure = "LBS", //UnitVolume { get; set; } //UnitVolumeUnitOfMeasurement { get; set; } BusUnit = "700", CompanyCode = "1000", LineNumber = 1 } }; view.OrderNumber = nnSalesOrder.NextNumberValue.ToString(); SalesOrder salesOrder = await salesOrderMod.SalesOrder.Query().MapToEntity(view); salesOrderMod.SalesOrder.AddSalesOrder(salesOrder).Apply(); SalesOrder newSalesOrder = await salesOrderMod.SalesOrder.Query().GetEntityByNumber(view.OrderNumber); Assert.NotNull(newSalesOrder); newSalesOrder.Note = "sales order note test"; SalesOrderView newSalesOrderView = await salesOrderMod.SalesOrder.Query().MapToView(newSalesOrder); salesOrderMod.SalesOrder.UpdateSalesOrder(newSalesOrder).Apply(); SalesOrderView updateView = await salesOrderMod.SalesOrder.Query().GetViewById(newSalesOrder.SalesOrderId); Assert.Same(updateView.Note, "sales order note test"); detailViews.ForEach(m => m.SalesOrderId = newSalesOrder.SalesOrderId); foreach (var item in detailViews) { NextNumber nn = await salesOrderMod.SalesOrderDetail.Query().GetNextNumber(); item.SalesOrderDetailNumber = nn.NextNumberValue; } List <SalesOrderDetail> salesOrderDetails = (await salesOrderMod.SalesOrderDetail.Query().MapToEntity(detailViews)).ToList <SalesOrderDetail>(); salesOrderMod.SalesOrderDetail.AddSalesOrderDetails(salesOrderDetails).Apply(); salesOrderDetails.ForEach(m => m.Description += " Updated"); salesOrderMod.SalesOrderDetail.UpdateSalesOrderDetails(salesOrderDetails).Apply(); List <SalesOrderDetail> soListDetails = (await salesOrderMod.SalesOrderDetail.Query().GetDetailsBySalesOrderId(newSalesOrder.SalesOrderId)).ToList <SalesOrderDetail>(); /************************************Shipments**************************/ ShipmentModule ShipmentMod = new ShipmentModule(); NextNumber nnShipment = await ShipmentMod.Shipment.Query().GetNextNumber(); ShipmentView shipmentCreation = new ShipmentView() { SalesOrderId = newSalesOrder.SalesOrderId, ActualWeight = 100, BillableWeight = 100, ShippedFromLocationId = 3, ShippedToLocationId = 9, TrackingNumber = "123", WeightUOM = "LBS", ShipmentDate = DateTime.Now, CarrierId = 2, ShipmentNumber = nnShipment.NextNumberValue }; shipmentCreation.ItemsAdjustedQuantityShipped = new List <ItemsAdjustedQuantityShippedStruct>(); foreach (var item in soListDetails) { var newItem = new ItemsAdjustedQuantityShippedStruct() { SalesOrderDetailId = item.SalesOrderDetailId, AdjustedQuantityShipped = item.Quantity ?? 0, AdjustedAmountShipped = item.Amount }; shipmentCreation.ItemsAdjustedQuantityShipped.Add(newItem); } bool result = await ShipmentMod.CreateBySalesOrder(shipmentCreation); Shipment lookupShipment = await ShipmentMod.Shipment.Query().GetEntityByNumber(shipmentCreation.ShipmentNumber); lookupShipment.TrackingNumber = "123"; ShipmentMod.Shipment.UpdateShipment(lookupShipment).Apply(); ShipmentView updateShipmentsView = await ShipmentMod.Shipment.Query().GetViewById(lookupShipment.ShipmentId); Assert.Same(updateShipmentsView.TrackingNumber, "123"); List <ShipmentDetail> listShipmentDetail = (await ShipmentMod.ShipmentDetail.Query().GetEntitiesByShipmentId(lookupShipment.ShipmentId)).ToList <ShipmentDetail>(); listShipmentDetail.ForEach(m => m.AmountShipped = 10); listShipmentDetail.ForEach(m => m.QuantityShipped = 1); ShipmentMod.ShipmentDetail.UpdateShipmentDetails(listShipmentDetail).Apply(); //Test Paging //lssWebApi2.AbstractFactory.PageListViewContainer<ShipmentView> container = await ShipmentMod.Shipment.Query().GetViewsByPage(predicate: e => e.TrackingNumber == "123", order: e => e.Amount, pageSize: 1, pageNumber: 1); //Assert.True(container.Items.Count > 0); List <ShipmentDetail> listShipmentDetails = (await ShipmentMod.ShipmentDetail.Query().GetEntitiesByShipmentId(lookupShipment.ShipmentId)).ToList <ShipmentDetail>(); IList <ShipmentDetailView> listShipmentDetailViews = await ShipmentMod.ShipmentDetail.Query().GetViewsByShipmentId(lookupShipment.ShipmentId); ShipmentMod.ShipmentDetail.DeleteShipmentDetails(listShipmentDetails).Apply(); ShipmentMod.Shipment.DeleteShipment(lookupShipment).Apply(); Shipment lookup2Shipments = await ShipmentMod.Shipment.Query().GetEntityById(lookupShipment.ShipmentId); Assert.Null(lookup2Shipments); /**********************remove sales Order detail******************************/ IList <SalesOrderDetailView> solistDetailViews = await salesOrderMod.SalesOrderDetail.Query().GetDetailViewsBySalesOrderId(newSalesOrder.SalesOrderId); if (solistDetailViews.ToList <SalesOrderDetailView>().Any(m => m.Description.Contains("Updated")) == false) { Assert.True(false); } salesOrderMod.SalesOrderDetail.DeleteSalesOrderDetails(soListDetails).Apply(); salesOrderMod.SalesOrder.DeleteSalesOrder(newSalesOrder).Apply(); SalesOrder lookupSalesOrder = await salesOrderMod.SalesOrder.Query().GetEntityById(view.SalesOrderId); Assert.Null(lookupSalesOrder); }
private void Pickup(object sender, EventArgs e) { var model = new ShipmentNumberAllocationDataManager().GetFirst <ShipmentAllocationModel>( WhereTerm.Default(Convert.ToInt64(tbxPod.Text), "shipment_code_start", EnumSqlOperator.LesThanEqual), WhereTerm.Default(Convert.ToInt64(tbxPod.Text), "shipment_code_end", EnumSqlOperator.GreatThanEqual), WhereTerm.Default(0, "drop_point_id", EnumSqlOperator.GreatThan) ); if (model != null) { var shipmentDp = new FranchiseDropPointDetailDataManager().PickupDropPoint(tbxPod.Text); if (shipmentDp == null) { using (var dialog = new AcceptanceDropPointForm { StartPosition = FormStartPosition.CenterScreen, NoResi = tbxPod.Text, ShowInTaskbar = false }) { dialog.ShowDialog(); if (!string.IsNullOrEmpty(dialog.NoResi)) { shipmentDp = new FranchiseDropPointDetailDataManager().PickupDropPoint(dialog.NoResi); } else { tbxPod.Clear(); tbxPod.Focus(); return; } } } var exists = new FranchiseDropPointDetailDataManager().ShipmentPickedup(tbxPod.Text); if (exists != null) { MessageBox.Show("No resi sudah di pickup."); tbxPod.Clear(); tbxPod.Focus(); return; } var data = GridShipment.DataSource as List <FranchiseDropPointPickup>; if (data != null) { if (data.Count > 0) { var existsdata = data.Where(p => p.ShipmentCode == tbxPod.Text).FirstOrDefault(); if (existsdata != null) { tbxPod.Clear(); tbxPod.Focus(); return; } } } else { data = new List <FranchiseDropPointPickup>(); } data.Add(shipmentDp); GridShipment.DataSource = data; ShipmentView.RefreshData(); tbxPod.Clear(); tbxPod.Focus(); } else { MessageBox.Show("Nomor resi tidak dikenali."); tbxPod.Clear(); tbxPod.Focus(); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ISeedData seedData) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseSignalR((cfg) => { cfg.MapHub <NotificationHub>("/notifications"); }); app.UseMvc(routes => routes.MapRoute( name: "WebAPI", template: "api/{controller}/{action}/{id?}" ) //.MapRoute( // name: "WebAPIForYear", // template: "api/foryear/{year:int}/{controller}/{action}/{id?}" //) ); seedData.SeedCompanyData(); seedData.SeedUserData(); //var tmp1 = UnitOfWork.ContoShemeOptions; //seedData.PopulateData(); // Create views BankView.CreateView(); BusinessPartnerBankView.CreateView(); BusinessPartnerByConstructionSiteView.CreateView(); BusinessPartnerInstitutionView.CreateView(); BusinessPartnerLocationView.CreateView(); BusinessPartnerDocumentView.CreateView(); BusinessPartnerNoteView.CreateView(); BusinessPartnerOrganizationUnitView.CreateView(); BusinessPartnerPhoneView.CreateView(); BusinessPartnerView.CreateView(); BusinessPartnerTypeView.CreateView(); //CompanyView.CreateView(); //??? //UserView.CreateView(); InputInvoiceView.CreateView(); InputInvoiceNoteView.CreateView(); InputInvoiceDocumentView.CreateView(); OutputInvoiceDocumentView.CreateView(); OutputInvoiceView.CreateView(); OutputInvoiceNoteView.CreateView(); CountryView.CreateView(); RegionView.CreateView(); MunicipalityView.CreateView(); CityView.CreateView(); ProfessionView.CreateView(); SectorView.CreateView(); AgencyView.CreateView(); TaxAdministrationView.CreateView(); ToDoView.CreateView(); EmployeeByBusinessPartnerView.CreateView(); EmployeeByConstructionSiteView.CreateView(); EmployeeCardView.CreateView(); EmployeeView.CreateView(); EmployeeDocumentView.CreateView(); EmployeeItemView.CreateView(); EmployeeLicenceView.CreateView(); EmployeeNoteView.CreateView(); EmployeeProfessionView.CreateView(); FamilyMemberView.CreateView(); LicenceTypeView.CreateView(); PhysicalPersonView.CreateView(); PhysicalPersonItemView.CreateView(); PhysicalPersonNoteView.CreateView(); PhysicalPersonLicenceView.CreateView(); PhysicalPersonDocumentView.CreateView(); PhysicalPersonCardView.CreateView(); PhysicalPersonProfessionView.CreateView(); ConstructionSiteCalculationView.CreateView(); ConstructionSiteDocumentView.CreateView(); ConstructionSiteNoteView.CreateView(); ConstructionSiteView.CreateView(); VatView.CreateView(); ServiceDeliveryView.CreateView(); DiscountView.CreateView(); StatusView.CreateView(); ShipmentView.CreateView(); ShipmentDocumentView.CreateView(); PhonebookView.CreateView(); PhonebookDocumentView.CreateView(); PhonebookNoteView.CreateView(); PhonebookPhoneView.CreateView(); InvoiceView.CreateView(); InvoiceItemView.CreateView(); CallCentarView.CreateView(); CalendarAssignmentView.CreateView(); EmployeeAttachmentView.CreateView(); PhysicalPersonAttachmentView.CreateView(); ToDoStatusView.CreateView(); var mailingTime = new Config().GetConfiguration()["MailTime"]; Console.WriteLine("Sending mails scheduled at: {0}\nCurrent time: {1}", mailingTime, DateTime.Now.ToString("HH:mm:ss")); Thread mailThread = new Thread(() => MailTask.SendMailTime(mailingTime)); mailThread.IsBackground = true; mailThread.Start(); }