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

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



Revision: 6288
          http://sourceforge.net/p/ledger-smb/code/6288
Author:   einhverfr
Date:     2013-11-15 06:45:51 +0000 (Fri, 15 Nov 2013)
Log Message:
-----------
Initial work on refactoring invoice entry control

Added Paths:
-----------
    addons/1.3/wxPOS/WXPOS/UI/Controls/
    addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/
    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

Added: addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePDesc.pm
===================================================================
Added: addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePNumber.pm
===================================================================
Added: addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry.pm	                        (rev 0)
+++ addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry.pm	2013-11-15 06:45:51 UTC (rev 6288)
@@ -0,0 +1,116 @@
+=head1 NAME
+
+WXPOS::UI::Controls::InvoiceEntry - WXPOS DataView Control for invoices
+
+=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 Moo;
+use WXPOS::Part;
+use WXPOS::UI::InventoryEntry::CompletePNumber;
+use WXPOS::UI::InventoryEntry::CompletePDesc;
+
+
+=head1 PUBLIC ATTRIBUTES
+
+=head2 entity_class
+
+Required.  Either 1 (AP) or 2 (AR).
+
+=cut
+
+has entity_class => (is => 'ro',
+                    isa => sub {
+                          croak 'Invalid value for entity_class'
+                            unless $_[1] eq '1' or $_[1] eq '2'l
+                    });
+
+=head2 partslist
+
+This is a list of WXPOS::Part objects for autopopulation.
+
+=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') };
+                 });
+
+=head1 METHODS
+
+=head2 new_wx
+
+Initializes the wx widget and returns the full class.
+
+=cut
+
+sub new_wx {
+    my $class = shift @_;
+    my $entity_class = shift @_;
+    my @wxargs = @_;
+
+    # Vars
+    my $wx;
+    my @partslist;
+
+    # Initialize DataViewCtrl
+
+    # Return object
+    return $class->new(entity_class => $entity_class,
+                          partslist => ..hidden..,
+                                 wx => $wx
+    );
+   
+}
+
+=head2 delete_selection
+
+Deletes the selected rows.
+
+=cut
+
+sub delete_selection {
+
+}
+
+=head2 invoice_lines
+
+Retrieves the invoice lines
+
+=cut
+
+sub invoice_lines {
+}
+
+=head1 COPYRIGHT
+
+COPYRIGHT(C) 2013 The LedgerSMB Core Team.
+
+This file may be used under the terms of the GNU General Public License 
+version 2 or at your option any later version.  Please see the enclosed 
+LICENSE.txt for more information.
+
+=cut
+
+1;

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