diff options
-rwxr-xr-x | LedgerSMB/PE.pm | 11 | ||||
-rwxr-xr-x | bin/pe.pl | 2 |
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) = @_; @@ -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}); |