Page 1 of 1

progressive contract number

Posted: Thu Jan 31, 2008 6:10 pm
by p3rseus
i try to locate the javascript (i guess it's javascript) that produce the progressive contract number. i would like to change it to have instead of 1, 2 , 3 something like 0001 0002 for official invoice or to start at 1000 instead of. if you can help me on this one marco it would be very appreciated.

Posted: Fri Feb 01, 2008 12:16 pm
by marco
The code is in php in the visualizza_contratto.php file, anyway I suggest you to upgrade because in the latest php-residence version it already works that way.

Marco

thank you but

Posted: Fri Feb 01, 2008 7:25 pm
by p3rseus
i have 1.0.1 version and it start at 1 with me. i will check the code but if you can give me a hint.

Posted: Wed Feb 06, 2008 7:36 pm
by tazilein
I use 1.0.1 and in my template the contract_progressive number starts with 1 not 0001

Posted: Fri Feb 08, 2008 10:20 am
by tazilein
Another issue that seems problematic to me: If I use contract_progressive number the contract is automatically created as soon as I say View Document "Bill".

If I say View "Bill" a second time, then a second bill is created. that is wrong and dangerous if you want to use the bills for the fiscal authorities

found a way to do it

Posted: Fri Feb 08, 2008 9:36 pm
by p3rseus
the portion of code used to produce the 4 zero number in the document name can be reproduce in the same page to make the same number in the progressive contract variable i can post the modification here but i would prefer marco acknowledge first

Posted: Sat Feb 16, 2008 2:16 pm
by marco
I thought you were referring to the number in the filename, not in the document. In the next version there should be a condition to "truncate" a document variable to a given length, or if it's shorter to add a default character (0 in this case) to reach that length.
For now viewing the document to be saved is the same as creating it, if you want to view it a second time you should open the saved one (with ftp if it's on the server). The number is given based on the higher numeber available in the saved files, so if you delete the last created file the number goes back, or if you create a file with number 1000 it will create the next with 1001 (if no other file with a higher number is present). This way you can also upload files (with appropriate filename) for invoices not coming from reservations.

Marco

temporary invoice

Posted: Sat Feb 16, 2008 5:35 pm
by p3rseus
if you want to view the bill of a client without producing a new numbered one just create a template called temporary invoice with no progressive contract number and no save contract option checkbox checked so you can always display an invoice before producing an official numbered one

Posted: Sun Mar 09, 2008 10:43 pm
by tazilein
Thanks for the answers. Unfortunately in my case that is no solution. We are 4 persons that are involved and every person should be able to create a bill (and this bill should be saved on the server). As it is an obligation in austria to have progressive numbers on our bills I cannot have the risk to create an invoice for the same reservation a second time.

My proposal: add a field on the sql-table for every reservation where the filename of the created bill on the server is saved. If that field is empty a new bill with a new number will be created. If there is a number in the field then the document will be showed and you can choose to delete the bill or change it or just print a second copy of the bill.

Posted: Thu Mar 13, 2008 10:39 am
by marco
I'll add this to the TODO list. Are you using the last_payment variable in invoices documents or just the reservation total price?

Marco

this is what i did

Posted: Fri Mar 14, 2008 3:26 pm
by deus3x
i've created 4 templates:
- temporary invoice with reservation total price
- final invoice with progressive contract number and reservation total price
- temporary credit invoice with last payment (when you need to recredit a client)
- final credit invoice with progressive contract number and last payment variable

the temporary display TEMPORARY mention is just to show a client how the final invoice will be.

however, my employee made some mistakes and i think it would be great to change the way you produce a payment. he produced a final invoice several time and forgot to change the booking as all paid or partially paid so there was no payment method variable displayed on it. i did that thinking that choosing to produce an invoice would lead to the payment method page and make the system register the payment. is there anyway to make this possible quickly because i think this payment process needs to be fullproof (i shouldn't erase final invoices from the system for legal reaons..)