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

SF.net SVN: ledger-smb:[6291] addons/1.3/wxPOS/WXPOS/UI



Revision: 6291
          http://sourceforge.net/p/ledger-smb/code/6291
Author:   einhverfr
Date:     2013-11-15 13:49:46 +0000 (Fri, 15 Nov 2013)
Log Message:
-----------
New UI layout, much improved (now to add autocomplete)

Modified Paths:
--------------
    addons/1.3/wxPOS/WXPOS/UI/AP.pm
    addons/1.3/wxPOS/WXPOS/UI/AR.pm
    addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePDesc.pm
    addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePNumber.pm
    addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry.pm

Modified: addons/1.3/wxPOS/WXPOS/UI/AP.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/AP.pm	2013-11-15 10:26:22 UTC (rev 6290)
+++ addons/1.3/wxPOS/WXPOS/UI/AP.pm	2013-11-15 13:49:46 UTC (rev 6291)
@@ -47,41 +47,43 @@
 ### Parts Search
 
  my $warehouse = $self->{sesion}->{defaults}->{wh} || '';
- Wx::StaticText->new($self->{tab}, -1, 'Warehouse: '.$warehouse, [10,120], [120, 24]);
- Wx::StaticText->new($self->{tab}, -1, 'Description', [140, 120], [90, 24]);
- $self->{desc} = Wx::TextCtrl->new($self->{tab}, -1, '', [240, 120], [180, 24]);
- my $parts_but = Wx::Button->new($self->{tab}, -1, 'Search', [440, 120], [60, 24]);
- EVT_BUTTON($self->{tab}, $parts_but, sub{$self->_listPartsByName});
+ Wx::StaticText->new($self->{tab}, -1, 'Warehouse: '.$warehouse, [400,10], [120, 24]);
  Wx::StaticLine->new($self->{tab}, -1, [0, 150], [800, 2], wxLI_HORIZONTAL);
 
 ### Line Entry
- Wx::StaticText->new($self->{tab}, -1, 'Qty: ', [10, 160], [30, 24]);
- $self->{part_qty} = Wx::TextCtrl->new($self->{tab}, -1, '1', [50, 160], [30, 24]);
- Wx::StaticText->new($self->{tab}, -1, 'Number: ', [90, 160], [60, 24]);
- $self->{part_numb} = Wx::TextCtrl->new($self->{tab}, -1, '', [160, 160], [90, 24]);
- Wx::StaticText->new($self->{tab}, -1, 'Price: ', [260, 160], [60, 24]);
+ $self->{part_numb} = Wx::TextCtrl->new($self->{tab}, -1, '', 
+                                     [10, 460], [80, 24]);
+ $self->{desc} = Wx::TextCtrl->new($self->{tab}, -1, '', 
+                                     [90, 460], [250, 24]);
+ my $parts_but = Wx::Button->new($self->{tab}, -1, 'Search', [440, 120], [60, 24]);
+ EVT_BUTTON($self->{tab}, $parts_but, sub{$self->_listPartsByName});
  $self->{part_sellprice} 
-     = Wx::TextCtrl->new($self->{tab}, -1, '', [300, 160], [90, 24]);
- Wx::StaticText->new($self->{tab}, -1, 'Disc: ', [400, 160], [60, 24]);
+     = Wx::TextCtrl->new($self->{tab}, -1, '', 
+                                     [390, 410], [90, 24]);
  $self->{part_discount} 
-     = Wx::TextCtrl->new($self->{tab}, -1, '', [440, 160], [40, 24]);
- my $parts_add = Wx::Button->new($self->{tab}, -1, 'Add', [500, 160], [60, 24]);
+     = Wx::TextCtrl->new($self->{tab}, -1, '', [550, 460], [100, 24]);
+ $self->{part_qty} = Wx::TextCtrl->new($self->{tab}, -1, '1', 
+                                     [650, 460], [30, 24]);
+ my $parts_add = Wx::Button->new($self->{tab}, -1, 'Add', [700, 460], [60, 24]);
  EVT_BUTTON($self->{tab}, $parts_add, sub{$self->_addParts});
