Revision 4cc5904b
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
bin/mozilla/is.pl | ||
---|---|---|
303 | 303 |
|
304 | 304 |
$main::auth->assert('invoice_edit'); |
305 | 305 |
|
306 |
our %TMPL_VAR = (); |
|
307 |
my @custom_hiddens; |
|
308 |
|
|
306 | 309 |
$form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id}; |
307 | 310 |
$form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; |
308 | 311 |
|
... | ... | |
340 | 343 |
"projects" => { "key" => "ALL_PROJECTS", |
341 | 344 |
"all" => 0, |
342 | 345 |
"old_id" => \@old_project_ids }, |
343 |
"employees" => "ALL_SALESMEN", |
|
346 |
"employees" => "ALL_EMPLOYEES", |
|
347 |
"salesmen" => "ALL_SALESMEN", |
|
344 | 348 |
"taxzones" => "ALL_TAXZONES", |
345 | 349 |
"currencies" => "ALL_CURRENCIES", |
346 | 350 |
"customers" => "ALL_CUSTOMERS", |
347 | 351 |
"price_factors" => "ALL_PRICE_FACTORS"); |
348 | 352 |
|
349 |
my %labels; |
|
350 |
my @values = (undef); |
|
351 |
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { |
|
352 |
push(@values, $item->{"cp_id"}); |
|
353 |
$labels{$item->{"cp_id"}} = join(',', $item->{"cp_name"}, $item->{"cp_givenname"}) . ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : ""); |
|
354 |
} |
|
355 |
my $contact; |
|
356 |
if (scalar @values > 1) { |
|
357 |
$contact = qq| |
|
358 |
<tr> |
|
359 |
<th align="right">| . $locale->text('Contact Person') . qq|</th> |
|
360 |
<td>| . NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, '-style' => 'width: 250px', |
|
361 |
'-labels' => \%labels, '-default' => $form->{"cp_id"})) . qq| |
|
362 |
</td> |
|
363 |
</tr>|; |
|
364 |
} |
|
365 |
|
|
366 |
%labels = (); |
|
367 |
@values = (); |
|
368 |
foreach my $item (@{ $form->{"ALL_SALESMEN"} }) { |
|
369 |
push(@values, $item->{"id"}); |
|
370 |
$labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login}; |
|
371 |
} |
|
372 |
|
|
373 |
my $employees = qq| |
|
374 |
<tr> |
|
375 |
<th align="right">| . $locale->text('Employee') . qq|</th> |
|
376 |
<td>| . NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"employee_id"}, |
|
377 |
'-values' => \@values, '-labels' => \%labels)) . qq| |
|
378 |
</td> |
|
379 |
</tr>|; |
|
380 |
|
|
381 |
|
|
382 |
%labels = (); |
|
383 |
@values = (); |
|
384 |
foreach my $item (@{ $form->{"ALL_CUSTOMERS"} }) { |
|
385 |
push(@values, $item->{name}.qq|--|.$item->{"id"}); |
|
386 |
$labels{$item->{name}.qq|--|.$item->{"id"}} = $item->{"name"}; |
|
387 |
} |
|
388 |
|
|
389 |
$form->{selectcustomer} = ($myconfig{vclimit} > scalar(@values)); |
|
390 |
|
|
391 |
my $customers = qq| |
|
392 |
<th align="right">| . $locale->text('Customer') . qq|</th> |
|
393 |
<td>| . |
|
394 |
(($myconfig{vclimit} <= scalar(@values)) |
|
395 |
? qq|<input type="text" value="| . H($form->{customer}) . qq|" name="customer">| |
|
396 |
: (NTI($cgi->popup_menu('-name' => 'customer', '-default' => $form->{oldcustomer}, |
|
397 |
'-onChange' => 'document.getElementById(\'update_button\').click();', |
|
398 |
'-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq| |
|
399 |
<input type="button" value="| . $locale->text('Details (one letter abbreviation)') . qq|" onclick="show_vc_details('customer')"> |
|
400 |
</td>|; |
|
401 |
|
|
402 |
%labels = (); |
|
403 |
@values = (""); |
|
404 |
foreach my $item (@{ $form->{"ALL_SHIPTO"} }) { |
|
405 |
push(@values, $item->{"shipto_id"}); |
|
406 |
$labels{$item->{"shipto_id"}} = join "; ", grep { $_ } map { $item->{"shipto${_}" } } qw(name department_1 street city); |
|
407 |
} |
|
408 |
|
|
409 |
my $shipto; |
|
410 |
if (scalar @values > 1) { |
|
411 |
$shipto = qq| |
|
412 |
<tr> |
|
413 |
<th align="right">| . $locale->text('Shipping Address') . qq|</th> |
|
414 |
<td>| . NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, '-style' => 'width: 250px', |
|
415 |
'-labels' => \%labels, '-default' => $form->{"shipto_id"})). qq| |
|
416 |
</td>|; |
|
417 |
} |
|
418 |
|
|
419 |
%labels = (); |
|
420 |
@values = (); |
|
421 |
foreach my $item (@{ $form->{"ALL_CURRENCIES"} }) { |
|
422 |
push(@values, $item); |
|
423 |
$labels{$item} = $item; |
|
424 |
} |
|
353 |
$TMPL_VAR{sales_employee_labels} = sub { $_[0]->{name} || $_[0]->{login} }; |
|
354 |
$TMPL_VAR{shipto_labels} = sub { join "; ", grep { $_ } map { $_[0]->{"shipto${_}" } } qw(name department_1 street city) }; |
|
355 |
$TMPL_VAR{contact_labels} = sub { join(', ', $_[0]->{"cp_name"}, $_[0]->{"cp_givenname"}) . ($_[0]->{cp_abteilung} ? " ($_[0]->{cp_abteilung})" : "") }; |
|
356 |
$TMPL_VAR{department_labels} = sub { "$_[0]->{description}--$_[0]->{id}" }; |
|
357 |
|
|
358 |
# customer |
|
359 |
$TMPL_VAR{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" }; |
|
360 |
$TMPL_VAR{vclimit} = $myconfig{vclimit}; |
|
361 |
$TMPL_VAR{vc_select} = "customer_or_vendor_selection_window('$form->{vc}', '', @{[ $form->{vc} eq 'vendor' ? 1 : 0 ]}, 0)"; |
|
362 |
push @custom_hiddens, "$form->{vc}_id"; |
|
363 |
push @custom_hiddens, "old$form->{vc}"; |
|
364 |
push @custom_hiddens, "select$form->{vc}"; |
|
365 |
|
|
366 |
# currencies and exchangerate |
|
367 |
my @values = map { $_ } @{ $form->{ALL_CURRENCIES} }; |
|
368 |
my %labels = map { $_ => $_ } @{ $form->{ALL_CURRENCIES} }; |
|
369 |
$form->{currency} = $form->{defaultcurrency} unless $form->{currency}; |
|
370 |
$TMPL_VAR{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency}; |
|
371 |
$TMPL_VAR{currencies} = NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"}, |
|
372 |
'-values' => \@values, '-labels' => \%labels)) if scalar @values; |
|
373 |
push @custom_hiddens, "forex"; |
|
374 |
push @custom_hiddens, "exchangerate" if $form->{forex}; |
|
375 |
|
|
376 |
$TMPL_VAR{creditwarning} = ($form->{creditlimit} != 0) && ($form->{creditremaining} < 0) && !$form->{update}; |
|
377 |
$TMPL_VAR{is_credit_remaining_negativ} = $form->{creditremaining} =~ /-/; |
|
425 | 378 |
|
426 |
$form->{currency} = $form->{defaultcurrency} unless $form->{currency}; |
|
427 |
my $currencies; |
|
428 |
if (scalar @values) { |
|
429 |
$currencies = qq| |
|
430 |
<tr> |
|
431 |
<th align="right">| . $locale->text('Currency') . qq|</th> |
|
432 |
<td>| . NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"}, |
|
433 |
'-values' => \@values, '-labels' => \%labels)) . qq| |
|
434 |
</td> |
|
435 |
</tr>|; |
|
436 |
} |
|
437 |
|
|
438 |
%labels = (); |
|
439 |
@values = (""); |
|
440 |
foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { |
|
441 |
push(@values, $item->{"id"}); |
|
442 |
$labels{$item->{"id"}} = $item->{"projectnumber"}; |
|
443 |
} |
|
444 |
my $globalprojectnumber = NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values, |
|
445 |
'-labels' => \%labels, |
|
446 |
'-default' => $form->{"globalproject_id"})); |
|
447 |
|
|
448 |
%labels = (); |
|
449 |
@values = (); |
|
450 |
foreach my $item (@{ $form->{ALL_SALESMEN} }) { |
|
451 |
push(@values, $item->{id}); |
|
452 |
$labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login}; |
|
453 |
} |
|
454 |
|
|
455 |
my $salesman = |
|
456 |
qq|<tr> <th align="right">| . $locale->text('Salesman') . qq|</th> |
|
457 |
<td>| . NTI($cgi->popup_menu('-name' => 'salesman_id', '-values' => \@values, '-labels' => \%labels, |
|
458 |
'-default' => $form->{salesman_id} ? $form->{salesman_id} : $form->{employee_id})) . qq| |
|
459 |
</td> |
|
460 |
</tr>|; |
|
461 |
|
|
462 |
%labels = (); |
|
463 |
@values = (); |
|
464 |
foreach my $item (@{ $form->{"ALL_TAXZONES"} }) { |
|
465 |
push(@values, $item->{"id"}); |
|
466 |
$labels{$item->{"id"}} = $item->{"description"}; |
|
467 |
} |
|
468 |
|
|
469 |
my $taxzone; |
|
470 |
if (!$form->{"id"}) { |
|
471 |
$taxzone = qq| |
|
472 |
<tr> |
|
473 |
<th align="right">| . $locale->text('Steuersatz') . qq|</th> |
|
474 |
<td>| . NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"}, |
|
475 |
'-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px',)) . qq| |
|
476 |
</td> |
|
477 |
</tr>|; |
|
379 |
$form->{fokus} = "invoice.customer"; |
|
478 | 380 |
|
479 |
} else { |
|
480 |
$taxzone = qq| |
|
481 |
<tr> |
|
482 |
<th align="right">| . $locale->text('Steuersatz') . qq|</th> |
|
483 |
<td> |
|
484 |
<input type="hidden" name="taxzone_id" value="| . H($form->{"taxzone_id"}) . qq|"> |
|
485 |
| . H($labels{$form->{"taxzone_id"}}) . qq| |
|
486 |
</td> |
|
487 |
</tr>|; |
|
488 |
} |
|
381 |
my $follow_up_vc = $form->{customer}; |
|
382 |
$follow_up_vc =~ s/--\d*\s*$//; |
|
383 |
$TMPL_VAR{customer_name} = $follow_up_vc; |
|
489 | 384 |
|
490 |
# set option selected
|
|
385 |
# set option selected |
|
491 | 386 |
foreach my $item (qw(AR customer currency department employee)) { |
492 | 387 |
$form->{"select$item"} =~ s/ selected//; |
493 | 388 |
$form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/; |
494 | 389 |
} |
495 | 390 |
|
496 |
my $creditwarning = (($form->{creditlimit} != 0) && ($form->{creditremaining} < 0) && !$form->{update}) ? 1 : 0; |
|
391 |
$TMPL_VAR{is_type_credit_note} = $form->{type} eq "credit_note"; |
|
392 |
$TMPL_VAR{is_format_html} = $form->{format} eq 'html'; |
|
393 |
$TMPL_VAR{dateformat} = $myconfig{dateformat}; |
|
394 |
$TMPL_VAR{numberformat} = $myconfig{numberformat}; |
|
497 | 395 |
|
498 |
$form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate}); |
|
499 |
$form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0"); |
|
500 |
$form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0"); |
|
396 |
# hiddens |
|
397 |
$TMPL_VAR{HIDDEN} = [qw( |
|
398 |
id action type media format queued printed emailed title vc discount |
|
399 |
creditlimit creditremaining tradediscount business closedto locked shipped storno storno_id |
|
400 |
max_dunning_level dunning_amount |
|
401 |
shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax |
|
402 |
shiptoemail shiptodepartment_1 shiptodepartment_2 message email subject cc bcc taxaccounts cursor_fokus |
|
403 |
convert_from_do_ids convert_from_oe_ids |
|
404 |
), @custom_hiddens, |
|
405 |
map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts}]; |
|
501 | 406 |
|
502 |
my $exchangerate = ""; |
|
503 |
if ($form->{currency} ne $form->{defaultcurrency}) { |
|
504 |
if ($form->{forex}) { |
|
505 |
$exchangerate .= qq|<th align="right">| . $locale->text('Exchangerate') . qq|</th> |
|
506 |
<td>$form->{exchangerate}<input type="hidden" name="exchangerate" value="$form->{exchangerate}"></td>|; |
|
507 |
} else { |
|
508 |
$exchangerate .= qq|<th align="right">| . $locale->text('Exchangerate') . qq|</th> |
|
509 |
<td><input name="exchangerate" size="10" value="$form->{exchangerate}"></td>|; |
|
510 |
} |
|
511 |
} |
|
512 |
$exchangerate .= qq|\n<input type="hidden" name="forex" value="$form->{forex}">\n|; |
|
513 |
|
|
514 |
my $department = qq| |
|
515 |
<tr> |
|
516 |
<th align="right" nowrap>| . $locale->text('Department') . qq|</th> |
|
517 |
<td colspan="3"><select name="department" style="width: 250px">$form->{selectdepartment}</select> |
|
518 |
<input type="hidden" name="selectdepartment" value="$form->{selectdepartment}"> |
|
519 |
</td> |
|
520 |
</tr> |
|
521 |
| if $form->{selectdepartment}; |
|
522 |
|
|
523 |
my $n = ($form->{creditremaining} =~ /-/) ? "0" : "1"; |
|
524 |
|
|
525 |
my $business; |
|
526 |
if ($form->{business}) { |
|
527 |
$business = qq| |
|
528 |
<tr> |
|
529 |
<th align="right">| . $locale->text('Customer type') . qq|</th> |
|
530 |
<td>$form->{business}; | . $locale->text('Trade Discount') . qq| | |
|
531 |
. $form->format_amount(\%myconfig, $form->{tradediscount} * 100) |
|
532 |
. qq| %</td> |
|
533 |
</tr> |
|
534 |
|; |
|
535 |
} |
|
536 |
|
|
537 |
my $dunning; |
|
538 |
if ($form->{max_dunning_level}) { |
|
539 |
$dunning = qq| |
|
540 |
<tr> |
|
541 |
<th align="right">| . $locale->text('Max. Dunning Level') . qq|:</th> |
|
542 |
<td> |
|
543 |
<b>$form->{max_dunning_level}</b>; |
|
544 |
| . $locale->text('Dunning Amount') . qq|: <b>| |
|
545 |
. $form->format_amount(\%myconfig, $form->{dunning_amount},2) |
|
546 |
. qq|</b> |
|
547 |
</td> |
|
548 |
</tr> |
|
549 |
|; |
|
550 |
} |
|
551 |
|
|
552 |
$form->{fokus} = "invoice.customer"; |
|
553 |
|
|
554 |
# use JavaScript Calendar or not |
|
555 | 407 |
$form->{jsscript} = 1; |
556 |
my $jsscript = ""; |
|
557 |
my ($button1, $button2, $button3); |
|
558 |
if ($form->{type} eq "credit_note") { |
|
559 |
$button1 = qq| |
|
560 |
<td nowrap><input name="invdate" id="invdate" size="11" title="$myconfig{dateformat}" value="$form->{invdate}" onBlur=\"check_right_date_format(this)\"> |
|
561 |
<input type="button" name="invdate_button" id="trigger1" value="| |
|
562 |
. $locale->text('button') . qq|"></td>|; |
|
563 |
|
|
564 |
#write Trigger |
|
565 |
$jsscript = |
|
566 |
Form->write_trigger(\%myconfig, "1", |
|
567 |
"invdate", "BL", |
|
568 |
"trigger1"); |
|
569 |
} else { |
|
570 |
$button1 = qq| |
|
571 |
<td nowrap><input name="invdate" id="invdate" size="11" title="$myconfig{dateformat}" value="$form->{invdate}" onBlur=\"check_right_date_format(this)\"> |
|
572 |
<input type="button" name="invdate_button" id="trigger1" value="| |
|
573 |
. $locale->text('button') . qq|"></td> |
|
574 |
|; |
|
575 |
$button2 = qq| |
|
576 |
<td width="13"><input name="duedate" id="duedate" size="11" title="$myconfig{dateformat}" value="$form->{duedate}" onBlur=\"check_right_date_format(this)\"> |
|
577 |
<input type="button" name="duedate_button" id="trigger2" value="| |
|
578 |
. $locale->text('button') . qq|"></td> |
|
579 |
|; |
|
580 |
$button3 = qq| |
|
581 |
<td width="13"><input name="deliverydate" id="deliverydate" size="11" title="$myconfig{dateformat}" value="$form->{deliverydate}" onBlur=\"check_right_date_format(this)\"> |
|
582 |
<input type="button" name="deliverydate_button" id="trigger3" value="| |
|
583 |
. $locale->text('button') . qq|"></td> |
|
584 |
|; |
|
585 |
|
|
586 |
#write Trigger |
|
587 |
$jsscript = |
|
588 |
Form->write_trigger(\%myconfig, "3", |
|
589 |
"invdate", "BL", "trigger1", |
|
590 |
"duedate", "BL", "trigger2", |
|
591 |
"deliverydate", "BL", "trigger3"); |
|
592 |
} |
|
593 |
|
|
594 |
my $credittext = $locale->text('Credit Limit exceeded!!!'); |
|
595 |
|
|
596 |
my $follow_up_vc = $form->{customer}; |
|
597 |
$follow_up_vc =~ s/--\d*\s*$//; |
|
598 |
my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)"; |
|
599 |
|
|
600 |
my $onload = ($form->{resubmit} && ($form->{format} eq "html")) ? qq|window.open('about:blank','Beleg'); document.invoice.target = 'Beleg';document.invoice.submit()| |
|
601 |
: ($form->{resubmit}) ? qq|document.invoice.submit()| |
|
602 |
: ($creditwarning) ? qq|alert('$credittext')| |
|
603 |
: "focus()"; |
|
604 |
$onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; |
|
605 |
$onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|; |
|
606 |
|
|
607 |
$form->{javascript} .= qq|<script type="text/javascript" src="js/show_form_details.js"></script>|; |
|
608 |
$form->{javascript} .= qq|<script type="text/javascript" src="js/show_vc_details.js"></script>|; |
|
609 |
|
|
610 |
$jsscript .= |
|
611 |
$form->write_trigger(\%myconfig, 2, |
|
612 |
"orddate", "BL", "trigger_orddate", |
|
613 |
"quodate", "BL", "trigger_quodate"); |
|
614 |
# show history button js |
|
615 |
$form->{javascript} .= qq|<script type="text/javascript" src="js/show_history.js"></script>|; |
|
616 |
#/show history button js |
|
617 |
$form->header; |
|
618 |
|
|
619 |
print qq| |
|
620 |
<body onLoad="$onload"> |
|
621 |
<script type="text/javascript" src="js/common.js"></script> |
|
622 |
<script type="text/javascript" src="js/delivery_customer_selection.js"></script> |
|
623 |
<script type="text/javascript" src="js/vendor_selection.js"></script> |
|
624 |
<script type="text/javascript" src="js/calculate_qty.js"></script> |
|
625 |
<script type="text/javascript" src="js/follow_up.js"></script> |
|
626 |
|
|
627 |
<form method="post" name="invoice" action="$form->{script}"> |
|
628 |
| ; |
|
629 |
|
|
630 |
$form->hide_form(qw(id action type media format queued printed emailed title vc discount |
|
631 |
creditlimit creditremaining tradediscount business closedto locked shipped storno storno_id |
|
632 |
max_dunning_level dunning_amount |
|
633 |
shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax |
|
634 |
shiptoemail shiptodepartment_1 shiptodepartment_2 message email subject cc bcc taxaccounts cursor_fokus |
|
635 |
convert_from_do_ids convert_from_oe_ids), |
|
636 |
map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts} ); |
|
637 |
|
|
638 |
print qq|<p>$form->{saved_message}</p>| if $form->{saved_message}; |
|
639 |
|
|
640 |
print qq| |
|
641 |
|
|
642 |
<input type="hidden" name="follow_up_trans_id_1" value="| . H($form->{id}) . qq|"> |
|
643 |
<input type="hidden" name="follow_up_trans_type_1" value="sales_invoice"> |
|
644 |
<input type="hidden" name="follow_up_trans_info_1" value="| . H($follow_up_trans_info) . qq|"> |
|
645 |
<input type="hidden" name="follow_up_rowcount" value="1"> |
|
646 |
|
|
647 |
<input type="hidden" name="lizenzen" value="$main::lizenzen"> |
|
648 |
|
|
649 |
<div class="listtop" width="100%">$form->{title}</div> |
|
650 |
|
|
651 |
<table width="100%"> |
|
652 |
<tr> |
|
653 |
<td valign="top"> |
|
654 |
<table> |
|
655 |
<tr> |
|
656 |
$customers |
|
657 |
<input type="hidden" name="customer_klass" value="| . H($form->{customer_klass}) . qq|"> |
|
658 |
<input type="hidden" name="customer_id" value="| . H($form->{customer_id}) . qq|"> |
|
659 |
<input type="hidden" name="oldcustomer" value="| . H($form->{oldcustomer}) . qq|"> |
|
660 |
<input type="hidden" name="selectcustomer" value="| . H($form->{selectcustomer}) . qq|"> |
|
661 |
</tr> |
|
662 |
$contact |
|
663 |
$shipto |
|
664 |
<tr> |
|
665 |
<td align="right">| . $locale->text('Credit Limit') . qq|</td> |
|
666 |
<td>$form->{creditlimit}; | . $locale->text('Remaining') . qq| <span class="plus$n">$form->{creditremaining}</span></td> |
|
667 |
</tr> |
|
668 |
$dunning |
|
669 |
$business |
|
670 |
<tr> |
|
671 |
<th align="right" nowrap>| . $locale->text('Record in') . qq|</th> |
|
672 |
<td colspan="3"><select name="AR" style="width:250px;">$form->{selectAR}</select></td> |
|
673 |
<input type="hidden" name="selectAR" value="$form->{selectAR}"> |
|
674 |
</tr> |
|
675 |
$taxzone |
|
676 |
$department |
|
677 |
<tr> |
|
678 |
$currencies |
|
679 |
<input type="hidden" name="fxgain_accno" value="$form->{fxgain_accno}"> |
|
680 |
<input type="hidden" name="fxloss_accno" value="$form->{fxloss_accno}"> |
|
681 |
$exchangerate |
|
682 |
</tr> |
|
683 |
<tr> |
|
684 |
<th align="right" nowrap>| . $locale->text('Shipping Point') . qq|</th> |
|
685 |
<td colspan="3"> | . |
|
686 |
$cgi->textfield("-name" => "shippingpoint", "-size" => 35, "-value" => $form->{shippingpoint}) . |
|
687 |
qq| </td> |
|
688 |
</tr> |
|
689 |
<tr> |
|
690 |
<th align="right" nowrap>| . $locale->text('Ship via') . qq|</th> |
|
691 |
<td colspan="3"> | . |
|
692 |
$cgi->textfield("-name" => "shipvia", "-size" => 35, "-value" => $form->{shipvia}) . |
|
693 |
qq| </td> |
|
694 |
</tr> |
|
695 |
<tr> |
|
696 |
<th align="right">| . $locale->text('Transaction description') . qq|</th> |
|
697 |
<td colspan="3">| . $cgi->textfield("-name" => "transaction_description", "-size" => 35, "-value" => $form->{transaction_description}) . qq|</td> |
|
698 |
</tr>|; |
|
699 |
# <tr> |
|
700 |
# <td colspan=4> |
|
701 |
# <table> |
|
702 |
# <tr> |
|
703 |
# <td colspan=2> |
|
704 |
# <button type="button" onclick="delivery_customer_selection_window('delivery_customer_string','delivery_customer_id')">| . $locale->text('Choose Customer') . qq|</button> |
|
705 |
# </td> |
|
706 |
# <td colspan=2><input type=hidden name=delivery_customer_id value="$form->{delivery_customer_id}"> |
|
707 |
# <input size=45 id=delivery_customer_string name=delivery_customer_string value="$form->{delivery_customer_string}"></td> |
|
708 |
# </tr> |
|
709 |
# <tr> |
|
710 |
# <td colspan=2> |
|
711 |
# <button type="button" onclick="vendor_selection_window('delivery_vendor_string','delivery_vendor_id')">| . $locale->text('Choose Vendor') . qq|</button> |
|
712 |
# </td> |
|
713 |
# <td colspan=2><input type=hidden name=delivery_vendor_id value="$form->{delivery_vendor_id}"> |
|
714 |
# <input size=45 id=delivery_vendor_string name=delivery_vendor_string value="$form->{delivery_vendor_string}"></td> |
|
715 |
# </tr> |
|
716 |
# </table> |
|
717 |
# </td> |
|
718 |
# </tr> |
|
719 |
print qq| </table> |
|
720 |
</td> |
|
721 |
<td align="right" valign="top"> |
|
722 |
<table> |
|
723 |
$employees |
|
724 |
$salesman |
|
725 |
|; |
|
726 |
|
|
727 |
#ergänzung in der maske um das feld Lieferscheinnummer (Delivery Order Number), meiner meinung nach sinnvoll ueber dem feld lieferscheindatum 12.02.2009 jb |
|
728 |
if ($form->{type} eq "credit_note") { |
|
729 |
print qq| <tr> |
|
730 |
<th align="right" nowrap>| . $locale->text('Credit Note Number') . qq|</th> |
|
731 |
<td> |. |
|
732 |
$cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) . |
|
733 |
qq| </td> |
|
734 |
</tr> |
|
735 |
<tr> |
|
736 |
<th align="right">| . $locale->text('Credit Note Date') . qq|</th> |
|
737 |
$button1 |
|
738 |
</tr>|; |
|
739 |
} else { |
|
740 |
print qq| <tr> |
|
741 |
<th align="right" nowrap>| . $locale->text('Invoice Number') . qq|</th> |
|
742 |
<td> |. |
|
743 |
$cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) . |
|
744 |
qq| </td> |
|
745 |
</tr> |
|
746 |
<tr> |
|
747 |
<th align="right">| . $locale->text('Invoice Date') . qq|</th> |
|
748 |
$button1 |
|
749 |
</tr> |
|
750 |
<tr> |
|
751 |
<th align="right">| . $locale->text('Due Date') . qq|</th> |
|
752 |
$button2 |
|
753 |
</tr> |
|
754 |
<tr> |
|
755 |
<th align="right" nowrap>| . $locale->text('Delivery Order Number') . qq|</th> |
|
756 |
<td> |. |
|
757 |
$cgi->textfield("-name" => "donumber", "-size" => 11, "-value" => $form->{donumber}) . |
|
758 |
qq| </td> |
|
759 |
</tr> |
|
760 |
<tr> |
|
761 |
<th align="right">| . $locale->text('Delivery Date') . qq|</th> |
|
762 |
$button3 |
|
763 |
</tr>|; |
|
764 |
} |
|
765 |
print qq| <tr> |
|
766 |
<th align="right" nowrap>| . $locale->text('Order Number') . qq|</th> |
|
767 |
<td> |. |
|
768 |
$cgi->textfield("-name" => "ordnumber", "-size" => 11, "-value" => $form->{ordnumber}) . |
|
769 |
qq| </td> |
|
770 |
</tr> |
|
771 |
<tr> |
|
772 |
<th align="right" nowrap>| . $locale->text('Order Date') . qq|</th> |
|
773 |
<td><input name="orddate" id="orddate" size="11" title="$myconfig{dateformat}" value="| . Q($form->{orddate}) . qq|" onBlur=\"check_right_date_format(this)\"> |
|
774 |
<input type="button" name="b_orddate" id="trigger_orddate" value="?"></td> |
|
775 |
</tr> |
|
776 |
<tr> |
|
777 |
<th align="right" nowrap>| . $locale->text('Quotation Number') . qq|</th> |
|
778 |
<td> |. |
|
779 |
$cgi->textfield("-name" => "quonumber", "-size" => 11, "-value" => $form->{quonumber}) . |
|
780 |
qq| </td> |
|
781 |
</tr> |
|
782 |
<tr> |
|
783 |
<th align="right" nowrap>| . $locale->text('Quotation Date') . qq|</th> |
|
784 |
<td><input name="quodate" id="quodate" size="11" title="$myconfig{dateformat}" value="| . Q($form->{quodate}) . qq|" onBlur=\"check_right_date_format(this)\"> |
|
785 |
<input type="button" name="b_quodate" id="trigger_quodate" value="?"></td> |
|
786 |
</tr> |
|
787 |
<tr> |
|
788 |
<th align="right" nowrap>| . $locale->text('Customer Order Number') . qq|</th> |
|
789 |
<td> |. |
|
790 |
$cgi->textfield("-name" => "cusordnumber", "-size" => 11, "-value" => $form->{cusordnumber}) . |
|
791 |
qq| </td> |
|
792 |
</tr> |
|
793 |
<tr> |
|
794 |
<th align="right" nowrap>| . $locale->text('Project Number') . qq|</th> |
|
795 |
<td>$globalprojectnumber</td> |
|
796 |
</tr> |
|
797 |
</table> |
|
798 |
</td> |
|
799 |
</tr> |
|
800 |
</table> |
|
801 |
</td> |
|
802 |
</tr> |
|
803 |
<tr> |
|
804 |
<td> |
|
805 |
</td> |
|
806 |
</tr> |
|
807 |
$jsscript |
|
808 |
|; |
|
809 |
print qq|<input type="hidden" name="webdav" value="$main::webdav">|; |
|
408 |
$form->header(); |
|
409 |
|
|
410 |
# print qq| |
|
411 |
#<body onLoad="$onload"> |
|
412 |
#<script type="text/javascript" src="js/common.js"></script> |
|
413 |
#<script type="text/javascript" src="js/delivery_customer_selection.js"></script> |
|
414 |
#<script type="text/javascript" src="js/vendor_selection.js"></script> |
|
415 |
#<script type="text/javascript" src="js/calculate_qty.js"></script> |
|
416 |
#<script type="text/javascript" src="js/follow_up.js"></script> |
|
417 |
# |
|
418 |
#<form method="post" name="invoice" action="$form->{script}"> |
|
419 |
#| ; |
|
420 |
# |
|
421 |
# $form->hide_form(qw(id action type media format queued printed emailed title vc discount |
|
422 |
# creditlimit creditremaining tradediscount business closedto locked shipped storno storno_id |
|
423 |
# max_dunning_level dunning_amount |
|
424 |
# shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax |
|
425 |
# shiptoemail shiptodepartment_1 shiptodepartment_2 message email subject cc bcc taxaccounts cursor_fokus |
|
426 |
# convert_from_do_ids convert_from_oe_ids), |
|
427 |
# map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts} ); |
|
428 |
# |
|
429 |
# print qq|<p>$form->{saved_message}</p>| if $form->{saved_message}; |
|
430 |
# |
|
431 |
# print qq| |
|
432 |
# |
|
433 |
#<input type="hidden" name="follow_up_trans_id_1" value="| . H($form->{id}) . qq|"> |
|
434 |
#<input type="hidden" name="follow_up_trans_type_1" value="sales_invoice"> |
|
435 |
#<input type="hidden" name="follow_up_trans_info_1" value="| . H($follow_up_trans_info) . qq|"> |
|
436 |
#<input type="hidden" name="follow_up_rowcount" value="1"> |
|
437 |
# |
|
438 |
#<input type="hidden" name="lizenzen" value="$lizenzen"> |
|
439 |
# |
|
440 |
#<div class="listtop" width="100%">$form->{title}</div> |
|
441 |
# |
|
442 |
#<table width="100%"> |
|
443 |
# <tr> |
|
444 |
# <td valign="top"> |
|
445 |
# <table> |
|
446 |
# <tr> |
|
447 |
# $customers |
|
448 |
# <input type="hidden" name="customer_klass" value="| . H($form->{customer_klass}) . qq|"> |
|
449 |
# <input type="hidden" name="customer_id" value="| . H($form->{customer_id}) . qq|"> |
|
450 |
# <input type="hidden" name="oldcustomer" value="| . H($form->{oldcustomer}) . qq|"> |
|
451 |
# <input type="hidden" name="selectcustomer" value="| . H($form->{selectcustomer}) . qq|"> |
|
452 |
# </tr> |
|
453 |
# $contact |
|
454 |
# $shipto |
|
455 |
# <tr> |
|
456 |
# <td align="right">| . $locale->text('Credit Limit') . qq|</td> |
|
457 |
# <td>$form->{creditlimit}; | . $locale->text('Remaining') . qq| <span class="plus$n">$form->{creditremaining}</span></td> |
|
458 |
# </tr> |
|
459 |
# $dunning |
|
460 |
# $business |
|
461 |
# <tr> |
|
462 |
# <th align="right" nowrap>| . $locale->text('Record in') . qq|</th> |
|
463 |
# <td colspan="3"><select name="AR" style="width:250px;">$form->{selectAR}</select></td> |
|
464 |
# <input type="hidden" name="selectAR" value="$form->{selectAR}"> |
|
465 |
# </tr> |
|
466 |
# $taxzone |
|
467 |
# $department |
|
468 |
# <tr> |
|
469 |
# $currencies |
|
470 |
# <input type="hidden" name="fxgain_accno" value="$form->{fxgain_accno}"> |
|
471 |
# <input type="hidden" name="fxloss_accno" value="$form->{fxloss_accno}"> |
|
472 |
# $exchangerate |
|
473 |
# </tr> |
|
474 |
# <tr> |
|
475 |
# <th align="right" nowrap>| . $locale->text('Shipping Point') . qq|</th> |
|
476 |
# <td colspan="3"> | . |
|
477 |
# $cgi->textfield("-name" => "shippingpoint", "-size" => 35, "-value" => $form->{shippingpoint}) . |
|
478 |
# qq| </td> |
|
479 |
# </tr> |
|
480 |
# <tr> |
|
481 |
# <th align="right" nowrap>| . $locale->text('Ship via') . qq|</th> |
|
482 |
# <td colspan="3"> | . |
|
483 |
# $cgi->textfield("-name" => "shipvia", "-size" => 35, "-value" => $form->{shipvia}) . |
|
484 |
# qq| </td> |
|
485 |
# </tr> |
|
486 |
# <tr> |
|
487 |
# <th align="right">| . $locale->text('Transaction description') . qq|</th> |
|
488 |
# <td colspan="3">| . $cgi->textfield("-name" => "transaction_description", "-size" => 35, "-value" => $form->{transaction_description}) . qq|</td> |
|
489 |
# </tr>|; |
|
490 |
## <tr> |
|
491 |
## <td colspan=4> |
|
492 |
## <table> |
|
493 |
## <tr> |
|
494 |
## <td colspan=2> |
|
495 |
## <button type="button" onclick="delivery_customer_selection_window('delivery_customer_string','delivery_customer_id')">| . $locale->text('Choose Customer') . qq|</button> |
|
496 |
## </td> |
|
497 |
## <td colspan=2><input type=hidden name=delivery_customer_id value="$form->{delivery_customer_id}"> |
|
498 |
## <input size=45 id=delivery_customer_string name=delivery_customer_string value="$form->{delivery_customer_string}"></td> |
|
499 |
## </tr> |
|
500 |
## <tr> |
|
501 |
## <td colspan=2> |
|
502 |
## <button type="button" onclick="vendor_selection_window('delivery_vendor_string','delivery_vendor_id')">| . $locale->text('Choose Vendor') . qq|</button> |
|
503 |
## </td> |
|
504 |
## <td colspan=2><input type=hidden name=delivery_vendor_id value="$form->{delivery_vendor_id}"> |
|
505 |
## <input size=45 id=delivery_vendor_string name=delivery_vendor_string value="$form->{delivery_vendor_string}"></td> |
|
506 |
## </tr> |
|
507 |
## </table> |
|
508 |
## </td> |
|
509 |
## </tr> |
|
510 |
#print qq| </table> |
|
511 |
# </td> |
|
512 |
# <td align="right" valign="top"> |
|
513 |
# <table> |
|
514 |
# $employees |
|
515 |
# $salesman |
|
516 |
#|; |
|
517 |
# |
|
518 |
##ergänzung in der maske um das feld Lieferscheinnummer (Delivery Order Number), meiner meinung nach sinnvoll ueber dem feld lieferscheindatum 12.02.2009 jb |
|
519 |
#if ($form->{type} eq "credit_note") { |
|
520 |
#print qq| <tr> |
|
521 |
# <th align="right" nowrap>| . $locale->text('Credit Note Number') . qq|</th> |
|
522 |
# <td> |. |
|
523 |
# $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) . |
|
524 |
# qq| </td> |
|
525 |
# </tr> |
|
526 |
# <tr> |
|
527 |
# <th align="right">| . $locale->text('Credit Note Date') . qq|</th> |
|
528 |
# $button1 |
|
529 |
# </tr>|; |
|
530 |
#} else { |
|
531 |
#print qq| <tr> |
|
532 |
# <th align="right" nowrap>| . $locale->text('Invoice Number') . qq|</th> |
|
533 |
# <td> |. |
|
534 |
# $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) . |
|
535 |
# qq| </td> |
|
536 |
# </tr> |
|
537 |
# <tr> |
|
538 |
# <th align="right">| . $locale->text('Invoice Date') . qq|</th> |
|
539 |
# $button1 |
|
540 |
# </tr> |
|
541 |
# <tr> |
|
542 |
# <th align="right">| . $locale->text('Due Date') . qq|</th> |
|
543 |
# $button2 |
|
544 |
# </tr> |
|
545 |
# <tr> |
|
546 |
# <th align="right" nowrap>| . $locale->text('Delivery Order Number') . qq|</th> |
|
547 |
# <td> |. |
|
548 |
# $cgi->textfield("-name" => "donumber", "-size" => 11, "-value" => $form->{donumber}) . |
|
549 |
# qq| </td> |
|
550 |
# </tr> |
|
551 |
# <tr> |
|
552 |
# <th align="right">| . $locale->text('Delivery Date') . qq|</th> |
|
553 |
# $button3 |
|
554 |
# </tr>|; |
|
555 |
#} |
|
556 |
#print qq| <tr> |
|
557 |
# <th align="right" nowrap>| . $locale->text('Order Number') . qq|</th> |
|
558 |
# <td> |. |
|
559 |
# $cgi->textfield("-name" => "ordnumber", "-size" => 11, "-value" => $form->{ordnumber}) . |
|
560 |
# qq| </td> |
|
561 |
# </tr> |
|
562 |
# <tr> |
|
563 |
# <th align="right" nowrap>| . $locale->text('Order Date') . qq|</th> |
|
564 |
# <td><input name="orddate" id="orddate" size="11" title="$myconfig{dateformat}" value="| . Q($form->{orddate}) . qq|" onBlur=\"check_right_date_format(this)\"> |
|
565 |
# <input type="button" name="b_orddate" id="trigger_orddate" value="?"></td> |
|
566 |
# </tr> |
|
567 |
# <tr> |
|
568 |
# <th align="right" nowrap>| . $locale->text('Quotation Number') . qq|</th> |
|
569 |
# <td> |. |
|
570 |
# $cgi->textfield("-name" => "quonumber", "-size" => 11, "-value" => $form->{quonumber}) . |
|
571 |
# qq| </td> |
|
572 |
# </tr> |
|
573 |
# <tr> |
|
574 |
# <th align="right" nowrap>| . $locale->text('Quotation Date') . qq|</th> |
|
575 |
# <td><input name="quodate" id="quodate" size="11" title="$myconfig{dateformat}" value="| . Q($form->{quodate}) . qq|" onBlur=\"check_right_date_format(this)\"> |
|
576 |
# <input type="button" name="b_quodate" id="trigger_quodate" value="?"></td> |
|
577 |
# </tr> |
|
578 |
# <tr> |
|
579 |
# <th align="right" nowrap>| . $locale->text('Customer Order Number') . qq|</th> |
|
580 |
# <td> |. |
|
581 |
# $cgi->textfield("-name" => "cusordnumber", "-size" => 11, "-value" => $form->{cusordnumber}) . |
|
582 |
# qq| </td> |
|
583 |
# </tr> |
|
584 |
# <tr> |
|
585 |
# <th align="right" nowrap>| . $locale->text('Project Number') . qq|</th> |
|
586 |
# <td>$globalprojectnumber</td> |
|
587 |
# </tr> |
|
588 |
# </table> |
|
589 |
# </td> |
|
590 |
# </tr> |
|
591 |
# </table> |
|
592 |
# </td> |
|
593 |
# </tr> |
|
594 |
# <tr> |
|
595 |
# <td> |
|
596 |
# </td> |
|
597 |
# </tr> |
|
598 |
# $jsscript |
|
599 |
#|; |
|
600 |
# print qq|<input type="hidden" name="webdav" value="$webdav">|; |
|
601 |
|
|
602 |
print $form->parse_html_template("is/form_header", \%TMPL_VAR); |
|
810 | 603 |
|
811 | 604 |
$main::lxdebug->leave_sub(); |
812 | 605 |
} |
Auch abrufbar als: Unified diff
Testversion is -> template