diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-11-23 00:57:29 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-11-23 00:57:29 +0000 |
commit | 588d85c60cb2629050a550ea56111e6a81d63d6d (patch) | |
tree | 8eb103d3a0b84918e1504b76e5a0c256d8257473 /bin | |
parent | eab1c390b1d504bab15644b17e77698ff7894570 (diff) |
Fixes to closing till report
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1892 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/hr.pl | 16 | ||||
-rwxr-xr-x | bin/ir.pl | 7 | ||||
-rwxr-xr-x | bin/is.pl | 4 | ||||
-rwxr-xr-x | bin/oe.pl | 6 | ||||
-rwxr-xr-x | bin/rc.pl | 16 |
5 files changed, 34 insertions, 15 deletions
@@ -528,6 +528,17 @@ sub employee_links { for ( keys %$form ) { $form->{$_} = $form->quote( $form->{$_} ) } + $form->all_departments; + if ( @{ $form->{all_department} } ) { + $form->{selectdepartment} = "<option>\n"; + $form->{department} = "$form->{department}--$form->{department_id}" + if $form->{department_id}; + + for ( @{ $form->{all_department} } ) { + $form->{selectdepartment} .= +qq|<option value="$_->{description}--$_->{id}">$_->{description}\n|; + } + } if ( @{ $form->{all_deduction} } ) { $form->{selectdeduction} = "<option>\n"; for ( @{ $form->{all_deduction} } ) { @@ -731,6 +742,11 @@ sub employee_header { <th align=right nowrap>| . $locale->text('BIC') . qq|</th> <td><input name=bic size=11 maxlength=11 value="$form->{bic}"></td> </tr> + <tr> + <th align=right nowrap>| . $locale->text('Department') . qq|</th> + <td><select name="department"> + $form->{selectdepartment} + </select> </table> </td> </tr> @@ -139,14 +139,15 @@ qq|<option value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n|; # departments if ( @{ $form->{all_department} } ) { $form->{selectdepartment} = "<option>\n"; - $form->{department} = "$form->{department}--$form->{department_id}" - if $form->{department_id}; for ( @{ $form->{all_department} } ) { $form->{selectdepartment} .= qq|<option value="$_->{description}--$_->{id}">$_->{description}\n|; } } + $form->{department} = "$form->{department}--$myconfig{department_id}" + if $myconfig{department_id}; + if ( @{ $form->{all_language} } ) { $form->{selectlanguage} = "<option>\n"; @@ -273,7 +274,7 @@ sub form_header { for (qw(vendor department)) { $form->{"select$_"} = $form->unescape( $form->{"select$_"} ); $form->{"select$_"} =~ s/ selected//; - $form->{"select$_"} =~ s/(<option value="\Q$form->{$_}\E")/$1 selected/; + $form->{"select$_"} =~ s/(<option value="[^"]*\Q$form->{$_}\E")/$1 selected/; } if ( $form->{selectlanguage} ) { @@ -153,6 +153,8 @@ qq|<option value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n|; qq|<option value="$_->{description}--$_->{id}">$_->{description}\n|; } } + $form->{department} = "$form->{department}--$myconfig{department_id}" + if $myconfig{department_id}; $form->{employee} = "$form->{employee}--$form->{employee_id}"; @@ -306,7 +308,7 @@ sub form_header { for (qw(customer department employee)) { $form->{"select$_"} = $form->unescape( $form->{"select$_"} ); $form->{"select$_"} =~ s/ selected//; - $form->{"select$_"} =~ s/(<option value="\Q$form->{$_}\E")/$1 selected/; + $form->{"select$_"} =~ s/(<option value="[^"]*\Q$form->{$_}\E")/$1 selected/; } $form->{exchangerate} = @@ -192,8 +192,6 @@ qq|<option value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n|; # departments if ( @{ $form->{all_department} } ) { $form->{selectdepartment} = "<option>\n"; - $form->{department} = "$form->{department}--$form->{department_id}" - if $form->{department_id}; for ( @{ $form->{all_department} } ) { $form->{selectdepartment} .= @@ -372,7 +370,7 @@ sub form_header { for ( "$form->{vc}", "department", "employee" ) { $form->{"select$_"} = $form->unescape( $form->{"select$_"} ); $form->{"select$_"} =~ s/ selected//; - $form->{"select$_"} =~ s/(<option value="\Q$form->{$_}\E")/$1 selected/; + $form->{"select$_"} =~ s/(<option value="[^"]*\Q$form->{$_}\E")/$1 selected/; } $form->{exchangerate} = @@ -1512,6 +1510,8 @@ sub transactions { # split vendor / customer ( $form->{ $form->{vc} }, $form->{"$form->{vc}_id"} ) = split( /--/, $form->{ $form->{vc} } ); + $form->{department} = "$form->{department}--$myconfig{department_id}" + if $myconfig{department_id}; OE->transactions( \%myconfig, \%$form ); @@ -402,7 +402,7 @@ sub close_till { $form->{transdate} = $form->current_date( \%myconfig ); GL->post_transaction( \%myconfig, \%$form ); delete $form->{id}; - $lines .= "Cumulative Error: $amount"; + $lines .= "Cumulative Error: $amount\n\n"; $form->{accno} = $form->{accno_1}; RC->getbalance( \%myconfig, \%$form ); $amount = $form->{balance} * -1; @@ -419,7 +419,7 @@ sub close_till { $head = "Closing Till $pos_config{till} for $form->{login}\n" . "Date: $form->{transdate}\n\n\n"; - my @cashlines = [ $locale->text("Cash Breakdown:") ]; + my @cashlines = ( $locale->text("Cash Breakdown:") ); foreach my $unit ( @{ $pos_config{'breakdown'} } ) { # XXX Needs to take into account currencies that don't use 2 dp @@ -428,34 +428,34 @@ sub close_till { $calcval = sprintf( '%03d', $calcval * 100 ) if $calcval < 1; my $subval = 'sub_' . $calcval; $calcval = 'calc_' . $calcval; - push @cashlines, "$form->{$calcval} x $parseval = $form->{$subval}"; + push @cashlines, "$form->{$calcval} x $parsed = $form->{$subval}"; } push @cashlines, $locale->text( "Total Cash in Drawer: [_1]", $form->{sub_sub} ); push @cashlines, - $locale->text( "Less Cash in Till At Start: [_1]", $form->{till_cash} ); + $locale->text( "Less Cash in Till At Start: [_1]", $pos_config{till_cash} ); push @cashlines, "\n"; $cash = join( "\n", @cashlines ); $foot = $locale->text( "Cumulative Error: [_1]", $difference ) . "\n"; $foot .= $locale->text( 'Reset Till By [_1]', $amount ) . "\n\n\n\n\n\n\n\n\n\n"; open( PRN, "|-", ${LedgerSMB::Sysconfig::printer}{Printer} ); + print PRN $head; print PRN $lines; print PRN $cash; - print PRN $cash; print PRN $foot; close PRN; - if ( $difference > 0 ) { + if ( $difference < 0 ) { $message = $locale->text( "You are over by [_1]", $difference ); } - elsif ( $difference < 0 ) { + elsif ( $difference > 0 ) { $message = $locale->text( "You are under by [_1]", $difference * -1 ); } else { $message = - $local->text("Congratulations! Your till is exactly balanced."); + $locale->text("Congratulations! Your till is exactly balanced."); } $form->info($message); } |