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

SF.net SVN: ledger-smb:[6178] addons/1.3/wxPOS/scripts



Revision: 6178
          http://sourceforge.net/p/ledger-smb/code/6178
Author:   einhverfr
Date:     2013-10-25 09:42:37 +0000 (Fri, 25 Oct 2013)
Log Message:
-----------
Invoices are now separate tabs, and can be closed independently

Modified Paths:
--------------
    addons/1.3/wxPOS/scripts/AR.pm
    addons/1.3/wxPOS/scripts/Console.pm
    addons/1.3/wxPOS/scripts/ConsoleWx.pm
    addons/1.3/wxPOS/scripts/LSMBDB.pm
    addons/1.3/wxPOS/scripts/Login.pm
    addons/1.3/wxPOS/scripts/WXPOS/State.pm

Modified: addons/1.3/wxPOS/scripts/AR.pm
===================================================================
--- addons/1.3/wxPOS/scripts/AR.pm	2013-10-24 10:17:30 UTC (rev 6177)
+++ addons/1.3/wxPOS/scripts/AR.pm	2013-10-25 09:42:37 UTC (rev 6178)
@@ -19,8 +19,11 @@
  $self->{sesion}->{tk} = undef;
  $self->{sesion}->{tk}->{items} = 0;
  $self->{tab} = Wx::Panel->new($self->{sesion}->{nb}, -1, wxDefaultPosition, wxDefaultSize);
+### Close Window
+ my $close_btn = Wx::Button->new($self->{tab}, -1, '[X]', [750, 3], [30, 24]);
+ EVT_BUTTON($self->{tab}, $close_btn, sub{$self->_close_pane});
 ### Customer
- my $dft_custom = $self->{sesion}->{defaults}->{custom};
+ my $dft_custom = $self->{sesion}->{defaults}->{custom} || '';
  Wx::StaticLine->new($self->{tab}, -1, [0, 0], [800, 2], wxLI_HORIZONTAL);
  Wx::StaticText->new($self->{tab}, -1, 'Customer', [10, 10], [90, 24]);
  $self->{custom} = Wx::TextCtrl->new($self->{tab}, -1, $dft_custom, [110, 10], [90, 24]);
@@ -35,7 +38,8 @@
  Wx::StaticText->new($self->{tab}, -1, 'Currency: ', [630, 40], [180, 24]);
  Wx::StaticLine->new($self->{tab}, -1, [0, 70], [800, 2], wxLI_HORIZONTAL);
 ### Parts
- Wx::StaticText->new($self->{tab}, -1, 'Warehouse: '.$self->{sesion}->{defaults}->{wh}, [10,120], [120, 24]);
+ 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]);
@@ -219,6 +223,13 @@
  return 1;
 }
 
