[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6634] trunk/LedgerSMB/Scripts/inventory.pm



Revision: 6634
          http://sourceforge.net/p/ledger-smb/code/6634
Author:   einhverfr
Date:     2014-01-25 08:49:09 +0000 (Sat, 25 Jan 2014)
Log Message:
-----------
Next button no longer errors.  However, items don't appear to be retrieved, and rowcount is not incremented

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/inventory.pm

Modified: trunk/LedgerSMB/Scripts/inventory.pm
===================================================================
--- trunk/LedgerSMB/Scripts/inventory.pm	2014-01-25 07:36:24 UTC (rev 6633)
+++ trunk/LedgerSMB/Scripts/inventory.pm	2014-01-25 08:49:09 UTC (rev 6634)
@@ -75,20 +75,20 @@
 
 sub adjustment_next {
     my ($request) = @_;
-    my $adjustment = LedgerSMB::Inventory::Adjust->new(base => $request);
-    for my $i (1 .. $adjustment->{rowcount}){
-        if ($adjustment->{"row_$i"} eq "new"){
+    my $adjustment = LedgerSMB::Inventory::Adjust->new(%$request);
+    for my $i (1 .. $request->{rowcount}){
+        if ($request->{"id_$i"} eq "new" or !$request->{"id_$i"}){
             my $item = $adjustment->retrieve_item_at_date(
-		$adjustment->{"partnumber_new_$i"});
-            $adjustment->{"row_$i"} = $item->{id};
-            $adjustment->{"description_$i"} = $item->{description};
-            $adjustment->{"onhand_$i"} = $item->{onhand};
+		$request->{"partnumber_new_$i"});
+            $request->{"row_$i"} = $item->{id};
+            $request->{"description_$i"} = $item->{description};
+            $request->{"onhand_$i"} = $item->{onhand};
         }
-        $adjustment->{"qty_$i"} = $adjustment->{"onhand_$i"} 
-		- $adjustment->{"counted_$i"}; 
+        $request->{"qty_$i"} = $request->{"onhand_$i"} 
+		- $request->{"counted_$i"}; 
     }
-    ++$adjustment->{rowcount};
-    enter_adjust($adjustment);
+    ++$request->{rowcount};
+    enter_adjust($request);
 }
 
 =item adjustment_save

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits