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/CT.pm
69 69

  
70 70
  map { $form->{$_} = $ref->{$_} } keys %$ref;
71 71

  
72
  # remove any trailing whitespace
73
  $form->{curr} =~ s/\s*$//;
74

  
72 75
  $sth->finish;
73 76
  if ( $form->{salesman_id} ) {
74 77
    my $query =
......
315 318
    qq|taxzone_id = ?, | .
316 319
    qq|user_password = ?, | .
317 320
    qq|c_vendor_id = ?, | .
318
    qq|klass = ? | .
321
    qq|klass = ?, | .
322
    qq|curr = ? | .
319 323
    qq|WHERE id = ?|;
320 324
  my @values = (
321 325
    $form->{customernumber},
......
357 361
    $form->{user_password},
358 362
    $form->{c_vendor_id},
359 363
    conv_i($form->{klass}),
364
    substr($form->{currency}, 0, 3),
360 365
    $form->{id}
361 366
    );
362 367
  do_query( $form, $dbh, $query, @values );
......
524 529
    qq|  language_id = ?, | .
525 530
    qq|  username = ?, | .
526 531
    qq|  user_password = ?, | .
527
    qq|  v_customer_id = ? | .
532
    qq|  v_customer_id = ?, | .
533
    qq|  curr = ? | .
528 534
    qq|WHERE id = ?|;
529 535
  my @values = (
530 536
    $form->{vendornumber},
......
564 570
    $form->{username},
565 571
    $form->{user_password},
566 572
    $form->{v_customer_id},
573
    substr($form->{currency}, 0, 3),
567 574
    $form->{id}
568 575
    );
569 576
  do_query($form, $dbh, $query, @values);
SL/Form.pm
2890 2890
                    "a.department_id"         => "department_id",
2891 2891
                    "d.description"           => "department",
2892 2892
                    "ct.name"                 => $table,
2893
                    "ct.curr"                 => "cv_curr",
2893 2894
                    "current_date + ct.terms" => "duedate",
2894 2895
    );
2895 2896

  
2896 2897
  if ($self->{type} =~ /delivery_order/) {
2897 2898
    $arap  = 'delivery_orders';
2898 2899
    delete $column_map{"a.curr"};
2900
    delete $column_map{"ct.curr"};
2899 2901

  
2900 2902
  } elsif ($self->{type} =~ /_order/) {
2901 2903
    $arap  = 'oe';
......
2931 2933

  
2932 2934
  # remove any trailing whitespace
2933 2935
  $self->{currency} =~ s/\s*$// if $self->{currency};
2936
  $self->{cv_curr} =~ s/\s*$// if $self->{cv_curr};
2937

  
2938
  # if customer/vendor currency is set use this
2939
  $self->{currency} = $self->{cv_curr} if $self->{cv_curr};
2934 2940

  
2935 2941
  $main::lxdebug->leave_sub();
2936 2942
}
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',
SL/IS.pm
450 450
  # get rest for the customer
451 451
  my $query =
452 452
    qq|SELECT ct.*, cp.*, ct.notes as customernotes,
453
         ct.phone AS customerphone, ct.fax AS customerfax, ct.email AS customeremail
453
         ct.phone AS customerphone, ct.fax AS customerfax, ct.email AS customeremail,
454
         ct.curr AS currency
454 455
       FROM customer ct
455 456
       LEFT JOIN contacts cp on ct.id = cp.cp_cv_id
456 457
       WHERE (ct.id = ?) $where
......
470 471

  
471 472
  map { $form->{$_} = $ref->{$_} } keys %$ref;
472 473

  
474
  # remove any trailing whitespace
475
  $form->{currency} =~ s/\s*$// if ($form->{currency});
476

  
473 477
  if ($form->{delivery_customer_id}) {
474 478
    $query =
475 479
      qq|SELECT *, notes as customernotes
......
1647 1651
         c.id AS customer_id, c.name AS customer, c.discount as customer_discount, c.creditlimit, c.terms,
1648 1652
         c.email, c.cc, c.bcc, c.language_id, c.payment_id,
1649 1653
         c.street, c.zipcode, c.city, c.country,
1650
         c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id,
1654
         c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, c.curr,
1651 1655
         $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
1652 1656
         b.discount AS tradediscount, b.description AS business
1653 1657
       FROM customer c
......
1661 1665

  
1662 1666
  map { $form->{$_} = $ref->{$_} } keys %$ref;
1663 1667

  
1668
  # remove any trailing whitespace
1669
  $form->{curr} =~ s/\s*$//;
1670

  
1671
  # use customer currency if not empty
1672
  $form->{currency} = $form->{curr} if $form->{curr};
1673

  
1664 1674
  $query =
1665 1675
    qq|SELECT sum(amount - paid) AS dunning_amount
1666 1676
       FROM ar
bin/mozilla/ct.pl
313 313
  my %myconfig = %main::myconfig;
314 314
  my $locale   = $main::locale;
315 315

  
316
  $form->get_lists(employees => "ALL_EMPLOYEES",
317
                   taxzones  => "ALL_TAXZONES");
316
  $form->get_lists(employees  => "ALL_EMPLOYEES",
317
                   taxzones   => "ALL_TAXZONES",
318
                   currencies => "ALL_CURRENCIES");
318 319
  $form->get_pricegroup(\%myconfig, { all => 1 });
319 320

  
320 321
  $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::lx_office_conf{features}->{vertreter};
......
345 346
    }
