From: Moritz Bunkus Date: Fri, 16 Feb 2007 10:26:16 +0000 (+0000) Subject: Mehr Codeteile entfernt, die zur Vorbereitung von Mehrlagerfähigkeit in SQL-Ledger... X-Git-Tag: release-2.4.2~93 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e07e9534d0c611913e31bc620c65e46701e5f000;p=kivitendo-erp.git Mehr Codeteile entfernt, die zur Vorbereitung von Mehrlagerfähigkeit in SQL-Ledger gedient haben und nie benutzt wurden. --- diff --git a/SL/AM.pm b/SL/AM.pm index f455e65a2..2b08cabc0 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -300,109 +300,6 @@ sub delete_account { return $rc; } -sub warehouses { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - - # connect to database - my $dbh = $form->dbconnect($myconfig); - - my $query = qq|SELECT id, description - FROM warehouse - ORDER BY 2|; - - $sth = $dbh->prepare($query); - $sth->execute || $form->dberror($query); - - while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { - push @{ $form->{ALL} }, $ref; - } - - $sth->finish; - $dbh->disconnect; - - $main::lxdebug->leave_sub(); -} - -sub get_warehouse { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - - # connect to database - my $dbh = $form->dbconnect($myconfig); - - my $query = qq|SELECT w.description - FROM warehouse w - WHERE w.id = $form->{id}|; - my $sth = $dbh->prepare($query); - $sth->execute || $form->dberror($query); - - my $ref = $sth->fetchrow_hashref(NAME_lc); - - map { $form->{$_} = $ref->{$_} } keys %$ref; - - $sth->finish; - - # see if it is in use - $query = qq|SELECT count(*) FROM inventory i - WHERE i.warehouse_id = $form->{id}|; - $sth = $dbh->prepare($query); - $sth->execute || $form->dberror($query); - - ($form->{orphaned}) = $sth->fetchrow_array; - $form->{orphaned} = !$form->{orphaned}; - $sth->finish; - - $dbh->disconnect; - - $main::lxdebug->leave_sub(); -} - -sub save_warehouse { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - - # connect to database - my $dbh = $form->dbconnect($myconfig); - - $form->{description} =~ s/\'/\'\'/g; - - if ($form->{id}) { - $query = qq|UPDATE warehouse SET - description = '$form->{description}' - WHERE id = $form->{id}|; - } else { - $query = qq|INSERT INTO warehouse - (description) - VALUES ('$form->{description}')|; - } - $dbh->do($query) || $form->dberror($query); - - $dbh->disconnect; - - $main::lxdebug->leave_sub(); -} - -sub delete_warehouse { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - - # connect to database - my $dbh = $form->dbconnect($myconfig); - - $query = qq|DELETE FROM warehouse - WHERE id = $form->{id}|; - $dbh->do($query) || $form->dberror($query); - - $dbh->disconnect; - - $main::lxdebug->leave_sub(); -} - sub departments { $main::lxdebug->enter_sub(); diff --git a/SL/OE.pm b/SL/OE.pm index b95098374..210a87c75 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -76,36 +76,6 @@ sub transactions { WHERE o.quotation = '$quotation' $department|; - # build query if type eq (ship|receive)_order - if ($form->{type} =~ /(ship|receive)_order/) { - my ($warehouse, $warehouse_id) = split /--/, $form->{warehouse}; - - $query = qq|SELECT DISTINCT ON (o.id) o.id, o.ordnumber, o.transdate, - o.reqdate, o.amount, ct.name, o.netamount, o.$form->{vc}_id, - ex.$rate AS exchangerate, - o.closed, o.quonumber, o.shippingpoint, o.shipvia, - e.name AS employee - FROM oe o - JOIN $form->{vc} ct ON (o.$form->{vc}_id = ct.id) - JOIN orderitems oi ON (oi.trans_id = o.id) - JOIN parts p ON (p.id = oi.parts_id) - LEFT JOIN employee e ON (o.employee_id = e.id) - LEFT JOIN exchangerate ex ON (ex.curr = o.curr - AND ex.transdate = o.transdate) - WHERE o.quotation = '0' - AND (p.inventory_accno_id > 0 OR p.assembly = '1') - AND oi.qty <> oi.ship - $department|; - - if ($warehouse_id && $form->{type} eq 'ship_order') { - $query .= qq| - AND i.warehouse_id = $warehouse_id - AND i.qty >= (oi.qty - oi.ship) - |; - } - - } - if ($form->{"$form->{vc}_id"}) { $query .= qq| AND o.$form->{vc}_id = $form->{"$form->{vc}_id"}|; } else { @@ -962,30 +932,6 @@ sub order_details { push @partsgroup, [$i, $partsgroup]; } - # if there is a warehouse limit picking - if ($form->{warehouse_id} && $form->{formname} =~ /(pick|packing)_list/) { - - # run query to check for inventory - $query = qq|SELECT sum(i.qty) AS qty - FROM inventory i - WHERE i.parts_id = ? - AND i.warehouse_id = ?|; - $sth = $dbh->prepare($query) || $form->dberror($query); - - for $i (1 .. $form->{rowcount}) { - $sth->execute($form->{"id_$i"}, $form->{warehouse_id}) || $form->dberror; - - ($qty) = $sth->fetchrow_array; - $sth->finish; - - $form->{"qty_$i"} = 0 if $qty == 0; - - if ($form->parse_amount($myconfig, $form->{"ship_$i"}) > $qty) { - $form->{"ship_$i"} = $form->format_amount($myconfig, $qty); - } - } - } - my $sameitem = ""; foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) { $i = $item->[0]; diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index d25eb7e30..fcaf0b2a5 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -3238,191 +3238,6 @@ sub doclose { $lxdebug->leave_sub(); } -sub add_warehouse { - $lxdebug->enter_sub(); - - $form->{title} = "Add"; - - $form->{callback} = - "$form->{script}?action=add_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}" - unless $form->{callback}; - - &warehouse_header; - &form_footer; - - $lxdebug->leave_sub(); -} - -sub edit_warehouse { - $lxdebug->enter_sub(); - - $form->{title} = "Edit"; - - AM->get_warehouse(\%myconfig, \%$form); - - &warehouse_header; - &form_footer; - - $lxdebug->leave_sub(); -} - -sub list_warehouse { - $lxdebug->enter_sub(); - - AM->warehouses(\%myconfig, \%$form); - - $form->{callback} = - "$form->{script}?action=list_warehouse&path=$form->{path}&login=$form->{login}&password=$form->{password}"; - - $callback = $form->escape($form->{callback}); - - $form->{title} = $locale->text('Warehouses'); - - @column_index = qw(description); - - $column_header{description} = - qq|| - . $locale->text('Description') - . qq||; - - $form->header; - - print qq| - - - - - - - - - - - - - -
$form->{title}
- - -|; - - map { print "$column_header{$_}\n" } @column_index; - - print qq| - -|; - - foreach $ref (@{ $form->{ALL} }) { - - $i++; - $i %= 2; - - print qq| - -|; - - $column_data{description} = - qq||; - - map { print "$column_data{$_}\n" } @column_index; - - print qq| - -|; - } - - print qq| -
{script}?action=edit_warehouse&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description}
-

