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

SF.net SVN: ledger-smb:[5034] addons/1.4/pos/trunk/bin



Revision: 5034
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5034&view=rev
Author:   einhverfr
Date:     2012-07-24 05:55:39 +0000 (Tue, 24 Jul 2012)
Log Message:
-----------
Merging in work from branches/1.3

Modified Paths:
--------------
    addons/1.4/pos/trunk/bin/pos.pl
    addons/1.4/pos/trunk/bin/ps.pl

Modified: addons/1.4/pos/trunk/bin/pos.pl
===================================================================
--- addons/1.4/pos/trunk/bin/pos.pl	2012-07-24 03:53:06 UTC (rev 5033)
+++ addons/1.4/pos/trunk/bin/pos.pl	2012-07-24 05:55:39 UTC (rev 5034)
@@ -49,24 +49,11 @@
 1;
 
 # end
-sub custom_send_to_pd{
-  socket(SOCK, 2, 1, getprotobynumber($pos_config{'pd_proto'}));
-  connect(SOCK, $pos_config{'pd_dest'});
-  my $rn = $numrows - 1;
-  my $ds_string = sprintf (
-	'%s%s @ $%-7.2f%s%s%s', 
-	$pd_control{'new_line'},
-	$form->{"qty_$rn"},
-	$form->{"sellprice_$rn"},
-	$pd_control{'new_line'},
-	"Subtotal: \$".sprintf('%-7.2f', $form->{'invtotal'})
-  );
-  print SOCK $ds_string;
-  close SOCK;
-}
 
 sub open_drawer{
-   require "pos.conf.pl";
+    eval {require "pos.conf.pl"} || $form->error($locale->text(
+      "Could not open pos.conf.pl in [_1] line [_2]: [_3]", 
+       __FILE__, __LINE__, $!));
    open (PRINTER, "|-", ${'LedgerSMB::Sysconfig::printer'}{Printer});
    print PRINTER $pos_config{'rp_cash_open'};
    close PRINTER;
@@ -84,7 +71,10 @@
 }
 
 sub send_to_pd {
-    socket( SOCK, 2, 1, getprotobynumber( $pos_config{'pd_proto'} ) );
+    my $sock_type = SOCK_STREAM;
+    $sock_type = SOCK_DGRAM if $pos_config{'pd_proto'} eq 'udp'; 
+    socket( SOCK, PF_INET, $sock_type, 
+             getprotobynumber( $pos_config{'pd_proto'} ) );
     connect( SOCK, $pos_config{'pd_dest'} );
     my $rn        = $numrows - 1;
     my $ds_string = sprintf(
@@ -1022,7 +1012,7 @@
         $form->{printed} .= " $form->{formname}";
         $form->{printed} =~ s/^ //;
 
-        $form->update_status( \%myconfig );
+        $form->update_status( \%myconfig, 1);
     }
     $old_form->{printed} = $form->{printed};
 

Modified: addons/1.4/pos/trunk/bin/ps.pl
===================================================================
--- addons/1.4/pos/trunk/bin/ps.pl	2012-07-24 03:53:06 UTC (rev 5033)
+++ addons/1.4/pos/trunk/bin/ps.pl	2012-07-24 05:55:39 UTC (rev 5034)
@@ -50,7 +50,9 @@
 require "bin/is.pl";
 require "bin/rp.pl";
 require "bin/pos.pl";
-require "pos.conf.pl";
+eval {require "pos.conf.pl"} || $form->error($locale->text(
+      "Could not open pos.conf.pl in [_1] line [_2]: [_3]", 
+       __FILE__, __LINE__, $!));
 
 # customizations
 if ( -f "bin/custom/pos.pl" ) {
@@ -78,7 +80,9 @@
     my $curren = $pos_config{'curren'};
 
     $form->{title} = $locale->text( "Closing Till For [_1]", $form->{login} );
-    require "pos.conf.pl";
+    eval {require "pos.conf.pl"} || $form->error($locale->text(
+      "Could not open pos.conf.pl in [_1] line [_2]: [_3]", 
+       __FILE__, __LINE__, $!));
     IS->getposlines( \%myconfig, \%$form );
     $form->header;
     print qq|
@@ -217,7 +221,9 @@
 
 sub close_till {
     use LedgerSMB::GL;
-    require 'pos.conf.pl';
+    eval {require "pos.conf.pl"} || $form->error($locale->text(
+      "Could not open pos.conf.pl in [_1] line [_2]: [_3]", 
+       __FILE__, __LINE__, $!));
     IS->clear_till( \%myconfig, \%$form );
     my $amount     = 0;
     my $expected   = 0;

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