cancel
Showing results for 
Search instead for 
Did you mean: 

amount in word format in a/r invoice

Former Member
0 Kudos

Hi to all,

i am creating a/r invoice of 200000/- but i set amount in word it show 20 hundred housand only.

i do not want this type

i want Two lacs indian rupee only

pls help me

Regrads,

vishal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi friend

i have solution for this problem i am sending on sql function run this function and add one userdefined field amount is displayed in that filed ok na

set ANSI_NULLS ON

set QUOTED_IDENTIFIER ON

go

create function [dbo].[inwords](@num numeric(22,2)) returns nvarchar(400) as

begin

declare @num1 numeric(16,2)

declare @le numeric(16)

declare @r as nvarchar(200)

declare @rs as nvarchar(400)

declare @rs1 as nvarchar(200)

declare @rs2 as nvarchar(200)

declare @rs3 as nvarchar(100)

set @le=len(rtrim(ltrim(@num)))

if @le>19

begin

set @rs3=substring(rtrim(ltrim((@num))),1,(len(rtrim(ltrim(@num)))-19))

set @r=substring(rtrim(ltrim((@num))),1,(len(rtrim(ltrim(@num)))-10))

select @rs1=@rs3','dbo.crores(@r)

set @r=substring(rtrim(ltrim((@num))),len(rtrim(ltrim(@r)))+1,10)

select @rs2=dbo.words(@r)

end

else if @le>10

begin

set @r=substring(rtrim(ltrim((@num))),1,(len(rtrim(ltrim(@num)))-10))

select @rs1=dbo.crores(@r)

set @r=substring(rtrim(ltrim((@num))),len(rtrim(ltrim(@r)))+1,10)

select @rs2=dbo.words(@r)

end

else if @le<11

begin

select @rs2=dbo.words(@num)

end

if @rs1<>''

begin

set @rs=@rs1+@rs2

end

else

begin

set @rs=@rs2

end

return @rs

end

Thanks & Regards

Naresh.K

Answers (0)