X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fvk.pl;h=c7a886feb4ea5ac6fdab22e9077abd793cda3690;hb=63a18ccadab9564ec780c5087e3be498f25f5382;hp=a6476d9f1ec8d6270c0a6ab37c7c49156f06a830;hpb=ba003bf85048f1aeb5cb1b0062291dbd1efb7854;p=kivitendo-erp.git diff --git a/bin/mozilla/vk.pl b/bin/mozilla/vk.pl index a6476d9f1..c7a886feb 100644 --- a/bin/mozilla/vk.pl +++ b/bin/mozilla/vk.pl @@ -24,7 +24,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # Sales report @@ -42,20 +43,19 @@ use Data::Dumper; require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; -require "bin/mozilla/drafts.pl"; require "bin/mozilla/reportgenerator.pl"; use strict; sub search_invoice { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger | invoice_edit'); + $main::auth->assert('ar_transactions | ap_transactions | invoice_edit'); my $form = $main::form; my %myconfig = %main::myconfig; my $locale = $main::locale; - my ($customer, $department); + my ($customer); # setup customer selection $form->all_vc(\%myconfig, "customer", "AR"); @@ -93,7 +93,7 @@ sub search_invoice { sub invoice_transactions { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger | invoice_edit'); + $main::auth->assert('ar_transactions | ap_transactions | invoice_edit'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -154,7 +154,7 @@ sub invoice_transactions { # pass hidden variables for pdf/csv export # first with l_ to determine which columns to show # then with the options for headings (such as transdatefrom, partnumber, ...) - my @hidden_variables = (qw(l_headers_mainsort l_headers_subsort l_subtotal_mainsort l_subtotal_subsort l_total l_parts l_customername l_customernumber transdatefrom transdateto decimalplaces customer customer_id department partnumber partsgroup country business description project_id customernumber salesman employee salesman_id employee_id business_id partsgroup_id mainsort subsort), + my @hidden_variables = (qw(l_headers_mainsort l_headers_subsort l_subtotal_mainsort l_subtotal_subsort l_total l_parts l_customername l_customernumber transdatefrom transdateto decimalplaces customer customer_id department_id partnumber partsgroup country business description project_id customernumber salesman employee salesman_id employee_id business_id partsgroup_id mainsort subsort), "$form->{db}number", map({ "cvar_$_->{name}" } @searchable_custom_variables), map { "l_$_" } @columns @@ -169,7 +169,7 @@ sub invoice_transactions { my %column_defs = ( 'description' => { 'text' => $locale->text('Description'), }, 'partnumber' => { 'text' => $locale->text('Part Number'), }, - 'partsgroup' => { 'text' => $locale->text('Group'), }, + 'partsgroup' => { 'text' => $locale->text('Partsgroup'), }, 'country' => { 'text' => $locale->text('Country'), }, 'business' => { 'text' => $locale->text('Customer type'), }, 'employee' => { 'text' => $locale->text('Employee'), }, @@ -211,11 +211,11 @@ sub invoice_transactions { push @options, $locale->text('Customer') . " : $form->{customer}" if $form->{customer}; push @options, $locale->text('Customer Number') . " : $form->{customernumber}" if $form->{customernumber}; # TODO: only customer id is passed - push @options, $locale->text('Department') . " : " . (split /--/, $form->{department})[0] if $form->{department}; + push @options, $locale->text('Department') . " : " . SL::DB::Department->new(id => $form->{department_id})->load->description if $form->{department_id}; push @options, $locale->text('Invoice Number') . " : $form->{invnumber}" if $form->{invnumber}; push @options, $locale->text('Invoice Date') . " : $form->{invdate}" if $form->{invdate}; push @options, $locale->text('Part Number') . " : $form->{partnumber}" if $form->{partnumber}; - push @options, $locale->text('Group') . " : " . SL::DB::PartsGroup->new(id => $form->{partsgroup_id})->load->partsgroup if $form->{partsgroup_id}; + push @options, $locale->text('Partsgroup') . " : " . SL::DB::PartsGroup->new(id => $form->{partsgroup_id})->load->partsgroup if $form->{partsgroup_id}; push @options, $locale->text('Country') . " : $form->{country}" if $form->{country}; push @options, $locale->text('Employee') . ' : ' . SL::DB::Employee->new(id => $form->{employee_id})->load->name if $form->{employee_id}; push @options, $locale->text('Salesman') . ' : ' . SL::DB::Employee->new(id => $form->{salesman_id})->load->name if $form->{salesman_id}; @@ -297,7 +297,7 @@ sub invoice_transactions { # The sellprice total can be calculated from sellprice or fxsellprice (the # value that was actually entered in the sellprice field and is always - # stored seperately). However, for fxsellprice this method only works when + # stored separately). However, for fxsellprice this method only works when # the tax is not included, because otherwise fxsellprice includes the tax # and there is no simple way to extract the tax rate of the article from # the big query.