Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision de6cead5

Von Sven Schöling vor fast 15 Jahren hinzugefügt

  • ID de6cead5597b9a1f7491f7b73a13f824589364b5
  • Vorgänger cb0dfa9a
  • Nachfolger 0c095a8e

is form_footer: weitere exportierte variablen

Unterschiede anzeigen:

bin/mozilla/is.pl
385 385
  my $form     = $main::form;
386 386
  my %myconfig = %main::myconfig;
387 387
  my $locale   = $main::locale;
388
  my $cgi      = $main::cgi;
389 388

  
390 389
  $main::auth->assert('invoice_edit');
391 390

  
392
  $form->{invtotal} = $form->{invsubtotal};
391
  $form->{invtotal}    = $form->{invsubtotal};
392
  $form->{oldinvtotal} = $form->{invtotal};
393

  
394
  # note rows
395
  $form->{rows} = max 2,
396
    $form->numtextrows($form->{notes},    26, 8),
397
    $form->numtextrows($form->{intnotes}, 35, 8);
393 398

  
394
  my ($rows, $introws);
395
  if (($rows    = $form->numtextrows($form->{notes}, 26, 8)) < 2)    { $rows    = 2; }
396
  if (($introws = $form->numtextrows($form->{intnotes}, 35, 8)) < 2) { $introws = 2; }
397
  $form->{rows} = ($rows > $introws) ? $rows : $introws;
398 399

  
400
  # tax, total and subtotal calculations
399 401
  my ($tax, $subtotal);
400 402
  $form->{taxaccounts_array} = [ split / /, $form->{taxaccounts} ];
401 403

  
......
412 414
    }
413 415
  }
414 416

  
415
  $form->{oldinvtotal} = $form->{invtotal};
416

  
417 417
  # unfortunately locales doesn't support extended syntax
418 418
  if ($form->{id}) {
419 419
    my $follow_ups = FU->follow_ups('trans_id' => $form->{id});
......
424 424
    }
425 425
  }
426 426

  
427

  
428
# payments
427
  # payments
429 428
  my $totalpaid = 0;
430

  
431 429
  $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
432 430
  $form->{paid_indices} = [ 1 .. $form->{paidaccounts} ];
433 431

  
434 432
  for my $i (1 .. $form->{paidaccounts}) {
435 433
    $form->{"selectAR_paid_$i"} = $form->{selectAR_paid};
436 434
    $form->{"selectAR_paid_$i"} =~ s/option>\Q$form->{"AR_paid_$i"}\E/option selected>$form->{"AR_paid_$i"}/;
437

  
438
    # format amounts
439 435
    $totalpaid += $form->{"paid_$i"};
440 436
  }
441 437

  
442
  $form->{print_options} = print_options(inline => 1);
443

  
444
  print $form->parse_html_template('is/form_footer');
445
# print $form->parse_html_template('is/_payments'); # parser
438
  print $form->parse_html_template('is/form_footer', {
439
    is_type_credit_note => ($form->{type} eq "credit_note"),
440
    totalpaid           => $totalpaid,
441
    paid_missing        => $form->{invtotal} - $totalpaid,
442
    print_options       => print_options(inline => 1),
443
    show_storno         => $form->{id} && !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && !$totalpaid,
444
    show_delete         => ($form->current_date(\%myconfig) eq $form->{gldate}),
445
  });
446
##print $form->parse_html_template('is/_payments'); # parser
446 447

  
447 448

  
448 449

  

Auch abrufbar als: Unified diff