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

SF.net SVN: ledger-smb:[6272] addons/1.3/wxPOS/WXPOS/UI/AR/Pay.pm



Revision: 6272
          http://sourceforge.net/p/ledger-smb/code/6272
Author:   einhverfr
Date:     2013-11-09 08:39:01 +0000 (Sat, 09 Nov 2013)
Log Message:
-----------
Moving dialog box to use strict and use warnings.  Fixing issues shown by this

Modified Paths:
--------------
    addons/1.3/wxPOS/WXPOS/UI/AR/Pay.pm

Modified: addons/1.3/wxPOS/WXPOS/UI/AR/Pay.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/AR/Pay.pm	2013-11-09 08:25:46 UTC (rev 6271)
+++ addons/1.3/wxPOS/WXPOS/UI/AR/Pay.pm	2013-11-09 08:39:01 UTC (rev 6272)
@@ -7,6 +7,8 @@
 use Wx::Event qw(EVT_BUTTON EVT_LIST_ITEM_SELECTED EVT_LIST_ITEM_DESELECTED);
 use WXPOS::Sysconfig;
 use WXPOS::Invoice;
+use strict;
+use warnings;
 
 sub new{
     my ($class, $parent) = @_;
@@ -76,9 +78,9 @@
     $self->{oweing} =  Wx::StaticText->new($self->{WxPanel}, -1, '',
                                  [100, 320], [90, 24]);
 
-    $post_btn =  Wx::Button->new($self->{WxPanel}, -1, 'Post',
+    my $post_btn =  Wx::Button->new($self->{WxPanel}, -1, 'Post',
                                  [10, 360], [60, 24]);
-    $cancel_btn =  Wx::Button->new($self->{WxPanel}, -1, 'Cancel',
+    my $cancel_btn =  Wx::Button->new($self->{WxPanel}, -1, 'Cancel',
                                  [500, 360], [60, 24]);
     EVT_BUTTON($self->{WxPanel}, $post_btn, sub{$self->_Post});
     EVT_BUTTON($self->{WxPanel}, $cancel_btn, sub{$self->_Cancel});
@@ -161,7 +163,7 @@
         $line->{partnumber} = $list->GetItemData($item, 0)->GetText(); 
         $line->{sellprice} = $list->GetItemData($item, 2)->GetText();
         $line->{qty} =  $list->GetItemData($item, 6)->GetText();
-        push @$lines, @line;
+        push @$lines, $line;
     }
     return $lines; 
 }
@@ -173,17 +175,17 @@
     my $payments = [];
     while (($item = $list->GetNextItem($item)) > -1){
        my $pmt = {};
-       $pmt->{amount} = $list->GetItemData($item, 0)->GetText();
-       $pmt->{memo} = $list->GetItemData($item, 1)->GetText();
-       $pmt->{source} = $list->GetItemData($item, 2)->GetText();
+       $pmt->{amount} = $list->GetItem($item, 0)->GetText();
+       $pmt->{memo} = $list->GetItem($item, 1)->GetText();
+       $pmt->{source} = $list->GetItem($item, 2)->GetText();
        push @$payments, $pmt;
     }
 
     # Change
     my $amounts = $self->get_amounts();
-    if ($amonts->{total} < $amounts->{paid}){
+    if ($amounts->{total} < $amounts->{paid}){
         push @$payments, {
-           amount => $amonts->{total} - $amounts->{paid},
+           amount => $amounts->{total} - $amounts->{paid},
            memo => 'cash',
            source => 'change'
         };

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


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits