Auf CustomerVendor auf currency_id umgestellt
authorThomas Heck <theck@linet-services.de>
Wed, 26 Jun 2013 11:51:15 +0000 (13:51 +0200)
committerJan Büren <jan@kivitendo-premium.de>
Thu, 18 Jul 2013 07:09:03 +0000 (09:09 +0200)
SL/Controller/CustomerVendor.pm
templates/webpages/customer_vendor/form.html

index 9becb61..8d2f96a 100644 (file)
@@ -19,6 +19,7 @@ use SL::DB::Pricegroup;
 use SL::DB::Contact;
 use SL::DB::FollowUp;
 use SL::DB::History;
+use SL::DB::Currency;
 
 # safety
 __PACKAGE__->run_before(
@@ -727,18 +728,7 @@ sub _pre_render {
     )
   ];
 
-  $query =
-    'SELECT curr
-     FROM defaults';
-  my $curr = selectall_hashref_query($::form, $dbh, $query)->[0]->{curr};
-  my @currencies = grep(
-    { $_; }
-    map(
-      { s/\s//g; $_; }
-      split(m/:/, $curr)
-    )
-  );
-  $self->{all_currencies} = \@currencies;
+  $self->{all_currencies} = SL::DB::Manager::Currency->get_all();
 
   $self->{all_languages} = SL::DB::Manager::Language->get_all();
 
index bb84e9b..dd12e75 100644 (file)
             <th align="right">[% 'Currency' | $T8 %]</th>
 
             <td>
-              [% L.select_tag('cv.curr', SELF.all_currencies, default = SELF.cv.curr, with_empty = 1) %]
+              [% L.select_tag('cv.currency_id', SELF.all_currencies, title_key = 'name', value_key = 'id', default = SELF.cv.currency_id, with_empty = 1) %]
             </td>
           [% END %]
         </tr>