- Wx::StaticText->new($self->{tab}, -1, 'Selected: ', [600, 160], [90, 24]);
- $self->{sel_del} = Wx::StaticText->new($self->{tab}, -1, '', [690, 160], [30, 24]);
- my $parts_del = Wx::Button->new($self->{tab}, -1, 'Del', [730, 160], [60, 24]);
+ Wx::StaticText->new($self->{tab}, -1, 'Selected: ', [600, 30], [90, 24]);
+ $self->{sel_del} = Wx::StaticText->new($self->{tab}, -1, '', [690, 30], [30, 24]);
+ my $parts_del = Wx::Button->new($self->{tab}, -1, 'Del', [730, 30], [60, 24]);
  EVT_BUTTON($self->{tab}, $parts_del, sub{$self->_delParts});
 
 ### Ticket
- $self->{list} = Wx::ListCtrl->new($self->{tab}, -1, [10, 200], [780, 280], wxLC_REPORT);
- $self->{list}->InsertColumn(1, 'Number');
- $self->{list}->InsertColumn(2, 'Description');
- $self->{list}->InsertColumn(3, 'Price');
- $self->{list}->InsertColumn(4, 'Tax');
- $self->{list}->InsertColumn(5, 'Ratio');
- $self->{list}->InsertColumn(6, 'SubTotal');
- $self->{list}->InsertColumn(7, 'Qty');
- $self->{list}->InsertColumn(8, 'Total');
+# InvoiceEntry control does not work on wxwidgets 2.8, so moving back to 
+# listctrl -CT
+# $self->{list} = WXPOS::UI::Controls::InvoiceEntry->new_wx($self->{tab}, -1, 
+#                                      [10, 200], [780, 280], wxLC_REPORT);
+ $self->{list} = Wx::ListCtrl->new($self->{tab}, -1, [10, 80], [780, 380], wxLC_REPORT);
+ $self->{list}->InsertColumn(1, 'Number', 0, 80);
+ $self->{list}->InsertColumn(2, 'Description', 0, 250);
+ $self->{list}->InsertColumn(3, 'Price', 0, 100);
+ $self->{list}->InsertColumn(4, 'Tax', 0, 100);
+ $self->{list}->InsertColumn(6, 'Discount', 0, 100);
+ $self->{list}->InsertColumn(7, 'Qty', 0, 30);
+ $self->{list}->InsertColumn(8, 'Total', 0, 100);
  EVT_LIST_ITEM_SELECTED($self->{tab}, $self->{list}, sub{$self->_selParts});
  EVT_LIST_ITEM_DESELECTED($self->{tab}, $self->{list}, sub{$self->_selParts});
 
@@ -187,7 +189,7 @@
  if ($disc){
     $sell = $sell * (100 - $disc)/100;
     
- }
+ } 
  my $qty = $self->{part_qty}->GetValue();
  my $total_tax = 0;
  my $total_tax_ratio = 0;
@@ -202,10 +204,9 @@
  $self->{list}->SetItem($pp, 1, $desc, -1);
  $self->{list}->SetItem($pp, 2, $self->format_money($sell), -1);
  $self->{list}->SetItem($pp, 3, $self->format_money($total_tax), -1);
- $self->{list}->SetItem($pp, 4, $total_tax_ratio, -1);
- $self->{list}->SetItem($pp, 5, $self->format_money($st), -1);
- $self->{list}->SetItem($pp, 6, $qty, -1);
- $self->{list}->SetItem($pp, 7, $self->format_money($total), -1);
+ $self->{list}->SetItem($pp, 4, $disc, -1);
+ $self->{list}->SetItem($pp, 5, $qty, -1);
+ $self->{list}->SetItem($pp, 6, $self->format_money($total), -1);
 
  $self->{sesion}->{tk}->{tnet} += $self->format_money($sell);
  $self->{sesion}->{tk}->{ttax} += $self->format_money($total_tax);

