NJC__Documentation::DB

dbo.spu_invoicenonhib_del_bc40_27

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

Name Data Type Length Description
@nobl varchar 50
@tgbl datetime 8
@typebc varchar 10

SQL Script

SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

create PROCEDURE dbo.spu_invoicenonhib_del_bc40_27
@nobl varchar(50), @tgbl datetime, @typebc varchar(10)
AS
BEGIN
  declare @id_bc_in bigint
  if (select COUNT(*) from [dbo].[tbl_bc_in_hdr] where nobl=@nobl and tglbl=@tgbl and [statusdok] = 'DATA BARU' and [typedok] =@typebc ) = 0
  begin
 select '06' as status, ' DATA TIDAK BISA DI UPDATE' as description
 return
  end  
  set @id_bc_in = (select [id_bc_in_hdr] from [dbo].[tbl_bc_in_hdr] where nobl=@nobl and tglbl=@tgbl and [statusdok] = 'DATA BARU' and [typedok] =@typebc )
  
  delete [dbo].[tbl_bc_in_hdr_h_status] where [id_bc_in_hdr] = @id_bc_in
  delete [dbo].tbl_bc_in_con where [id_bc_in_hdr] = @id_bc_in
  delete [dbo].tbl_bc_in_dok where [id_bc_in_hdr] = @id_bc_in
  delete [dbo].tbl_bc_in_dtl where [id_bc_in_hdr] = @id_bc_in
  delete [dbo].tbl_bc_in_dtl_partnumber where [id_bc_in_hdr] = @id_bc_in
  delete [dbo].tbl_bc_in_hdr where [id_bc_in_hdr] = @id_bc_in
  
  update dbo.tbl_inv_hdr set  nobl = '-', tgbl =  null,[status_inv]=0  where nobl=@nobl and tgbl=@tgbl and [status_inv]=1
  select '00' as status, ' DATA SUKSES DI UPDATE' as description
END
--go
--EXEC ('spu_invoicenonhib_del_bc40_27 @nobl=''BC4020130924000222'', @tgbl=''2013-09-24'', @typebc=''BC40'' ')
GO

Used By

No items found