Hi y'all,

When I add several items in an invoice, they order fine when i look at the invoice. When I press the "Print HTML" button, the order changes, messing up the invoice. Any solutions?

Thanks!

Comments

Steff Vanhaverbeke’s picture

In storminvoice.module, the ordering should be added in the function storminvoice_getitems(), like this:

function storminvoice_getitems($invoice_vid) {
$s = "SELECT sit.* FROM {storminvoice_items} AS sit WHERE sit.invoice_vid = %d ORDER BY sit.weight ASC";
$r = db_query($s, $invoice_vid);

$items = array();
while ($i = db_fetch_object($r)) {
$items[] = $i;
}
return $items;
}

juliangb’s picture

This needs to be posted as a patch for us to commit the change (http://drupal.org/patch/create).

tchurch’s picture

Status: Active » Closed (duplicate)

There is a general issue with ordering of invoice items. This would only fixed part of it.
Issue #887638: Invoice Items not in correct order is created to cover all these issues. I have marked this one as closed (duplicate).