Extending simple invoicing

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
soltec1
Posts: 12
Joined: 2013-11-13 16:01

Extending simple invoicing

Post by soltec1 » 2013-12-06 15:45

I have setup the simple invoicing and want to pick some of the experts brains here about an extension.

So three tables: client, invoice and invoice_items

How to get a single invoice to display multiple items within the "invoice"

In other words, a single invoice "code" to display many items, within the invoice table itself (the reason is then a csv export is possible per invoice, with all item, item quantity, and item price in separate fields, while at the moment, each item is listed in the invoice items only)

I was thinking lookup fields, or hooks, or i dont really know??

Let me know if i need to explain better. I think im overcomplicating the thing, but any direction help would be awesome !!

Thanks in advance :)

benzoD
Veteran Member
Posts: 69
Joined: 2013-01-31 21:16

Re: Extending simple invoicing

Post by benzoD » 2013-12-06 21:18

Sounds like the best way would be to have lookup fields. Create fields in your invoice table, make them lookup fields pointing to the information in your other tables.

Client: name, email, phone, address
Invoice_items: hours_billed, job_name, job_code, date_of_job, job_notes
Invoice: client_name (lookup->client.name), job_date(lookup->invoice_items.date_of_job), job_description(lookup->invoice_items.job_notes), billed(invoice_items.hours_billed)

Once you've filled in information for the client name, job_notes, etc, in invoice they are filled as pull down menus with the info you've already put in.

Hope this helps.

soltec1
Posts: 12
Joined: 2013-11-13 16:01

Re: Extending simple invoicing

Post by soltec1 » 2013-12-07 02:39

Thanks benzoD,
My db is like this

Client: client_ID, name, email, phone, address
invoice: invoice_id, client_name (lookup->Client.client.name), inv_code, status, due_date, total
Invoice_items: item_id, invoices (lookup-> to invoice.inv_code), item, unit_price, qty, price

At the moment a new record in invoice items is listed under the same inv_code, so thats all fine..but i want EACH item listed in the invoice table, so EACH invoice item, qty, price be listed in the invoice table as a lookup..So if there is 4 items, i want all 4 items listed in separate fileds, invoice: item1, qty1, price1, AND item2, qty2, price2 AND. item3, qty3, price3

you might ask why the need for this,

because then i can import a FULL INVOICE with multiple items as a csv file, into excel, do a mail merge and print out the invoices :)

thanks :)

soltec1
Posts: 12
Joined: 2013-11-13 16:01

Re: Extending simple invoicing

Post by soltec1 » 2013-12-15 23:18

ok basically used mpdf - mpdf1.com to generate the invoices and added a "generate invoice" button code to invoices.php

much better solution than mailmerging.

pdf templating a little tricky but results are instant invoices on the fly, and easy way to add new invoice templates as services increase

Post Reply