Forums
Billings
Creating Estimates and Invoices
Error with Slip Quantity Token in Invoice when Slip Kind = "flat"|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Apprentice |
As the "Slip Duration/Quantity" token outputs an unwanted and meaningless "00:00" for flat rate slips, I tried using the "Slip Quantity" and "Slip Duration" tokens on their own, hoping that the one that applies would show, and where not would be omitted. However when previewing an invoice containing a flat rate slip it returns the following error:
Error [<BITimeSlip 0x18d09a20> valueForUndefinedKey:]: this class is not key value coding-compliant for the key quantity. during data extraction for text area: TDName string content: Subsequent items that follow then fail, such as SmartDate. I have a non-tabular slip entry in the invoice as follows: {Slip Category} : {Slip Name} {Slip Duration/Quantity}
(completed:{Slip Date}){Slip Comment}with various "comma space" and "newline" before/after additions. What I am trying to achieve: As I do some jobs with a quantity (e.g. a translation in words) and some per hour (e.g. corrections at x hours) and then again some tasks at a fixed fee (e.g. x reviews) I want the relevant time in hours or quantity with units to be listed, and where a flat rate, no units. I imagine the above error is a bug. However, could it perhaps be got around for the time being by replacing the "Slip Duration/Quantity" token with a script token to the tune of: if slipkind = flat show nothing if slipkind = timed show ', ' + SlipDuration + 'hrs' if slipkind = quantity show ', ' + SlipQuantity + ' units' If so, could you be kind enough to provide the appropriate code? ----- Finally, a couple of feedback ideas: [LIST] A last related question: is it possible to enter rates in 3 decimal places? At present Billings rounds the third decimal place up or down. At present I have to enter a rate per thousands of words and divide the quantity by 1000. Invoices then have to display as 1.5 thousand words rather than 1500 words. Possibly this latter could also be solved with a script in the invoice template? Many thanks for a reply. This message has been edited. Last edited by: jakob, |
||
|
|
Apprentice |
Hi Jakob,
I just ran into this myself today after I finally got started on my own invoice template. So if this is still relevant to you, here goes... On my invoice, I want to show the quantity/duration followed by "Std." if it's a timed slip, and "Stk." if it's a quantity slip. To that end, I put down the "Slip Duration/Quantity" token, followed by a Script token with the following script: slipType := element valueForKeyPath:'parent.reportData.object.typeString'. (slipType = 'Quantity') ifTrue: [ result := 'Stk.'. ]. (slipType = 'Timed') ifTrue: [ result := 'Std.'. ]. result. This may not be the best way to do it, but it seems to work. :-) Best, Chris Ferebee |
|||
|
|
Apprentice |
Hi everyone,
I know this is old and somewhat solved, but still I had the same problem and managed to find a solution which works for me. I added two scripts to my Hrs/Qty field. I used the result of the flat being '00:00' to change it to the amount of 1. Please note, that if you have a slip which has to appear in your invoice without being charged and therefore has to have an amount of '00:00' printed my solution does not work for you. my script does something like: if slipamount = 00:00 change to 'flat' else show slipamount the second one is Chris Ferebees script. now all you have to do is change 'flat' to whatever you feel is appropriate. if you want to show nothing on '00:00' just delete the whole "ifTrue:" part up to "ifFalse:" slipAmount := element valueForKeyPath:'parent.reportData.object.quantityDurationString'. (slipAmount = '00:00') ifTrue: [ result := 'flat'. ] ifFalse: [ result := slipAmount. ]. result. cheers patrick This message has been edited. Last edited by: patrick75, |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|
Forums
Billings
Creating Estimates and Invoices
Error with Slip Quantity Token in Invoice when Slip Kind = "flat"
