sub _transaction {
my ($self, $script) = @_;
- $::auth->assert('general_ledger | invoice_edit | vendor_invoice_edit | ' .
+ $::auth->assert('gl_transactions | ap_transactions | ar_transactions'.
+ '| invoice_edit | vendor_invoice_edit | ' .
' request_quotation_edit | sales_quotation_edit | sales_order_edit | purchase_order_edit');
$self->_save();
sub action_save_and_ar_transaction {
my ($self) = @_;
- $main::auth->assert('general_ledger');
+ $main::auth->assert('ar_transactions');
$self->_transaction('ar.pl');
}
sub action_save_and_ap_transaction {
my ($self) = @_;
- $main::auth->assert('general_ledger');
+ $main::auth->assert('ap_transactions');
$self->_transaction('ap.pl');
}
$self->{all_delivery_terms} = SL::DB::Manager::DeliveryTerm->get_all();
- $self->{all_pricegroups} = SL::DB::Manager::Pricegroup->get_all();
+ if ($self->{cv}->is_customer) {
+ $self->{all_pricegroups} = SL::DB::Manager::Pricegroup->get_all_sorted(query => [ or => [ id => $self->{cv}->pricegroup_id, obsolete => 0 ] ]);
+ }
$query =
'SELECT DISTINCT(cp_abteilung) AS department