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

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



Revision: 6253
          http://sourceforge.net/p/ledger-smb/code/6253
Author:   einhverfr
Date:     2013-11-08 04:14:08 +0000 (Fri, 08 Nov 2013)
Log Message:
-----------
Parts searches now working

Modified Paths:
--------------
    addons/1.3/wxPOS/scripts/AR.pm
    addons/1.3/wxPOS/scripts/LSMBDB.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:58:52 UTC (rev 6252)
+++ addons/1.3/wxPOS/scripts/AR.pm	2013-11-08 04:14:08 UTC (rev 6253)
@@ -6,6 +6,12 @@
 use Wx::Grid;
 use WXPOS::Part;
 
+# TODO:
+# customer box addresses entity.id when is should address entity_credit_account.id
+# Need payment/posting screen
+# No hardware support/printing support yet.
+# Dropping warehouse search restrictions currently.
+
 sub new {
  my ($class, $sesion, $action) = @_;
  my $self = {};
@@ -135,9 +141,10 @@
  my $desc = $self->{desc}->GetValue();
  my $wh = $self->{sesion}->{defaults}->{wh};
  my $list;
- foreach (@{$self->{sesion}->{ldb}->getPartsList(undef, $desc, $wh)}) {
-  push (@{$list}, "$_->[1]");
-  $self->{parts_search}->{$_->[1]} = $_->[0];
+ my $cust = $self->{customer_search}->{$self->{customer_list}->GetValue()};
+ foreach (WXPOS::Part->search($desc, $cust, 2)) {
+  push (@{$list}, $_->description);
+  $self->{parts_search}->{$_->description} = $_->partnumber;
  }
  if ($list) {
   $self->{parts_list} = undef;
@@ -173,7 +180,6 @@
   Wx::MessageBox("Please, try again selecting a part.", "Part not Found!", wxOK|wxCENTRE|wxICON_ERROR, $self->{tab});
   return 0;
  }
- warn $cust;
  $part = WXPOS::Part->get_by_partnumber($part, $cust, 2);
  my $numb = $part->partnumber;
  my $desc = $part->description;

Modified: addons/1.3/wxPOS/scripts/LSMBDB.pm
===================================================================
--- addons/1.3/wxPOS/scripts/LSMBDB.pm	2013-11-08 03:58:52 UTC (rev 6252)
+++ addons/1.3/wxPOS/scripts/LSMBDB.pm	2013-11-08 04:14:08 UTC (rev 6253)
@@ -66,13 +66,6 @@
  return $list;
 }
 
-sub getPartsByNumber {
- my ($self, $numb) = @_;
- my $sql = "SELECT partnumber, description, sellprice, inventory_accno_id, income_accno_id,image FROM parts WHERE partnumber = \'".$numb."\'";
- my ($part) = $self->{dbh}->selectrow_arrayref($sql);
- return $part;
-}
-
 sub getWarehouseList {
  my ($self) = @_;
  my $sql = "SELECT id, description FROM public.warehouse";

Modified: addons/1.3/wxPOS/scripts/WXPOS/Part.pm
===================================================================
--- addons/1.3/wxPOS/scripts/WXPOS/Part.pm	2013-11-08 03:58:52 UTC (rev 6252)
+++ addons/1.3/wxPOS/scripts/WXPOS/Part.pm	2013-11-08 04:14:08 UTC (rev 6253)
@@ -97,7 +97,7 @@
                                                          $entity_class]
     );
     for my $part (@results) {
-        my $part = __PACKAGE__->new(%$part);
+        $part = __PACKAGE__->new(%$part);
     }
     return @results;
 }

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