? uberpos-700642-2.patch
Index: uberpos.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uberpos/uberpos.module,v
retrieving revision 1.24
diff -u -p -r1.24 uberpos.module
--- uberpos.module	22 Jan 2010 14:33:01 -0000	1.24
+++ uberpos.module	2 Feb 2010 15:26:11 -0000
@@ -440,7 +440,7 @@ function uberpos_order_to_js($order, $ac
         'id' => $product->order_product_id,
         'class' => 'product',
         'type' => 'IT',
-        'title' => check_plain($product->title),
+        'title' => check_plain($product->qty . 'x ' . $product->title),
         'price' => uc_price($price_info, $context, array(), 'formatted'),
       );
     }
@@ -562,7 +562,7 @@ function uberpos_get_receipt($order) {
   $receipt_header_format = variable_get('uberpos_receipt_header_format', FILTER_FORMAT_DEFAULT);
   $output['receipt_header'] = check_markup($receipt_header, $receipt_header_format, FALSE);
 
-  $output['date'] = format_date(time());
+  $output['date'] = format_date(time(),'custom','d/m/Y H:i:s');
   $output['cashier'] = $user->name;
 
   $context = array(
@@ -585,7 +585,7 @@ function uberpos_get_receipt($order) {
     );
     $context['subject']['order_product'] = $product;
 
-    $rows[] = array('<div class="product-title">'. check_plain($product->title) .'</div>', array('data' => uc_price($price_info, $context), 'class' => 'price'));
+    $rows[] = array('<div class="product-title">'. check_plain($product->qty .  'x ' . $product->title) .'</div>', array('data' => uc_price($price_info, $context), 'class' => 'price'));
   }
 
   $results = db_query("SELECT title, price FROM {up_log} WHERE command = 'RF' AND order_id = %d", $order->order_id);
@@ -618,8 +618,7 @@ function uberpos_get_receipt($order) {
 
   /* Get a barcode if the barcode module is installed */
   if (module_exists('barcode')) {
-    $element['#item']['bar'] = $order->order_id . 'OR';
-    $output['receipt_barcode'] = theme('barcode_formatter_default', $element);
+    $output['receipt_barcode'] = theme_barcode_image($order->order_id . 'OR');
   }
 
   /* Don't reprint again */
@@ -789,21 +788,21 @@ function uberpos_add_product($input, $or
       }
 
       $product->qty = $qty;
-
-      if ($qty > 1) {
-        $product->title = $qty .'X '. $product->title;
-      }
-
       $product->price = $product->sell_price;
-
       $product->data = array();
-      $product->data['model'] = $input;
+//      $product->data['model'] = $input;
+      $product->model = $input;
 
       if (isset($attributes)) {
-        $product->data['attributes'] = array_merge($attributes, $attributes_extra);
-      }
-      else {
-        $product->data['attributes'] = $attributes_extra;
+        if (isset($attributes_extra)) {
+          $product->data['attributes'] = array_merge($attributes, $attributes_extra);
+        } else {
+          $product->data['attributes'] = $attributes;
+	}
+      } else {
+        if (isset($attributes_extra)) {
+          $product->data['attributes'] = $attributes_extra;
+	}
       }
 
       module_invoke_all('cart_item', 'load', $product);
@@ -962,5 +961,4 @@ function uberpos_views_api() {
     'api' => '2.0',
     'path' => drupal_get_path('module', 'uberpos') .'/views',
   );
-}
-
+}
\ No newline at end of file
