map { $form->{$_} = $ref->{$_} } keys %$ref;
+ # remove any trailing whitespace
+ $form->{curr} =~ s/\s*$//;
+
$sth->finish;
if ( $form->{salesman_id} ) {
my $query =
qq|taxzone_id = ?, | .
qq|user_password = ?, | .
qq|c_vendor_id = ?, | .
- qq|klass = ? | .
+ qq|klass = ?, | .
+ qq|curr = ? | .
qq|WHERE id = ?|;
my @values = (
$form->{customernumber},
$form->{user_password},
$form->{c_vendor_id},
conv_i($form->{klass}),
+ substr($form->{currency}, 0, 3),
$form->{id}
);
do_query( $form, $dbh, $query, @values );
qq| language_id = ?, | .
qq| username = ?, | .
qq| user_password = ?, | .
- qq| v_customer_id = ? | .
+ qq| v_customer_id = ?, | .
+ qq| curr = ? | .
qq|WHERE id = ?|;
my @values = (
$form->{vendornumber},
$form->{username},
$form->{user_password},
$form->{v_customer_id},
+ substr($form->{currency}, 0, 3),
$form->{id}
);
do_query($form, $dbh, $query, @values);
"a.department_id" => "department_id",
"d.description" => "department",
"ct.name" => $table,
+ "ct.curr" => "cv_curr",
"current_date + ct.terms" => "duedate",
);
if ($self->{type} =~ /delivery_order/) {
$arap = 'delivery_orders';
delete $column_map{"a.curr"};
+ delete $column_map{"ct.curr"};
} elsif ($self->{type} =~ /_order/) {
$arap = 'oe';
# remove any trailing whitespace
$self->{currency} =~ s/\s*$// if $self->{currency};
+ $self->{cv_curr} =~ s/\s*$// if $self->{cv_curr};
+
+ # if customer/vendor currency is set use this
+ $self->{currency} = $self->{cv_curr} if $self->{cv_curr};
$main::lxdebug->leave_sub();
}
v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount,
v.creditlimit, v.terms, v.notes AS intnotes,
v.email, v.cc, v.bcc, v.language_id, v.payment_id,
- v.street, v.zipcode, v.city, v.country, v.taxzone_id,
+ v.street, v.zipcode, v.city, v.country, v.taxzone_id, v.curr,
$duedate + COALESCE(pt.terms_netto, 0) AS duedate,
b.description AS business
FROM vendor v
my $ref = selectfirst_hashref_query($form, $dbh, $query, @values);
map { $params->{$_} = $ref->{$_} } keys %$ref;
+ # remove any trailing whitespace
+ $form->{curr} =~ s/\s*$//;
+
+ # use vendor currency if not empty
+ $form->{currency} = $form->{curr} if $form->{curr};
+
$params->{creditremaining} = $params->{creditlimit};
$query = qq|SELECT SUM(amount - paid) FROM ap WHERE vendor_id = ?|;
# get rest for the vendor
# fax and phone and email as vendor*
my $query =
- qq|SELECT ct.*, cp.*, ct.notes as vendornotes, phone as vendorphone, fax as vendorfax, email as vendoremail
+ qq|SELECT ct.*, cp.*, ct.notes as vendornotes, phone as vendorphone, fax as vendorfax, email as vendoremail,
+ ct.curr AS currency
FROM vendor ct
LEFT JOIN contacts cp ON (ct.id = cp.cp_cv_id)
WHERE (ct.id = ?) $contact
}
map { $form->{$_} = $ref->{$_} } keys %$ref;
+ # remove any trailing whitespace
+ $form->{currency} =~ s/\s*$// if ($form->{currency});
my $custom_variables = CVar->get_custom_variables('dbh' => $dbh,
'module' => 'CT',
# get rest for the customer
my $query =
qq|SELECT ct.*, cp.*, ct.notes as customernotes,
- ct.phone AS customerphone, ct.fax AS customerfax, ct.email AS customeremail
+ ct.phone AS customerphone, ct.fax AS customerfax, ct.email AS customeremail,
+ ct.curr AS currency
FROM customer ct
LEFT JOIN contacts cp on ct.id = cp.cp_cv_id
WHERE (ct.id = ?) $where
map { $form->{$_} = $ref->{$_} } keys %$ref;
+ # remove any trailing whitespace
+ $form->{currency} =~ s/\s*$// if ($form->{currency});
+
if ($form->{delivery_customer_id}) {
$query =
qq|SELECT *, notes as customernotes
c.id AS customer_id, c.name AS customer, c.discount as customer_discount, c.creditlimit, c.terms,
c.email, c.cc, c.bcc, c.language_id, c.payment_id,
c.street, c.zipcode, c.city, c.country,
- c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id,
+ c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, c.curr,
$duedate + COALESCE(pt.terms_netto, 0) AS duedate,
b.discount AS tradediscount, b.description AS business
FROM customer c
map { $form->{$_} = $ref->{$_} } keys %$ref;
+ # remove any trailing whitespace
+ $form->{curr} =~ s/\s*$//;
+
+ # use customer currency if not empty
+ $form->{currency} = $form->{curr} if $form->{curr};
+
$query =
qq|SELECT sum(amount - paid) AS dunning_amount
FROM ar
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- $form->get_lists(employees => "ALL_EMPLOYEES",
- taxzones => "ALL_TAXZONES");
+ $form->get_lists(employees => "ALL_EMPLOYEES",
+ taxzones => "ALL_TAXZONES",
+ currencies => "ALL_CURRENCIES");
$form->get_pricegroup(\%myconfig, { all => 1 });
$form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::lx_office_conf{features}->{vertreter};
}
}
+ if (!$form->{'id'}) {
+ $form->{'currency'} = $form->get_default_currency(\%myconfig);
+ } else {
+ $form->{currency} = $form->{curr};
+ }
+
$form->{CUSTOM_VARIABLES} = CVar->get_custom_variables('module' => 'CT', 'trans_id' => $form->{id});
CVar->render_inputs('variables' => $form->{CUSTOM_VARIABLES}) if (scalar @{ $form->{CUSTOM_VARIABLES} });
my $salesman_id_saved = $form->{salesman_id};
my $cp_id_saved = $form->{cp_id};
my $taxzone_id_saved = $form->{taxzone_id};
+ my $currency_saved = $form->{currency};
call_sub("$form->{vc}_details") if ($form->{vc});
$form->{language_id} = $language_saved;
$form->{payment_id} = $payment_id_saved;
$form->{taxzone_id} = $taxzone_id_saved;
+ $form->{currency} = $currency_saved;
$form->{"email"} = $saved_email if ($saved_email);
$form->{"cc"} = $saved_cc if ($saved_cc);
$form->{"$form->{vc}_id"} ||= $form->{"all_$form->{vc}"}->[0]->{id} if $form->{"all_$form->{vc}"};
- $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes shipto_id));
+ $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes shipto_id currency));
$form->{shipto} = 1 if $form->{id};
# get customer / vendor
IS->get_customer(\%myconfig, \%$form) if $form->{type} =~ /sales_(order|quotation)/;
$form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id shipto_id));
+ $form->restore_vars(qw(currency)) if $form->{id};
$form->restore_vars(qw(taxincluded)) if $form->{id};
$form->restore_vars(qw(salesman_id)) if $editing;
$form->{forex} = $form->{exchangerate};
- Häkchen bei der Konto-Konfiguration f. Forderungen u. Verbindlichkeiten
als Radio-Buttons.
+ - 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.
+
Liste gefixter Bugs aus dem Bugtracker:
- Bugfix 1640: Buchungen werden falsch zugeordnet, wenn man Konten umkonfiguriert
- Bugfix 1753: Benutzerdefinierte Variable f. Waren: bearbeitbar nicht auswählbar
- Bugfix 1738: Entwürfe können nicht gelöscht werden
+ - Bugfix 1759: Währung bei Kunden / Lieferanten vorbelegen
2011-06-15 - Release 2.6.3
<td><input name="iban" size="10" maxlength="100" value="[% HTML.escape(iban) %]"></td>
<th align="right">[% 'BIC' | $T8 %]</th>
<td><input name="bic" size="10" maxlength="100" value="[% HTML.escape(bic) %]"></td>
+ [%- IF ALL_CURRENCIES.size %]
+ <th align="right">[% 'Currency' | $T8 %]</th>
+ <td>[% L.select_tag('currency', L.options_for_select(ALL_CURRENCIES, default=currency, with_empty=1)) %]</td>
+ [%- END %]
</tr>
<tr>