RT Posted January 31, 2007 Posted January 31, 2007 Hello cannot get my head around this i want to search all my invoices and if the balance is <0.10 set the invoice state to "paid" i think my script is correct but alas it is not working. here is what i have.. and is this the best way to do this, the script willl load on log in and logout... thanks
RT Posted January 31, 2007 Author Posted January 31, 2007 Daniele, Thank you so much..... :cofeebrake:
Raybaudi Posted January 31, 2007 Posted January 31, 2007 Hi Robert my answer was about the calc into the If [ ] step... but, reading your post carefully, that script can't do what you wish without a Loop on all records. BTW: why not use a calculation field for Status with: Case( Balance.c < 0.10 ; "paid" ; ... ... )
RT Posted February 1, 2007 Author Posted February 1, 2007 (edited) that is a much better soulution here is what i used. Case(Balance.c < 10000 ; "paid" ;TextColor ( Status ; RGB ( 0 ;255 ; 0 ) ) ; Status = "sent in post"; TextColor ( Status ; RGB ( 0 ; 0 ; 255 ) ) ; TextColor ( Status ; RGB ( 0 ; 0 ; 0 ) ) ) i changed the calc to 10000 just to test and all works apart from the text color is now not changing can you please tell me, have i missed some syntax to make this work. the reason i used a script is because i did not have the confidence to change it from text to calc field thanks i have learnt a lot today.. :smile2: Edited February 1, 2007 by Guest
Raybaudi Posted February 1, 2007 Posted February 1, 2007 Try this: Case( Balance.c < 10000 ;TextColor ( "paid" ; RGB ( 0 ;255 ; 0 ) ) ; Status = "sent in post"; TextColor ( Status ; RGB ( 0 ; 0 ; 255 ) ) ; TextColor ( Status ; RGB ( 0 ; 0 ; 0 ) ) )
RT Posted February 1, 2007 Author Posted February 1, 2007 (edited) ahhh i see thanks again Case( Balance.c < 100;TextColor ( "paid" ; RGB ( 0 ;255 ; 0 ) )) & Case( Balance.c > 100;TextColor ( "Sent in Post" ; RGB ( 0 ; 0 ; 255 ) )) Edited February 1, 2007 by Guest figured it all out thanks
Raybaudi Posted February 1, 2007 Posted February 1, 2007 B) Didn't Status contain paid or Sent in post ?? Why IF balance.c > 100 = Sent in post ?? What IF balance.c = 100 ?? BTW: it is better to write your calc so: Case( Balance.c < 100 ; TextColor ( "paid" ; RGB ( 0 ;255 ; 0 ) ) Balance.c > 100 ; TextColor ( "Sent in Post" ; RGB ( 0 ; 0 ; 255 ) ) )
RT Posted February 1, 2007 Author Posted February 1, 2007 Didn't Status contain paid or Sent in post ?? Why IF balance.c > 100 = Sent in post ?? What IF balance.c = 100 ?? BTW: it is better to write your calc so: Case( Balance.c < 100 ; TextColor ( "paid" ; RGB ( 0 ;255 ; 0 ) ) Balance.c > 100 ; TextColor ( "Sent in Post" ; RGB ( 0 ; 0 ; 255 ) ) ) thanks i have now added the equal sign. Case( Balance.c < 100;TextColor ( "Paid" ; RGB ( 0 ;255 ; 0 ) )) & Case( Balance.c >= 100;TextColor ( "Sent in Post" ; RGB ( 0 ; 0 ; 255 ) )) ---------- if i use your statement i get an error, a operator is expected here + - * / and it does not work, i tried messing but could not get it to validate. Why IF balance.c > 100 = Sent in post ? the job automatically creates the invoice and is printed also all invoices that are created are always in $ never any cents. thanks for showing me i am using the example 100, i will change this to .1 in the future..
mr_vodka Posted February 1, 2007 Posted February 1, 2007 if i use your statement i get an error, a operator is expected here + - * / and it does not work, i tried messing but could not get it to validate. There was a typo. Daniele overlooked a semicolon. Case( Balance.c < 100 ; TextColor ( "paid" ; RGB ( 0 ;255 ; 0 ) )[color:red]; Balance.c > 100 ; TextColor ( "Sent in Post" ; RGB ( 0 ; 0 ; 255 ) ) )
RT Posted February 1, 2007 Author Posted February 1, 2007 Thanks John, and Daniele for your time this calc has saved me and others lots of time......
Recommended Posts
This topic is 6507 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