Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 94802c79

Von Bernd Blessmann vor fast 13 Jahren hinzugefügt

Fix für Bug 1759: (Verbesserung) Währung bei Kunden / Lieferanten vorbelegen

Für Kunden und Lieferanten kann jetzt in den Stammdaten eine Währung
eingestellt werden, die als Voreinstellung in den Ver- und Einkaufs-
Masken dient.

Unterschiede anzeigen:

SL/IR.pm
997 997
         v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount,
998 998
         v.creditlimit, v.terms, v.notes AS intnotes,
999 999
         v.email, v.cc, v.bcc, v.language_id, v.payment_id,
1000
         v.street, v.zipcode, v.city, v.country, v.taxzone_id,
1000
         v.street, v.zipcode, v.city, v.country, v.taxzone_id, v.curr,
1001 1001
         $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
1002 1002
         b.description AS business
1003 1003
       FROM vendor v
......
1007 1007
  my $ref = selectfirst_hashref_query($form, $dbh, $query, @values);
1008 1008
  map { $params->{$_} = $ref->{$_} } keys %$ref;
1009 1009

  
1010
  # remove any trailing whitespace
1011
  $form->{curr} =~ s/\s*$//;
1012

  
1013
  # use vendor currency if not empty
1014
  $form->{currency} = $form->{curr} if $form->{curr};
1015

  
1010 1016
  $params->{creditremaining} = $params->{creditlimit};
1011 1017

  
1012 1018
  $query = qq|SELECT SUM(amount - paid) FROM ap WHERE vendor_id = ?|;
......
1289 1295
  # get rest for the vendor
1290 1296
  # fax and phone and email as vendor*
1291 1297
  my $query =
1292
    qq|SELECT ct.*, cp.*, ct.notes as vendornotes, phone as vendorphone, fax as vendorfax, email as vendoremail
1298
    qq|SELECT ct.*, cp.*, ct.notes as vendornotes, phone as vendorphone, fax as vendorfax, email as vendoremail,
1299
         ct.curr AS currency
1293 1300
       FROM vendor ct
1294 1301
       LEFT JOIN contacts cp ON (ct.id = cp.cp_cv_id)
1295 1302
       WHERE (ct.id = ?) $contact
......
1308 1315
  }
1309 1316

  
1310 1317
  map { $form->{$_} = $ref->{$_} } keys %$ref;
1318
  # remove any trailing whitespace
1319
  $form->{currency} =~ s/\s*$// if ($form->{currency});
1311 1320

  
1312 1321
  my $custom_variables = CVar->get_custom_variables('dbh'      => $dbh,
1313 1322
                                                    'module'   => 'CT',

Auch abrufbar als: Unified diff