summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-17 23:06:29 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-17 23:06:29 +0000
commit47c66435de7d251558c613300988067baf722306 (patch)
tree74aef9238fc966e5d0b427e0a4eb14694642bcab
parent1d323f4d638f01dbf20a0f8151322ea611a8dd1b (diff)
Fixing bug 1682775
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@937 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/PE.pm28
-rwxr-xr-xbin/pe.pl4
2 files changed, 22 insertions, 10 deletions
diff --git a/LedgerSMB/PE.pm b/LedgerSMB/PE.pm
index 58d7a6cf..7fc00012 100755
--- a/LedgerSMB/PE.pm
+++ b/LedgerSMB/PE.pm
@@ -1431,23 +1431,33 @@ sub delete_translation {
}
+sub timecard_get_currency {
+ my $self = shift @_;
+ my $form = shift @_;
+ my $dbh = $form->{dbh};
+ my $query = qq|SELECT curr FROM customer WHERE id = ?|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute($form->{customer_id});
+ my ($curr) = $sth->fetchrow_array;
+ $form->{currency} = $curr;
+}
sub project_sales_order {
- my ($self, $myconfig, $form) = @_;
+ my ($self, $myconfig, $form) = @_;
- # connect to database
- my $dbh = $form->{dbh};
+ # connect to database
+ my $dbh = $form->{dbh};
- my $query = qq|SELECT current_date|;
- my ($transdate) = $dbh->selectrow_array($query);
+ my $query = qq|SELECT current_date|;
+ my ($transdate) = $dbh->selectrow_array($query);
- $form->all_years($myconfig, $dbh);
+ $form->all_years($myconfig, $dbh);
- $form->all_projects($myconfig, $dbh, $transdate);
+ $form->all_projects($myconfig, $dbh, $transdate);
- $form->all_employees($myconfig, $dbh, $transdate);
+ $form->all_employees($myconfig, $dbh, $transdate);
- $dbh->commit;
+ $dbh->commit;
}
diff --git a/bin/pe.pl b/bin/pe.pl
index e44315ca..62450bb3 100755
--- a/bin/pe.pl
+++ b/bin/pe.pl
@@ -2528,7 +2528,7 @@ sub generate_sales_orders {
$i = 0;
$order->{"$order->{vc}_id"} = $_;
-
+
AA->get_name(\%myconfig, \%$order);
foreach $ref (@ {$form->{order}{$_} }) {
@@ -2550,6 +2550,8 @@ sub generate_sales_orders {
$order->{reqdate} = $order->{transdate};
for (qw(intnotes employee employee_id)) { delete $order->{$_} }
+ PE->timecard_get_currency(\%$order);
+
if (OE->save(\%myconfig, \%$order)) {
if (! PE->allocate_projectitems(\%myconfig, \%$order)) {