Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* This script will copy transactions from the SV000815 table to the SV000810 for a given service call ID
- and then remove the transactions from SV000815. This is used if the customer manually closes a call which
- moves the costs to history but it does not bill them. Moving the transactions to SV000810 will allow billing
- of those transactions.
- This was written with the table structure in 16.00b02g214.
- */
- INSERT INTO [dbo].[SV000810]
- SELECT
- [Service_Call_ID]
- ,'' --[Call_Invoice_Number]
- ,[JRNENTRY]
- ,[OH_ACTINDX_CR]
- ,[OH_ACTINDX_DR]
- ,[Divisions]
- ,[UNITCOST]
- ,[Wennsoft_Affiliate]
- ,[Wennsoft_Region]
- ,[Wennsoft_Branch]
- ,[USERID]
- ,[Technician_ID]
- ,[Technician_Team]
- ,[Reference_TRX_Number]
- ,[CUSTNMBR]
- ,[ADRSCODE]
- ,[SEQNUMBR]
- ,[WS_Job_Name]
- ,[Job_Type]
- ,[Appointment]
- ,[Sub_Task_Code]
- ,[Added_Rate]
- ,[Travel_Transaction]
- ,[WS_Cost_Code]
- ,[WS_Other_Cost_Sub_Code]
- ,[Cost_Code_Description]
- ,[Task_Code]
- ,[DOCTYPE]
- ,[DOCAMNT]
- ,[DOCDATE]
- ,[TRXDSCRN]
- ,[Billable_Check_Box]
- ,[TAXABLE]
- ,[TRXSOURC]
- ,[Billing_Amount]
- ,[VENDORID]
- ,[VENDNAME]
- ,[Equipment_ID]
- ,[Equipment_Type]
- ,[Dynamics_Status]
- ,'OPEN' --[Wennsoft_Status]
- ,[BACHNUMB]
- ,[BCHSOURC]
- ,[TRXHRUNT]
- ,[EMPLOYID]
- ,[EMPLNAME]
- ,[VCHNUMWK]
- ,[OH_Amount]
- ,[EXTDCOST]
- ,[WS_Extended_Cost]
- ,[TRXQTY]
- ,[UOFM]
- ,[ITEMNMBR]
- ,[ITEMDESC]
- ,[UNITPRCE]
- ,[JOBTITLE]
- ,[PAYRCORD]
- ,[PAYRATE]
- ,[Billing_Rate]
- ,[Add_New_Equipment_Record]
- ,[New_Equipment_ID]
- ,[Wennsoft_Model_Number]
- ,[Wennsoft_Serial_Number]
- ,[Manufacturer_ID]
- ,[Note_Checkbox]
- ,[TRXHRUNTBILL]
- ,[WS_Committed_Cost]
- ,[TRXQTYBILL]
- ,[WIP_ACTINDX_CR]
- ,[OH_WIP_ACTINDX_CR]
- ,[ACTINDX_CR]
- ,[ACTINDX_DR]
- ,[INV_ACTINDX_DR]
- ,[INV_ACTINDX_CR]
- ,[SHFTCODE]
- ,[SHFTPREM]
- ,[Labor_Group_Name]
- ,[Pricing_Matrix_Name]
- ,[Travel_Rate_Name]
- ,[Service_User_Define_1]
- ,[Service_User_Define_2]
- ,[Service_User_Define_5]
- ,[Service_User_Define_6]
- ,[Service_User_Define_7]
- ,[Service_User_Define_8]
- ,[Service_User_Define_9]
- ,[Service_User_Define_10]
- ,[Service_User_Define_11]
- ,[Service_User_Define_12]
- ,[Service_User_Define_18]
- ,[Service_User_Define_19]
- ,[Service_User_Define_20]
- ,[Service_User_Define_21]
- ,[Service_User_Define_22]
- ,[Service_User_Define_23]
- ,[Service_User_Define_24]
- ,[Service_User_Define_25]
- ,[MODIFDT]
- ,[Modified_Time]
- ,[MDFUSRID]
- ,[Time_Zone]
- ,[SV_Language_ID]
- ,[Base_Currency_ID]
- ,[Base_Curr_Conv_Factor]
- ,[Billing_Currency_ID]
- ,[Billing_Curr_Conv_Factor]
- ,[Local_Currency_ID]
- ,[WSReserved_CB1]
- ,[WSReserved_CB2]
- ,[WSReserved_CB3]
- ,[WSReserved_CB4]
- ,[WSReserved_CB5]
- ,[WSReserved_CB6]
- ,[WSReserved_CB7]
- ,[WSReserved_CB8]
- ,[WSReserved_CB9]
- ,[WSReserved_CB10]
- ,[WSReserved_STR1]
- ,[WSReserved_STR2]
- ,[WS_Created_Date]
- ,[WS_Created_Time]
- ,[GLPOSTDT]
- ,[BilledToJob]
- ,[WS_Grouped]
- ,[REVSETRX]
- ,[PYADNMBR]
- ,[VOIDPYADNMBR]
- ,[NonBillable]
- ,[Task_Account]
- ,[ORGSEQNUMBR]
- ,[WS_Transaction_Note]
- FROM SV000815 WHERE Service_Call_ID = '170815-0001'
- DELETE SV000815 WHERE Service_Call_ID = '170815-0001'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement