77 replies [Last post]
Sborselli's picture
Offline
Joined: 03/15/2010
Juice: 10
Was this information Helpful?

Hi everybody,

i come from reading this: http://www.ubercart.org/forum/module_support/3222/invoice_number
and this http://www.ubercart.org/faq/2892 about how numbering invoices.

My qyestion, is there a way to differentiate invoice number and order number?

As an example: let the order number alone and, maybe via conditional action, let the system create the invoice only after the order reach the status "Payment received"?

In this way the invoice number would be fiscally consistent.

I say so because (at least in Italy), for the fiscal law is mandatory that invoices number are consecutive.

Do you have any hint? But please consider that I'm not so php-savvy to write code.

Thank you very much indeed
Simone

Happyness is round the corner: beware!

Uberchic's picture
Offline
Administrator
Joined: 08/29/2008
Juice: 754
Re: invoice number vs order number

So, not all orders produce invoices? What is the difference between orders that produce invoices and ones that dont? Would it be possible to assign an invoice to each order, but mark the not needed ones as paid in full?

Sborselli's picture
Offline
Joined: 03/15/2010
Juice: 10
the problem is...

That every operation in the checkout part generate an order.
If a user start to buy, then stop the process and never complete it, the number of that order is gone.

What i need instead is a way to generate invoices only at the very end of the process, and the invoice number generated only at that moment, so I'm sure the invoices are consecutive and generated only once the client pays.

Happyness is round the corner: beware!

koyama's picture
Offline
Joined: 08/12/2009
Juice: 36
Re: invoice number vs order number

I had similar problems for a Danish webshop. Also in Denmark, invoice numbers are required to be consecutive.

Attached is a custom module I am using for a webshop being developed. For use with Drupal 6.x / Ubercart 2.x

Extends Ubercart 2.x to provide

* Invoice number (in addition to the order id)
* Button which the shop owner can click when an invoice needs to be generated for an order
* Consecutive invoice numbers 1,2,3...
* Invoice date
* Invoice template that includes invoice date and invoice number

In the included README.txt there are some instructions.

Since I am new with Drupal and Ubercart it may be somewhat primitive.

Screen shot showing button "Generate invoice":
http://img543.imageshack.us/img543/2038/ss20100419014100.png

Screen shot showing invoice with "invoice number" and "invoice date"
http://img59.imageshack.us/img59/9710/ss20100419014333.png

AttachmentSize
uc_invoice_6.x-custom.tar.gz 4.12 KB
Bruno-2M's picture
Offline
Joined: 01/27/2010
Juice: 28
module UC invoice

Thanks a lot,

Works perfectly !

2M Internet - Drupal Ubercart Montpellier France

klippklapp's picture
Offline
Joined: 05/17/2010
Juice: 28
Hi there, I was trying to

Hi there,

I was trying to find a way that a conditional aktion could manage this after the order is completed instead of pushing the button.
Does anyone have a tip for me what php code i have to take for this?

klipp

cfab's picture
Offline
Joined: 06/30/2009
Juice: 70
Conditional action added

Hi there,

for those who are still interested here is a modified version of this module, adding a conditional action to generate the invoice automatically.

Enjoy!

AttachmentSize
uc_invoice.zip 6.06 KB
klippklapp's picture
Offline
Joined: 05/17/2010
Juice: 28
Thank you for your work!

But, what do I have to do to get it work?
Thanks for helping Smiling

klippklapp

cfab's picture
Offline
Joined: 06/30/2009
Juice: 70
Re: Thank you for your work!

You have to activate the invoice module, then you can create a conditional action taking the order status change (to whatever status you want) as a predicate and you'll find an action "Invoice > Generate the invoice corresponding to the order".

klippklapp's picture
Offline
Joined: 05/17/2010
Juice: 28
Works Great!!!!

Thank you very much cfab!

Now I just need t find a way to generate a PDF file from the Invoice but thats another tricky thing i have to find out. Any ideas?

