X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/8058448b8c3969bc043a54275fa89e4a9405908d..7635f647ec7dcdef51684b21601ee0930ea2bc5b:/SL/AM.pm diff --git a/SL/AM.pm b/SL/AM.pm index acc5bdccc..4934d866c 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -40,6 +40,7 @@ package AM; use Carp; use Data::Dumper; use Encode; +use List::MoreUtils qw(any); use SL::DBUtils; use strict; @@ -213,8 +214,8 @@ sub save_account { # sanity check, can't have AR with AR_... if ($form->{AR} || $form->{AP} || $form->{IC}) { - for (qw(AR_amount AR_tax AR_paid AP_amount AP_tax AP_paid IC_sale IC_cogs IC_taxpart IC_income IC_expense IC_taxservice)) { - $form->error($::locale->text('It is not allowed that a summary account occurs in a drop-down menu!')) if $form->{$_}; + if (any { $form->{$_} } qw(AR_amount AR_tax AR_paid AP_amount AP_tax AP_paid IC_sale IC_cogs IC_taxpart IC_income IC_expense IC_taxservice)) { + $form->error($::locale->text('It is not allowed that a summary account occurs in a drop-down menu!')); } } @@ -2115,9 +2116,10 @@ sub get_warehouse { map { $form->{$_} = $ref->{$_} } keys %{ $ref }; $query = qq|SELECT b.*, EXISTS - (SELECT i.warehouse_id - FROM inventory i + (SELECT i.warehouse_id, p.warehouse_id + FROM inventory i, parts p WHERE i.bin_id = b.id + OR p.bin_id = b.id LIMIT 1) AS in_use FROM bin b