Warehouses #1

Merged
trent merged 159 commits from Warehouses into master 2026-01-10 20:24:17 +00:00
13 changed files with 280 additions and 231 deletions
Showing only changes of commit 47f37d016d - Show all commits

View File

@@ -43,5 +43,20 @@ namespace FaKrosnoApi.Controllers
int result = await service.SendOrderToSyteline(customerOrderNumber);
return result > 0 ? Ok() : BadRequest();
}
[HttpPost("save-orders")]
public async Task<ActionResult> SaveOrdersWithDetails([FromBody] List<EdiCustomerOrderDto> ediCustomerOrders)
{
if (!ediCustomerOrders.Any())
{
return BadRequest("The list of orders cannot be null or empty.");
}
var result = await service.SaveOrdersWithDetails(ediCustomerOrders);
return result.Item1
? Ok("Orders saved successfully.")
: BadRequest($"Failed to save orders. Error: {result.Item2}");
}
}
}

View File

@@ -4,9 +4,9 @@ public class CustomerDto : DtoBase
{
public string CustNum { get; set; }
public int CustSeq { get; set; }
public string Contact1 { get; set; }
public string Contact2 { get; set; }
public string Contact3 { get; set; }
public string? Contact1 { get; set; }
public string? Contact2 { get; set; }
public string? Contact3 { get; set; }
public string Phone1 { get; set; }
public string Phone2 { get; set; }
public string Phone3 { get; set; }

View File

@@ -8,8 +8,8 @@ namespace SytelineSaAppEfDataModel.Dtos
{
public class EdiCustomerOrderDto : DtoBase
{
public string TransactionCode { get; set; }
public string TpCode { get; set; }
public string? TransactionCode { get; set; }
public string? TpCode { get; set; }
public DateTime? RecivedDate { get; set; }
public byte? Posted { get; set; }
public DateTime? PostedDate { get; set; }
@@ -17,24 +17,24 @@ namespace SytelineSaAppEfDataModel.Dtos
public short? ErrorMessage { get; set; }
public byte? Override { get; set; }
public byte? Ack { get; set; }
public string AckNumber { get; set; }
public string? AckNumber { get; set; }
public int? AckSequence { get; set; }
public string AckType { get; set; }
public string? AckType { get; set; }
public DateTime? AckDate { get; set; }
public string SymbolicCustomerOrderNumber { get; set; }
public string? SymbolicCustomerOrderNumber { get; set; }
public decimal? BlanketDollar { get; set; }
public string Type { get; set; }
public string CustomerOrderNumber { get; set; }
public string EstimatedNumber { get; set; }
public string CustomerNumber { get; set; }
public string? Type { get; set; }
public string? CustomerOrderNumber { get; set; }
public string? EstimatedNumber { get; set; }
public string? CustomerNumber { get; set; }
public int? CustomerSequence { get; set; }
public string Contact { get; set; }
public string Phone { get; set; }
public string CustomerPoNumber { get; set; }
public string? Contact { get; set; }
public string? Phone { get; set; }
public string? CustomerPoNumber { get; set; }
public DateTime? OrderDate { get; set; }
public string TakenBy { get; set; }
public string TermsCode { get; set; }
public string ShipCode { get; set; }
public string? TakenBy { get; set; }
public string? TermsCode { get; set; }
public string? ShipCode { get; set; }
public decimal? Price { get; set; }
public decimal? Weight { get; set; }
public short? QtyPackages { get; set; }
@@ -42,67 +42,67 @@ namespace SytelineSaAppEfDataModel.Dtos
public decimal? MiscCharges { get; set; }
public decimal? PrepaidAmount { get; set; }
public decimal? SalesTax { get; set; }
public string Status { get; set; }
public string? Status { get; set; }
public decimal? Cost { get; set; }
public DateTime? CloseDate { get; set; }
public decimal? FreightT { get; set; }
public decimal? MchargesT { get; set; }
public decimal? PrepaidT { get; set; }
public decimal? SalesTaxT { get; set; }
public string Salesman { get; set; }
public string? Salesman { get; set; }
public DateTime? EffectiveDate { get; set; }
public DateTime? ExpirationDate { get; set; }
public string Warehouse { get; set; }
public string? Warehouse { get; set; }
public decimal? SalesTaxTwo { get; set; }
public decimal? SalesTaxTwoT { get; set; }
public string CharFieldOne { get; set; }
public string CharFieldTwo { get; set; }
public string CharFieldThree { get; set; }
public string? CharFieldOne { get; set; }
public string? CharFieldTwo { get; set; }
public string? CharFieldThree { get; set; }
public DateTime? DateField { get; set; }
public decimal? DecimalFieldOne { get; set; }
public decimal? DecimalFieldTwo { get; set; }
public decimal? DecimalFieldThree { get; set; }
public byte? LogiField { get; set; }
public byte? EdiOrder { get; set; }
public string TransactionNat { get; set; }
public string ProcessInd { get; set; }
public string DelTerm { get; set; }
public string? TransactionNat { get; set; }
public string? ProcessInd { get; set; }
public string? DelTerm { get; set; }
public byte? UseExchangeRate { get; set; }
public string TaxCodeOne { get; set; }
public string TaxCodeTwo { get; set; }
public string FreightTaxCodeOne { get; set; }
public string FreightTaxCodeTwo { get; set; }
public string MscTaxCodeOne { get; set; }
public string MscTaxCodeTwo { get; set; }
public string? TaxCodeOne { get; set; }
public string? TaxCodeTwo { get; set; }
public string? FreightTaxCodeOne { get; set; }
public string? FreightTaxCodeTwo { get; set; }
public string? MscTaxCodeOne { get; set; }
public string? MscTaxCodeTwo { get; set; }
public decimal? Discount { get; set; }
public string PriceCode { get; set; }
public string? PriceCode { get; set; }
public byte? ShipPartial { get; set; }
public byte? ShipEarly { get; set; }
public string NonApplyData { get; set; }
public string? NonApplyData { get; set; }
public byte NoteExistsFlag { get; set; }
public DateTime RecordDate { get; set; }
public Guid RowPointer { get; set; }
public string CreatedBy { get; set; }
public string UpdatedBy { get; set; }
public string? CreatedBy { get; set; }
public string? UpdatedBy { get; set; }
public DateTime CreateDate { get; set; }
public byte InWorkflow { get; set; }
public string DiscountType { get; set; }
public string? DiscountType { get; set; }
public decimal? DiscountAmount { get; set; }
public string TransNatTwo { get; set; }
public string? TransNatTwo { get; set; }
public string? UfFkrEdiMessageRefNum { get; set; }
public string UfFkrEdiConsigneeAddress { get; set; }
public string UfFkrEdiConsigneeName { get; set; }
public string UfFkrEdiFileName { get; set; }
public string UfFkrEdiBuyerDunsNumber { get; set; }
public string Gate { get; set; }
public string CustomerName { get; set; }
public string? UfFkrEdiConsigneeAddress { get; set; }
public string? UfFkrEdiConsigneeName { get; set; }
public string? UfFkrEdiFileName { get; set; }
public string? UfFkrEdiBuyerDunsNumber { get; set; }
public string? Gate { get; set; }
public string? CustomerName { get; set; }
public string? RecipientCode { get; set; }
public string? SenderCode { get; set; }
public string? SellerCode { get; set; }
public string? DocType { get; set; }
public string? BuyerCode { get; set; }
public string TranslatedStatus => TranslateStatus(Status);
public string TranslatedStatus => TranslateStatus(Status ?? string.Empty);
public string? SlOrderNumber => EdiCustomerOrderTranslates.MaxBy(x => x.CreatedDate)?.CoCoNum;
public string SentToSl => Posted == 1 ? "TAK" : "NIE";

View File

@@ -6,7 +6,7 @@ public class EdiCustomerOrderImportDto
public int ScheduleOrderId { get; set; }
public DateTime LastUpdateDate { get; set; }
public DateTime CreatedDate { get; set; }
public string Status { get; set; }
public string LogData { get; set; }
public string? Status { get; set; }
public string? LogData { get; set; }
public int ItemsCount { get; set; }
}

View File

@@ -9,31 +9,31 @@ namespace SytelineSaAppEfDataModel.Dtos
{
public class EdiCustomerOrderLineDto : DtoBase
{
public string CustomerOrderNumber { get; set; }
public string? CustomerOrderNumber { get; set; }
public int CustomerOrderLine { get; set; }
public string Item { get; set; }
public string CustomerItemNumber { get; set; }
public string FeatStr { get; set; }
public string? Item { get; set; }
public string? CustomerItemNumber { get; set; }
public string? FeatStr { get; set; }
public decimal? BlanketQty { get; set; }
public DateTime? EffectiveDate { get; set; }
public DateTime? ExpirationDate { get; set; }
public decimal? ContPrice { get; set; }
public string Status { get; set; }
public string? Status { get; set; }
public DateTime? PromiseDate { get; set; }
public string PriceCode { get; set; }
public string Uom { get; set; }
public string? PriceCode { get; set; }
public string? Uom { get; set; }
public decimal? BlanketQtyReleased { get; set; }
public decimal? ContPriceReleased { get; set; }
public decimal? QtySent { get; set; }
public string SentCode { get; set; }
public string NonAppliedData { get; set; }
public string? SentCode { get; set; }
public string? NonAppliedData { get; set; }
public byte NoteExistsFlag { get; set; }
public DateTime RecordDate { get; set; }
public Guid RowPointer { get; set; }
public string Description { get; set; }
public string CreatedBy { get; set; }
public string UpdatedBy { get; set; }
public DateTime CreateDate { get; set; }
public string? Description { get; set; }
public string? CreatedBy { get; set; }
public string? UpdatedBy { get; set; }
public DateTime? CreateDate { get; set; }
public byte InWorkflow { get; set; }
public string? BoxType { get; set; }
public string? Address { get; set; }

View File

@@ -8,7 +8,7 @@ namespace SytelineSaAppEfDataModel.Dtos
{
public class EdiCustomerOrderLineItemDto : DtoBase
{
public string TransactionCode { get; set; }
public string? TransactionCode { get; set; }
public DateTime? ReceivedDate { get; set; }
public byte? Posted { get; set; }
public DateTime? PostedDate { get; set; }
@@ -17,17 +17,17 @@ namespace SytelineSaAppEfDataModel.Dtos
public byte? Override { get; set; }
public byte? Edi { get; set; }
public byte? Ack { get; set; }
public string AckNumber { get; set; }
public string AckType { get; set; }
public string? AckNumber { get; set; }
public string? AckType { get; set; }
public DateTime? AckDate { get; set; }
public string SymCustomerOrderNumber { get; set; }
public string? SymCustomerOrderNumber { get; set; }
public byte? QtyChanged { get; set; }
public byte? DateChanged { get; set; }
public byte? PriceChanged { get; set; }
public string CustomerOrderNumber { get; set; }
public string? CustomerOrderNumber { get; set; }
public int CustomerOrderLine { get; set; }
public int CustomerOrderRelease { get; set; }
public string Item { get; set; }
public string? Item { get; set; }
public decimal? QtyOrdered { get; set; }
public decimal? QtyReady { get; set; }
public decimal? QtyShipped { get; set; }
@@ -35,8 +35,8 @@ namespace SytelineSaAppEfDataModel.Dtos
public decimal? Discount { get; set; }
public decimal? Cost { get; set; }
public decimal? Price { get; set; }
public string RefType { get; set; }
public string RefNumber { get; set; }
public string? RefType { get; set; }
public string? RefNumber { get; set; }
public short? RefLineSuf { get; set; }
public short? RefRelease { get; set; }
public DateTime? DueDate { get; set; }
@@ -47,68 +47,68 @@ namespace SytelineSaAppEfDataModel.Dtos
public decimal? BrkQtyFour { get; set; }
public decimal? BrkQtyFive { get; set; }
public byte? Reprice { get; set; }
public string CustomerItem { get; set; }
public string? CustomerItem { get; set; }
public decimal? QtyInvoiced { get; set; }
public decimal? QtyReturned { get; set; }
public decimal? CgsTotal { get; set; }
public string FeatStr { get; set; }
public string Status { get; set; }
public string CustomerNumber { get; set; }
public string? FeatStr { get; set; }
public string? Status { get; set; }
public string? CustomerNumber { get; set; }
public int? CustomerSequence { get; set; }
public decimal? PrgBillTot { get; set; }
public decimal? PrgBillApp { get; set; }
public DateTime? ReleaseDate { get; set; }
public DateTime? PromiseDate { get; set; }
public string Warehouse { get; set; }
public string WksBasis { get; set; }
public string? Warehouse { get; set; }
public string? WksBasis { get; set; }
public decimal? WksValue { get; set; }
public string CommCode { get; set; }
public string TransNat { get; set; }
public string ProcessInd { get; set; }
public string DelTerm { get; set; }
public string? CommCode { get; set; }
public string? TransNat { get; set; }
public string? ProcessInd { get; set; }
public string? DelTerm { get; set; }
public decimal? UnitWeight { get; set; }
public string Origin { get; set; }
public string? Origin { get; set; }
public int? ConsNumber { get; set; }
public string TaxCodeOne { get; set; }
public string TaxCodeTwo { get; set; }
public string? TaxCodeOne { get; set; }
public string? TaxCodeTwo { get; set; }
public decimal? ExportValue { get; set; }
public string EcCode { get; set; }
public string Transport { get; set; }
public string? EcCode { get; set; }
public string? Transport { get; set; }
public DateTime? PickupDate { get; set; }
public string PriceCode { get; set; }
public string Uom { get; set; }
public string? PriceCode { get; set; }
public string? Uom { get; set; }
public decimal? QtyOrderedReleased { get; set; }
public decimal? PriceReleased { get; set; }
public string CustomerOrderCustomerNumber { get; set; }
public string? CustomerOrderCustomerNumber { get; set; }
public byte? Packed { get; set; }
public byte? Bol { get; set; }
public decimal? QtyBco { get; set; }
public string BcoCode { get; set; }
public string ExternalRef { get; set; }
public string CustomerPoNumber { get; set; }
public string NonApplyData { get; set; }
public string? BcoCode { get; set; }
public string? ExternalRef { get; set; }
public string? CustomerPoNumber { get; set; }
public string? NonApplyData { get; set; }
public byte NoteExistsFlag { get; set; }
public DateTime RecordDate { get; set; }
public Guid RowPointer { get; set; }
public string Description { get; set; }
public string CreatedBy { get; set; }
public string UpdatedBy { get; set; }
public string? Description { get; set; }
public string? CreatedBy { get; set; }
public string? UpdatedBy { get; set; }
public DateTime CreateDate { get; set; }
public byte InWorkflow { get; set; }
public string TransNatTwo { get; set; }
public string? TransNatTwo { get; set; }
public decimal SupplyQtyConvFactor { get; set; }
public string UfFkrEdiAddIntDest { get; set; }
public string UfFkrEdiCustPoLineNum { get; set; }
public string UfFkrEdiPlaceOrPortDischarge { get; set; }
public string? UfFkrEdiAddIntDest { get; set; }
public string? UfFkrEdiCustPoLineNum { get; set; }
public string? UfFkrEdiPlaceOrPortDischarge { get; set; }
public string? RoutingCode { get; set; }
public string? DeliveryCallNumber { get; set; }
public string? UnloadingPoint { get; set; }
public string? DestinationPoint { get; set; }
public string NewStatus { get; set; }
public string PalletCode { get; set; }
public string? NewStatus { get; set; }
public string? PalletCode { get; set; }
public string? PalletNumber { get; set; }
public string DocumentType { get; set; }
public string? DocumentType { get; set; }
public string TranslatedStatus => TranslateStatus(Status);
}
}

View File

@@ -12,16 +12,16 @@ namespace SytelineSaAppEfDataModel.Dtos
public int Id { get; set; }
public byte CoEdiOrder { get; set; }
public Guid CoRowPointer { get; set; }
public string CoCoNum { get; set; }
public string CoType { get; set; }
public string CoTakenBy { get; set; }
public string EdiCoCoNum { get; set; }
public string? CoCoNum { get; set; }
public string? CoType { get; set; }
public string? CoTakenBy { get; set; }
public string? EdiCoCoNum { get; set; }
public int OrdersCount { get; set; }
public bool OrderFound { get; set; }
public DateTime CreatedDate { get; set; }
public string FoundNumbers { get; set; }
public string? FoundNumbers { get; set; }
public int ScheduleOrderId { get; set; }
[Ignore] public string PoNumber { get; set; }
[Ignore] public string? PoNumber { get; set; }
}
}

View File

@@ -8,8 +8,8 @@ namespace SytelineSaAppEfDataModel.Entities
{
public class EdiCustomerOrder : EntityBase
{
public string TransactionCode { get; set; }
public string TpCode { get; set; }
public string? TransactionCode { get; set; }
public string? TpCode { get; set; }
public DateTime? RecivedDate { get; set; }
public byte? Posted { get; set; }
public DateTime? PostedDate { get; set; }
@@ -17,24 +17,24 @@ namespace SytelineSaAppEfDataModel.Entities
public short? ErrorMessage { get; set; }
public byte? Override { get; set; }
public byte? Ack { get; set; }
public string AckNumber { get; set; }
public string? AckNumber { get; set; }
public int? AckSequence { get; set; }
public string AckType { get; set; }
public string? AckType { get; set; }
public DateTime? AckDate { get; set; }
public string SymbolicCustomerOrderNumber { get; set; }
public string? SymbolicCustomerOrderNumber { get; set; }
public decimal? BlanketDollar { get; set; }
public string Type { get; set; }
public string CustomerOrderNumber { get; set; }
public string EstimatedNumber { get; set; }
public string CustomerNumber { get; set; }
public string? Type { get; set; }
public string? CustomerOrderNumber { get; set; }
public string? EstimatedNumber { get; set; }
public string? CustomerNumber { get; set; }
public int? CustomerSequence { get; set; }
public string Contact { get; set; }
public string Phone { get; set; }
public string CustomerPoNumber { get; set; }
public string? Contact { get; set; }
public string? Phone { get; set; }
public string? CustomerPoNumber { get; set; }
public DateTime? OrderDate { get; set; }
public string TakenBy { get; set; }
public string TermsCode { get; set; }
public string ShipCode { get; set; }
public string? TakenBy { get; set; }
public string? TermsCode { get; set; }
public string? ShipCode { get; set; }
public decimal? Price { get; set; }
public decimal? Weight { get; set; }
public short? QtyPackages { get; set; }
@@ -42,64 +42,64 @@ namespace SytelineSaAppEfDataModel.Entities
public decimal? MiscCharges { get; set; }
public decimal? PrepaidAmount { get; set; }
public decimal? SalesTax { get; set; }
public string Status { get; set; }
public string? Status { get; set; }
public decimal? Cost { get; set; }
public DateTime? CloseDate { get; set; }
public decimal? FreightT { get; set; }
public decimal? MchargesT { get; set; }
public decimal? PrepaidT { get; set; }
public decimal? SalesTaxT { get; set; }
public string Salesman { get; set; }
public string? Salesman { get; set; }
public DateTime? EffectiveDate { get; set; }
public DateTime? ExpirationDate { get; set; }
public string Warehouse { get; set; }
public string? Warehouse { get; set; }
public decimal? SalesTaxTwo { get; set; }
public decimal? SalesTaxTwoT { get; set; }
public string CharFieldOne { get; set; }
public string CharFieldTwo { get; set; }
public string CharFieldThree { get; set; }
public string? CharFieldOne { get; set; }
public string? CharFieldTwo { get; set; }
public string? CharFieldThree { get; set; }
public DateTime? DateField { get; set; }
public decimal? DecimalFieldOne { get; set; }
public decimal? DecimalFieldTwo { get; set; }
public decimal? DecimalFieldThree { get; set; }
public byte? LogiField { get; set; }
public byte? EdiOrder { get; set; }
public string TransactionNat { get; set; }
public string ProcessInd { get; set; }
public string DelTerm { get; set; }
public string? TransactionNat { get; set; }
public string? ProcessInd { get; set; }
public string? DelTerm { get; set; }
public byte? UseExchangeRate { get; set; }
public string TaxCodeOne { get; set; }
public string TaxCodeTwo { get; set; }
public string FreightTaxCodeOne { get; set; }
public string FreightTaxCodeTwo { get; set; }
public string MscTaxCodeOne { get; set; }
public string MscTaxCodeTwo { get; set; }
public string? TaxCodeOne { get; set; }
public string? TaxCodeTwo { get; set; }
public string? FreightTaxCodeOne { get; set; }
public string? FreightTaxCodeTwo { get; set; }
public string? MscTaxCodeOne { get; set; }
public string? MscTaxCodeTwo { get; set; }
public decimal? Discount { get; set; }
public string PriceCode { get; set; }
public string? PriceCode { get; set; }
public byte? ShipPartial { get; set; }
public byte? ShipEarly { get; set; }
public string NonApplyData { get; set; }
public string? NonApplyData { get; set; }
public byte NoteExistsFlag { get; set; }
public DateTime RecordDate { get; set; }
public Guid RowPointer { get; set; }
public string CreatedBy { get; set; }
public string UpdatedBy { get; set; }
public string? CreatedBy { get; set; }
public string? UpdatedBy { get; set; }
public DateTime CreateDate { get; set; }
public byte InWorkflow { get; set; }
public string DiscountType { get; set; }
public string? DiscountType { get; set; }
public decimal? DiscountAmount { get; set; }
public string TransNatTwo { get; set; }
public string UfFkrEdiMessageRefNum { get; set; }
public string UfFkrEdiConsigneeAddress { get; set; }
public string UfFkrEdiConsigneeName { get; set; }
public string UfFkrEdiFileName { get; set; }
public string UfFkrEdiBuyerDunsNumber { get; set; }
public string Gate { get; set; }
public string CustomerName { get; set; }
public string RecipientCode { get; set; }
public string SenderCode { get; set; }
public string SellerCode { get; set; }
public string DocType { get; set; }
public string BuyerCode { get; set; }
public string? TransNatTwo { get; set; }
public string? UfFkrEdiMessageRefNum { get; set; }
public string? UfFkrEdiConsigneeAddress { get; set; }
public string? UfFkrEdiConsigneeName { get; set; }
public string? UfFkrEdiFileName { get; set; }
public string? UfFkrEdiBuyerDunsNumber { get; set; }
public string? Gate { get; set; }
public string? CustomerName { get; set; }
public string? RecipientCode { get; set; }
public string? SenderCode { get; set; }
public string? SellerCode { get; set; }
public string? DocType { get; set; }
public string? BuyerCode { get; set; }
}
}

View File

@@ -8,35 +8,35 @@ namespace SytelineSaAppEfDataModel.Entities
{
public class EdiCustomerOrderLine
{
public string CustomerOrderNumber { get; set; }
public string? CustomerOrderNumber { get; set; }
public int CustomerOrderLine { get; set; }
public string Item { get; set; }
public string CustomerItemNumber { get; set; }
public string FeatStr { get; set; }
public string? Item { get; set; }
public string? CustomerItemNumber { get; set; }
public string? FeatStr { get; set; }
public decimal? BlanketQty { get; set; }
public DateTime? EffectiveDate { get; set; }
public DateTime? ExpirationDate { get; set; }
public decimal? ContPrice { get; set; }
public string Status { get; set; }
public string? Status { get; set; }
public DateTime? PromiseDate { get; set; }
public string PriceCode { get; set; }
public string Uom { get; set; }
public string? PriceCode { get; set; }
public string? Uom { get; set; }
public decimal? BlanketQtyReleased { get; set; }
public decimal? ContPriceReleased { get; set; }
public decimal? QtySent { get; set; }
public string SentCode { get; set; }
public string NonAppliedData { get; set; }
public string? SentCode { get; set; }
public string? NonAppliedData { get; set; }
public byte NoteExistsFlag { get; set; }
public DateTime RecordDate { get; set; }
public Guid RowPointer { get; set; }
public string Description { get; set; }
public string CreatedBy { get; set; }
public string UpdatedBy { get; set; }
public DateTime CreateDate { get; set; }
public string? Description { get; set; }
public string? CreatedBy { get; set; }
public string? UpdatedBy { get; set; }
public DateTime? CreateDate { get; set; }
public byte InWorkflow { get; set; }
public string BoxType { get; set; }
public string Address { get; set; }
public string FinalDestination { get; set; }
public string? BoxType { get; set; }
public string? Address { get; set; }
public string? FinalDestination { get; set; }
public int? QtyPerBox { get; set; }
}
}

View File

@@ -8,7 +8,7 @@ namespace SytelineSaAppEfDataModel.Entities
{
public class EdiCustomerOrderLineItem
{
public string TransactionCode { get; set; }
public string? TransactionCode { get; set; }
public DateTime? ReceivedDate { get; set; }
public byte? Posted { get; set; }
public DateTime? PostedDate { get; set; }
@@ -17,17 +17,17 @@ namespace SytelineSaAppEfDataModel.Entities
public byte? Override { get; set; }
public byte? Edi { get; set; }
public byte? Ack { get; set; }
public string AckNumber { get; set; }
public string AckType { get; set; }
public string? AckNumber { get; set; }
public string? AckType { get; set; }
public DateTime? AckDate { get; set; }
public string SymCustomerOrderNumber { get; set; }
public string? SymCustomerOrderNumber { get; set; }
public byte? QtyChanged { get; set; }
public byte? DateChanged { get; set; }
public byte? PriceChanged { get; set; }
public string CustomerOrderNumber { get; set; }
public string? CustomerOrderNumber { get; set; }
public int CustomerOrderLine { get; set; }
public int CustomerOrderRelease { get; set; }
public string Item { get; set; }
public string? Item { get; set; }
public decimal? QtyOrdered { get; set; }
public decimal? QtyReady { get; set; }
public decimal? QtyShipped { get; set; }
@@ -35,8 +35,8 @@ namespace SytelineSaAppEfDataModel.Entities
public decimal? Discount { get; set; }
public decimal? Cost { get; set; }
public decimal? Price { get; set; }
public string RefType { get; set; }
public string RefNumber { get; set; }
public string? RefType { get; set; }
public string? RefNumber { get; set; }
public short? RefLineSuf { get; set; }
public short? RefRelease { get; set; }
public DateTime? DueDate { get; set; }
@@ -47,67 +47,67 @@ namespace SytelineSaAppEfDataModel.Entities
public decimal? BrkQtyFour { get; set; }
public decimal? BrkQtyFive { get; set; }
public byte? Reprice { get; set; }
public string CustomerItem { get; set; }
public string? CustomerItem { get; set; }
public decimal? QtyInvoiced { get; set; }
public decimal? QtyReturned { get; set; }
public decimal? CgsTotal { get; set; }
public string FeatStr { get; set; }
public string Status { get; set; }
public string CustomerNumber { get; set; }
public string? FeatStr { get; set; }
public string? Status { get; set; }
public string? CustomerNumber { get; set; }
public int? CustomerSequence { get; set; }
public decimal? PrgBillTot { get; set; }
public decimal? PrgBillApp { get; set; }
public DateTime? ReleaseDate { get; set; }
public DateTime? PromiseDate { get; set; }
public string Warehouse { get; set; }
public string WksBasis { get; set; }
public string? Warehouse { get; set; }
public string? WksBasis { get; set; }
public decimal? WksValue { get; set; }
public string CommCode { get; set; }
public string TransNat { get; set; }
public string ProcessInd { get; set; }
public string DelTerm { get; set; }
public string? CommCode { get; set; }
public string? TransNat { get; set; }
public string? ProcessInd { get; set; }
public string? DelTerm { get; set; }
public decimal? UnitWeight { get; set; }
public string Origin { get; set; }
public string? Origin { get; set; }
public int? ConsNumber { get; set; }
public string TaxCodeOne { get; set; }
public string TaxCodeTwo { get; set; }
public string? TaxCodeOne { get; set; }
public string? TaxCodeTwo { get; set; }
public decimal? ExportValue { get; set; }
public string EcCode { get; set; }
public string Transport { get; set; }
public string? EcCode { get; set; }
public string? Transport { get; set; }
public DateTime? PickupDate { get; set; }
public string PriceCode { get; set; }
public string Uom { get; set; }
public string? PriceCode { get; set; }
public string? Uom { get; set; }
public decimal? QtyOrderedReleased { get; set; }
public decimal? PriceReleased { get; set; }
public string CustomerOrderCustomerNumber { get; set; }
public string? CustomerOrderCustomerNumber { get; set; }
public byte? Packed { get; set; }
public byte? Bol { get; set; }
public decimal? QtyBco { get; set; }
public string BcoCode { get; set; }
public string ExternalRef { get; set; }
public string CustomerPoNumber { get; set; }
public string NonApplyData { get; set; }
public string? BcoCode { get; set; }
public string? ExternalRef { get; set; }
public string? CustomerPoNumber { get; set; }
public string? NonApplyData { get; set; }
public byte NoteExistsFlag { get; set; }
public DateTime RecordDate { get; set; }
public Guid RowPointer { get; set; }
public string Description { get; set; }
public string CreatedBy { get; set; }
public string UpdatedBy { get; set; }
public string? Description { get; set; }
public string? CreatedBy { get; set; }
public string? UpdatedBy { get; set; }
public DateTime CreateDate { get; set; }
public byte InWorkflow { get; set; }
public string TransNatTwo { get; set; }
public string? TransNatTwo { get; set; }
public decimal SupplyQtyConvFactor { get; set; }
public string UfFkrEdiAddIntDest { get; set; }
public string UfFkrEdiCustPoLineNum { get; set; }
public string UfFkrEdiPlaceOrPortDischarge { get; set; }
public string RoutingCode { get; set; }
public string DeliveryCallNumber { get; set; }
public string UnloadingPoint { get; set; }
public string DestinationPoint { get; set; }
public string NewStatus { get; set; }
public string PalletCode { get; set; }
public string PalletNumber { get; set; }
public string? UfFkrEdiAddIntDest { get; set; }
public string? UfFkrEdiCustPoLineNum { get; set; }
public string? UfFkrEdiPlaceOrPortDischarge { get; set; }
public string? RoutingCode { get; set; }
public string? DeliveryCallNumber { get; set; }
public string? UnloadingPoint { get; set; }
public string? DestinationPoint { get; set; }
public string? NewStatus { get; set; }
public string? PalletCode { get; set; }
public string? PalletNumber { get; set; }
public string DocumentType { get; set; }
public string? DocumentType { get; set; }
}
}

View File

@@ -11,14 +11,14 @@ namespace SytelineSaAppEfDataModel.Entities
public int Id { get; set; }
public byte CoEdiOrder { get; set; }
public Guid CoRowPointer { get; set; }
public string CoCoNum { get; set; }
public string CoType { get; set; }
public string CoTakenBy { get; set; }
public string EdiCoCoNum { get; set; }
public string? CoCoNum { get; set; }
public string? CoType { get; set; }
public string? CoTakenBy { get; set; }
public string? EdiCoCoNum { get; set; }
public int OrdersCount { get; set; }
public bool OrderFound { get; set; }
public DateTime CreatedDate { get; set; }
public string FoundNumbers { get; set; }
public string? FoundNumbers { get; set; }
public int ScheduleOrderId { get; set; }
}
}