346 347
  }
347 348

  
349
  if (!$form->{'id'}) {
350
    $form->{'currency'} = $form->get_default_currency(\%myconfig);
351
  } else {
352
    $form->{currency} = $form->{curr};
353
  }
354

  
348 355
  $form->{CUSTOM_VARIABLES} = CVar->get_custom_variables('module' => 'CT', 'trans_id' => $form->{id});
349 356

  
350 357
  CVar->render_inputs('variables' => $form->{CUSTOM_VARIABLES}) if (scalar @{ $form->{CUSTOM_VARIABLES} });
bin/mozilla/io.pl
1328 1328
  my $salesman_id_saved = $form->{salesman_id};
1329 1329
  my $cp_id_saved = $form->{cp_id};
1330 1330
  my $taxzone_id_saved = $form->{taxzone_id};
1331
  my $currency_saved = $form->{currency};
1331 1332

  
1332 1333
  call_sub("$form->{vc}_details") if ($form->{vc});
1333 1334

  
1334 1335
  $form->{language_id} = $language_saved;
1335 1336
  $form->{payment_id} = $payment_id_saved;
1336 1337
  $form->{taxzone_id} = $taxzone_id_saved;
1338
  $form->{currency} = $currency_saved;
1337 1339

  
1338 1340
  $form->{"email"} = $saved_email if ($saved_email);
1339 1341
  $form->{"cc"}    = $saved_cc    if ($saved_cc);
bin/mozilla/oe.pl
239 239

  
240 240
  $form->{"$form->{vc}_id"} ||= $form->{"all_$form->{vc}"}->[0]->{id} if $form->{"all_$form->{vc}"};
241 241

  
242
  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes shipto_id));
242
  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes shipto_id currency));
243 243
  $form->{shipto} = 1 if $form->{id};
244 244

  
245 245
  # get customer / vendor
......
247 247
  IS->get_customer(\%myconfig, \%$form) if $form->{type} =~ /sales_(order|quotation)/;
248 248

  
249 249
  $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id shipto_id));
250
  $form->restore_vars(qw(currency))    if $form->{id};
250 251
  $form->restore_vars(qw(taxincluded)) if $form->{id};
251 252
  $form->restore_vars(qw(salesman_id)) if $editing;
252 253
  $form->{forex}       = $form->{exchangerate};
doc/changelog
56 56
  - Häkchen bei der Konto-Konfiguration f. Forderungen u. Verbindlichkeiten
57 57
    als Radio-Buttons.
58 58

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

  
59 63

  
60 64
  Liste gefixter Bugs aus dem Bugtracker:
61 65

  
62 66
  - Bugfix 1640: Buchungen werden falsch zugeordnet, wenn man Konten umkonfiguriert
63 67
  - Bugfix 1753: Benutzerdefinierte Variable f. Waren: bearbeitbar nicht auswählbar
64 68
  - Bugfix 1738:  Entwürfe können nicht gelöscht werden
69
  - Bugfix 1759: Währung bei Kunden / Lieferanten vorbelegen
65 70

  
66 71
2011-06-15 - Release 2.6.3
67 72

  
templates/webpages/ct/form_header.html
213 213
      <td><input name="iban" size="10" maxlength="100" value="[% HTML.escape(iban) %]"></td>
214 214
      <th align="right">[% 'BIC' | $T8 %]</th>
215 215
      <td><input name="bic" size="10" maxlength="100" value="[% HTML.escape(bic) %]"></td>
216
      [%- IF ALL_CURRENCIES.size %]
217
        <th align="right">[% 'Currency' | $T8 %]</th>
218
        <td>[% L.select_tag('currency', L.options_for_select(ALL_CURRENCIES, default=currency, with_empty=1)) %]</td>
219
      [%- END %]
216 220
     </tr>
217 221

  
218 222
     <tr>

Auch abrufbar als: Unified diff