summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-17 23:09:08 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-17 23:09:08 +0000
commit05f273f6a72d57872454286497319e9f9209559b (patch)
tree2560a7345a275d16e3a01be00543f56267aa6cf8
parent422e6108dcd2a46bd94c154e7e63eeaf5d3181a9 (diff)
Fixing bug 1682775
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@938 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/PE.pm11
-rwxr-xr-xbin/pe.pl2
2 files changed, 13 insertions, 0 deletions
diff --git a/LedgerSMB/PE.pm b/LedgerSMB/PE.pm
index efe8f4ec..099f94ce 100755
--- a/LedgerSMB/PE.pm
+++ b/LedgerSMB/PE.pm
@@ -1431,6 +1431,17 @@ 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) = @_;
diff --git a/bin/pe.pl b/bin/pe.pl
index e44315ca..acfaa784 100755
--- a/bin/pe.pl
+++ b/bin/pe.pl
@@ -2551,6 +2551,8 @@ sub generate_sales_orders {
for (qw(intnotes employee employee_id)) { delete $order->{$_} }
+ PE->timecard_get_currency(\%$order);
+
if (OE->save(\%myconfig, \%$order)) {
if (! PE->allocate_projectitems(\%myconfig, \%$order)) {
OE->delete(\%myconfig, \%$order, ${LedgerSMB::Sysconfig::spool});