klipp

derjochenmeyer's picture
Offline
Joined: 10/10/2010
Juice: 3
Thanks for this module

Module works as described above.
- Conditional actions work && manual invoice generation works.

Modifications:
- cleaned up the code to meet Drupal's coding standards.
- use hook_uc_invoice_templates to meet requirements of ubercarts new template system
- rewrite the invoice template from itpl.php to new tpl.php

To make new template with "invoice #" and "invoice date" work you need to:
- copy the template from this module "uc_invoice-invoice.tpl.php" to ubercart/uc_order/templates
- goto admin/store/settings/orders/edit and choose "invoice" from the dropdown "On-site invoice template"

AttachmentSize
uc_invoice.zip 9.83 KB
willeaton's picture
Offline
Joined: 05/06/2008
Juice: 69
Re: Thanks for this module

There were a few spelling mistakes in this in the module and the template file for the word "invoice" however the variable used in the template to show the order ID needs fixing as well.

Instead of $order->invoice_id it should be $order->invoice[invoice_id]

Thanks
Will Eaton

Drupal Developer based on the Costa Del Sol, Spain

bunset's picture
Offline
Joined: 03/06/2011
Juice: 33
Doesnt work for me in ubercart 6.x-2.4

Hello, thanks for your module.

I have
- installed and enabled your uc_invoice
- copied uc_invoice-invoice.tpl.php to ubercart/uc_order/templates
- selected "invoice" from dropdown "on-site invoice template",

but it doesnt show your custom template with invoice id value,
it is always using uc_order-customer.tpl.php.
I know it becuase if I rename the file uc_order-customer.tpl.php, it is giving error and no invoice showed.

Are you tested in 6.x-2.4?

I dont know what to do to get using your template and Im needing it for spanish invoices requirement.

Paracetamol (not verified)
Paracetamol's picture
Re: Doesnt work for me in ubercart 6.x-2.4

That error had been fixed in a newer version of the module, see #28
You can then apply the display changes in the 2 PHP templates as described above.

polmaresma's picture
Offline
Joined: 02/19/2008
Juice: 21
Reset invoice number on january 1st

Thank's for the module!
I can't see on the code if in the 1st of january it will start again from 1. In Spain it's necessary and I'm sure on other countryes too.

Thank's again.

willeaton's picture
Offline
Joined: 05/06/2008
Juice: 69
Re: Reset invoice number on january 1st

You do not need to start the factura numbers at 1 again every year in Spain, you will end up with duplication like that. Me personally I do my facturas in the following format...

WE2010-00001

so basically you can write what you want so long as they are sequential.

Drupal Developer based on the Costa Del Sol, Spain

Neo13's picture
Offline
Joined: 09/05/2010
Juice: 44
Hi, how can I do my invoices

Hi,

how can I do my invoices in your format? I would like to do somehow like this: YYYY-INVOICEID (2010-00001,2010-00002...)
Is this possible with invoice module? How?

Thanks for your time.

willeaton's picture
Offline
Joined: 05/06/2008
Juice: 69
Re: Hi, how can I do my invoices

Yes you can, I just modified the template file for the invoices (modules\ubercart\uc_order\templates), find the bit that outputs the order ID and use PHP to add a year prefix. I also added leading zeros, here is an example of how to do it...

<?php

print date("Y")."-";
printf("%010d"$order->invoice[invoice_id]);
?>

note that I am using the invoice module as well so instead of $order->order_id I use $order->invoice[invoice_id]

Drupal Developer based on the Costa Del Sol, Spain

Neo13's picture
Offline
Joined: 09/05/2010
Juice: 44
Re: Re: Hi, how can I do my invoices

But I would also like to have invoices in this format in database and to start every year from 1. For example: last invoice in 2010 will be 2010-00546 and first invoice in 2011 will be 2011-00001 and not 2011-00547. It would be nice to have it in database in this format. How can I do this?

Many thanks for your help.

