X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=7ecd3a24cff3a0dbf679738de0617ed0b70c7c61;hb=da10bf753ae49b8322e79fc1bb9276a092403b9a;hp=b99fb25f4409c6691bfca86672b7718b5f1498f3;hpb=864b73ffb0964215f287a393ea37ec2eef6eb8eb;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index b99fb25f4..7ecd3a24c 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -397,7 +397,6 @@ $jsscript $lxdebug->leave_sub(); } #end search() - sub search_update_prices { $lxdebug->enter_sub(); @@ -1309,7 +1308,7 @@ sub addtop100 { $column_data{number} = "" - . $form->format_amount(\%myconfig, $ref->{number}, '', " ") + . $form->format_amount(\%myconfig, $ref->{number}) . ""; $column_data{partnumber} = "$ref->{partnumber} "; @@ -1318,32 +1317,29 @@ sub addtop100 { $column_data{onhand} = "" - . $form->format_amount(\%myconfig, $ref->{onhand}, '', " ") + . $form->format_amount(\%myconfig, $ref->{onhand}) . ""; $column_data{sellprice} = "" - . $form->format_amount(\%myconfig, $ref->{sellprice}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{sellprice}) . ""; $column_data{listprice} = "" - . $form->format_amount(\%myconfig, $ref->{listprice}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{listprice}) . ""; $column_data{lastcost} = "" - . $form->format_amount(\%myconfig, $ref->{lastcost}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{lastcost}) . ""; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2) . ""; if (!$ref->{assemblyitem}) { @@ -1359,10 +1355,10 @@ sub addtop100 { $column_data{rop} = "" - . $form->format_amount(\%myconfig, $ref->{rop}, '', " ") . ""; + . $form->format_amount(\%myconfig, $ref->{rop}) . ""; $column_data{weight} = "" - . $form->format_amount(\%myconfig, $ref->{weight}, '', " ") + . $form->format_amount(\%myconfig, $ref->{weight}) . ""; $column_data{unit} = "$ref->{unit} "; $column_data{bin} = "$ref->{bin} "; @@ -1419,15 +1415,15 @@ sub addtop100 { map { $column_data{$_} = " " } @column_index; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $totalsellprice, 2, " ") + . $form->format_amount(\%myconfig, $totalsellprice, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $totallastcost, 2, " ") + . $form->format_amount(\%myconfig, $totallastcost, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $totallistprice, 2, " ") + . $form->format_amount(\%myconfig, $totallistprice, 2) . ""; print ""; @@ -1861,32 +1857,29 @@ sub generate_report { $column_data{onhand} = "" - . $form->format_amount(\%myconfig, $ref->{onhand}, '', " ") + . $form->format_amount(\%myconfig, $ref->{onhand}) . ""; $column_data{sellprice} = "" - . $form->format_amount(\%myconfig, $ref->{sellprice}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{sellprice}, -2) . ""; $column_data{listprice} = "" - . $form->format_amount(\%myconfig, $ref->{listprice}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{listprice}, -2) . ""; $column_data{lastcost} = "" - . $form->format_amount(\%myconfig, $ref->{lastcost}, 2, " ") + . $form->format_amount(\%myconfig, $ref->{lastcost}, -2) . ""; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, - 2, " ") + . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2) . ""; if (!$ref->{assemblyitem}) { @@ -1902,10 +1895,10 @@ sub generate_report { $column_data{rop} = "" - . $form->format_amount(\%myconfig, $ref->{rop}, '', " ") . ""; + . $form->format_amount(\%myconfig, $ref->{rop}) . ""; $column_data{weight} = "" - . $form->format_amount(\%myconfig, $ref->{weight}, '', " ") + . $form->format_amount(\%myconfig, $ref->{weight}) . ""; $column_data{unit} = "$ref->{unit} "; $column_data{bin} = "$ref->{bin} "; @@ -1943,7 +1936,7 @@ sub generate_report { $column_data{soldtotal} = "" - . $form->format_amount(\%myconfig, $ref->{soldtotal}, '', " ") + . $form->format_amount(\%myconfig, $ref->{soldtotal}) . ""; $column_data{deliverydate} = "$ref->{deliverydate}"; @@ -1968,15 +1961,15 @@ sub generate_report { map { $column_data{$_} = " " } @column_index; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $totalsellprice, 2, " ") + . $form->format_amount(\%myconfig, $totalsellprice, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $totallastcost, 2, " ") + . $form->format_amount(\%myconfig, $totallastcost, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $totallistprice, 2, " ") + . $form->format_amount(\%myconfig, $totallistprice, 2) . ""; print ""; @@ -2028,20 +2021,20 @@ sub parts_subtotal { $column_data{onhand} = "" - . $form->format_amount(\%myconfig, $subtotalonhand, '', " ") + . $form->format_amount(\%myconfig, $subtotalonhand) . ""; $column_data{linetotalsellprice} = "" - . $form->format_amount(\%myconfig, $subtotalsellprice, 2, " ") + . $form->format_amount(\%myconfig, $subtotalsellprice, 2) . ""; $column_data{linetotallistprice} = "" - . $form->format_amount(\%myconfig, $subtotallistprice, 2, " ") + . $form->format_amount(\%myconfig, $subtotallistprice, 2) . ""; $column_data{linetotallastcost} = "" - . $form->format_amount(\%myconfig, $subtotallastcost, 2, " ") + . $form->format_amount(\%myconfig, $subtotallastcost, 2) . ""; $subtotalonhand = 0; @@ -2062,7 +2055,9 @@ sub parts_subtotal { sub edit { $lxdebug->enter_sub(); - + # show history button + $form->{javascript} = qq||; + #/show hhistory button IC->get_part(\%myconfig, \%$form); $form->{"original_partnumber"} = $form->{"partnumber"}; @@ -2170,31 +2165,8 @@ 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; - - map { - $form->{$_} = - $form->format_amount(\%myconfig, $form->{$_}, $decimalplaces) - } qw(sellprice gv); - - ($dec) = ($form->{lastcost} =~ /\.(\d+)/); - $dec = length $dec; - my $decimalplaces = ($dec == 2) ? $dec : 2; - - $form->{lastcost} = - $form->format_amount(\%myconfig, $form->{lastcost}, $decimalplaces); + map({ $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, -2) } + qw(sellprice listprice lastcost gv)); map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}) } qw(weight rop stock); @@ -2743,9 +2715,26 @@ sub form_footer { } } + if (!$form->{previousform}) { + if ($form->{menubar}) { + require "$form->{path}/menu.pl"; + &menubar; + } + } +# button for saving history + if($form->{id} ne "") { + print qq| + {id} + . qq|); name=history id=history value=| + . $locale->text('history') + . qq|>|; + } +# /button for saving history print qq| + @@ -3011,8 +3000,8 @@ sub update { } if ($form->{item} eq 'service') { - map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } - qw(sellprice listprice); + map({ $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } + qw(sellprice listprice lastcost)); &form_header; &price_row; &form_footer; @@ -3035,7 +3024,7 @@ sub save { $locale->text( "Inventory quantity must be zero before you can set this $form->{item} obsolete!" )) - if ($form->{onhand}); + if ($form->{onhand} * 1); } if (!$form->{buchungsgruppen_id}) { @@ -3061,6 +3050,12 @@ sub save { if ($rc == 3) { $form->error($locale->text('Partnumber not unique!')); } + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history $parts_id = $form->{id}; # load previous variables @@ -3177,19 +3172,29 @@ sub save { sub save_as_new { $lxdebug->enter_sub(); + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED AS NEW"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history $form->{id} = 0; if ($form->{"original_partnumber"} && ($form->{"partnumber"} eq $form->{"original_partnumber"})) { $form->{partnumber} = ""; } &save; - $lxdebug->leave_sub(); } sub delete { $lxdebug->enter_sub(); - + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history $rc = IC->delete(\%myconfig, \%$form); # redirect @@ -3199,181 +3204,6 @@ sub delete { $lxdebug->leave_sub(); } -sub stock_assembly { - $lxdebug->enter_sub(); - - $form->{title} = $locale->text('Stock Assembly'); - - $form->header; - - print qq| - - -
{script}> - - - - - - - - - - -
$form->{title}
- - - - - - - - - - -
| - . $locale->text('Part Number') . qq| 
| - . $locale->text('Part Description') . qq|
-