- -
-
{script}> - - - - - -{path}> -{login}> -{password}> - - - -
- - - -|; - - $lxdebug->leave_sub(); -} - -sub warehouse_header { - $lxdebug->enter_sub(); - - $form->{title} = $locale->text("$form->{title} Warehouse"); - - # $locale->text('Add Warehouse') - # $locale->text('Edit Warehouse') - - $form->{description} =~ s/\"/"/g; - - if (($rows = $form->numtextrows($form->{description}, 60)) > 1) { - $description = - qq||; - } else { - $description = - qq||; - } - - $form->header; - - print qq| - - -
{script}> - -{id}> - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text('Description') . qq|$description

-|; - - $lxdebug->leave_sub(); -} - -sub save_warehouse { - $lxdebug->enter_sub(); - - $form->isblank("description", $locale->text('Description missing!')); - AM->save_warehouse(\%myconfig, \%$form); - $form->redirect($locale->text('Warehouse saved!')); - - $lxdebug->leave_sub(); -} - -sub delete_warehouse { - $lxdebug->enter_sub(); - - AM->delete_warehouse(\%myconfig, \%$form); - $form->redirect($locale->text('Warehouse deleted!')); - - $lxdebug->leave_sub(); -} - sub continue { $lxdebug->enter_sub(); diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index c0fdcdad0..8b0b7fc69 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1892,7 +1892,6 @@ sub print_form { } ($form->{employee}) = split /--/, $form->{employee}; - ($form->{warehouse}, $form->{warehouse_id}) = split /--/, $form->{warehouse}; # create the form variables if ($order) { diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 49edb578d..0d0d80131 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -214,7 +214,7 @@ sub order_links { } } - if ($form->{type} =~ /(sales|ship)_(order|quotation)/) { + if ($form->{type} =~ /sales_(order|quotation)/) { IS->get_customer(\%myconfig, \%$form); #quote all_vendor Bug 133 @@ -1374,7 +1374,6 @@ sub search { $vclabel $vc - $warehouse $department $ordlabel @@ -1464,20 +1463,18 @@ sub orders { $number = $form->escape($form->{$ordnumber}); $name = $form->escape($form->{ $form->{vc} }); $department = $form->escape($form->{department}); - $warehouse = $form->escape($form->{warehouse}); # construct href $href = - "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department&warehouse=$warehouse"; + "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department"; # construct callback $number = $form->escape($form->{$ordnumber}, 1); $name = $form->escape($form->{ $form->{vc} }, 1); $department = $form->escape($form->{department}, 1); - $warehouse = $form->escape($form->{warehouse}, 1); $callback = - "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department&warehouse=$warehouse"; + "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department"; @columns = $form->sort_columns("transdate", "reqdate", "id", "$ordnumber", @@ -1583,12 +1580,6 @@ sub orders { $option = $locale->text(ucfirst $form->{vc}); $option .= " : $form->{$form->{vc}}"; } - if ($form->{warehouse}) { - ($warehouse) = split /--/, $form->{warehouse}; - $option .= "\n
" if ($option); - $option .= $locale->text('Warehouse'); - $option .= " : $warehouse"; - } if ($form->{department}) { $option .= "\n
" if ($option); ($department) = split /--/, $form->{department}; @@ -1646,9 +1637,6 @@ sub orders { } $action = "edit"; - $action = "ship_receive" if ($form->{type} =~ /(ship|receive)_order/); - - $warehouse = $form->escape($form->{warehouse}); foreach $oe (@{ $form->{OE} }) { $form->{rowcount} = ++$j; @@ -1687,7 +1675,7 @@ sub orders { $column_data{reqdate} = "$oe->{reqdate} "; $column_data{$ordnumber} = - "{path}&action=$action&type=$form->{type}&id=$oe->{id}&warehouse=$warehouse&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&callback=$callback_escaped>$oe->{$ordnumber}"; + "{path}&action=$action&type=$form->{type}&id=$oe->{id}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&callback=$callback_escaped>$oe->{$ordnumber}"; $column_data{name} = "$oe->{name}"; $column_data{employee} = "$oe->{employee} "; @@ -1759,7 +1747,6 @@ sub orders { . $locale->text('Continue') . qq|"> - @@ -1781,15 +1768,7 @@ sub orders { {path}> {login}> {password}> -|; - if ($form->{type} !~ /(ship|receive)_order/) { - print qq| -|; - } - - print qq|
diff --git a/locale/de/all b/locale/de/all index b68905b54..107f43f49 100644 --- a/locale/de/all +++ b/locale/de/all @@ -113,7 +113,6 @@ $self->{texts} = { 'Add User' => 'Benutzer erfassen', 'Add Vendor' => 'Lieferant erfassen', 'Add Vendor Invoice' => 'Einkaufsrechnung erfassen', - 'Add Warehouse' => 'Lager erfassen', 'Add and edit %s' => '%s hinzufügen und bearbeiten', 'Add unit' => 'Einheit hinzufügen', 'Address' => 'Adresse', @@ -434,7 +433,6 @@ gestartet', 'Edit User' => 'Benutzerdaten bearbeiten', 'Edit Vendor' => 'Lieferant editieren', 'Edit Vendor Invoice' => 'Einkaufsrechnung bearbeiten', - 'Edit Warehouse' => 'Lager bearbeiten', 'Edit the purchase_order' => 'Bearbeiten des Lieferantenauftrags', 'Edit the request_quotation' => 'Bearbeiten der Preisanfrage', 'Edit the sales_order' => 'Bearbeiten des Auftrags', @@ -1139,10 +1137,6 @@ gestartet', 'View License' => 'Lizenz ansehen', 'Von Konto: ' => 'von Konto: ', 'WEBDAV-Zugriff' => 'WEBDAV-Zugriff', - 'Warehouse' => 'Lager', - 'Warehouse deleted!' => 'Das Lager wurde gelöscht.', - 'Warehouse saved!' => 'Das Lager wurde gespeichert.', - 'Warehouses' => 'Lager', 'Warnings during template upgrade' => 'Warnungen bei Aktualisierung der Dokumentenvorlagen', 'Weight' => 'Gewicht', 'What type of item is this?' => 'Was ist dieser Artikel?', diff --git a/locale/de/am b/locale/de/am index 150abad91..9cbe095f0 100644 --- a/locale/de/am +++ b/locale/de/am @@ -52,7 +52,6 @@ $self->{texts} = { 'Add Payment Terms' => 'Zahlungskonditionen hinzufügen', 'Add Printer' => 'Drucker hinzufügen', 'Add SIC' => 'SIC erfassen', - 'Add Warehouse' => 'Lager erfassen', 'Add and edit %s' => '%s hinzufügen und bearbeiten', 'Address' => 'Adresse', 'Article Code' => 'Artikelkürzel', @@ -121,7 +120,6 @@ $self->{texts} = { 'Edit Printer' => 'Drucker bearbeiten', 'Edit SIC' => 'SIC bearbeiten', 'Edit Template' => 'Vorlage bearbeiten', - 'Edit Warehouse' => 'Lager bearbeiten', 'Enforce transaction reversal for all dates' => 'Gegenbuchungen für jeden Zeitraum aktualisieren', 'Enter longdescription' => 'Langtext eingeben', '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)', @@ -311,9 +309,6 @@ $self->{texts} = { 'Unknown dependency \'%s\'.' => 'Unbekannte Abhängigkeit \'%s\'.', 'Value' => 'Wert', 'Variable' => 'Variable', - 'Warehouse deleted!' => 'Das Lager wurde gelöscht.', - 'Warehouse saved!' => 'Das Lager wurde gespeichert.', - 'Warehouses' => 'Lager', 'Year End' => 'Jahresende', 'Yes' => 'Ja', 'You can use the following strings in the long description and all translations. They will be replaced by their actual values by Lx-Office before they\'re output.' => 'Sie können im Langtext und allen Übersetzungen die folgenden Variablen benutzen, die vor der Ausgabe von Lx-Office automatisch ersetzt werden:', @@ -342,7 +337,6 @@ $self->{subs} = { 'add_printer' => 'add_printer', 'add_sic' => 'add_sic', 'add_unit' => 'add_unit', - 'add_warehouse' => 'add_warehouse', 'audit_control' => 'audit_control', 'backup' => 'backup', 'buchungsgruppe_header' => 'buchungsgruppe_header', @@ -361,7 +355,6 @@ $self->{subs} = { 'delete_payment' => 'delete_payment', 'delete_printer' => 'delete_printer', 'delete_sic' => 'delete_sic', - 'delete_warehouse' => 'delete_warehouse', 'delivery_customer_selection' => 'delivery_customer_selection', 'department_header' => 'department_header', 'display_form' => 'display_form', @@ -379,7 +372,6 @@ $self->{subs} = { 'edit_sic' => 'edit_sic', 'edit_template' => 'edit_template', 'edit_units' => 'edit_units', - 'edit_warehouse' => 'edit_warehouse', 'employee_selection_internal' => 'employee_selection_internal', 'form_footer' => 'form_footer', 'format_dates' => 'format_dates', @@ -394,7 +386,6 @@ $self->{subs} = { 'list_payment' => 'list_payment', 'list_printer' => 'list_printer', 'list_sic' => 'list_sic', - 'list_warehouse' => 'list_warehouse', 'part_selection_internal' => 'part_selection_internal', 'payment_header' => 'payment_header', 'printer_header' => 'printer_header', @@ -415,7 +406,6 @@ $self->{subs} = { 'save_sic' => 'save_sic', 'save_template' => 'save_template', 'save_unit' => 'save_unit', - 'save_warehouse' => 'save_warehouse', 'select_employee' => 'select_employee', 'select_employee_internal' => 'select_employee_internal', 'select_part' => 'select_part', @@ -427,7 +417,6 @@ $self->{subs} = { 'swap_payment_terms' => 'swap_payment_terms', 'swap_units' => 'swap_units', 'vendor_selection' => 'vendor_selection', - 'warehouse_header' => 'warehouse_header', 'erfassen' => 'add', 'konto_erfassen' => 'add_account', 'weiter' => 'continue', diff --git a/locale/de/oe b/locale/de/oe index ea39d6fec..52db95a52 100644 --- a/locale/de/oe +++ b/locale/de/oe @@ -2,7 +2,6 @@ $self->{texts} = { ' Date missing!' => ' Datum fehlt!', ' missing!' => ' fehlt!', '*/' => '*/', - 'Add' => 'Erfassen', 'Add Exchangerate' => 'Wechselkurs erfassen', 'Add Purchase Order' => 'Lieferantenauftrag erfassen', 'Add Quotation' => 'Angebot erfassen', @@ -223,7 +222,6 @@ $self->{texts} = { 'Vendor Number' => 'Lieferantennummer', 'Vendor missing!' => 'Lieferant fehlt!', 'Vendor not on file!' => 'Lieferant ist nicht in der Datenbank!', - 'Warehouse' => 'Lager', 'What type of item is this?' => 'Was ist dieser Artikel?', 'Workflow purchase_order' => 'Workflow Lieferantenauftrag', 'Workflow request_quotation' => 'Workflow Preisanfrage', @@ -320,7 +318,6 @@ $self->{subs} = { 'vendor_invoice' => 'vendor_invoice', 'vendor_selection' => 'vendor_selection', 'yes' => 'yes', - 'erfassen' => 'add', 'weiter' => 'continue', 'löschen' => 'delete', 'email' => 'e_mail', diff --git a/menu.ini b/menu.ini index b971c0128..0b2de6a7b 100644 --- a/menu.ini +++ b/menu.ini @@ -443,19 +443,6 @@ module=am.pl action=edit_units unit_type=service -#[System--Warehouses] -#module=menu.pl -#action=acc_menu -#target=acc_menu -#submenu=1 - -#[System--Warehouses--Add Warehouse] -#module=am.pl -#action=add_warehouse -# -#[System--Warehouses--List Warehouses] -#module=am.pl -#action=list_warehouse [System--Departments] module=menu.pl