USE [WebBranches]
GO
/****** Object:  StoredProcedure [dbo].[proc_text_info_saldo_web]    Script Date: 01/08/2013 09:57:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[proc_text_info_saldo_web]
  @pi_no_polis varchar(12),
  @pi_tanggal datetime
AS
BEGIN
  DECLARE @po_tgl_nav datetime
  DECLARE @po_nilai_nav float
  DECLARE @out_tgl_nav datetime
  DECLARE @out_nilai_nav float

  EXEC IndInsurance.dbo.proc_link_get_nilai_nav_per_polis @pi_tanggal, @pi_no_polis, @out_tgl_nav OUTPUT, @out_nilai_nav OUTPUT

  SELECT    
    @out_tgl_nav AS 'tgl_transaksi',
    IndInsurance.dbo.func_link_get_saldo_akhir_nominal(@pi_no_polis,@pi_tanggal) AS 'nominal',
    @out_nilai_nav AS 'nav',
    IndInsurance.dbo.func_link_get_saldo_akhir_unit(@pi_no_polis,@pi_tanggal) AS 'total_unit'
    
  RETURN(0)
END
--CONVERT(varchar(100), @out_tgl_nav, 103) AS 'tgl_transaksi',
--CONVERT(varchar(100), CAST(IndInsurance.dbo.func_link_get_saldo_akhir(@pi_no_polis,@pi_tanggal)*@out_nilai_nav AS decimal(38,3))) AS 'nominal',
--CONVERT(varchar(100), CAST(@out_nilai_nav AS decimal(38,3))) AS 'nav',
--CONVERT(varchar(100), CAST(IndInsurance.dbo.func_link_get_saldo_akhir(@pi_no_polis,@pi_tanggal) AS decimal(38,3)))+CHAR(13)+CHAR(10) AS 'total_unit'