- -{path}> -{login}> -{password}> - - - -
- -
- - - -|; - - $lxdebug->leave_sub(); -} - -sub list_assemblies { - $lxdebug->enter_sub(); - - IC->retrieve_assemblies(\%myconfig, \%$form); - - $column_header{partnumber} = - qq|| . $locale->text('Part Number') . qq||; - $column_header{description} = - qq|| . $locale->text('Part Description') . qq||; - $column_header{bin} = - qq|| . $locale->text('Bin') . qq||; - $column_header{onhand} = - qq|| . $locale->text('Qty') . qq||; - $column_header{rop} = - qq|| . $locale->text('ROP') . qq||; - $column_header{stock} = - qq|| . $locale->text('Add') . qq||; - - @column_index = (qw(partnumber description bin onhand rop stock)); - - $form->{title} = $locale->text('Stock Assembly'); - - $form->{callback} = - "$form->{script}?action=stock_assembly&path=$form->{path}&login=$form->{login}&password=$form->{password}"; - - $form->header; - - $colspan = $#column_index + 1; - - print qq| - - -
{script}> - - - - - - - |; - - map { print "\n$column_header{$_}" } @column_index; - - print qq| - -|; - - $i = 1; - foreach $ref (@{ $form->{assembly_items} }) { - - map { $ref->{$_} =~ s/\"/"/g } qw(partnumber description); - - $column_data{partnumber} = qq||; - $column_data{description} = - qq||; - $column_data{bin} = qq||; - $column_data{onhand} = - qq||; - $column_data{rop} = - qq||; - $column_data{stock} = qq||; - - $j++; - $j %= 2; - print - qq|{id}>\n|; - - map { print "\n$column_data{$_}" } @column_index; - - print qq| - -|; - - $i++; - - } - - $i--; - print qq| - - -
$form->{title}
$ref->{partnumber}$ref->{description} $ref->{bin} | - . $form->format_amount(\%myconfig, $ref->{onhand}, '', " ") - . qq|| - . $form->format_amount(\%myconfig, $ref->{rop}, '', " ") - . qq|

-
- - -{path}> -{login}> -{password}> - - - - - -
- - -
- - - -|; - - $lxdebug->leave_sub(); -} - -sub restock_assemblies { - $lxdebug->enter_sub(); - - $form->redirect($locale->text('Assemblies restocked!')) - if (IC->restock_assemblies(\%myconfig, \%$form)); - $form->error($locale->text('Cannot stock assemblies!')); - - $lxdebug->leave_sub(); -} - sub price_row { $lxdebug->enter_sub(); @@ -3407,7 +3237,6 @@ sub price_row { $lxdebug->leave_sub(); } - sub parts_language_selection { $lxdebug->enter_sub();