Copy Purchase orders

Does any one know how to copy a purchase order?

We do booking orders and have different ship dates. I would like to break up my PO and not have to enter items 2 - 3 times. Thanks

Reply to
lax guy
Loading thread data ...

No-one answered this one yet. Shame, because I could do with knowing. We very often want to produce a PO for 8 branch, all identical.

Please help.

Reply to
chris allsopp

Run the following sql statement

***************************************************** /*You have to specify 2 things the PONumber of the order to be copied and the PONumber of the order to be created*/ begin transaction declare @OldPONo varchar(20) declare @NewPONo varchar(20) declare @OldPOID int declare @NewPOID int

set @OldPONo='' --SPECIFY PONUMBER set @NewPONo='' --SPECIFY PONUMBER

select @OldPOID=ID FROM PurchaseOrder WHERE PONumber=@OldPONo

INSERT INTO PurchaseOrder([POTitle], [POType], [StoreID], [WorksheetID], [PONumber], [Status], [DateCreated], [To], [ShipTo], [Requisitioner], [ShipVia], [FOBPoint], [Terms], [TaxRate], [Shipping], [Freight], [RequiredDate], [ConfirmingTo], [Remarks], [SupplierID], [OtherStoreID], [CurrencyID], [ExchangeRate], [OtherPOID], [InventoryLocation], [IsPlaced], [DatePlaced], [BatchNumber]) select [POTitle], [POType], [StoreID], [WorksheetID], @NewPONo as PONumber,

0 as [Status], getdate(), [To], [ShipTo], [Requisitioner], [ShipVia], [FOBPoint], [Terms], [TaxRate], [Shipping], [Freight], [RequiredDate], [ConfirmingTo], [Remarks], [SupplierID], [OtherStoreID], [CurrencyID], [ExchangeRate], [OtherPOID], [InventoryLocation], [IsPlaced], [DatePlaced], [BatchNumber] from PurchaseOrder where ponumber=@oldpono

if @@error0 begin rollback transaction return end

select @NewPOID=@@identity

INSERT INTO PurchaseOrderEntry ([ItemDescription], [LastUpdated], [QuantityReceivedToDate], [StoreID], [PurchaseOrderID], [QuantityOrdered], [QuantityReceived], [ItemID], [OrderNumber], [Price], [TaxRate], [InventoryOfflineID]) select [ItemDescription], getdate() as [LastUpdated], 0 as [QuantityReceivedToDate], [StoreID], @NewPOID as [PurchaseOrderID], [QuantityOrdered], 0 as [QuantityReceived], [ItemID], [OrderNumber], [Price], [TaxRate], [InventoryOfflineID] from PurchaseOrderEntry WHERE PurchaseOrderID=@OldPOID

commit transaction

****************************************************
Reply to
Nashat

Run the following sql statement

***************************************************** /*You have to specify 2 things the PONumber of the order to be copied and the PONumber of the order to be created*/ begin transaction declare @OldPONo varchar(20) declare @NewPONo varchar(20) declare @OldPOID int declare @NewPOID int

set @OldPONo='' --SPECIFY PONUMBER set @NewPONo='' --SPECIFY PONUMBER

select @OldPOID=ID FROM PurchaseOrder WHERE PONumber=@OldPONo

INSERT INTO PurchaseOrder([POTitle], [POType], [StoreID], [WorksheetID], [PONumber], [Status], [DateCreated], [To], [ShipTo], [Requisitioner], [ShipVia], [FOBPoint], [Terms], [TaxRate], [Shipping], [Freight], [RequiredDate], [ConfirmingTo], [Remarks], [SupplierID], [OtherStoreID], [CurrencyID], [ExchangeRate], [OtherPOID], [InventoryLocation], [IsPlaced], [DatePlaced], [BatchNumber]) select [POTitle], [POType], [StoreID], [WorksheetID], @NewPONo as PONumber,

0 as [Status], getdate(), [To], [ShipTo], [Requisitioner], [ShipVia], [FOBPoint], [Terms], [TaxRate], [Shipping], [Freight], [RequiredDate], [ConfirmingTo], [Remarks], [SupplierID], [OtherStoreID], [CurrencyID], [ExchangeRate], [OtherPOID], [InventoryLocation], [IsPlaced], [DatePlaced], [BatchNumber] from PurchaseOrder where ponumber=@oldpono

if @@error0 begin rollback transaction return end

select @NewPOID=@@identity

INSERT INTO PurchaseOrderEntry ([ItemDescription], [LastUpdated], [QuantityReceivedToDate], [StoreID], [PurchaseOrderID], [QuantityOrdered], [QuantityReceived], [ItemID], [OrderNumber], [Price], [TaxRate], [InventoryOfflineID]) select [ItemDescription], getdate() as [LastUpdated], 0 as [QuantityReceivedToDate], [StoreID], @NewPOID as [PurchaseOrderID], [QuantityOrdered], 0 as [QuantityReceived], [ItemID], [OrderNumber], [Price], [TaxRate], [InventoryOfflineID] from PurchaseOrderEntry WHERE PurchaseOrderID=@OldPOID

commit transaction

****************************************************

"chris alls> No-one answered this one yet. Shame, because I could do with knowing. We

Reply to
Nashat

No-one answered this one yet. Shame, because I could do with knowing. We very often want to produce a PO for 8 branch, all identical.

Please help.

Reply to
spam

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.