ashill Posted August 19, 2010 Posted August 19, 2010 I need script advice. I am creating an expense report database. Part of my layout includes the following information – Start date End date Number of Days (calculating end date - start date) Per Diem Rate City Each days per diem needs to be itemized so I need to create a record in a portal for each day that includes the date, rate & city. Any ideas? Thanks in advance!
comment Posted August 19, 2010 Posted August 19, 2010 Each days per diem needs to be itemized Are you sure you need this? All it does is duplicate existing data and create room for possible discrepancy. BTW, shouldn't it be end date - start date + 1?
ashill Posted August 19, 2010 Author Posted August 19, 2010 Yes, each day needs it's own per diem entry (bookkeepers orders), only the date is different. I forgot to mention the +1 but it's in the calculation. Any thoughts on how to accomplish this? I'm stuck.
ashill Posted August 19, 2010 Author Posted August 19, 2010 Problem solved. I couldn't figure out how to loop the script so I just created a maximum # of days possible & created a really long script full of Set Field steps.
comment Posted August 19, 2010 Posted August 19, 2010 Sorry, I missed your earlier reply. So how about: Set Variable [ $parentID ; Parent::ParentID ] Set Variable [ $start ; Parent::Start Date ] Set Variable [ $n ; Parent::Number of Days ] Set Variable [ $rate ; Parent::Per Diem Rate ] # DELETE RELATED RECORDS, IF PREVIOUSLY CREATED If [ not IsEmpty ( Child::ParentID ) ] Go to Related Record [ Child ; Show related only ] Delete All Records Else Go to Layout [ Child ] End If Loop Exit Loop If [ not $n ] New Record Set Field [ Child::ParentID ; $parentID ] Set Field [ Child::Date ; $start ] Set Field [ Child::Rate ; $rate ] Set Variable [ $start ; $start + 1 ] Set Variable [ $n ; $n - 1 ] End Loop
Recommended Posts
This topic is 5210 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now