Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

sorting items on printable INVOICE


Guest

Recommended Posts

Hello How is every one,

 

Do any of you know of an add on that will help sort the products on an invoice by alphabetical/numerical order, My pickers and packers are allways walking all around the shop getting one item from here and back to the other side for an item and so forth. I have a field on products/invoice that states location and I want all items to sort into order by that

 

thank you to anyone that can help

Link to comment
Share on other sites

post the code that you use for printing the invoice and we can easily tell where to add it

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

I think the invoice printing in admin get the list of products from /includes/class/order.php

 

If you have a picking location on the product you will need to do a join to product, a left join would prob be best if you ever intend to delete products or if it is just on model no or product name a simple order by e.g.

 

tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "' ORDER BY products_id ASC");

 

HTH

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

i have added a custom field in the output to show the remaining stock, and called it stockquantity.

 

the following lines determine how things are sorted.

I think you just need to expand the default (empty) order by statement like 'order by p.location'
and then you can also add the location field to the order products info so you can show it on the invoice, like i did with stock_quantity

 

 

      if ($sorted == true) { $orderby = ' order by o.products_model asc'; } else { $orderby = ''; }
      $orders_products_query = tep_db_query("select o.orders_products_id, o.products_id, o.products_name, o.products_model, o.products_price, o.products_tax, o.products_quantity, o.final_price, p.products_quantity as stock_quantity, p.products_image from " . TABLE_ORDERS_PRODUCTS . " o, products p where orders_id = '" . (int)$order_id . "' and o.products_id = p.products_id  $orderby ");
      while ($orders_products = tep_db_fetch_array($orders_products_query)) {
        $this->products[$index] = array('qty' => $orders_products['products_quantity'],
                                        'name' => $orders_products['products_name'],
                                        'id' => $orders_products['products_id'],
                                        'stockqty' => $orders_products['stock_quantity'],
                                        'image' => $orders_products['products_image'],
                                        'model' => $orders_products['products_model'],
                                        'tax' => $orders_products['products_tax'],
                                        'price' => $orders_products['products_price'],
                                        'final_price' => $orders_products['final_price'])

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

btw, yes geoffrywalton knows best - it is that classes/order that contains this code ...

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

It makes sense to store the product_location into the orders_products table then call it as part of the order class.

i don't agree, I think that is a much bigger change (thinking also about held orders) that I find unnecessary unless there is real value in knowing what the location was at the time of the order.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

I'm thinking of scenarios where the product might have been deleted.  

Or where the attributes system is used for stock.  

 

Things that do happen in real life and could potentially cause problems with a product stored location.

 

You can think of more, no doubt.

Link to comment
Share on other sites

personal i think you should not touch that at all.

It would be better to have a separated script that READS the ordered products and by these products read it's location from a different db-table.

And give your pickers/packers a printed copy of that file for the given order.

 

 

 

-H = HAL (or if is just one hall use Section).

-C = Corridor (or hallway) , (could be extended to CL [Corridor-Left], CR [Corridor-Right]).

-S = Stage (floors/stage).

-P = Position (the position of the product on the given stage).

 

product_id : 12345 , H-1/C-2/S-5/P-3.

 

The table should print then as: order by the above table columns.

Link to comment
Share on other sites

you know, the location should be on the picking slip, but it so happens that our oscommerce invoice is used as the picking list, the real invoice comes out of the accounting system. Thus why I have modified the invoice layout to suit our internal needs.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

  • 2 months later...

Hi,  I asked a similar question a while ago, and got a very easy fix so heres the link to the discussion for anyone who doesn't want to get in too deep!  Works fantastic for me.

 

http://www.oscommerce.com/forums/topic/393403-sorting-items-in-basket-for-invoice/

Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...