Home » Developer & Programmer » Forms » Voucher no financial year wise
Voucher no financial year wise [message #463479] Thu, 01 July 2010 09:05 Go to next message
kame
Messages: 69
Registered: July 2009
Member
I have form (table GL_PV)in this form I want to generate voucher no financial year wise.
I have Four columns
Year varchar2(4)
Month number(2)
Pv_no number(6)
Pv_date date

--- I use pre-insert tirgger---
when Insert record year save pv_date 'YYYY' (2010)
Month save as 'MM' (7)
and pv_date I enter manulay
now I want Pv_no it should generate auto according to financial year.
I have 2 financial year
2009-2010 June-July
2010-2011 June-July

I want that every financial year PV_no should be separate.
both financial year pv_no start from 1.
when I enter data any financial year first it check the MAX(PV_no) then generate next Pv_no No. MAX(pv_No)+1
Re: Voucher no financial year wise [message #463822 is a reply to message #463479] Sun, 04 July 2010 09:43 Go to previous message
ranamirfan
Messages: 535
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Dear !,
I suggest you to save this Financial Year in a seperate table
For Example

From Date To Date Year
01/01/2009 31/01/2009 2009

01/02/2009 28/02/2009 2009

01/03/2009 31/03/2009 2009

01/04/2009 30/04/2009 2009

then when you gave Financial year manullay then validate it from this new created table and select New Max Voucher No like this

Select Max(V_No)+1 Into A From TableName
where Year=:Form.Year;


I hope you'll get idea.

Regards,

Irfan
Previous Topic: loop to commit more than 1 record ?
Next Topic: date
Goto Forum:
  


Current Time: Fri Sep 20 00:56:19 CDT 2024