Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Sunil Pandey
  Where is Sunil Pandey?
 Rajkot
 India
 Sunil Pandey
 Tags
Subject: RE: Transaction solution
Thread ID: 154184 Message ID: 154618 # Views: 1 # Ratings: 0
Version: Visual FoxPro 3 Category: Foxite: feedback
Date: Tuesday, December 18, 2007 12:41:14 PM         
   


> > Here are some samples, ( with buffering and without it0
> > In transaction all operations should be get ok, otherwise -rollback
> > 1
> >
> > Function post
> > Lparameters _ky,_vl
> > Set Reprocess To  3
> > Begin Transaction 
> > Update customer Set maxordamt=(_vl) Where cust_id=(_ky)
> > If _Tally>0
> >     End Transaction 
> > Else
> >     Rollback
> > Endif
> > 

> >
> > 2
> >
> > Set Exclusive Off
> > If Not Used('customer')
> >     Use customer In 0
> > Endif
> > Set Multilocks On
> > Set Reprocess To To 3
> > =CursorSetProp('buffering',5,'customer')
> > 
> > Update customer maxordamt=1000 Where cust_id='ALFKI'
> > 
> > Update customer maxordamt=2000 Where cust_id='ANATR'
> > 
> > Update customer maxordamt=1000 Where cust_id='ANTON'
> > Begin Transaction 
> > If Tableupdate(.T.,.T.,'customer')
> >     End Transaction 
> > Else
> >     Rollback
> > Endif
> > 

> >
> > 3
> >
> > SET EXCLUSIVE OFF
> > IF NOT USED('customer')
> > USE customer IN 0
> > ENDIF
> > SET MULTILOCKS ON
> > SET REPROCESS TO to 3
> > =cursorsetprop('buffering',5,'customer')
> > 
> > UPDATE customer maxordamt=1000 WHERE cust_id='ALFKI'
> > ok =TABLEUPDATE()
> > UPDATE customer maxordamt=2000 WHERE cust_id='ANATR'
> > ok1 =TABLEUPDATE()
> > UPDATE customer maxordamt=1000 WHERE cust_id='ANTON'
> > m.ok2=TABLEUPDATE()
> > Begin Transaction 
> > If m.ok and m.ok1 and m.ok2
> >     End Transaction 
> > Else
> >     Rollback
> > Endif
> > 
> > 
> > 

> > Transaction should be short in time
> > No messageboxes or wait window inside it
> > good transaction always has errors analise inside
> > In case of erro - rollback
> >
> >
> >
> > MVP , www.foxclub.ru domain owner
> > 100 friends are better than 100 dollars.
>
> Thanking for reply,
>
> but I am sorry that I have not explain correctly. What I am doing that I am developing a payroll Package for my company and I have already done the master entry and monthly transaction entry module and both are working nice. Now i am confused that how to process that data and generate salary slips from it.
> Please guide me. and give few example code if possible.
>
> Thanking you,
> Sunil Pandey

Sunil,

Without knowing how you designed your tables, it would be a bit difficult to tell you how to proceed. The salary slips however, are basically a report. Treat them the same as you would any other report. Use a SELECT command to gather the data into a single "flat file" non-normalized cursor and then create the report over that cursor. Something like this:

SELECT HourlyPayrollTable.*, Employee.EmpName, Employee.Address, ...
   FROM HourlyPayrollTable ;
   INNER JOIN Employee ON Employee.RecordID = MonthlyPayrollTable.EmployeeID ;
   WHERE HourlyPayrollTable.DateField >= ldPayrollPeriodStartDate AND ;
         HourlyPayrollTable.DateField <= ldPayrollPeriodEndDate AND ;
         llAnyOtherConditionsYouNeed ;
   ORDER BY HourlyPayrollTable.EmployeeID ;
   INTO CURSOR PayrollSlipsCursor
REPORT FORM MyPaySlipsReport TO PRINTER PROMPT
USE IN SELECT([PayrollSlipsCursor])



Ken
You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

Transaction solution Posted by Sunil Pandey @ 12/13/2007 4:34:32 AM
RE: Transaction solution Posted by Vladimir Zhuravlev @ 12/13/2007 6:56:03 AM
RE: Transaction solution Posted by Sunil Pandey @ 12/18/2007 8:27:03 AM
RE: Transaction solution Posted by Ken Murphy @ 12/18/2007 12:41:14 PM
RE: Transaction solution Posted by Sunil Pandey @ 12/20/2007 6:53:32 AM
RE: Transaction solution Posted by Ken Murphy @ 12/20/2007 1:22:37 PM
RE: Transaction solution Posted by Ken Murphy @ 12/13/2007 1:21:32 PM
RE: Transaction solution Posted by Benny Thomas @ 12/14/2007 1:11:37 PM