Page 1 of 1

Invoicing program

PostPosted: Mon Nov 14, 2011 4:26 am
by PolderBoy
Hello All,

I am making a invoicing program using xataface.
I have a table tblLines already filled with data (starttime, stoptime, project, etc)

I show the records of a certain project, but not all the lines should be on the invoice. That is depending on the user (me)
I want to select the lines I want to invoice and ignore some other lines.

Then I would like to copy them to a temp table to print a pdf.

I don't want to change the code in the xataface folder. For future updates.
I use a lot of ajax ( in a javascript and with php behind )
I would like to use the functions in the delagate pages.
tables/tablename/tablename.php

One way of doing this would be to have a button below the list page.
But then I would need to loop through the records showing in the list grid.

If that doesn't work I could build a page where the user (me) would select a project from a
pulldown and the php code would show the records outside xataface.


anyone an idee on how to do this?

Thanks in advance,
PolderBoy

Re: Invoicing program

PostPosted: Wed Nov 16, 2011 10:34 am
by jhenry
Not sure if it would work but could you set up a view that grabs all the line items from the project and then set up a grid entry in the invoice to select which line items you wanted for that invoice. Just a thought.

Jason

Re: Invoicing program

PostPosted: Fri Nov 18, 2011 1:42 am
by PolderBoy
Hello,

Thank you Jason.
You mean a view in MySql?
That would be a view with a variable (projectID)


I was more thinking in the line of:
I select project, then I make a sql string: Select * from table where Invoiced = false and projectID = $ProjectID.

This I show in xataface. Select all the lines and Unselect the ones that I don't want to invoice.
Press some save button, then in the tablename.php use the function beforesave() and there I would like to
update the table : is selected is true then Update table set ToBeInvoiced to true

But the last one is the one I am having troubles with.

I could set the standard value of ToBeInvoiced to true
Let the user select Project.
With that show the records in the grid view and set the records that shouldn't be invoiced to false.
With grid view the records are updated automaticly.
Then make the invoice for that Project.

I like the last line. (Which is what you suggested...)
Thanks Jason.

With regards,
PolderBoy