DynEntTech / CBKnownIssues

0 stars 0 forks source link

Supplier, Ship From issues with multiple ship from per supplier #52

Open davidonelson opened 11 months ago

davidonelson commented 11 months ago

If you have multiple ship-from records under a supplier, there are issues with adding items. When you add an item to a supplier, it does not automatically get added to all ship-from records. Therefore, when you try to create a PO using the non-primary ship-from, the item cannot be added to the PO. (I THINK) More research is needed.

davidonelson commented 11 months ago

SAMPLE INSERT QUERY to fix the issue:

Insert into InventorySupplier ( ItemCode , SupplierCode , warehouseCode , UnitMeasureCode , ShortDescription , LeadTime , DefaultCost , CurrencyCost , CurrencyCode , DiscountPercent , DiscountBefore , DiscountAfter , Priority , DefaultSupplier , LastCost , MinLevel , MaxLevel , PurchaseReorderLevel , UserCreated , DateCreated , UserModified , DateModified , PurchaseTaxOption , LastCostDate , UsualQtyOrder , ShipFromCode , ShipFromName , DefaultReaderQty , QtyInStock , ShipFromCountry , IsDefaultSupplierShipFrom , PerItemFee , PerOrderFee , CBNItemVersion , IsTemp , PerItemFeeRate ) select a.ItemCode , c.SupplierCode , d.warehouseCode , 'EACH' as UnitMeasureCode , '33-508 Organic Clutch Kit: IHC Truck - 13 in. x 10T x 1-1/2 in.' as ShortDescription , 0 as LeadTime , c.BaseCost as DefaultCost , c.BaseCost as CurrencyCost , e.CurrencyCode , 0 as DiscountPercent , 0 as DiscountBefore , 0 as DiscountAfter , 0 as Priority , 0 as DefaultSupplier , c.BaseCost as LastCost , 0 as MinLevel , 0 as MaxLevel , 0 as PurchaseReorderLevel , 'admin' as UserCreated , GETDATE() as DateCreated , 'admin' as UserModified , GETDATE() as DateModified , 'Customer' as PurchaseTaxOption , GETDATE() as LastCostDate , 0 as UsualQtyOrder , f.ShipFromCode , f.ShipFromName , 0 as DefaultReaderQty , 0 as QtyInStock , f.Country as ShipFromCountry , 1 as IsDefaultSupplierShipFrom , 0 as PerItemFee , 0 as PerOrderFee , 0 as CBNItemVersion , 0 as IsTemp , 0 as PerItemFeeRate from InventoryItem a inner join InventorySupplierPricingLevel c on a.ItemCode = c.ItemCode inner join Supplier e on c.SupplierCode = e.SupplierCode inner join SupplierShipFrom f on e.DefaultShipFrom = f.ShipFromCode cross join InventoryWarehouse d where c.ItemCode = 'ITEM-016956' and e.SupplierCode <> 'SUP-000170'