willeaton's picture
Offline
Joined: 05/06/2008
Juice: 69
Re: Re: Re: Hi, how can I do my invoices

Simply put, you can't. The database works on an incremental decimal value and to do what you are talking about complicates the system and would have to override the core functionality. As I explained in my previous post above, its not necessary to start from number 1 in facturas, I don't

Drupal Developer based on the Costa Del Sol, Spain

polmaresma's picture
Offline
Joined: 02/19/2008
Juice: 21
<?php print
<?php

print date("Y")."-";
printf("%010d"$order->invoice[invoice_id]);
?>

With this solution if I wanna print a 2009 invoice today they will appear as a 2010 invoice.

Should whe use invoice date's year instead?

Thank's for all.

Neo13's picture
Offline
Joined: 09/05/2010
Juice: 44
date

You are right. I used this:

<?php
echo date('Y ', $order->invoice[created]), '-', $order->invoice[invoice_id];
?>
designate's picture
Offline
Joined: 11/16/2009
Juice: 80
Invoice number mailed 000

I followed instructions as described, installed uc_invoice which provides a conditional action with which you can generate an invoice automatically after receiving payment. I also added the action to mail the invoice afterwards. Everything works fine except the invoice I receive contains an invoice number BDY-2010-0000 with 4 zero's for which I use the following code in my template file;


<?php
echo t('Invoice #:');
?>

<?php
print ("BDY")."-"; print date("Y")."-"; printf("%04d"$order->invoice[invoice_id]);
?>

When I view the invoice from within Ubercart Order admin the invoicenumber is something like BDY-2010-0010 etc. Also when I received an order, generate the invoice by hand via Orders admin, make payment for specific order, I receive an invoice with a correct invoicenumber. When I set the arguments in the condition and actions to "original order" no email is sent, it only sents when it is put on "updated order" so all three arguments are set to to state.

Any help or idea's please!

Regards, Rob

Neo13's picture
Offline
Joined: 09/05/2010
Juice: 44
Hi, I use this code: <?php

Hi,

I use this code:

<?php
echo t('Invoice number: '), $site_date_yyyy, '-'$order->invoice[invoice_id];
?>


<?php
echo t('Created'),' ', date('d.m.Y ', $order->invoice[created]);
?>

$site_date_yyyy displays actual year

So I do not have 0000 and everything works just fine. I have no idea, why are you getting zero's instead of invoice number, sorry.

designate's picture
Offline
Joined: 11/16/2009
Juice: 80
Hi, When I use yours code I

Hi,

When I use yours code I get the following information in the invoice once payment has been made: "Invoice number: 2010- Created 01.01.1970". No invoice number is printed and the date doesn't match the order date, which actually is today date 11/19/2010. Within admin/orders I receive the correct information. Where do I go wrong?

Update; when I turn off the uc_invoice module, the invoice within admin/orders also starts displaying zero's. Seems to have something to do with this module. I will check which one is installed, I think the last version as published above on 10 october but will check to be sure.
Regards, Rob

cioppy's picture
Offline
Joined: 01/11/2011
Juice: 8
Re: Hi, When I use yours code I

I've installed this module, but even if I paste the template in /modules/ubercart/uc_order/templates/ I don't see it in admin/store/settings/orders/edit/basic .
Infact if I try to make an order and I generate an invoice, the Invoice number doesn't appear.
How can I make it works ???
Thanks.

Vantel's picture
Offline
Joined: 06/03/2010
Juice: 68
How To Generate Multiple Invoices on the Number of Order

Can someone help me with how I can generate multiple invoices depending on the number of orders. Say for instance, a customer orders 3 Shirts. I would like to generate 3 different invoices each with its own unique invoice number or order number. Please help.

cfab's picture
Offline
Joined: 06/30/2009
Juice: 70
Re: How To Generate Multiple Invoices on the Number of Order

Then maybe it's more a multiple orders you need rather than multiple invoices, since invoices are linked to orders.

