? 738020.patch
? 738020_2.patch
? 738020_3.patch
? 887638.patch
Index: storminvoice/storminvoice.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/storm/storminvoice/storminvoice.module,v
retrieving revision 1.4.4.82
diff -u -p -r1.4.4.82 storminvoice.module
--- storminvoice/storminvoice.module	11 Oct 2010 15:40:14 -0000	1.4.4.82
+++ storminvoice/storminvoice.module	12 Oct 2010 18:03:25 -0000
@@ -488,10 +488,6 @@ function storminvoice_form(&$node) {
       '#size' => 80,
     );  
     
-    $form['group4'][$i]['first']['items_'. $i .'_weight'] = array(
-      '#type' => 'hidden',
-      '#default_value' => isset($node->items[$i]->weight) ? $node->items[$i]->weight : NULL,
-    );
     
     $form['group4'][$i]['first']['items_'. $i .'_amount'] = array(
       '#type' => 'textfield',
@@ -501,6 +497,14 @@ function storminvoice_form(&$node) {
       '#default_value' => isset($node->items[$i]->amount) ? $node->items[$i]->amount : NULL,
     );
 
+    $form['group4'][$i]['first']['items_'. $i .'_weight'] = array(
+      '#type' => 'textfield',
+      '#withnull' => 'true',
+      '#title' => t('Weight'),
+      '#size' => 3,
+      '#default_value' => isset($node->items[$i]->weight) ? $node->items[$i]->weight : NULL,
+    );
+
     $form['group4'][$i]['tax1'] = array(
       '#type' => 'markup',
       '#theme' => 'storm_form_group',
@@ -732,7 +736,8 @@ function _storminvoice_beforesave(&$node
     $node->items[$j]->tax2app = $node->$variable;
     $variable = 'items_'. $j .'_tax2percent';
     $node->items[$j]->tax2percent = $node->$variable;
-    $node->items[$j]->weight = $j;
+    $variable = 'items_'. $j .'_weight';
+    $node->items[$j]->weight = (isset($node->$variable)) ? $node->$variable : $j;
 
     $variable = 'items_'. $j .'_src_nid';
     $node->items[$j]->src_nid = $node->$variable;
