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

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



Revision: 6252
          http://sourceforge.net/p/ledger-smb/code/6252
Author:   einhverfr
Date:     2013-11-08 03:58:52 +0000 (Fri, 08 Nov 2013)
Log Message:
-----------
Parts retrieval by new object now largely works.  Still need get the search working.

Modified Paths:
--------------
    addons/1.3/wxPOS/scripts/AR.pm
    addons/1.3/wxPOS/scripts/WXPOS/Part.pm

Modified: addons/1.3/wxPOS/scripts/AR.pm
===================================================================
--- addons/1.3/wxPOS/scripts/AR.pm	2013-11-08 03:12:52 UTC (rev 6251)
+++ addons/1.3/wxPOS/scripts/AR.pm	2013-11-08 03:58:52 UTC (rev 6252)
@@ -4,6 +4,7 @@
 use Wx::Event qw(EVT_BUTTON EVT_LISTBOX_DCLICK EVT_COMBOBOX EVT_LIST_ITEM_RIGHT_CLICK EVT_LIST_ITEM_SELECTED EVT_LIST_ITEM_DESELECTED);
 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::Grid;
+use WXPOS::Part;
 
 sub new {
  my ($class, $sesion, $action) = @_;
@@ -157,6 +158,7 @@
  return $self->{part_numb};
 }
 
+
 sub _addParts {
  my($self, $event) = @_;
  my $part = $self->{part_numb}->GetValue();
@@ -171,11 +173,16 @@
   Wx::MessageBox("Please, try again selecting a part.", "Part not Found!", wxOK|wxCENTRE|wxICON_ERROR, $self->{tab});
   return 0;
  }
- my ($numb, $desc, $sell, $inv_acc, $inc_acc, $img) = @{$self->{sesion}->{ldb}->getPartsByNumber($part)};
+ warn $cust;
+ $part = WXPOS::Part->get_by_partnumber($part, $cust, 2);
+ my $numb = $part->partnumber;
+ my $desc = $part->description;
+ my $sell = $part->sellprice;
  if (!$numb) {
   Wx::MessageBox("Please, try again.", "Part not Found!", wxOK|wxCENTRE|wxICON_ERROR, $self->{tab});
   return 0;
  }
+## Price/discount overrides
  if ($self->{part_sellprice}->GetValue()){
     $sell = $self->{part_sellprice}->GetValue();
  }

Modified: addons/1.3/wxPOS/scripts/WXPOS/Part.pm
===================================================================
--- addons/1.3/wxPOS/scripts/WXPOS/Part.pm	2013-11-08 03:12:52 UTC (rev 6251)
+++ addons/1.3/wxPOS/scripts/WXPOS/Part.pm	2013-11-08 03:58:52 UTC (rev 6252)
@@ -48,9 +48,9 @@
 
 has description => (is => 'ro', required => 1);
 
-has sell => (is => 'ro', required => 1);
+has sellprice => (is => 'ro', required => 1);
 
-has cost => (is => 'ro', required => 0);
+has lastcost => (is => 'ro', required => 0);
 
 has unit => (is => 'ro', required => 0);
 
@@ -71,12 +71,12 @@
 
 =cut
 
-sub get_part_by_partnumber {
+sub get_by_partnumber {
     my ($self, $partnumber, $contact_id, $entity_class) = @_;
     my ($ref) = __PACKAGE__->call_procedure(funcname => 'get',
                                                 args => [$partnumber, 
                                                          $contact_id, 
-                                                         $contact_class]
+                                                         $entity_class]
     );
     return __PACKAGE__->new(%$ref);
 }
@@ -92,9 +92,9 @@
 sub search {
     my ($self, $string, $contact_id, $entity_class) = @_;
     my @results = __PACKAGE__->call_procedure(funcname => 'search',
-                                                  args => [$search,
+                                                  args => [$string,
                                                          $contact_id, 
-                                                         $contact_class]
+                                                         $entity_class]
     );
     for my $part (@results) {
         my $part = __PACKAGE__->new(%$part);

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