X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=b2a4da64a9da486cb8a38a97677ea9be11798207;hb=8e58d69a5a65f4887c7722dfae72a658b883eeec;hp=0e7fdf533149cf957f77d1017a8f158cd9273ad0;hpb=010ec97da07a51f2dc0d11fa326fbed1328082ce;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 0e7fdf533..b2a4da64a 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -30,8 +30,10 @@ # Inventory Control module # #====================================================================== +#$locale->text('ea'); use SL::IC; + #use SL::PE; require "$form->{path}/io.pl"; @@ -354,6 +356,8 @@ sub search { . $locale->text('Subtotal') . qq|  | . $locale->text('soldtotal') . qq| +  | + . $locale->text('deliverydate') . qq| @@ -1417,8 +1421,12 @@ sub generate_report { $option .= $locale->text('soldtotal') . qq| : $form->{soldtotal}
|; } + if ($form->{l_deliverydate}) { + $callback .= "&deliverydate=$form->{deliverydate}"; + } + @columns = $form->sort_columns( - qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal) + qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal deliverydate) ); if ($form->{l_linetotal}) { @@ -1555,6 +1563,11 @@ sub generate_report { . $locale->text('soldtotal') . qq||; + $column_header{deliverydate} = + qq|{revers}&lastsort=$form->{lastsort}>| + . $locale->text('deliverydate') + . qq||; + $form->header; $colspan = $#column_index + 1; @@ -1706,6 +1719,8 @@ sub generate_report { . $form->format_amount(\%myconfig, $ref->{soldtotal}, '', " ") . ""; + $column_data{deliverydate} = "$ref->{deliverydate}"; + $i++; $i %= 2; print ""; @@ -1933,7 +1948,7 @@ sub form_header { $lxdebug->enter_sub(); my $dec = ''; - + #decimalplaces for listprice ($dec) = ($form->{listprice} =~ /\.(\d+)/); $dec = length $dec; @@ -2044,7 +2059,7 @@ sub form_header { - | . $locale->text('COGS') . qq| + | . $locale->text('Expense') . qq| @@ -2227,8 +2242,7 @@ sub form_header { #write Trigger $jsscript = - Form->write_trigger(\%myconfig, "1", "priceupdate", "BL", "trigger1", "", - "", ""); + Form->write_trigger(\%myconfig, "1", "priceupdate", "BL", "trigger1"); } else { # without JavaScript Calendar @@ -2611,6 +2625,8 @@ sub assembly_row { $column_data{total} = qq|$linetotal|; + $column_data{deliverydate} = qq|$deliverydate|; + print qq| |; @@ -2699,9 +2715,12 @@ sub update { sub save { $lxdebug->enter_sub(); - # check if there is a part number + # check if there is a part number - commented out, cause there is an automatic allocation of numbers # $form->isblank("partnumber", $locale->text(ucfirst $form->{item}." Part Number missing!")); + # check if there is a description + $form->isblank("description", $locale->text("Part Description missing!")); + if ($form->{obsolete}) { $form->error( $locale->text( @@ -2718,6 +2737,8 @@ sub save { # $locale->text('Assembly Number missing!') # save part + $lxdebug->message(LXDebug::DEBUG1, + "ic.pl: sellprice in save = $form->{sellprice}\n"); $rc = IC->save(\%myconfig, \%$form); if ($rc == 3) { $form->error($locale->text('Partnumber not unique!')); @@ -2772,11 +2793,12 @@ sub save { map { $form->{"${_}_$i"} = $newform{$_} } qw(partnumber description bin unit listprice inventory_accno income_accno expense_accno sellprice); $form->{"sellprice_$i"} = $newform{lastcost} if ($form->{vendor_id}); - if ($form->{exchangerate} != 0) { $form->{"sellprice_$i"} /= $form->{exchangerate}; } - + $lxdebug->message(LXDebug::DEBUG1, + qq|sellprice_$i in previousform 2 = | + . $form->{"sellprice_$i"} . qq|\n|); map { $form->{"taxaccounts_$i"} .= "$_ " } split / /, $newform{taxaccount}; chop $form->{"taxaccounts_$i"}; @@ -2797,6 +2819,12 @@ sub save { $form->{creditremaining} -= $amount; + # redo number formatting, because invoice parse them! + $i = $form->{rowcount}; + map { + $form->{"${_}_$i"} = + $form->format_amount(\%myconfig, $form->{"${_}_$i"}) + } qw(weight listprice sellprice rop); } $form->{"id_$i"} = $parts_id; @@ -2818,6 +2846,9 @@ sub save { } $form->{callback} = $callback; } + $lxdebug->message(LXDebug::DEBUG1, + qq|ic.pl: sellprice_$i nach sub save = | + . $form->{"sellprice_$i"} . qq|\n|); # redirect $form->redirect; @@ -3038,7 +3069,7 @@ sub price_row { for $i (1 .. $numrows) { print qq| - {"pricegroup_$i"}>$form->{"pricegroup_$i"} + $form->{"pricegroup_$i"}