Vantel's picture
Offline
Joined: 06/03/2010
Juice: 68
Re: Re: How To Generate Multiple Invoices on the Number of Order

Thanks Cfab for your reply. How can I generate the multiple orders for the purchase to make this possible? Some people suggested Conditional Action, however, I don't know how to do this with Conditional Action. Can you please explain the Step By Step method. I'm new to Ubercart. Thank you in advance.

fuerst's picture
Offline
Joined: 03/12/2011
Juice: 25
Re: invoice number vs order number

Attached is a modified release mainly because the uc_invoice.zip from 10/10/2010 did not work in Ubercart 2.4:

  • Added hook_theme_registry_alter(): Allow template file to stay in uc_invoice/templates.
  • Changed template name for the On-site invoice template option from invoice to invoice-number to make clear the modules template should be choosen.
  • Renamed the template from uc_invoice-invoice.tpl.php to uc_order-invoice-number.tpl.php. Note: Invoice templates must start by uc_order- to be recognized by the Order module.
  • Fixed wrong variable call for the Invoice ID in the template file: $order->invoice['invoice_id'] instead of $order->invoice_id
  • Added Invoice date to the template file because Invoice date may by different from Order date.
  • Added module dependencies: uc_order and ca.
  • Renamed it in the uc_invoice.info from UC Invoice to Invoice Number to reflect it's aim better.
  • Fixed some typos.
  • Updated README.txt

I tested the module successfully with Ubercart 2.4.

I think that module deserves to be a project (module) at drupal.org. May be better renamed to uc_invoice_number probably. What do you think?

AttachmentSize
uc_invoice_2011-03-12.zip 6.41 KB
bunset's picture
Offline
Joined: 03/06/2011
Juice: 33
Excellent module. How can I see list of invoices?

Now I have to see each order and into the order I see invoice in case it is created,
I need to see a list of invoices easily, how can I do ?

Thanks.

jan_ver's picture
Offline
Joined: 03/19/2011
Juice: 43
Custom number

Hi,

I also had the need for invoice numbering but like Neo13 I needed to have a prefix to this number (current year) so I made some changes to this module taking into account all the previous remarks (including fuerst's). I kept the name UC Invoice as opposed to Invoice Number (what fuerst suggested) because for me invoice embodies more than only the number and I can imagine other functionalities being added to this module later like 'credit note'.
I added a field invoice_nbr which is a varchar to allow for more flexibility in invoice numbering, I kept the invoice_id auto increment as primary key.
In my module the invoice number looks like: 201100001, 201100002,... .
Code for this:

$result = db_query("SELECT invoice_nbr FROM {uc_invoices} WHERE invoice_id = (SELECT MAX(invoice_id) FROM {uc_invoices})");
$invoice_nbr = db_result($result);
$invoice_nbr_prefix = substr($invoice_nbr,0,4);
$invoice_nbr_key = (int)(substr($invoice_nbr,4,strlen($invoice_nbr)-4));
$current_year = date('Y');
if ($invoice_nbr_prefix != $current_year) {
$invoice_nbr = $current_year.'00001';
}
else {
$invoice_nbr_key += 1;
$invoice_nbr = $current_year.str_pad($invoice_nbr_key, 5, "0", STR_PAD_LEFT);
}

db_query("INSERT INTO {uc_invoices} (invoice_id, order_id, created, invoice_nbr) VALUES (NULL, %d, %d, %s)", $order_id, $time, $invoice_nbr);

I also made some changes to the template so that it's named Invoice instead of Order when an invoice number is present.

I agree with fuerst that this module deserves to be a project.

AttachmentSize
uc_invoice_2011-03-22.zip 6.77 KB
peterkamp's picture
Offline
Joined: 03/15/2011
Juice: 11
Invoice number in Views

Hi,

You all did a great job creating this nice invoice number module.
Works great.

I want to use the invoice number in a View. Any ideas?

Thanks

jan_ver's picture
Offline
Joined: 03/19/2011
Juice: 43
Invoice number in Views

Hi,

I made it work using the module uc_views but I had to make a change to the uc_invoice table, this was calles uc_invoices and I renamed the table to uc_invoice. So you should uninstall uc_invoice (loosing the invoice numbers) and reïnstall with the attached module (or you can rename the table manually to uc_invoice).

Then install the module uc_views and add following code to the function uc_views_views_data() in the file /modules/uc_views/views/uc_views.views.inc
(you can search for "return $data" and past it before)

****** Copy below ******
//Added by jan_ver
$invoice_schema = drupal_get_schema('uc_invoice');
$data['uc_invoice']['table']['join']['uc_orders'] = array(
'left_field' => 'order_id',
'field' => 'order_id',
);
$data['uc_invoice']['table']['join']['uc_order_products'] = array(
'left_field' => 'order_id',
'field' => 'order_id',
);
$data['uc_invoice']['table']['group'] = t('Ubercart invoice number');
$data['uc_invoice']['invoice_nbr'] = array(
'title' => t('Invoice number'),
'help' => $invoice_schema['fields']['invoice_nbr']['description'],
'field' => array(
'handler' => 'views_handler_field',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
);
$data['uc_invoice']['created'] = array(
'title' => t('Invoice date'),
'help' => $invoice_schema['fields']['created']['description'],
'field' => array(
'handler' => 'views_handler_field_date',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
),
);
****** Copy above ******

After that you can add "Invoice number" and "Invoice date" to the orders view.

Kind regards,

Jan Verhulst

AttachmentSize
uc_invoice_2011-03-30.zip 7.06 KB
peterkamp's picture
Offline
Joined: 03/15/2011
Juice: 11
Invoice number in Views

Hello Jan,

I had made some changes insite your module. My invoice number are like this 11-00005.
So I copied your Views code and made it work for the uc_invoices table.

It works great. Thank you very much for sharing this nice pice of code.

Is there aa way to add this oudsite of the uc_views module?
As soon as we get an update from them we have to change the code again.

Thanks again.

Kind regards Peter

jan_ver's picture
Offline
Joined: 03/19/2011
Juice: 43
Re: Invoice number in Views

Actually I just realised I made a stupid mistake and there was no need to hack the uc_views code (beginnersmistake). I'm now adding the code to the uc_invoice module so you don't need to hack uc_views.

peterkamp's picture
Offline
Joined: 03/15/2011
Juice: 11
Re: Invoice number in Views

Hi Jan,

That sounds great.
Hope to see your new code soon.

Thanks, Peter

jan_ver's picture
Offline
Joined: 03/19/2011
Juice: 43
Invoice number in Views

Attached the changed uc_invoice that doesn't require hacking uc_views.

AttachmentSize
uc_invoice_2011-03-30-2300.zip 7.21 KB
jan_ver's picture
Offline
Joined: 03/19/2011
Juice: 43
Disable order deletion

Since it's not so good to delete an order that has an invoice number I rewrote the uc_invoice_order function (= hook_order implementation) so that if an invoice number exists for an order the order cannot be deleted (unless the user has the 'unconditionally delete orders' permission). I also added the function uc_invoice_order_has_invoice (to avoid the recurring code).

Replace function uc_invoice_order with:
**** COPY BELOW ****
function uc_invoice_order($op, &$arg1, $arg2) {
switch ($op) {
case 'load':
$order = $arg1;
if (uc_invoice_order_has_invoice($order)) {
$result = db_query("SELECT invoice_id, created, invoice_nbr FROM {uc_invoice} WHERE order_id = %d", $order->order_id);
$row = db_fetch_array($result);
$invoice_id = $row['invoice_id'];
$created = $row['created'];
$invoice_nbr = $row['invoice_nbr'];
$order->invoice = array(
'invoice_id' => $invoice_id,
'created' => $created,
'invoice_nbr'=> $invoice_nbr,
);
}
break;

case 'can_delete':
$order = $arg1;
if (uc_invoice_order_has_invoice($order)) {
return FALSE;
}
break;
}
}

function uc_invoice_order_has_invoice($order) {
$result = db_query("SELECT COUNT(*) FROM {uc_invoice} WHERE order_id = %d", $order->order_id);
$count = db_result($result);
if ($count > 0) {
return TRUE;
}
else {
return FALSE;
}
}
**** COPY ABOVE****

If your using Ubercart 2.4 (don't know about the other versions) the above won't work because of a bug in the UC API.
I created an issue fo this:
http://drupal.org/node/1112550

Until an official patch is released you can fix it yourself by doing some changes in uc_order.module according to my comment #2 on http://drupal.org/node/1112550
Because of the bug above you were also able to delete orders that already had payments.

In attachment my invoice module

Note: If the user has the 'unconditionally delete orders' permission and he deletes an order the invoice number will not be cleaned up automatically.

AttachmentSize
uc_invoice_2011-04-01.zip 7.27 KB
simmel's picture
Offline
Joined: 01/14/2010
Juice: 9
hey there,thanks for the

hey there,
thanks for the code.
I updated the uc_invoice files but didn't get the fields in the views. Do I still have to rename the table uc_inoices table?

EDIT: After some refreshing of my view I got the field! BUT:
I get the following error message: "Table '###.uc_invoice' doesn't exist query: ..."
so I still have to rename the table?

Thanks, simon

jan_ver's picture
Offline
Joined: 03/19/2011
Juice: 43
Yes, table should be as

Yes,
table should be as follows:

function uc_invoice_schema() {
$schema['uc_invoice'] = array(
'description' => t('Generates and stores ubercart Invoice numbers.'),
'fields' => array(
'invoice_id' => array(
'description' => t('A consecutive Invoice ID'),
'type' => 'serial',
'not null' => TRUE,
),
'order_id' => array(
'description' => t('The order_id stored in uc_orders table.'),
'type' => 'int',
'not null' => TRUE,
),
'created' => array(
'description' => t('Invoice Date'),
'type' => 'int',
'not null' => TRUE,
),
'invoice_nbr' => array(
'description' => t('A consecutive Invoice number'),
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array('invoice_id'),
'indexes' => array(
'order_id' => array('order_id'),
),
);
return $schema;
}

This is not an upgrade to previous versions so your old invoice numbers won't show anymore unless you copy them yourself to the invoice_nbr field

simmel's picture
Offline
Joined: 01/14/2010
Juice: 9
customize invoice number

Thank you so far for your help. The table now works.
Could you help me get the right code for my customized invoice number?

It should look like: FMA-2011-#####
where ##### is the actual invoice number. i can't get the code to put the FMA in front of it and insert the dashes "-".
For instance, if I put:
$invoice_nbr = ''.$current_year.'-'.str_pad($invoice_nbr_key, 5, "0", STR_PAD_LEFT).'';

I get for invoice 1200 an invoice number of 811 since 2011-1200=810

I really appreciate your help! I already tried it for 2 hours this morning, but somehow I don't get it working.

jan_ver's picture
Offline
Joined: 03/19/2011
Juice: 43
Re: customize invoice number

Change the function uc_invoice_view_generate_invoice_form_submit in the uc_invoice.module to:

function uc_invoice_view_generate_invoice_form_submit($form, &$form_state) {
// insert new row in `uc_invoice` table
$order_id = $form_state['values']['order_id'];
$time = time();

//JVH
$result = db_query("SELECT invoice_nbr FROM {uc_invoice} WHERE invoice_id = (SELECT MAX(invoice_id) FROM {uc_invoice})");
$invoice_nbr = db_result($result);
$invoice_nbr_prefix_year = substr($invoice_nbr,4,4);

$invoice_nbr_key = (int)(substr($invoice_nbr,9,strlen($invoice_nbr)-9));
$current_year = date('Y');
if ($invoice_nbr_prefix_year != $current_year) {
$invoice_nbr = "FMA-".$current_year."-".'00001';
}
else {
$invoice_nbr_key += 1;
//$invoice_nbr = $current_year.str_pad($invoice_nbr_key, 5, "0", STR_PAD_LEFT);
$invoice_nbr = "FMA-".$current_year."-".str_pad($invoice_nbr_key, 5, "0", STR_PAD_LEFT);

}

db_query("INSERT INTO {uc_invoice} (invoice_id, order_id, created, invoice_nbr) VALUES (NULL, %d, %d, '%s')", $order_id, $time, $invoice_nbr);

drupal_set_message(t('Invoice generated. '));
}

****END OF CODE****
To be tested...

Make changes accordingly to function uc_invoice_generate_invoice in uc_invoice.ca.inc

I think you were having so much difficulties because '%s' in the INSERT sql wasn't quoted. This works fine for numbers but not if you add other characters.

lopar's picture
Offline
Joined: 06/26/2011
Juice: 63
Re: Custom number

Hi I installed \ytour module and I got this message - Unknown column 'invoice_nbr'
Do I need to paste your code into some file? If yes, where to , please?

So far only Fuerst's module works for me

Thank you for reply

jan_ver's picture
Offline
Joined: 03/19/2011
Juice: 43
Hi, The module is'nt made as

Hi,

The module is'nt made as an upgrade to previous versions, so you first need to disable and uninstall the UC Invoice module and then re-install with my code (carefull! you will loose your previous invoice numbers).

regards,

Jan

lopar's picture
Offline
Joined: 06/26/2011
Juice: 63
Re: Hi,The module is'nt made as

Thank you, I will try that
Where should I put your code? oh, into database querry, of course Smiling

jan_ver's picture
Offline
Joined: 03/19/2011
Juice: 43
Re: Re: Hi,The module is'nt made as

What code do you mean? If it's the function uc_invoice_schema(), this is not sql. It's a function from the uc_invoice install file that tells drupal how to create the table. Really the easiest way to do this is to disable uc_invoice, uninstall uc_invoice (this will delete the existing tables), delete the uc_invoice files, copy the new uc_invoice files, enable the new uc_invoice.
If you have invoice numbers you want to keep before doing this I would suggest you to save them before, convert the numbers to the correct format (like: 201100001, 201100002,... .) and re-insert (putting the number in invoice_nbr).
If you are new to sql you may wan't to get some help with that before doing anything.

victorcoder's picture
Offline
Joined: 07/20/2009
Juice: 15
Re: invoice number vs order number

Why not create a official drupal project for this?

Paracetamol (not verified)
Paracetamol's picture
Vote for Drupal project
victorcoder wrote:

Why not create a official drupal project for this?

I just registered at ubercart.org to vote for the same thing. This module concept, aside with VAT seems to be among the most important setups for European Ubercart shops (for the less IT savvy at least).

Also big thanks to #28 for providing a solution to the template name problem and cleanup for Ubercart 2.4.

On a sidenote (and another strong point to start a real Drupal project) I have been using one of the earlier solutions in the thread and was a bit confused, when jan_ver's solution introduced different table names, that – on a Drupal project – would make an upgrade function necessary, especially because otherwise the invoices reset their count.

So for users relying on this for a longer time, the solution in #28 is the best upgrade method.

cjl
cjl's picture
Offline
Joined: 12/11/2011
Juice: 3
name on project?

What is the name of the drupal project? how do i find it at drupal.org?

fuerst's picture
Offline
Joined: 03/12/2011
Juice: 25
Look at my drupal.org sandbox

Currently this module is not available as a official one. I put it into my sandbox at drupal.org to let it grow and mature before releasing it into the wild. Please try it and report any issues: http://drupal.org/sandbox/fuerst/1249740. Be patient - I'm currently somewhat busy.