+sub _close_pane {
+ my ($self) = $_;
+ my $selection = $WXPOS::State::Notebook->GetSelection;
+ $WXPOS::State::Notebook->DeletePage($selection);
+ return 1;
+}
+
 sub _InvoicePost {
  my($self) = @_;
  Wx::MessageBox("At this point we should be able to track each account and the account to set.", "DEBUG", wxOK|wxCENTRE|wxICON_ERROR, $self->{tab});

Modified: addons/1.3/wxPOS/scripts/Console.pm
===================================================================
--- addons/1.3/wxPOS/scripts/Console.pm	2013-10-24 10:17:30 UTC (rev 6177)
+++ addons/1.3/wxPOS/scripts/Console.pm	2013-10-25 09:42:37 UTC (rev 6178)
@@ -50,7 +50,7 @@
 use Wx::Event;
 use Wx::Menu;
 use Wx qw(wxDefaultPosition wxDefaultSize wxDEFAULT_FRAME_STYLE wxNO_FULL_REPAINT_ON_RESIZE wxCLIP_CHILDREN wxBITMAP_TYPE_PNG wxMAXIMIZE);
-use Wx::Event qw(EVT_TREE_SEL_CHANGED EVT_CLOSE EVT_IDLE EVT_MENU);
+use Wx::Event qw(EVT_TREE_SEL_CHANGED EVT_CLOSE EVT_IDLE EVT_MENU EVT_KEY_DOWN);
 
 sub new {
  my ($class) = @_;
@@ -65,7 +65,6 @@
  }
 ### Getting my initialized hash sesion with lsmbdb object (an object layer to access db), login options, logo image object
  $self->{sesion} = $login->{sesion};
- $self->{sesion}->{defaults} = eval $self->{sesion}->{user_info}->{defaults};
 ###
  $login->Destroy();
 #
@@ -74,6 +73,10 @@
 ### Notebook (tabs), this will be the window parent inside the frame.
 #
  $self->{sesion}->{nb} = Wx::Notebook->new($self, -1, wxDefaultPosition, wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
+
+ $WXPOS::State::Notebook = $self->{sesion}->{nb};
+
+EVT_KEY_DOWN($self, \&_process_char);
 #
 ###
 
@@ -92,8 +95,6 @@
  my $ar = Wx::Menu->new;
  $ar->Append($AR_INVOICE, "&Invoice");
  EVT_MENU($self, $AR_INVOICE, sub{$self->_load_module(AR, Invoice)});
- $ar->Append($AR_TRANSACTION, "&Transaction");
- EVT_MENU($self, $AR_TRANSACTION, sub{$self->_load_module(AR, Transaction)});
  $ar->Append($AR_CUSTOMER, "&Customer");
  EVT_MENU($self, $AR_CUSTOMER, sub{$self->_load_module(AR, Customer)});
  $bar->Append($ar, "&AR" );
@@ -107,6 +108,12 @@
  return $self;
 }
 
+sub _process_char {
+ my ($evt);
+ warn 'key pressed
+ ';
+}
+
 ### About
 sub _about {
  my ($self) = @_;
@@ -124,11 +131,11 @@
 ### Handler
 sub _load_module {
  my ($self, $module, $action) = @_;
- $self->{sesion}->{nb}->DeleteAllPages();
+ #$self->{sesion}->{nb}->DeleteAllPages();
  use lib "scripts";
  require $module.".pm";
  my $tab = $module->new($self->{sesion}, $action);
- $self->{sesion}->{nb}->AddPage($tab, $module."::".$action, 0);
+ $self->{sesion}->{nb}->AddPage($tab, $action, 1);
  $tab->Show();
  return $self;
 }

Modified: addons/1.3/wxPOS/scripts/ConsoleWx.pm
===================================================================
--- addons/1.3/wxPOS/scripts/ConsoleWx.pm	2013-10-24 10:17:30 UTC (rev 6177)
+++ addons/1.3/wxPOS/scripts/ConsoleWx.pm	2013-10-25 09:42:37 UTC (rev 6178)
@@ -48,8 +48,6 @@
  my $ar = Wx::Menu->new;
  $ar->Append($AR_INVOICE, "&Invoice");
  EVT_MENU($self, $AR_INVOICE, sub{$self->load_module(AR, Invoice)});
- $ar->Append($AR_TRANSACTION, "&Transaction");
- EVT_MENU($self, $AR_TRANSACTION, sub{$self->load_module(AR, Transaction)});
  $ar->Append($AR_CUSTOMER, "&Customer");
  EVT_MENU($self, $AR_CUSTOMER, sub{$self->load_module(AR, Customer)});
  $bar->Append($ar, "&AR" );
@@ -89,7 +87,8 @@
  use lib "scripts";
  require $module.".pm";
  my $tab = $module->new($self->{dbh}, $self->{nb}, $action);
- $self->{nb}->AddPage($tab, $module."::".$action, 0);
+ warn 'testing...';
+ $self->{nb}->AddPage($tab, $module."::".$action);
  $tab->Show();
  return $self;
 }

Modified: addons/1.3/wxPOS/scripts/LSMBDB.pm
===================================================================
--- addons/1.3/wxPOS/scripts/LSMBDB.pm	2013-10-24 10:17:30 UTC (rev 6177)
+++ addons/1.3/wxPOS/scripts/LSMBDB.pm	2013-10-25 09:42:37 UTC (rev 6178)
@@ -118,13 +118,6 @@
  return $list;
 }
 
