nBill Community nBill Home Page
21/May/2012, 10:41:18 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Click Here for the nBill home page, or take a tour.  
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to add custom field values to invoice  (Read 2829 times)
carry2web
Jr. Member
**
Offline Offline

Posts: 19


View Profile
« on: 17/November/2009, 02:09:25 AM »

Hello netshine,

I'm working on a custom invoice template and need to add some csutom order field info (form_field_values in inv_orders) per invoice item.
I noticed that there are two intermediate tables one called inv_invoice_items and inv_orders_invoice via which invoice items can be related back to the order they belong to. Only when I have the order_id I can use the get_form_value function. Is that correct?
Do you perhaps have a relationship diagram of your data tables documented?
TIA
Logged
carry2web
Jr. Member
**
Offline Offline

Posts: 19


View Profile
« Reply #1 on: 17/November/2009, 02:36:44 AM »

Got it in the for loop for the invoice items, get the order_id and then the field values from that order:

Code:
$db = & JFactory::getDBO();
$query = "SELECT order_id FROM #__inv_orders_invoice WHERE invoice_item_id = $invoice_item->id AND invoice_id = $invoice->id";
$db->setQuery($query);
$order_id = $db->loadResult();
// get field values
$the_service = get_form_field_value($order_id, "service");
etc...
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,563


View Profile
« Reply #2 on: 17/November/2009, 09:00:37 AM »

You got it.  Smiley
Logged
ericta
Jr. Member
**
Offline Offline

Posts: 28


View Profile
« Reply #3 on: 08/January/2011, 11:10:55 PM »

I'm trying to solve the same problem.

But it seems I can't find the this #__inv_orders_invoice table and how do you use this get_form_value() function? is there a document?

Thank you
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,563


View Profile
« Reply #4 on: 09/January/2011, 09:53:16 AM »

This thread is for nBill 1. For nBill 2, see http://www.nbill.co.uk/forum-smf/index.php/topic,1727.0.html
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!