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;
|
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.)