# get customer
$query =
qq|SELECT
- c.id AS customer_id, c.name AS customer, c.discount, c.creditlimit, c.terms,
+ 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,
$cgi->hidden("-name" => "callback", "-value" => $form->{callback})
. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}])
. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}])
+. $cgi->hidden('-name' => 'customer_discount', '-value' => [$form->{customer_discount}])
. qq|
</form>
$rows = scalar @{ $form->{item_list} };
- $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{discount} * 100);
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{customer_discount} * 100);
if ($rows) {
$form->{"qty_$i"} = ($form->{"qty_$i"} * 1) ? $form->{"qty_$i"} : 1;
use SL::PE;
use SL::ReportGenerator;
use List::Util qw(max reduce sum);
+use Data::Dumper;
require "bin/mozilla/io.pl";
require "bin/mozilla/arap.pl";
check_oe_access();
+# $main::lxdebug->message(0, Dumper($form));
+
set_headings($form->{"id"} ? "edit" : "add");
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate) unless $recursive_call;
&& ($form->{"partsgroup_$i"} eq "")) {
$form->{creditremaining} += ($form->{oldinvtotal} - $form->{oldtotalpaid});
- &check_form;
+ &check_form;
} else {
if ($form->{type} =~ /^sales/) {
}
my $rows = scalar @{ $form->{item_list} };
-
- $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{discount} * 100);
+ # hier ist das problem fuer bug 817 $form->{discount} wird nicht durchgeschliffen
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{customer_discount} * 100);
if ($rows) {
$form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
<input type="hidden" name="saved_xyznumber" value="[% HTML.escape(saved_xyznumber) %]">
<input type="hidden" name="rowcount" value="[% HTML.escape(rowcount) %]">
+<input type="hidden" name="customer_discount" value="[% HTML.escape(customer_discount) %]">
<input type="hidden" name="callback" value="[% callback %]">
</form>
<input type="hidden" name="saved_xyznumber" value="[% HTML.escape(saved_xyznumber) %]">
<input type="hidden" name="rowcount" value="[% HTML.escape(rowcount) %]">
+<input type="hidden" name="customer_discount" value="[% HTML.escape(customer_discount) %]">
<input type="hidden" name="callback" value="[% callback %]">
</form>