-sub getUserByUsername {
- my ($self, $name) = @_;
- my $sql = "SELECT u.username, e.name, ee.ssn, en.note as defaults FROM users u JOIN entity e ON (u.entity_id = e.id) JOIN entity_employee ee ON (e.id = ee.entity_id) JOIN entity_note en ON (e.id = en.entity_id) WHERE en.subject = \'WX\' AND u.username = \'".$name."\'";
- my ($list) = $self->{dbh}->selectrow_hashref($sql);
- return $list;
-}
-
 sub getTaxByPair {
  my ($self, $cust, $part) = @_;
  my $sql = "SELECT a.id, t.rate, a.description, pt.parts_id, eca.id FROM tax t JOIN partstax pt ON (t.chart_id = pt.chart_id) JOIN parts p ON (p.id = pt.parts_id) JOIN customertax ct ON (t.chart_id = ct.chart_id) JOIN account a ON (a.id = ct.chart_id) JOIN entity_credit_account eca ON (eca.id = ct.customer_id) WHERE p.partnumber = \'".$part."\' and eca.entity_id = \'".$cust."\'"; 

Modified: addons/1.3/wxPOS/scripts/Login.pm
===================================================================
--- addons/1.3/wxPOS/scripts/Login.pm	2013-10-24 10:17:30 UTC (rev 6177)
+++ addons/1.3/wxPOS/scripts/Login.pm	2013-10-25 09:42:37 UTC (rev 6178)
@@ -46,11 +46,11 @@
  $self->{sesion}->{logo} =  Wx::Bitmap->new("ledgersmb.png", wxBITMAP_TYPE_PNG);
  Wx::StaticBitmap->new($self->{WxPanel}, -1, $self->{sesion}->{logo}, [50, 10], [200, 100]);
  Wx::StaticText->new($self->{WxPanel}, -1, 'User', [50, 120], [80, 24]);
- $self->{user} = Wx::TextCtrl->new($self->{WxPanel}, -1, 'user', [130, 120], [120, 24]);
+ $self->{user} = Wx::TextCtrl->new($self->{WxPanel}, -1, '', [130, 120], [120, 24]);
  Wx::StaticText->new($self->{WxPanel}, -1, 'Password', [50, 160], [90, 24]);
  $self->{pass} = Wx::TextCtrl->new($self->{WxPanel}, -1, 'pass', [130, 160], [120, 24], wxTE_PASSWORD);
  Wx::StaticText->new($self->{WxPanel}, -1, 'Company', [50, 200], [90, 30]);
- $self->{comp} = Wx::TextCtrl->new($self->{WxPanel}, -1, 'database', [130, 200], [120, 24]);
+ $self->{comp} = Wx::TextCtrl->new($self->{WxPanel}, -1, 'mtech_test', [130, 200], [120, 24]);
  Wx::StaticText->new($self->{WxPanel}, -1, 'Server', [50, 240], [90, 30]);
  $self->{serv} = Wx::TextCtrl->new($self->{WxPanel}, -1, 'localhost', [130, 240], [120, 24]);
  my $button = Wx::Button->new($self->{WxPanel}, -1, 'Enter', [100, 280], [100, 24]);

Modified: addons/1.3/wxPOS/scripts/WXPOS/State.pm
===================================================================
--- addons/1.3/wxPOS/scripts/WXPOS/State.pm	2013-10-24 10:17:30 UTC (rev 6177)
+++ addons/1.3/wxPOS/scripts/WXPOS/State.pm	2013-10-25 09:42:37 UTC (rev 6178)
@@ -37,6 +37,7 @@
 
 our $DBH;
 our $User;
+our $Notebook;
 
 sub clear {
     $DBH->disconnect;

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


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits