From e20e7a6e47760d0e8561ae7d13a29ddc24330b68 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 18 Oct 2007 00:44:57 +0000 Subject: POS Fixes: 1: Drawer opening now uses correct printer designation 2: Change issued is now entered with correct memo field. 3: Closing tell report works as advertised git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1781 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/is.pl | 2 ++ bin/pos.pl | 53 +++++++++++++++++++++++++++++++++++++---------------- bin/rc.pl | 2 +- 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/bin/is.pl b/bin/is.pl index 21502022..edb2f0f0 100644 --- a/bin/is.pl +++ b/bin/is.pl @@ -53,6 +53,7 @@ require "bin/io.pl"; 1; # end of main +sub on_update{} sub add { if ($form->{type} eq 'credit_invoice'){ @@ -831,6 +832,7 @@ qq|{taxes} = {}; $form->{exchangerate} = $form->parse_amount( \%myconfig, $form->{exchangerate} ); diff --git a/bin/pos.pl b/bin/pos.pl index cbc3ddea..92b68e72 100644 --- a/bin/pos.pl +++ b/bin/pos.pl @@ -45,9 +45,38 @@ use Error qw(:try); use LedgerSMB::Template; use LedgerSMB::Tax; +$form->{currency} = 'USD'; 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 on_update{ + &custom_send_to_pd; + &custom_check_alert; +} + +sub open_drawer{ + require "pos.conf.pl"; + open (PRINTER, "|-", ${'LedgerSMB::Sysconfig::printer'}{Printer}); + print PRINTER $pos_config{'rp_cash_open'}; + close PRINTER; + sleep 1; +} sub check_alert { my $rc = $form->{'rowcount'}; @@ -80,14 +109,7 @@ sub on_update { &check_alert; } -sub open_drawer { - open( PRINTER, "|-", ${LedgerSMB::Sysconfig::printer}{Printer} ); - print PRINTER $pos_config{'rp_cash_open'}; - close PRINTER; - sleep 1; -} - -sub open { +sub open_till { &open_drawer; &update; } @@ -606,12 +628,10 @@ qq||; %button = ( 'update' => { ndx => 1, key => 'U', value => $locale->text('Update') }, - 'print' => - { ndx => 2, key => 'P', value => $locale->text('Print') }, - 'post' => { ndx => 3, key => 'O', value => $locale->text('Post') }, + 'open_till' => { ndx => 3, key => 'O', value => $locale->text('Open Till') }, 'print_and_post' => { ndx => 4, - key => 'R', + key => 'P', value => $locale->text('Print and Post') }, 'delete' => @@ -676,7 +696,6 @@ qq|