Modified: addons/1.3/wxPOS/WXPOS/UI/AR.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/AR.pm	2013-11-15 10:26:22 UTC (rev 6290)
+++ addons/1.3/wxPOS/WXPOS/UI/AR.pm	2013-11-15 13:49:46 UTC (rev 6291)
@@ -8,6 +8,7 @@
 use WXPOS::Counterparty;
 use lib 'scripts';
 use WXPOS::UI::AR::Pay;
+#use WXPOS::UI::Controls::InvoiceEntry; # Not working on wxwidgets 2.8
 use Math::BigFloat; # for rounding
 
 # TODO:
@@ -47,41 +48,43 @@
 ### Parts Search
 
  my $warehouse = $self->{sesion}->{defaults}->{wh} || '';
- Wx::StaticText->new($self->{tab}, -1, 'Warehouse: '.$warehouse, [10,120], [120, 24]);
- Wx::StaticText->new($self->{tab}, -1, 'Description', [140, 120], [90, 24]);
- $self->{desc} = Wx::TextCtrl->new($self->{tab}, -1, '', [240, 120], [180, 24]);
- my $parts_but = Wx::Button->new($self->{tab}, -1, 'Search', [440, 120], [60, 24]);
- EVT_BUTTON($self->{tab}, $parts_but, sub{$self->_listPartsByName});
+ Wx::StaticText->new($self->{tab}, -1, 'Warehouse: '.$warehouse, [400,10], [120, 24]);
  Wx::StaticLine->new($self->{tab}, -1, [0, 150], [800, 2], wxLI_HORIZONTAL);
 
 ### Line Entry
- Wx::StaticText->new($self->{tab}, -1, 'Qty: ', [10, 160], [30, 24]);
- $self->{part_qty} = Wx::TextCtrl->new($self->{tab}, -1, '1', [50, 160], [30, 24]);
- Wx::StaticText->new($self->{tab}, -1, 'Number: ', [90, 160], [60, 24]);
- $self->{part_numb} = Wx::TextCtrl->new($self->{tab}, -1, '', [160, 160], [90, 24]);
- Wx::StaticText->new($self->{tab}, -1, 'Price: ', [260, 160], [60, 24]);
+ $self->{part_numb} = Wx::TextCtrl->new($self->{tab}, -1, '', 
+                                     [10, 460], [80, 24]);
+ $self->{desc} = Wx::TextCtrl->new($self->{tab}, -1, '', 
+                                     [90, 460], [250, 24]);
+ my $parts_but = Wx::Button->new($self->{tab}, -1, 'Search', [440, 120], [60, 24]);
+ EVT_BUTTON($self->{tab}, $parts_but, sub{$self->_listPartsByName});
  $self->{part_sellprice} 
-     = Wx::TextCtrl->new($self->{tab}, -1, '', [300, 160], [90, 24]);
- Wx::StaticText->new($self->{tab}, -1, 'Disc: ', [400, 160], [60, 24]);
+     = Wx::TextCtrl->new($self->{tab}, -1, '', 
+                                     [390, 410], [90, 24]);
  $self->{part_discount} 
-     = Wx::TextCtrl->new($self->{tab}, -1, '', [440, 160], [40, 24]);
- my $parts_add = Wx::Button->new($self->{tab}, -1, 'Add', [500, 160], [60, 24]);
+     = Wx::TextCtrl->new($self->{tab}, -1, '', [550, 460], [100, 24]);
+ $self->{part_qty} = Wx::TextCtrl->new($self->{tab}, -1, '1', 
+                                     [650, 460], [30, 24]);
+ my $parts_add = Wx::Button->new($self->{tab}, -1, 'Add', [700, 460], [60, 24]);
  EVT_BUTTON($self->{tab}, $parts_add, sub{$self->_addParts});
