Page 1 of 1
PHP code in Documents.
Posted: Tue May 20, 2008 8:39 pm
by MarcAstr0
Is there a way to include PHP code in the Documents? What I want to do is print a bill, with a subtotal excluding the extra costs, so I want to multiply the rate by the number of nights and print that.
Posted: Fri May 23, 2008 9:25 pm
by MarcAstr0
Oh, and another thing I need to do is the following: I have a 10% discount as an extra cost, and I need to substract that discount from the rate cost, that does not include extra costs. For example, the bill has to look something like this:
Rate: rate1($33,00)
Number of nights: 2
Subtotal: $66,00
10% Discount: $6,60
Subtotal: $59,4
Extra costs:
Laundry: $5,00
Extra costs subtotal: $5,00
Total: $64,40
I need all these details because the hostel's accountant needs detailed reports. So that's why I'd like to know if somehow I can insert php code in the Documents to do these calculations. Any help is greatly appreciated.
Posted: Tue May 27, 2008 1:32 pm
by gonesouth
I don't see why not. If not, just code a file in php that does what you want, place it on the server, and have your accountant call it when needed.
Posted: Sun Jun 29, 2008 8:50 am
by marco
The price without extra costs is already provided in document variables.
For the extra cost discount you can use custom variables, if the name of the extra cost is equal to X put the custom variable equal to 10, otherwise default it with 0 (with an always true expression inserted before). Then you put a 2nd custom variable as rate_price / 100 and then 2nd c.v. = 2nd c.v. * 1st c.v. , so you have the value of the discount. If the value is different than 0 you can add the lines with another custom variable.
Marco