Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d557935a

Von Bernd Bleßmann vor fast 10 Jahren hinzugefügt

  • ID d557935a1484e5ebbb15f0eabe107d74e192ff0b
  • Vorgänger 46c0aaf1
  • Nachfolger 77350196

Rechnungen: Nicht editierbare CVars nicht rendern, aber richtig speichern bzw. drucken.

Die Änderung für Rechnungen (u. Gutschriften) fehlte noch im commit
6b4a71ff376e8337b708127f9f6c63c1d70d0af3
(Nicht editierbare CVars nicht rendern, aber richtig speichern und drucken.)

Unterschiede anzeigen:

SL/IR.pm
369 369

  
370 370
    next if $payments_only;
371 371

  
372
    my $cvars;
372 373
    if (!$form->{"invoice_id_$i"}) {
373 374
      # there is no persistent id, therefore create one with all necessary constraints
374 375
      my $q_invoice_id = qq|SELECT nextval('invoiceid')|;
......
379 380
      do_query($form, $dbh, $q_create_invoice_id, conv_i($form->{"invoice_id_$i"}),
380 381
               conv_i($form->{id}), conv_i($position), conv_i($form->{"id_$i"}));
381 382
      $h_invoice_id->finish();
383

  
384
      # get values for CVars from master data for new items
385
      $cvars = CVar->get_custom_variables(dbh      => $dbh,
386
                                          module   => 'IC',
387
                                          trans_id => $form->{"id_$i"},
388
                                         );
389
    } else {
390
      # get values for CVars from custom_variables for existing items
391
      $cvars = CVar->get_custom_variables(dbh        => $dbh,
392
                                          module     => 'IC',
393
                                          sub_module => 'invoice',
394
                                          trans_id   => $form->{"invoice_id_$i"},
395
                                         );
382 396
    }
397
    # map only non-editable CVars to form (editable ones are already there)
398
    map { $form->{"ic_cvar_$_->{name}_$i"} = $_->{value} unless $_->{flag_editable} } @{ $cvars };
383 399

  
384 400
      # save detail record in invoice table
385 401
      $query = <<SQL;
SL/IS.pm
373 373
        $sth->finish;
374 374
      }
375 375

  
376
      my $cvars;
377
      if (! $form->{"invoice_id_$i"}) {
378
        # get values for CVars from master data for new items
379
        $cvars = CVar->get_custom_variables(dbh      => $dbh,
380
                                            module   => 'IC',
381
                                            trans_id => $form->{"id_$i"},
382
                                           );
383
      } else {
384
        # get values for CVars from custom_variables for existing items
385
        $cvars = CVar->get_custom_variables(dbh        => $dbh,
386
                                            module     => 'IC',
387
                                            sub_module => 'invoice',
388
                                            trans_id   => $form->{"invoice_id_$i"},
389
                                           );
390
      }
391
      # map only non-editable CVars to form (editable ones are already there)
392
      map { $form->{"ic_cvar_$_->{name}_$i"} = $_->{value} unless $_->{flag_editable} } @{ $cvars };
393

  
376 394
      push @{ $form->{TEMPLATE_ARRAYS}->{"ic_cvar_$_->{name}"} },
377 395
        CVar->format_to_template(CVar->parse($form->{"ic_cvar_$_->{name}_$i"}, $_), $_)
378 396
          for @{ $ic_cvar_configs };
......
749 767
      $pricegroup_id *= 1;
750 768
      $pricegroup_id  = undef if !$pricegroup_id;
751 769

  
770
      my $cvars;
752 771
      if (!$form->{"invoice_id_$i"}) {
753 772
        # there is no persistent id, therefore create one with all necessary constraints
754 773
        my $q_invoice_id = qq|SELECT nextval('invoiceid')|;
......
759 778
        do_query($form, $dbh, $q_create_invoice_id, conv_i($form->{"invoice_id_$i"}),
760 779
                 conv_i($form->{id}), conv_i($position), conv_i($form->{"id_$i"}));
761 780
        $h_invoice_id->finish();
781

  
782
        # get values for CVars from master data for new items
783
        $cvars = CVar->get_custom_variables(dbh      => $dbh,
784
                                            module   => 'IC',
785
                                            trans_id => $form->{"id_$i"},
786
                                           );
787
      } else {
788
        # get values for CVars from custom_variables for existing items
789
        $cvars = CVar->get_custom_variables(dbh        => $dbh,
790
                                            module     => 'IC',
791
                                            sub_module => 'invoice',
792
                                            trans_id   => $form->{"invoice_id_$i"},
793
                                           );
762 794
      }
795
      # map only non-editable CVars to form (editable ones are already there)
796
      map { $form->{"ic_cvar_$_->{name}_$i"} = $_->{value} unless $_->{flag_editable} } @{ $cvars };
763 797

  
764 798
      # save detail record in invoice table
765 799
      $query = <<SQL;

Auch abrufbar als: Unified diff