[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[6284] addons/1.3/wxPOS/WXPOS
- Subject: SF.net SVN: ledger-smb:[6284] addons/1.3/wxPOS/WXPOS
- From: ..hidden..
- Date: Thu, 14 Nov 2013 06:55:00 +0000
Revision: 6284
http://sourceforge.net/p/ledger-smb/code/6284
Author: einhverfr
Date: 2013-11-14 06:54:58 +0000 (Thu, 14 Nov 2013)
Log Message:
-----------
Fixing error handling on post
Modified Paths:
--------------
addons/1.3/wxPOS/WXPOS/UI/AP/Pay.pm
addons/1.3/wxPOS/WXPOS/UI/AP.pm
addons/1.3/wxPOS/WXPOS/UI/AR/Pay.pm
addons/1.3/wxPOS/WXPOS/UI.pm
Modified: addons/1.3/wxPOS/WXPOS/UI/AP/Pay.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/AP/Pay.pm 2013-11-12 12:18:20 UTC (rev 6283)
+++ addons/1.3/wxPOS/WXPOS/UI/AP/Pay.pm 2013-11-14 06:54:58 UTC (rev 6284)
@@ -136,26 +136,25 @@
sub _Post {
my ($self) = @_;
my $invoice = WXPOS::Invoice->from_UI($self, 1);
+ my $to_close = 1;
try {
$invoice->post;
+ $invoice->print(); # TODO
+ $self->{parent_window}->_close_pane;
+ $self->EndModal(0);
} catch {
Wx::MessageBox("Something went wrong. Please try again",
"More information has been logged on this error",
wxOK|wxCENTRE|wxICON_ERROR, $self->{tab});
warn $_;
- return undef;
+ $to_close = 0;
}
- $invoice->print(); # TODO
- # Ok, we succeeded, now to close the current tab and window,
- # and initialize the next one. -CT
- $self->{parent_window}->_close_pane;
- $self->EndModal(0);
}
sub get_entity_credit_account {
my ($self) = @_;
- return $self->{parent_window}->{customer_search}
- ->{$self->{parent_window}->{customer_list}->GetValue()};;
+ return $self->{parent_window}->{vendor_search}
+ ->{$self->{parent_window}->{vendor_list}->GetValue()};;
}
sub get_amounts {
Modified: addons/1.3/wxPOS/WXPOS/UI/AP.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/AP.pm 2013-11-12 12:18:20 UTC (rev 6283)
+++ addons/1.3/wxPOS/WXPOS/UI/AP.pm 2013-11-14 06:54:58 UTC (rev 6284)
@@ -1,4 +1,4 @@
-package WXPOS::UI::AR;
+package WXPOS::UI::AP;
use Wx qw(wxDefaultPosition wxDefaultSize wxLI_HORIZONTAL wxCB_READONLY wxICON_ERROR wxOK wxCENTRE wxLC_REPORT wxLIST_NEXT_ALL wxLIST_STATE_SELECTED wxLIST_STATE_DONTCARE wxLIST_NEXT_BELOW wxLC_VIRTUAL);
use Wx::Event qw(EVT_BUTTON EVT_LISTBOX_DCLICK EVT_COMBOBOX EVT_LIST_ITEM_RIGHT_CLICK EVT_LIST_ITEM_SELECTED EVT_LIST_ITEM_DESELECTED);
@@ -7,7 +7,7 @@
use WXPOS::Part;
use WXPOS::Counterparty;
use lib 'scripts';
-use WXPOS::UI::AR::Pay;
+use WXPOS::UI::AP::Pay;
use Math::BigFloat; # for rounding
# TODO:
@@ -259,7 +259,7 @@
my $total = $self->{total}->GetLabel;
$total =~ s/\s//;
return undef unless $total ne '' and defined $total; # Can't pay without anything here.
- WXPOS::UI::AR::Pay->new($self);
+ WXPOS::UI::AP::Pay->new($self);
}
sub format_money {
Modified: addons/1.3/wxPOS/WXPOS/UI/AR/Pay.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/AR/Pay.pm 2013-11-12 12:18:20 UTC (rev 6283)
+++ addons/1.3/wxPOS/WXPOS/UI/AR/Pay.pm 2013-11-14 06:54:58 UTC (rev 6284)
@@ -139,23 +139,23 @@
my $invoice = WXPOS::Invoice->from_UI($self, 2);
try {
$invoice->post;
+ $invoice->print(); # TODO
+ # Ok, we succeeded, now to close the current tab and window,
+ # and initialize the next one. -CT
+
+ $self->{parent_window}->_close_pane;
+ $self->{parent_window}->{sesion}->{nb}->AddPage(
+ WXPOS::UI::AR->new($self->{parent_window}->{sesion},
+ 'Invoice'), 'Invoice', 1
+ );
+
+ $self->EndModal(0);
} catch {
Wx::MessageBox("Something went wrong. Please try again",
"More information has been logged on this error",
wxOK|wxCENTRE|wxICON_ERROR, $self->{tab});
warn $_;
- return undef;
}
- $invoice->print(); # TODO
- # Ok, we succeeded, now to close the current tab and window,
- # and initialize the next one. -CT
- $self->{parent_window}->_close_pane;
- $self->{parent_window}->{sesion}->{nb}->AddPage(
- WXPOS::UI::AR->new($self->{parent_window}->{sesion},
- 'Invoice'), 'Invoice', 1
- );
-
- $self->EndModal(0);
}
sub get_entity_credit_account {
Modified: addons/1.3/wxPOS/WXPOS/UI.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI.pm 2013-11-12 12:18:20 UTC (rev 6283)
+++ addons/1.3/wxPOS/WXPOS/UI.pm 2013-11-14 06:54:58 UTC (rev 6284)
@@ -81,7 +81,7 @@
### Menu
# TODO: It should be loaded/created on demand according to user acl.
- my($ID_FILE, $ID_ABOUT, $ID_EXIT, $ID_AR, $AR_INVOICE, $AR_TRANSACTION, $AR_CUSTOMER, $ID_AP, $ID_IC, $IC_PARTS) = (100 .. 200);
+ my($ID_FILE, $ID_ABOUT, $ID_EXIT, $ID_AR, $AR_INVOICE, $AR_TRANSACTION, $AR_CUSTOMER, $ID_AP, $ID_IC, $IC_PARTS, $AP_INVOICE) = (100 .. 200);
my $bar = Wx::MenuBar->new;
my $file = Wx::Menu->new;
@@ -98,10 +98,14 @@
EVT_MENU($self, $AR_CUSTOMER, sub{$self->_load_module(AR, Customer)});
$bar->Append($ar, "&AR" );
- my $ic = Wx::Menu->new;
- $ic->Append($IC_PARTS, "&Parts");
- EVT_MENU($self, $IC_PARTS, sub{$self->_load_module(IC, Parts)});
- $bar->Append($ic, "&Inventory" );
+# my $ic = Wx::Menu->new;
+# $ic->Append($IC_PARTS, "&Parts");
+# EVT_MENU($self, $IC_PARTS, sub{$self->_load_module(IC, Parts)});
+# $bar->Append($ic, "&Inventory" );
+ my $ap = Wx::Menu->new;
+ $ap->Append($AP_INVOICE, "&Invoice");
+ EVT_MENU($self, $AP_INVOICE, sub{$self->_load_module('AP', 'Invoice')});
+ $bar->Append($ap, "&AP" );
$self->SetMenuBar($bar);
return $self;
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