- Wx::StaticText->new($self->{tab}, -1, 'Selected: ', [600, 160], [90, 24]);
- $self->{sel_del} = Wx::StaticText->new($self->{tab}, -1, '', [690, 160], [30, 24]);
- my $parts_del = Wx::Button->new($self->{tab}, -1, 'Del', [730, 160], [60, 24]);
+ Wx::StaticText->new($self->{tab}, -1, 'Selected: ', [600, 30], [90, 24]);
+ $self->{sel_del} = Wx::StaticText->new($self->{tab}, -1, '', [690, 30], [30, 24]);
+ my $parts_del = Wx::Button->new($self->{tab}, -1, 'Del', [730, 30], [60, 24]);
  EVT_BUTTON($self->{tab}, $parts_del, sub{$self->_delParts});
 
 ### Ticket
- $self->{list} = Wx::ListCtrl->new($self->{tab}, -1, [10, 200], [780, 280], wxLC_REPORT);
- $self->{list}->InsertColumn(1, 'Number');
- $self->{list}->InsertColumn(2, 'Description');
- $self->{list}->InsertColumn(3, 'Price');
- $self->{list}->InsertColumn(4, 'Tax');
- $self->{list}->InsertColumn(5, 'Ratio');
- $self->{list}->InsertColumn(6, 'SubTotal');
- $self->{list}->InsertColumn(7, 'Qty');
- $self->{list}->InsertColumn(8, 'Total');
+# InvoiceEntry control does not work on wxwidgets 2.8, so moving back to 
+# listctrl -CT
+# $self->{list} = WXPOS::UI::Controls::InvoiceEntry->new_wx($self->{tab}, -1, 
+#                                      [10, 200], [780, 280], wxLC_REPORT);
+ $self->{list} = Wx::ListCtrl->new($self->{tab}, -1, [10, 80], [780, 380], wxLC_REPORT);
+ $self->{list}->InsertColumn(1, 'Number', 0, 80);
+ $self->{list}->InsertColumn(2, 'Description', 0, 250);
+ $self->{list}->InsertColumn(3, 'Price', 0, 100);
+ $self->{list}->InsertColumn(4, 'Tax', 0, 100);
+ $self->{list}->InsertColumn(6, 'Discount', 0, 100);
+ $self->{list}->InsertColumn(7, 'Qty', 0, 30);
+ $self->{list}->InsertColumn(8, 'Total', 0, 100);
  EVT_LIST_ITEM_SELECTED($self->{tab}, $self->{list}, sub{$self->_selParts});
  EVT_LIST_ITEM_DESELECTED($self->{tab}, $self->{list}, sub{$self->_selParts});
 
@@ -201,7 +204,7 @@
  if ($disc){
     $sell = $sell * (100 - $disc)/100;
     
- }
+ } 
  my $qty = $self->{part_qty}->GetValue();
  my $total_tax = 0;
  my $total_tax_ratio = 0;
@@ -216,10 +219,9 @@
  $self->{list}->SetItem($pp, 1, $desc, -1);
  $self->{list}->SetItem($pp, 2, $self->format_money($sell), -1);
  $self->{list}->SetItem($pp, 3, $self->format_money($total_tax), -1);
- $self->{list}->SetItem($pp, 4, $total_tax_ratio, -1);
- $self->{list}->SetItem($pp, 5, $self->format_money($st), -1);
- $self->{list}->SetItem($pp, 6, $qty, -1);
- $self->{list}->SetItem($pp, 7, $self->format_money($total), -1);
+ $self->{list}->SetItem($pp, 4, $disc, -1);
+ $self->{list}->SetItem($pp, 5, $qty, -1);
+ $self->{list}->SetItem($pp, 6, $self->format_money($total), -1);
 
  $self->{sesion}->{tk}->{tnet} += $self->format_money($sell);
  $self->{sesion}->{tk}->{ttax} += $self->format_money($total_tax);

Modified: addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePDesc.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePDesc.pm	2013-11-15 10:26:22 UTC (rev 6290)
+++ addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePDesc.pm	2013-11-15 13:49:46 UTC (rev 6291)
@@ -11,8 +11,8 @@
 =cut
 
 package WXPOS::UI::InvoiceEntry::CompletePDesc;
-use WX;
-use base 'WX::wxTextCompleterSimple';
+use Wx;
+#use base 'Wx::wxTextCompleterSimple';
 use WXPOS::State;
 use strict;
 use warnings;

Modified: addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePNumber.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePNumber.pm	2013-11-15 10:26:22 UTC (rev 6290)
+++ addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePNumber.pm	2013-11-15 13:49:46 UTC (rev 6291)
@@ -11,8 +11,8 @@
 =cut
 
 package WXPOS::UI::InvoiceEntry::CompletePNumber;
-use WX;
-use base 'WX::wxTextCompleterSimple';
+use Wx;
+#use base 'Wx::wxTextCompleterSimple';
 use WXPOS::State;
 use strict;
 use warnings;

Modified: addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry.pm	2013-11-15 10:26:22 UTC (rev 6290)
+++ addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry.pm	2013-11-15 13:49:46 UTC (rev 6291)
@@ -5,19 +5,18 @@
 =head1 SYNOPSIS
 
    my $control = WXPOS::UI::Controls::InvoiceEntry->new_wx($eclass, @wxargs);
-   $control->partslist(..hidden..);
    my @invoice_lines = $control->invoicelist;
 
 =cut
 
 package WXPOS::UI::Controls::InvoiceEntry;
 use Carp;
-use WX;
-use WX::Event;
+use Wx;
+use Wx::Event;
 use Moo;
 use WXPOS::Part;
-use WXPOS::UI::InventoryEntry::CompletePNumber;
-use WXPOS::UI::InventoryEntry::CompletePDesc;
+use WXPOS::UI::Controls::InvoiceEntry::CompletePNumber;
+use WXPOS::UI::Controls::InvoiceEntry::CompletePDesc;
 
 
 =head1 PUBLIC ATTRIBUTES
@@ -31,30 +30,20 @@
 has entity_class => (is => 'ro',
                     isa => sub {
                           croak 'Invalid value for entity_class'
-                            unless $_[1] eq '1' or $_[1] eq '2'l
+                            unless $_[1] eq '1' or $_[1] eq '2';
                     });
 
-=head2 partslist
+=head2 wx
 
-This is a list of WXPOS::Part objects for autopopulation.
+This is the wx control contained.
 
 =cut
 
-has partslist => (is => 'rw', 
-                 isa => sub {
-                               return if !defined $_[1];
-                               croak 'Partslist needs arrayref'
-                                   unless ref $_[1] eq ref [];
-                               croak 'Wrong type for partslist.'
-                                   unless eval {$_[1]->[0]->isa('WXPOS::Part')};
-                             },
-                 );
-
 has wx => (is => 'ro', required => 1,
                  isa => sub {
                        my $wx = $_[1];
                        croak 'Wrong wx type' unless 
-                           eval {$_[1]->isa('WX::wxDataViewControl') };
+                           eval {$_[1]->isa('Wx::wxDataViewListCtrl') };
                  });
 
 =head1 METHODS
@@ -72,18 +61,26 @@
 
     # Vars
     my $wx;
-    my @partslist;
 
-    # Initialize DataViewCtrl
+    # Initialize DataViewListCtrl
 
+    $wx = Wx::wxDataViewListCtrl(@wxargs);
+    $wx->AppendTextColumn('Number');
+    $wx->AppendTextColumn('Description');
+    $wx->AppendTextColumn('Qty');
+    $wx->AppendTextColumn('Sellprice');
+    $wx->AppendTextColumn('Total');
+
     # Return object
     return $class->new(entity_class => $entity_class,
-                          partslist => ..hidden..,
                                  wx => $wx
     );
    
 }
 
+sub _add_line {
+}
+
 =head2 delete_selection
 
 Deletes the selected rows.

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


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits