[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [937] branches/1.2



Revision: 937
          http://svn.sourceforge.net/ledger-smb/?rev=937&view=rev
Author:   einhverfr
Date:     2007-03-17 16:06:29 -0700 (Sat, 17 Mar 2007)

Log Message:
-----------
Fixing bug 1682775

Modified Paths:
--------------
    branches/1.2/LedgerSMB/PE.pm
    branches/1.2/bin/pe.pl

Modified: branches/1.2/LedgerSMB/PE.pm
===================================================================
--- branches/1.2/LedgerSMB/PE.pm	2007-03-17 22:12:29 UTC (rev 936)
+++ branches/1.2/LedgerSMB/PE.pm	2007-03-17 23:06:29 UTC (rev 937)
@@ -1431,23 +1431,33 @@
 
 }
 
+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;
 
 }
 

Modified: branches/1.2/bin/pe.pl
===================================================================
--- branches/1.2/bin/pe.pl	2007-03-17 22:12:29 UTC (rev 936)
+++ branches/1.2/bin/pe.pl	2007-03-17 23:06:29 UTC (rev 937)
@@ -2528,7 +2528,7 @@
 
     $i = 0;
     $order->{"$order->{vc}_id"} = $_;
-    
+
     AA->get_name(\%myconfig, \%$order);
 
     foreach $ref (@ {$form->{order}{$_} }) {
@@ -2550,6 +2550,8 @@
     $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)) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.