View File

@@ -109,14 +109,19 @@ namespace SytelineSaAppEfDataModel.Services
public async Task<int> SendOrderToSyteline(Guid customerOrderNumber)
{
EdiCustomerOrder? ediCustomerOrder = await context.EdiCustomerOrders.FirstOrDefaultAsync(x => x.RowPointer == customerOrderNumber);
EdiCustomerOrder? ediCustomerOrder =
await context.EdiCustomerOrders.FirstOrDefaultAsync(x => x.RowPointer == customerOrderNumber);
if (ediCustomerOrder == null) return 0;
var ediCoNum = new SqlParameter("@PEdiCoNum", SqlDbType.NVarChar, 50) { Value = ediCustomerOrder.CustomerOrderNumber };
var ediCoCount = new SqlParameter("@PEdiCoCount", SqlDbType.Int) { Value = 0, Direction = ParameterDirection.Output };
var postedCount = new SqlParameter("@PPostedCount", SqlDbType.Int) { Value = 0, Direction = ParameterDirection.Output };
var infoBar = new SqlParameter("@Infobar", SqlDbType.NVarChar, 2800) { Value = "", Direction = ParameterDirection.Output };
var ediCoNum = new SqlParameter("@PEdiCoNum", SqlDbType.NVarChar, 50)
{ Value = ediCustomerOrder.CustomerOrderNumber };
var ediCoCount = new SqlParameter("@PEdiCoCount", SqlDbType.Int)
{ Value = 0, Direction = ParameterDirection.Output };
var postedCount = new SqlParameter("@PPostedCount", SqlDbType.Int)
{ Value = 0, Direction = ParameterDirection.Output };
var infoBar = new SqlParameter("@Infobar", SqlDbType.NVarChar, 2800)
{ Value = "", Direction = ParameterDirection.Output };
var autoPost = new SqlParameter("@AutoPost", SqlDbType.Int) { Value = 0 };
var processId = new SqlParameter("@ProcessId", SqlDbType.Int) { Value = 423456 };
@@ -134,5 +139,33 @@ namespace SytelineSaAppEfDataModel.Services
return postedCountResult;
}
public async Task<(bool, string)> SaveOrdersWithDetails(List<EdiCustomerOrderDto> ediCustomerOrders)
{
if (ediCustomerOrders.Count == 0)
{
return (false, string.Empty);
}
try
{
await context.EdiCustomerOrders.AddRangeAsync(ediCustomerOrders.Select(mapper.Map<EdiCustomerOrder>));
await context.EdiCustomerOrderLines.AddRangeAsync(ediCustomerOrders
.SelectMany(x => x.EdiCustomerOrderLines)
.Select(mapper.Map<EdiCustomerOrderLine>));
await context.EdiCustomerOrderLineItems.AddRangeAsync(ediCustomerOrders
.SelectMany(x => x.EdiCustomerOrderLines)
.SelectMany(y => y.EdiCustomerOrderLineItems).Select(mapper.Map<EdiCustomerOrderLineItem>));
await context.EdiCustomerOrderTranslates.AddRangeAsync(ediCustomerOrders
.SelectMany(x => x.EdiCustomerOrderTranslates)
.Select(mapper.Map<EdiCustomerOrderTranslate>));
await context.SaveChangesAsync();
return (true, string.Empty);
}
catch (Exception ex)
{
return (false, ex.Message);
}
}
}
}

View File

@@ -14,6 +14,7 @@ namespace SytelineSaAppEfDataModel.Services
Task<IEnumerable<EdiCustomerOrderDto?>> GetByDate(DateTime date);
Task<EdiCustomerOrderDto?> GetByOrderNumber(Guid orderNumber);
Task<IEnumerable<EdiCustomerOrderTranslateDto>> FindMissingOrders(DateTime startDate);
Task<(bool, string)> SaveOrdersWithDetails(List<EdiCustomerOrderDto> ediCustomerOrders);
Task<int> SendOrderToSyteline(Guid customerOrderNumber);
}
}