Forums
Billings
Creating Estimates and Invoices
Script help for Quick Settlement Discount line.|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Apprentice |
Hello!
I'm totally new to scripting so I was wondering if someone can help me creating some script/s. I would like to put it at the bottom of my invoices to improve my cashflow: Enjoy a 10% discount if invoice is paid before [script: invoice date plus 10 days]. I.e pay only [script: invoice subtotal minus 10%] + VAT [script: total invoice TAX (17.5%) minus 10%] = [script: invoice total due minus 10%] Any help with this or pointers to where I can get help with this would be greatly appreciated. |
||
|
|
Marketcircle Team |
I assume you are referring to Billings, so I'm going to move this post there.
|
|||
|
|
Marketcircle Team |
Somewhere outside the slips table, create a dynamic text and add "script" tokens.
For due date - 10, here is the script: invoice_due_date := (element valueForKey:'dueDate'). new_date := invoice_due_date dateByAddingDays:-10. new_date. For the new total, here is the script. NOTE, I don't think removing 10% from the total taxes will give you the right number - you'll have to test that out. Here are the calculations anyways: sub_total := (element valueForKey:'subTotal'). new_sub_total := sub_total - (sub_total * 0.1). taxes := (element valueForKey:'taxesTotal'). new_taxes := taxes - (taxes * 0.1). new_total := new_sub_total + new_taxes. new_total. Please test it out (math wise). HTH. |
|||
|
|
Apprentice |
Thanks for your answer on this. I haven't checked the calculations yet. Just tried to get the script working as you supplied them to start with.
Got the date + 10 days to work. Managed to modify your script to add 10 days to invoice date rather than deducting 10 days from the due date as your script suggested: invoice_date := (element valueForKey:'invoiceDate'). new_date := invoice_date dateByAddingDays: 10. new_date. Having said that - do I have any control of the date formatting? I'd like it to be 'medium date' formatted, at the moment it's giving me a very long date with time etc. Didn't manage to get the other scripts running though. new_sub_total new_taxes new_total I just copied them into the script window. That's what I was supposed to do - right? |
|||
|
|
Apprentice |
Sorry - I did paste the whole scripts as you wrote them, i.e
sub_total := (element valueForKey:'subTotal'). new_sub_total := sub_total - (sub_total * 0.1). etc. |
|||
|
|
Apprentice |
OK - A good night sleep and I managed somehow to make it work.
Only thing remaining is the Date formatting. Would like it to format the date in the script above to 'Medium Date'. I assume I need to incorporate that to the script somehow... |
|||
|
|
Journeyman |
This could be handy in the "next" version of Billings.
Somewhat off topic, Marketcircle really needs to start doing something - there are plenty of folks requesting features, to which we usually get something along the lines of "We aren't allowed to discuss upcoming features". Why the heck not? I find it unfortunate that Marketcircle thinks that users - *Mac users* - need to learn a scripting language to design their invoices and run custom reports - especially when there are a slew of online invoicing apps that do this stuff in a web browser. Don't get me wrong - I love Billings, but the shortcomings are starting to form a large pile and eventually, users will move away. The vocal users are trying to help MarketCircle improve Billings. Blog: http://www.leroux.ca/ MUG: http://www.bymug.ca/ (Ottawa, Canada) Lists: http://www.bymug.ca/mailing-lists/ (including one for Billings) |
|||
|
|
Apprentice |
Whilst this post seems to be still getting some attention, can anyone tell me the tokens for including the *undiscounted* Rate/Price so that it shows up on the invoice and therefore highlights the virtuous discount you have provided.
On MC, I agree with WTL and would like a bit more 'disclosure' about priorities for feature requests and to see a bit more systematic handling of problems. I couldn't agree more about being forced to learn F-@#$%^&* script in order to use Billings. Gotta be a betta way! This message has been edited. Last edited by: Tim Jacka, |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|
Forums
Billings
Creating Estimates and Invoices
Script help for Quick Settlement Discount line.
