X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=8a8e6d4aeea54b101a7df37639e9e3ac53b74aad;hb=094307a8ce3e7680a5b14ef17b5c1094a2555009;hp=883507aa9c5a563a65e642954f4e4d804268b59c;hpb=0f0cb3b708f9078b774a07cecd996e5bdc5fac63;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 883507aa9..8a8e6d4ae 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -429,19 +429,20 @@ sub form_header { } } - $form->{javascript} .= qq||; - $form->{javascript} .= qq||; - $form->{javascript} .= qq||; + $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.SalesPurchase show_form_details show_history show_vc_details)); $form->header; - + if ($form->{CFDD_shipto} && $form->{CFDD_shipto_id} ) { + $form->{shipto_id} = $form->{CFDD_shipto_id}; + } $TMPL_VAR{HIDDENS} = [ map { name => $_, value => $form->{$_} }, qw(id action type vc formname media format proforma queued printed emailed title creditlimit creditremaining tradediscount business max_dunning_level dunning_amount shiptoname shiptostreet shiptozipcode - shiptocity shiptocountry shiptocontact shiptophone shiptofax + CFDD_shipto CFDD_shipto_id shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptodepartment_1 shiptodepartment_2 shiptoemail shiptocp_gender - message email subject cc bcc taxpart taxservice taxaccounts cursor_fokus), + message email subject cc bcc taxpart taxservice taxaccounts cursor_fokus + show_details), @custom_hiddens, map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts} ]; # deleted: discount @@ -1119,10 +1120,8 @@ sub save_and_close { } - # get new number in sequence if no number is given or if saveasnew was requested - if (!$form->{$ordnumber} || $form->{saveasnew}) { - $form->{$ordnumber} = $form->update_defaults(\%myconfig, $numberfld); - } + # get new number in sequence if saveasnew was requested + delete $form->{$ordnumber} if $form->{saveasnew}; relink_accounts(); @@ -1229,10 +1228,6 @@ sub save { } - # value of $ordnumber is ordnumber or quonumber - $form->{$ordnumber} = $form->update_defaults(\%myconfig, $numberfld) - unless $form->{$ordnumber}; - relink_accounts(); OE->save(\%myconfig, \%$form); @@ -1358,8 +1353,7 @@ sub invoice { $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $orddate, $buysell); if (!$exchangerate) { - &backorder_exchangerate($orddate, $buysell); - ::end_of_request(); + $exchangerate = 0; } } @@ -1450,75 +1444,6 @@ sub invoice { $main::lxdebug->leave_sub(); } -sub backorder_exchangerate { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - check_oe_access(); - - my ($orddate, $buysell) = @_; - - $form->header; - - print qq| -
{script}> -|; - - # delete action variable - map { delete $form->{$_} } qw(action header exchangerate); - - foreach my $key (keys %$form) { - next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key})); - $form->{$key} =~ s/\"/"/g; - print qq|\n|; - } - - $form->{title} = $locale->text('Add Exchangerate'); - - print qq| - - - - - - - - - - -
$form->{title}
- - - - - - - - - - - - - -
| . $locale->text('Currency') . qq|$form->{currency}
| . $locale->text('Date') . qq|$orddate
| . $locale->text('Exchangerate') . qq|
-
- -
- -
- - - - -
-|; - - $main::lxdebug->leave_sub(); -} - sub save_exchangerate { $main::lxdebug->enter_sub(); @@ -1669,6 +1594,7 @@ sub check_for_direct_delivery_yes { delete @{$form}{grep /^shipto/, keys %{ $form }}; map { s/^CFDD_//; $form->{$_} = $form->{"CFDD_${_}"} } grep /^CFDD_/, keys %{ $form }; $form->{shipto} = 1; + $form->{CFDD_shipto} = 1; purchase_order(); $main::lxdebug->leave_sub(); } @@ -1682,6 +1608,7 @@ sub check_for_direct_delivery_no { $form->{direct_delivery_checked} = 1; delete @{$form}{grep /^shipto/, keys %{ $form }}; + $form->{CFDD_shipto} = 0; purchase_order(); $main::lxdebug->leave_sub(); @@ -2068,7 +1995,9 @@ sub _oe_remove_delivered_or_billed_rows { next if $ord_quot->is_sales != $record->is_sales; foreach my $item (@{ $record->items }) { - $handled_base_qtys{ $item->parts_id } += $item->qty * $item->unit_obj->base_factor; + my $key = $item->parts_id; + $key .= ':' . $item->serialnumber if $item->serialnumber; + $handled_base_qtys{$key} += $item->qty * $item->unit_obj->base_factor; } }