From 0bb0eb67db98f28ec8faf8dfe8c233268332f842 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20K=C3=B6hler?= Date: Sat, 26 Nov 2005 16:10:15 +0000 Subject: [PATCH] Merge von 641,653 aus unstable: Preisgruppen Teil 3 -Preisgruppen Kommentar entfernt, nach Perltidy formatiert -Menue Berichte Preisgruppen verschoben, Hola raus & locales angepasst --- SL/IS.pm | 105 +++++++++++++++++----------------------------- SL/PE.pm | 5 +-- bin/mozilla/ct.pl | 1 - bin/mozilla/io.pl | 11 +++-- bin/mozilla/ir.pl | 31 ++++++-------- bin/mozilla/is.pl | 20 ++++----- locale/de/all | 8 ---- locale/de/ct | 1 - menu.ini | 9 ++-- 9 files changed, 70 insertions(+), 121 deletions(-) diff --git a/SL/IS.pm b/SL/IS.pm index c5950b15a..8643eaef2 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -214,7 +214,7 @@ sub invoice_details { $taxbase{$item} += $taxbase; } } - $tax_rate = $taxrate*100; + $tax_rate = $taxrate * 100; push(@{ $form->{tax_rate} }, qq|$tax_rate|); if ($form->{"assembly_$i"}) { $sameitem = ""; @@ -368,7 +368,7 @@ sub customer_details { sub post_invoice { $main::lxdebug->enter_sub(); -print STDERR "IS.pm-post_invoice\n"; + my ($self, $myconfig, $form) = @_; # connect to database, turn off autocommit @@ -552,7 +552,6 @@ print STDERR "IS.pm-post_invoice\n"; ? qq|'$form->{"deliverydate_$i"}'| : "NULL"; - # get pricegroup_id and save ist ($null, my $pricegroup_id) = split /--/, $form->{"sellprice_drag_$i"}; $pricegroup_id *= 1; @@ -1114,7 +1113,7 @@ sub delete_invoice { sub retrieve_invoice { $main::lxdebug->enter_sub(); -print STDERR "IS.pm-retrieve_invoice\n"; + my ($self, $myconfig, $form) = @_; # connect to database @@ -1532,11 +1531,11 @@ sub retrieve_item { ########################## # get pricegroups from database # build up selected pricegroup -# if an exchange rate - change price +# if an exchange rate - change price # for each part # sub get_pricegroups_for_parts { -print STDERR "IS.pm - get_pricegroups_for_parts\n"; + $main::lxdebug->enter_sub(); my ($self, $myconfig, $form) = @_; @@ -1555,111 +1554,85 @@ print STDERR "IS.pm - get_pricegroups_for_parts\n"; $id = $form->{"new_id_$i"}; } - ($price, $selectedpricegroup_id) = split /--/, $form->{"sellprice_drag_$i"}; -# print (STDERR "sellprice_drag_$i", Dumper($form->{"sellprice_drag_$i"})); + ($price, $selectedpricegroup_id) = split /--/, + $form->{"sellprice_drag_$i"}; $pricegroup_old = $form->{"pricegroup_old_$i"}; -# print (STDERR "pricegroup_old_i-$i", Dumper($pricegroup_old)); $price_new = $form->{"price_new_$i"}; $price_old = $form->{"price_old_$i"}; - - $query = qq|SELECT pricegroup_id, (SELECT p.sellprice from parts p where p.id = $id) as default_sellprice,(SELECT pg.pricegroup FROM pricegroup pg WHERE id=pricegroup_id) AS pricegroup, price, '' AS selected FROM prices WHERE parts_id = $id UNION SELECT 0 as pricegroup_id,(SELECT sellprice FROM parts WHERE id=$id) as default_sellprice,'' as pricegroup, (SELECT DISTINCT sellprice from parts where id=$id) as price, 'selected' AS selected from prices ORDER BY pricegroup|; + $query = + qq|SELECT pricegroup_id, (SELECT p.sellprice from parts p where p.id = $id) as default_sellprice,(SELECT pg.pricegroup FROM pricegroup pg WHERE id=pricegroup_id) AS pricegroup, price, '' AS selected FROM prices WHERE parts_id = $id UNION SELECT 0 as pricegroup_id,(SELECT sellprice FROM parts WHERE id=$id) as default_sellprice,'' as pricegroup, (SELECT DISTINCT sellprice from parts where id=$id) as price, 'selected' AS selected from prices ORDER BY pricegroup|; $pkq = $dbh->prepare($query); $pkq->execute || $form->dberror($query); while ($pkr = $pkq->fetchrow_hashref(NAME_lc)) { -# push @{ $form->{PRICES}{$id} }, $pkr; - push @{ $form->{PRICES}{$i} }, $pkr; - $pkr->{id} = $id; - $pkr->{selected} = ''; - # if there is an exchange rate change price + # push @{ $form->{PRICES}{$id} }, $pkr; + push @{ $form->{PRICES}{$i} }, $pkr; + $pkr->{id} = $id; + $pkr->{selected} = ''; + + # if there is an exchange rate change price if (($form->{exchangerate} * 1) != 0) { -# print STDERR "WECHSELKURS?-$form->{exchangerate}\n"; + $pkr->{price} /= $form->{exchangerate}; } - $pkr->{price} = $form->format_amount($myconfig,$pkr->{price},5); - + $pkr->{price} = $form->format_amount($myconfig, $pkr->{price}, 5); if ($selectedpricegroup_id eq undef) { if ($pkr->{pricegroup_id} eq $form->{customer_klass}) { -print STDERR " INIT ROW \n"; -#print (STDERR " PREIS", Dumper($pkr->{price})); + $pkr->{selected} = ' selected'; $last->{selected} = ''; -# print (STDERR " SELLPRICE", Dumper($form->{"sellprice_$i"})); - # no customer pricesgroup set + # no customer pricesgroup set if ($pkr->{price} == $pkr->{default_sellprice}) { -print (STDERR " PREIS IST DEFAULT-SELLPRICE", Dumper($form->{"sellprice_$i"})); - $pkr->{price} = $form->{"sellprice_$i"}; -# if ($form->{tradediscount}){ -# print (STDERR "TRADE--", Dumper($pkr->{price})); -# $pkr->{price} =$pkr->{price} * (1 - $form->{tradediscount}); -# $pkr->{price} = $form->format_amount($myconfig,$pkr->{price},5); -# print (STDERR "TRADE--", Dumper($pkr->{price})); -# } + $pkr->{price} = $form->{"sellprice_$i"}; } else { -print STDERR " PREIS IST NICHT NULL\n"; - $form->{"sellprice_$i"} = $pkr->{price}; + + $form->{"sellprice_$i"} = $pkr->{price}; } -# print (STDERR " PRICE", Dumper($pkr->{price})); } else { -print STDERR " INIT ROW but what\n"; -print (STDERR " PREIS -", Dumper($pkr->{price}), "Default", Dumper($pkr->{default_sellprice})); if ($pkr->{price} == $pkr->{default_sellprice}) { -print (STDERR " PREIS IST DEFAULT-", Dumper($form->{"sellprice_$i"})); - $pkr->{price} = $form->{"sellprice_$i"}; - $pkr->{selected} = ' selected'; + + $pkr->{price} = $form->{"sellprice_$i"}; + $pkr->{selected} = ' selected'; } } } - if ($selectedpricegroup_id or $selectedpricegroup_id == 0){ + if ($selectedpricegroup_id or $selectedpricegroup_id == 0) { if ($selectedpricegroup_id ne $pricegroup_old) { if ($pkr->{pricegroup_id} eq $selectedpricegroup_id) { if ($price_new != $form->{"sellprice_$i"}) { -print STDERR " MANUELLEN PREIS WÄHLEN\n"; } else { -print STDERR " UPDATE CHANGE PRICEGROUP\n"; - $pkr->{selected} = ' selected'; - $last->{selected} = ''; -#$form->{"pricegroup_old_$i"} = $pkr->{$pricegroup_id}; + $pkr->{selected} = ' selected'; + $last->{selected} = ''; } } - } else { + } else { if (($price_new != $form->{"sellprice_$i"}) and ($price_new ne 0)) { if ($pkr->{pricegroup_id} == 0) { -print STDERR " UPDATE CHANGE PRICEGROUP with price manuelly\n"; -print (STDERR " SELLPRICE??? ---", Dumper($form->{"sellprice_$i"})); -print (STDERR " NEWPRICE??? ---", Dumper($price_new)); - $pkr->{price} = $form->{"sellprice_$i"}; - $pkr->{selected} = ' selected'; - $last->{selected} = ''; - #$form->{"sellprice_$i"} = $form->format_amount($myconfig, $price_new, 2); -# print (STDERR "----5555---", Dumper($pkr)); + $pkr->{price} = $form->{"sellprice_$i"}; + $pkr->{selected} = ' selected'; + $last->{selected} = ''; } } else { if ($pkr->{pricegroup_id} eq $selectedpricegroup_id) { -print STDERR " UPDATE NO CHANGE\n"; - $pkr->{selected} = ' selected'; - $last->{selected} = ''; -print STDERR " DEFAULTPRICE??? ---$pkr->{default_sellprice}\n"; -print (STDERR " SELLPRICE??? ---", Dumper($form->{"sellprice_$i"})); -# print (STDERR " HIER DER SELLPRICE DEFAULT??? ---", Dumper($form)); -print STDERR " NEWPRICE??? ---$price_new_\n"; - if (($pkr->{pricegroup_id} == 0) and ($pkr->{price} == $form->{"sellprice_$i"})) { -print (STDERR " UPDATE NO CHANGE BUT PRICE MANUELLY SET", Dumper($pkr->{price})); + $pkr->{selected} = ' selected'; + $last->{selected} = ''; + if ( ($pkr->{pricegroup_id} == 0) + and ($pkr->{price} == $form->{"sellprice_$i"})) { + # $pkr->{price} = $form->{"sellprice_$i"}; - } else { + } else { $pkr->{price} = $form->{"sellprice_$i"}; } -#print (STDERR " FEHLER", Dumper($form->{"sellprice_$i"})); } } } @@ -1672,8 +1645,6 @@ print (STDERR " UPDATE NO CHANGE BUT PRICE MANUELLY SET", Dumper($pkr->{price}) $dbh->disconnect; -# print (STDERR "TEST", Dumper($form->{PRICES})); -# print (STDERR "TEST id_$i", Dumper($form->{"id_$i"})); $main::lxdebug->leave_sub(); } diff --git a/SL/PE.pm b/SL/PE.pm index 1532e79ce..57c9c67af 100644 --- a/SL/PE.pm +++ b/SL/PE.pm @@ -332,7 +332,6 @@ sub pricegroups { WHERE $where ORDER BY $sortorder|; } -print STDERR "asdfasdf-$query\n"; $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); @@ -385,7 +384,7 @@ sub save_pricegroup { # sub get_pricegroup { $main::lxdebug->enter_sub(); -print STDERR "PE.pm-get_pricegroup\n"; + my ($self, $myconfig, $form) = @_; # connect to database @@ -416,7 +415,7 @@ print STDERR "PE.pm-get_pricegroup\n"; $sth->finish; $dbh->disconnect; -#print (STDERR " ", Dumper($form)); + $main::lxdebug->leave_sub(); } diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index c1bd16e21..09068dce4 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -612,7 +612,6 @@ sub form_header { $pricegroup .= qq||; - $group = $locale->text('Hola'); } } # $locale->text('Customer Number') diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index c0ab3dc9a..ae8f500bb 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -254,13 +254,13 @@ sub display_row { qq||; } - (my $qty_dec) = ($form->{"qty_$i"} =~ /\.(\d+)/); - $qty_dec = length $qty_dec; + (my $qty_dec) = ($form->{"qty_$i"} =~ /\.(\d+)/); + $qty_dec = length $qty_dec; $column_data{qty} = - qq|format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec) - .qq|>|; + qq|format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec) + . qq|>|; $column_data{ship} = qq|format_amount(\%myconfig, $form->{"ship_$i"}) @@ -454,7 +454,6 @@ sub set_pricegroup { } } - #print (STDERR "HIER", Dumper($prices) ); $lxdebug->leave_sub(); } diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index ee0e813a4..264100e74 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -43,7 +43,7 @@ require "$form->{path}/arap.pl"; sub add { $lxdebug->enter_sub(); -print STDERR "ir.pl-add\n"; + $form->{title} = $locale->text('Add Vendor Invoice'); &invoice_links; @@ -67,7 +67,7 @@ sub edit { sub invoice_links { $lxdebug->enter_sub(); -print STDERR "ir.pl-invoice_links\n"; + # create links $form->{webdav} = $webdav; @@ -160,7 +160,7 @@ print STDERR "ir.pl-invoice_links\n"; sub prepare_invoice { $lxdebug->enter_sub(); -print STDERR "ir.pl-prepare_invoice\n"; + if ($form->{id}) { map { $form->{$_} =~ s/\"/"/g } qw(invnumber ordnumber quonumber); @@ -176,10 +176,10 @@ print STDERR "ir.pl-prepare_invoice\n"; $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); - + (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); - $dec_qty = length $dec_qty; - + $dec_qty = length $dec_qty; + $form->{"qty_$i"} = $form->format_amount(\%myconfig, ($form->{"qty_$i"} * -1), $dec_qty); @@ -192,7 +192,7 @@ print STDERR "ir.pl-prepare_invoice\n"; sub form_header { $lxdebug->enter_sub(); -print STDERR "ir.pl-form_header\n"; + # set option selected foreach $item (qw(AP vendor currency department contact)) { $form->{"select$item"} =~ s/ selected//; @@ -227,15 +227,13 @@ print STDERR "ir.pl-form_header\n"; if ($form->{forex}) { $exchangerate .= qq| | - . $locale->text('Exchangerate') - . qq| + . $locale->text('Exchangerate') . qq| $form->{exchangerate}{exchangerate}> |; } else { $exchangerate .= qq| | - . $locale->text('Exchangerate') - . qq| + . $locale->text('Exchangerate') . qq| {exchangerate}> |; } @@ -274,14 +272,12 @@ print STDERR "ir.pl-form_header\n"; $button1 = qq| {invdate}> text('button') - . qq|> + . $locale->text('button') . qq|> |; $button2 = qq| {duedate}> text('button') - . qq|> + . $locale->text('button') . qq|> |; #write Trigger @@ -335,8 +331,7 @@ print STDERR "ir.pl-form_header\n"; $vendor | - . $locale->text('Contact Person') - . qq| + . $locale->text('Contact Person') . qq| $contact {vendor_id}> @@ -421,7 +416,7 @@ $jsscript sub form_footer { $lxdebug->enter_sub(); -print STDERR "ir.pl-form_footer\n"; + $form->{invtotal} = $form->{invsubtotal}; if (($rows = $form->numtextrows($form->{notes}, 25, 8)) < 2) { diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index c6afe176c..7d79ba9f2 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -67,7 +67,7 @@ sub add { sub edit { $lxdebug->enter_sub(); - print STDERR "is.pl-edit\n"; + $form->{title} = $locale->text('Edit Sales Invoice'); if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR") @@ -84,7 +84,7 @@ sub edit { sub invoice_links { $lxdebug->enter_sub(); - print STDERR "is.pl-invoice_links\n"; + $form->{vc} = 'customer'; # create links @@ -184,7 +184,7 @@ sub invoice_links { sub prepare_invoice { $lxdebug->enter_sub(); - print STDERR "is.pl-prepare_invoice\n"; + $form->{type} = "invoice"; $form->{formname} = "invoice"; $form->{format} = "html"; @@ -210,12 +210,12 @@ sub prepare_invoice { $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); - + (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); - $dec_qty = length $dec_qty; - - $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, - $dec_qty); + $dec_qty = length $dec_qty; + + $form->{"qty_$i"} = + $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); map { $form->{"${_}_$i"} =~ s/\"/"/g } qw(partnumber description unit partnotes); @@ -228,7 +228,6 @@ sub prepare_invoice { sub form_header { $lxdebug->enter_sub(); - print STDERR "is.pl-form_header\n"; # set option selected foreach $item (qw(AR customer currency department employee contact)) { @@ -525,7 +524,7 @@ $jsscript sub form_footer { $lxdebug->enter_sub(); - print STDERR "is.pl-form_footer\n"; + $form->{invtotal} = $form->{invsubtotal}; if (($rows = $form->numtextrows($form->{notes}, 26, 8)) < 2) { @@ -930,7 +929,6 @@ sub update { $sellprice = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}); - #print STDERR " SELLPRICE-111- $sellprice\n"; map { $form->{item_list}[$i]{$_} =~ s/\"/"/g } qw(partnumber description unit); map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } diff --git a/locale/de/all b/locale/de/all index f75afa69e..2f869d192 100644 --- a/locale/de/all +++ b/locale/de/all @@ -178,7 +178,6 @@ $self{texts} = { 'Company' => 'Firma', 'Company Name' => 'Firmenname', 'Compare to' => 'Gegenüberstellen zu', - 'Config' => 'Konfiguration', 'Confirm!' => 'Bestätigen Sie!', 'Confirmation' => 'Auftragsbestätigung', 'Connect to' => 'Als Vorlage verwenden', @@ -306,11 +305,6 @@ $self{texts} = { 'Enforce transaction reversal for all dates' => 'Gegenbuchungen für jeden Zeitraum aktualisieren', 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Geben Sie Ihre und weitere Währungen mit bis zu drei Buchstaben pro Währung und Währungen durch Doppelpunkte getrennt ein (z.B. EUR:USD:CAD)', 'Equity' => 'Passiva', - 'Es fehlen Angaben zur Versteuerung. - Wenn Sie Ist Versteuert sind, wählen Sie die Einnahmen/Überschuß-Rechnung aus. - Sind Sie Soll-Versteuert und Bilanzverpflichtet, dann wählen Sie Bilanz aus.' => 'Es fehlen Angaben zur Versteuerung. - Wenn Sie Ist Versteuert sind, wählen Sie die Einnahmen/Überschuß-Rechnung aus. - Sind Sie Soll-Versteuert und Bilanzverpflichtet, dann wählen Sie Bilanz aus.', 'Es fehlen Angaben zur Versteuerung. Wenn Sie Ist Versteuert sind, wählen Sie die Einnahmen/Überschuß-Rechnung aus. Sind Sie Soll-Versteuert und Bilanzverpflichtet, dann wählen Sie Bilanz aus.' => 'Es fehlen Angaben zur Versteuerung. @@ -365,7 +359,6 @@ $self{texts} = { 'Help' => 'Hilfe', 'Hier den Berechnungszeitraum auswählen...' => 'Hier den Berechnungszeitraum auswählen...', 'Hinweise' => 'Hinweise', - 'Hola' => '', 'Homepage' => 'Homepage', 'Host' => 'Datenbankcomputer', 'Hostname missing!' => 'Computername fehlt!', @@ -819,7 +812,6 @@ $self{texts} = { 'soldtotal' => 'Verkaufte Anzahl', 'successfully created!' => 'wurde erfolgreich erstellt', 'successfully deleted!' => 'wurde erfolgreich gelöscht', - 'test' => 'test', 'ustva' => 'UStVA', 'website' => 'Webseite', 'winston_export' => 'Winston-Export', diff --git a/locale/de/ct b/locale/de/ct index b1f39df70..a564050a4 100644 --- a/locale/de/ct +++ b/locale/de/ct @@ -35,7 +35,6 @@ $self{texts} = { 'GIFI' => 'GIFI', 'Given Name' => 'Vorname', 'Greeting' => 'Anrede', - 'Hola' => 'Hola', 'Homepage' => 'Homepage', 'ID' => 'Buchungsnummer', 'Include in Report' => 'In Bericht aufnehmen', diff --git a/menu.ini b/menu.ini index ddeda1177..ce9261a98 100644 --- a/menu.ini +++ b/menu.ini @@ -35,7 +35,6 @@ module=pe.pl action=add type=project -#sk [Master Data--Add Pricegroup] module=pe.pl action=add @@ -92,16 +91,14 @@ module=rp.pl action=report report=projects -[Master Data--Reports--Licenses] -module=licenses.pl -action=search - -#sk [Master Data--Reports--Pricegroups] module=pe.pl action=search type=pricegroup +[Master Data--Reports--Licenses] +module=licenses.pl +action=search [AR] -- 2.20.1