use SL::DB::Letter;
use SL::DB;
-__PACKAGE__->run_before('check_auth');
sub action_list_turnover {
my ($self) = @_;
$self->render('customer_vendor_turnover/letter_statistic', { layout => 0 }, letters => $letters);
}
-sub _list_articles_by_invoice {
-}
-sub _list_count_articles_by_year {
-}
-sub check_auth {
- $::auth->assert('general_ledger');
-}
1;
__END__
'Show parts' => 'Artikel anzeigen',
'Show parts longdescription (notes) in select list' => 'Langtext in Auswahlliste bei mehreren Treffern im Stammdaten-Bestand anzeigen',
'Show purchase letters report' => 'Einkaufsbriefe zeigen',
+ 'Show record tab in customer' => 'Zeige Tab Belege in den Kundenstammdaten',
+ 'Show record tab in vendor' => 'Zeige Tab Belege in den Lieferantenstammdaten',
'Show requirement spec' => 'Pflichtenheft anzeigen',
'Show requirement spec template' => 'Pflichtenheftvorlage anzeigen',
'Show sales letters report' => 'Verkaufsbrief anzeigen',
--- /dev/null
+# @tag: customer_vendor_record_extra_tab_rights
+# @description: Setzt Rechte um bei Kunden/Lieferanten einen Extratab anzeigen zu lassen, der Belege anzeigt per Default erlaubt
+# @depends: release_3_5_2
+# @locales: Show record tab in customer
+# @locales: Show record tab in vendor
+package SL::DBUpgrade2::Auth::customer_vendor_record_extra_tab_rights;
+
+use strict;
+use utf8;
+
+use parent qw(SL::DBUpgrade2::Base);
+
+use SL::DBUtils;
+
+sub run {
+ my ($self) = @_;
+
+ $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 610, 'show_extra_record_tab_customer', 'Show record tab in customer')");
+ $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES ( 611, 'show_extra_record_tab_vendor', 'Show record tab in vendor')");
+
+ my $groups = $main::auth->read_groups();
+
+ foreach my $group (values %{$groups}) {
+ $group->{rights}->{show_extra_record_tab_customer} = 1;
+ $group->{rights}->{show_extra_record_tab_vendor} = 1;
+ $main::auth->save_group($group);
+ }
+
+ return 1;
+} # end run
+
+1;
[% IF SELF.cv.id %]
<li><a href="#price_rules">[% 'Price Rules' | $T8 %]</a></li>
[% END %]
- <li><a href="[% 'controller.pl?action=CustomerVendorTurnover/list_turnover&id=' _ SELF.cv.id _ '&db=' _ FORM.db %]">[% LxERP.t8('Records') %] [%- IF SELF.open_items > 0 %] <span style="color:red;"> $</span>[% END %] [%- IF SELF.open_orders > 0 %] <span style="color:red;"> !</span>[% END %]</a></li>
+
+ [% IF SELF.cv.id %]
+ [% IF ( FORM.db == 'customer' && AUTH.assert('show_extra_record_tab_customer',1) ) %]
+ <li><a href="[% 'controller.pl?action=CustomerVendorTurnover/list_turnover&id=' _ SELF.cv.id _ '&db=' _ FORM.db %]">[% LxERP.t8('Records') %]
+ [%- IF SELF.open_items > 0 %] <span style="color:red;"> $</span>[% END %] [%- IF SELF.open_orders > 0 %] <span style="color:red;"> !</span>[% END %]</a>
+ </li>
+ [% END %]
+ [% IF ( FORM.db == 'vendor' && AUTH.assert('show_extra_record_tab_vendor',1) ) %]
+ <li><a href="[% 'controller.pl?action=CustomerVendorTurnover/list_turnover&id=' _ SELF.cv.id _ '&db=' _ FORM.db %]">[% LxERP.t8('Records') %]
+ [%- IF SELF.open_items > 0 %] <span style="color:red;"> $</span>[% END %] [%- IF SELF.open_orders > 0 %] <span style="color:red;"> !</span>[% END %]</a>
+ </li>
+ [% END %]
+ [% END %]
+
</ul>
[% PROCESS "customer_vendor/tabs/billing.html" %]