summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/is.pl2
-rwxr-xr-xbin/pos.pl65
-rwxr-xr-xbin/rc.pl2
3 files changed, 42 insertions, 27 deletions
diff --git a/bin/is.pl b/bin/is.pl
index 3322f695..3338018a 100755
--- 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 {
@@ -808,6 +809,7 @@ qq|<td align="center"><input name="memo_$i" size="11" value="$form->{"memo_$i"}"
}
sub update {
+ on_update();
$form->{taxes} = {};
$form->{exchangerate} =
$form->parse_amount( \%myconfig, $form->{exchangerate} );
diff --git a/bin/pos.pl b/bin/pos.pl
index 0622681f..35fea78a 100755
--- a/bin/pos.pl
+++ b/bin/pos.pl
@@ -42,9 +42,38 @@
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'};
@@ -77,14 +106,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;
}
@@ -246,14 +268,6 @@ sub form_header {
</tr>
| if $form->{selectdepartment};
- $employee = qq|
- <tr>
- <th align="right" nowrap>| . $locale->text('Salesperson') . qq|</th>
- <td colspan="3"><select name="employee">$form->{selectemployee}</select></td>
- <input type="hidden" name="selectemployee" value="|
- . $form->escape( $form->{selectemployee}, 1 ) . qq|">
- </tr>
-| if $form->{selectemployee};
if ( $form->{change} != $form->{oldchange} ) {
$form->{creditremaining} -= $form->{oldchange};
@@ -347,7 +361,7 @@ sub form_header {
<td></td>
<td colspan="3">
<table>
- <tr>
+ <!-- tr>
<th align="right" nowrap>| . $locale->text('Credit Limit') . qq|</th>
<td>$form->{creditlimit}</td>
<td width="10"></td>
@@ -355,7 +369,7 @@ sub form_header {
<td class="plus$n">|
. $form->format_amount( \%myconfig, $form->{creditremaining}, 0, "0" )
. qq|</font></td>
- </tr>
+ </tr -->
$business
</table>
</td>
@@ -603,12 +617,10 @@ qq|<td><select name="AR_paid_$i">$form->{"selectAR_paid_$i"}</select></td>|;
%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' =>
@@ -673,7 +685,6 @@ qq| <button class="submit" type="submit" name="action" value="$spc$item">$spc$it
sub post {
- $form->{media} = 'Printer';
$form->isblank( "customer", $locale->text('Customer missing!') );
# if oldcustomer ne customer redo form
@@ -686,7 +697,6 @@ sub post {
}
&validate_items;
- &print;
$form->isblank( "exchangerate", $locale->text('Exchange rate missing!') )
if ( $form->{currency} ne $form->{defaultcurrency} );
@@ -706,7 +716,7 @@ sub post {
++$form->{paidaccounts};
my $pa = $form->{paidaccounts};
$form->{"paid_$pa"} = $total - $paid;
- $form->{"source_$pa"} = 'cash';
+ $form->{"memo_$pa"} = 'cash';
$form->{"exchangerate_$pa"} = 0;
$form->{"AR_paid_$pa"} = $form->{AR_paid_1};
}
@@ -884,7 +894,10 @@ qq|<td><input name="description_$i" size=48 value="$form->{"description_$i"}"></
}
+
sub print {
+ open_drawer();
+ sleep 1;
if ( !$form->{invnumber} ) {
$form->{invnumber} = $form->update_defaults( \%myconfig, 'sinumber' );
}
@@ -1029,7 +1042,7 @@ sub print_form {
}
sub print_and_post {
-
+ $form->{media} = 'Printer';
$form->error( $locale->text('Select a Printer!') )
if ( $form->{media} eq 'screen' );
$form->{printandpost} = 1;
diff --git a/bin/rc.pl b/bin/rc.pl
index d713b03c..8f282f57 100755
--- a/bin/rc.pl
+++ b/bin/rc.pl
@@ -250,7 +250,7 @@ sub till_closing {
foreach $source ( sort keys %pos_sources ) {
$amount = 0;
foreach $ref ( @{ $form->{TB} } ) {
- if ( $ref->{source} eq $source ) {
+ if ( $ref->{memo} eq $source ) {
$amount = $ref->{amount} * -1;
last;
}