I am trying to edit the code on the uc_order.module so that when you add a blank line to the invoice it has an extra field called "file" on it. The user can then select the file and on the invoice sent to the customer the information will populate correctly. Now I know that I am going to need to edit hook_line_item but I am not sure where else in the code that it will need to be set up. Honestly I have been trying for over a week to look at the code and figure it out but for some reason I just can't see it. Any assistance that anyone can render will be wonderfull, because right now I am at the point of utter frustration and I don't know what I am missing.
Can anyone please comment to help me with this. Looking at the code gives me a headache and I can't see where I need to change things. This is the last problem before I am finished. Thanks.
Well, what are you trying to do with the file? File handling in Drupal is tricky business, and line items aren't a picnic either. It may be worth seeing if there's a better solution to your problem.
Thanks for the reply. I am sorry I did not get back to you sooner. What is happning is I am using Drupal as a system for the Recovery and Reposession company that I work for. Each node of a certain type is a file for a debtor that we need to try and retreive the collateral. When we bill for retreiving the collateral or doing skip-tracing service it needs information from the original node on the invoice. I can get that information on the invoice no problem. My current problem is a way for the office staff to choose which node (or file, same thing) is being billed so that the correct information shows up on the invoice sent to the customer. Usually without this information we don't get paid. The way I was trying to set it up was to have a new drop down box when you add a blank line item to the invoice. But honestly when I take a look at the code I am so new to PHP that it makes it very hard for me to understand where it is I would have to change it to add that information. I thought of making them products, but I don't know of a way either to have the system make each node of that type a product.
Really the problem all boils down to I have had to teach myself what I know of PHP and while I was able to handle all other parts of the system I needed to change Ubercart is being a pain. But still this is better than EC module. I couldn't even get that to work period. If you know of a better way to do what I need (get the nid of the node being billed to the invoice screen) than don't hesitate to correct me. At this point this is the last part of the system that I need to change to get it working like it needs to be.
Hey Mink, I think what you really wanna do here is create a new product class at admin/store/products/classes. That creates a new node type that you can then use for your records. If I were you, I would indeed create a new product for each one and use the SKU field to store the file number or whatever it is you need. This will ensure it is visible/editable from the order admin screen and it will show on invoices. You could use CCK to add another field to that node for the file, but then you'll need some custom PHP in the invoice template to load the node based on the product's nid to access the file number. This help?
I already put the custom PHP on the invoice to load the node, but your saying that each time I want to bill I need to create a new product and put the invoice number in the SKU field? This seems like it might be a bit more complicated to the office staff. Am I understanding what you are saying correctly?
Well, I guess I don't have enough info to help. Is the File you want on each invoice simply a number? And if so, how does this make it into the system in the first place? If it's through creating a node I don't know that it would require any extra steps to just create a product, although it would be a bigger form...
Each file is actually a node created with CCK that we work as a repo company. When we get the collateral or the account is closed we need to be able to somehow get some of the information from the node to the invoice. I already put a bunch of customer php on the invoice, I just need now to be able to somehow get the nid of the node that we are billing for to the invoice so that it can get the information. As I said without the information we don't get paid. If that means I have to create a product for each node I can do that but it seems redundant which is why I wanted to see about adding a drop down box to the "add a blank line" function. Our fees also vary which is another reason creating a product for each node might be a pain. I hope I explained better. I can clarify more if needed.