X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=b2a4da64a9da486cb8a38a97677ea9be11798207;hb=8e58d69a5a65f4887c7722dfae72a658b883eeec;hp=81db7674172595f06a9d040ff258d48b9bb33006;hpb=ee072e4f077213bf6f8792ca8f0a1afebbb6282f;p=kivitendo-erp.git
diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl
index 81db76741..b2a4da64a 100644
--- a/bin/mozilla/ic.pl
+++ b/bin/mozilla/ic.pl
@@ -30,9 +30,12 @@
# Inventory Control module
#
#======================================================================
+#$locale->text('ea');
use SL::IC;
+#use SL::PE;
+
require "$form->{path}/io.pl";
1;
@@ -50,7 +53,7 @@ sub add {
$form->{unit} =
($form->{item} eq 'service') ? $locale->text('hr') : $locale->text('ea');
-
+ IC->get_pricegroups(\%myconfig, \%$form);
&link_part;
&display_form;
@@ -84,14 +87,12 @@ sub search {
$button1 = qq|
text('button')
- . qq|>
+ . $locale->text('button') . qq|>
|;
$button2 = qq|
text('button')
- . qq|>
+ . $locale->text('button') . qq|>
|;
#write Trigger
@@ -132,8 +133,7 @@ sub search {
$l_serialnumber = qq|
|
- . $locale->text('Serial Number')
- . qq|
+ . $locale->text('Serial Number') . qq|
|;
}
@@ -272,8 +272,7 @@ sub search {
|
- . $locale->text('Part Description')
- . qq|
+ . $locale->text('Part Description') . qq|
@@ -310,71 +309,55 @@ sub search {
|
- . $locale->text('Include in Report')
- . qq|
+ . $locale->text('Include in Report') . qq|
@@ -433,11 +416,9 @@ sub choice {
|
- . $locale->text('Part Number')
- . qq|
+ . $locale->text('Part Number') . qq|
|
- . $locale->text('Part Description')
- . qq|
+ . $locale->text('Part Description') . qq|
@@ -858,10 +839,9 @@ sub addtop100 {
$option .= $locale->text('soldtotal') . qq| : $form->{soldtotal} |;
}
- @columns =
- $form->sort_columns(
+ @columns = $form->sort_columns(
qw(number partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal)
- );
+ );
if ($form->{l_linetotal}) {
$form->{l_onhand} = "Y";
@@ -1441,10 +1421,13 @@ sub generate_report {
$option .= $locale->text('soldtotal') . qq| : $form->{soldtotal} |;
}
- @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)
- );
+ 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 deliverydate)
+ );
if ($form->{l_linetotal}) {
$form->{l_onhand} = "Y";
@@ -1580,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;
@@ -1731,6 +1719,8 @@ sub generate_report {
. $form->format_amount(\%myconfig, $ref->{soldtotal}, '', " ")
. "";
+ $column_data{deliverydate} = "$ref->{deliverydate} ";
+
$i++;
$i %= 2;
print " ";
@@ -1921,7 +1911,9 @@ sub link_part {
delete $form->{amount};
$form->get_partsgroup(\%myconfig, { all => 1 });
+
$form->{partsgroup} = "$form->{partsgroup}--$form->{partsgroup_id}";
+
if (@{ $form->{all_partsgroup} }) {
$form->{selectpartsgroup} = qq|\n|;
map {
@@ -1955,6 +1947,16 @@ sub link_part {
sub form_header {
$lxdebug->enter_sub();
+ my $dec = '';
+
+ #decimalplaces for listprice
+ ($dec) = ($form->{listprice} =~ /\.(\d+)/);
+ $dec = length $dec;
+ my $decimalplaces = ($dec > 2) ? $dec : 2;
+ $form->{listprice} =
+ $form->format_amount(\%myconfig, $form->{listprice}, $decimalplaces);
+
+ #decimalplaces for sellprice and gv
($dec) = ($form->{sellprice} =~ /\.(\d+)/);
$dec = length $dec;
my $decimalplaces = ($dec > 2) ? $dec : 2;
@@ -1962,7 +1964,7 @@ sub form_header {
map {
$form->{$_} =
$form->format_amount(\%myconfig, $form->{$_}, $decimalplaces)
- } qw(listprice sellprice gv);
+ } qw(sellprice gv);
($dec) = ($form->{lastcost} =~ /\.(\d+)/);
$dec = length $dec;
@@ -2008,6 +2010,7 @@ sub form_header {
}
}
}
+
if ($form->{selectpartsgroup}) {
$form->{selectpartsgroup} = $form->unescape($form->{selectpartsgroup});
$partsgroup =
@@ -2034,8 +2037,7 @@ sub form_header {
$lastcost = qq|
|
- . $locale->text('Last Cost')
- . qq|
+ . $locale->text('Last Cost') . qq|
{lastcost}>
|;
@@ -2057,7 +2059,7 @@ sub form_header {
- | . $locale->text('COGS') . qq|
+ | . $locale->text('Expense') . qq|
$form->{selectIC_expense}
@@ -2143,8 +2145,7 @@ sub form_header {
| . $locale->text('On Hand') . qq|
|
- . $form->format_amount(\%myconfig, $form->{onhand})
- . qq|
+ . $form->format_amount(\%myconfig, $form->{onhand}) . qq|
|;
@@ -2173,14 +2174,12 @@ sub form_header {
$vegv = qq|
|
- . $locale->text('Verrechnungseinheit')
- . qq|
+ . $locale->text('Verrechnungseinheit') . qq|
{ve}>
|
- . $locale->text('Geschäftsvolumen')
- . qq|
+ . $locale->text('Geschäftsvolumen') . qq|
{gv}>
|;
@@ -2217,8 +2216,7 @@ sub form_header {
$obsolete .= qq|
|
- . $locale->text('Shopartikel')
- . qq|
+ . $locale->text('Shopartikel') . qq|
|;
@@ -2239,14 +2237,12 @@ sub form_header {
$button1 = qq|
text('button')
- . qq|>
+ . $locale->text('button') . qq|>
|;
#write Trigger
$jsscript =
- Form->write_trigger(\%myconfig, "1", "priceupdate", "BL", "trigger1", "",
- "", "");
+ Form->write_trigger(\%myconfig, "1", "priceupdate", "BL", "trigger1");
} else {
# without JavaScript Calendar
@@ -2304,8 +2300,7 @@ sub form_header {
|
- . $locale->text('Link Accounts')
- . qq|
+ . $locale->text('Link Accounts') . qq|
$linkaccounts
@@ -2322,8 +2317,7 @@ sub form_header {
|
- . $locale->text('Updated')
- . qq|
+ . $locale->text('Updated') . qq|
$button1
@@ -2368,11 +2362,9 @@ sub form_footer {
|
- . $locale->text('Total')
- . qq|
+ . $locale->text('Total') . qq|
|
- . $form->format_amount(\%myconfig, $form->{assemblytotal}, 2)
- . qq|
+ . $form->format_amount(\%myconfig, $form->{assemblytotal}, 2) . qq|
@@ -2405,6 +2397,9 @@ sub form_footer {
|;
}
+ print qq|
+ {price_rows}>|;
+
print qq|
|;
@@ -2630,6 +2625,8 @@ sub assembly_row {
$column_data{total} = qq|$linetotal |;
+ $column_data{deliverydate} = qq|$deliverydate |;
+
print qq|
|;
@@ -2708,7 +2705,6 @@ sub update {
if ($form->{item} eq 'service') {
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
qw(sellprice listprice);
-
&form_header;
&form_footer;
}
@@ -2719,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(
@@ -2738,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!'));
@@ -2792,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"};
@@ -2817,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;
@@ -2838,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;
@@ -2888,15 +2899,13 @@ sub stock_assembly {
@@ -3043,4 +3052,37 @@ sub restock_assemblies {
$lxdebug->leave_sub();
}
+sub price_row {
+ $lxdebug->enter_sub();
+
+ my ($numrows) = @_;
+
+ print qq|
+
+
+
+
+
+|;
+
+ $lxdebug->leave_sub();
+}
+
sub continue { &{ $form->{nextsub} } }