765 |
765 |
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(listprice sellprice lastcost);
|
766 |
766 |
|
767 |
767 |
} else {
|
768 |
|
my @flds = qw(id partnumber description qty ship sellprice unit
|
769 |
|
discount inventory_accno income_accno expense_accno listprice
|
770 |
|
taxaccounts bin assembly weight projectnumber project_id
|
771 |
|
oldprojectnumber runningnumber serialnumber partsgroup payment_id
|
772 |
|
not_discountable shop ve gv buchungsgruppen_id language_values
|
773 |
|
sellprice_pg pricegroup_old price_old price_new unit_old ordnumber
|
774 |
|
transdate longdescription basefactor marge_total marge_percent
|
775 |
|
marge_price_factor lastcost price_factor_id partnotes
|
776 |
|
stock_out stock_in has_sernumber);
|
777 |
|
|
778 |
|
my $ic_cvar_configs = CVar->get_configs(module => 'IC');
|
779 |
|
push @flds, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
|
780 |
|
|
781 |
|
# this section applies to invoices and orders
|
782 |
|
# remove any empty numbers
|
783 |
|
if ($form->{rowcount}) {
|
784 |
|
for my $i (1 .. $form->{rowcount} - 1) {
|
785 |
|
if ($form->{"partnumber_$i"}) {
|
786 |
|
push @a, {};
|
787 |
|
my $j = $#a;
|
788 |
|
|
789 |
|
map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
|
790 |
|
$count++;
|
791 |
|
if ($main::lizenzen) {
|
792 |
|
if ($form->{"licensenumber_$i"} == -1) {
|
793 |
|
&new_license($i);
|
794 |
|
exit;
|
795 |
|
}
|
796 |
|
}
|
797 |
|
}
|
798 |
|
}
|
799 |
|
|
800 |
|
$form->redo_rows(\@flds, \@a, $count, $form->{rowcount});
|
801 |
|
$form->{rowcount} = $count;
|
802 |
|
|
803 |
|
$form->{creditremaining} -= &invoicetotal;
|
|
768 |
remove_emptied_rows(1);
|
804 |
769 |
|
805 |
|
}
|
|
770 |
$form->{creditremaining} -= &invoicetotal;
|
806 |
771 |
}
|
807 |
772 |
|
808 |
773 |
#sk
|
... | ... | |
825 |
790 |
$main::lxdebug->leave_sub();
|
826 |
791 |
}
|
827 |
792 |
|
|
793 |
sub remove_emptied_rows {
|
|
794 |
my $dont_add_empty = shift;
|
|
795 |
my $form = $::form;
|
|
796 |
|
|
797 |
return unless $form->{rowcount};
|
|
798 |
|
|
799 |
my @flds = qw(id partnumber description qty ship sellprice unit
|
|
800 |
discount inventory_accno income_accno expense_accno listprice
|
|
801 |
taxaccounts bin assembly weight projectnumber project_id
|
|
802 |
oldprojectnumber runningnumber serialnumber partsgroup payment_id
|
|
803 |
not_discountable shop ve gv buchungsgruppen_id language_values
|
|
804 |
sellprice_pg pricegroup_old price_old price_new unit_old ordnumber
|
|
805 |
transdate longdescription basefactor marge_total marge_percent
|
|
806 |
marge_price_factor lastcost price_factor_id partnotes
|
|
807 |
stock_out stock_in has_sernumber);
|
|
808 |
|
|
809 |
my $ic_cvar_configs = CVar->get_configs(module => 'IC');
|
|
810 |
push @flds, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
|
|
811 |
|
|
812 |
my @new_rows;
|
|
813 |
for my $i (1 .. $form->{rowcount} - 1) {
|
|
814 |
next unless $form->{"partnumber_$i"};
|
|
815 |
|
|
816 |
push @new_rows, { map { $_ => $form->{"${_}_$i" } } @flds };
|
|
817 |
}
|
|
818 |
|
|
819 |
my $new_rowcount = scalar @new_rows;
|
|
820 |
$form->redo_rows(\@flds, \@new_rows, $new_rowcount, $form->{rowcount});
|
|
821 |
$form->{rowcount} = $new_rowcount + ($dont_add_empty ? 0 : 1);
|
|
822 |
}
|
|
823 |
|
828 |
824 |
sub invoicetotal {
|
829 |
825 |
$main::lxdebug->enter_sub();
|
830 |
826 |
|
Beim Speichern/Buchen geleerte Zeilen entfernen
Vor dem Speichern/Buchen von Verkaufs- und Einkaufsbelegen
evtl. geleerte Zeilen entfernen (also Zeilen, in denen die
Artikelnummer entfernt wurde), damit kein explizites "Erneuern" durch
den Benutzer notwendig ist.
Fix für Bug 1197.