use SL::DBUtils;
use SL::IO;
use SL::MoreCommon;
+use SL::DB::ApGl;
use SL::DB::Default;
use SL::DB::Draft;
use SL::DB::Order;
SL::DB::Manager::Draft->delete_all(where => [ id => delete($form->{draft_id}) ]);
}
+ # hook for taxkey 94
+ $self->_reverse_charge($myconfig, $form);
# safety check datev export
if ($::instance_conf->get_datev_check_on_ap_transaction) {
my $datev = SL::DATEV->new(
return 1;
}
+sub _reverse_charge {
+ my ($self, $myconfig, $form) = @_;
+
+ # check taxkey settings or return
+ my $tax = SL::DB::Manager::Tax->get_first( where => [taxkey => 94 ]);
+ return unless ref $tax eq 'SL::DB::Tax';
+
+ # delete previous bookings, if they exists (repost)
+ my $ap_gl = SL::DB::Manager::ApGl->get_first(where => [ ap_id => $form->{id} ]);
+ my $gl_id = ref $ap_gl eq 'SL::DB::ApGl' ? $ap_gl->gl_id : undef;
+
+ SL::DB::Manager::GLTransaction->delete_all(where => [ id => $gl_id ]) if $gl_id;
+ SL::DB::Manager::ApGl-> delete_all(where => [ ap_id => $form->{id} ]) if $gl_id;
+ SL::DB::Manager::RecordLink-> delete_all(where => [ from_table => 'ap', to_table => 'gl', from_id => $form->{id} ]);
+
+ # gl booking
+ my ($credit, $debit);
+ $credit = SL::DB::Manager::Chart->find_by(id => $tax->chart_id);
+ $debit = SL::DB::Manager::Chart->find_by(id => $tax->reverse_charge_chart_id);
+
+ croak("No such Chart ID" . $tax->chart_id) unless ref $credit eq 'SL::DB::Chart';
+ croak("No such Chart ID" . $tax->reverse_chart_id) unless ref $debit eq 'SL::DB::Chart';
+
+ my ($i, $current_transaction);
+
+ for $i (1 .. $form->{rowcount}) {
+ next unless $form->{"taxkey_$i"} == 94;
+
+ my ($tmpnetamount, $tmptaxamount) = $form->calculate_tax($form->{"amount_$i"}, 0.19, $form->{taxincluded}, 2);
+ $current_transaction = SL::DB::GLTransaction->new(
+ employee_id => $form->{employee_id},
+ transdate => $form->{transdate},
+ description => $form->{notes} || $form->{invnumber},
+ reference => $form->{invnumber},
+ department_id => $form->{department_id} ? $form->{department_id} : undef,
+ imported => 0, # not imported
+ taxincluded => 0,
+ )->add_chart_booking(
+ chart => $tmptaxamount < 0 ? $credit : $debit,
+ credit => abs($tmptaxamount),
+ source => "Reverse Charge for " . $form->{invnumber},
+ )->add_chart_booking(
+ chart => $tmptaxamount < 0 ? $debit : $credit,
+ debit => abs($tmptaxamount),
+ source => "Reverse Charge for " . $form->{invnumber},
+ )->post;
+ # add a stable link from ap to gl
+ my %props_gl = (
+ ap_id => $form->{id},
+ gl_id => $current_transaction->id,
+ );
+ SL::DB::ApGl->new(%props_gl)->save;
+ # Record a record link from ap to gl
+ my %props_rl = (
+ from_table => 'ap',
+ from_id => $form->{id},
+ to_table => 'gl',
+ to_id => $current_transaction->id,
+ );
+ SL::DB::RecordLink->new(%props_rl)->save;
+ }
+}
+
sub delete_transaction {
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
SL::DB->client->with_transaction(sub {
+
+ # if tax 94 reverse charge, clear all GL bookings and links
+ my $ap_gl = SL::DB::Manager::ApGl->get_first(where => [ ap_id => $form->{id} ]);
+ my $gl_id = ref $ap_gl eq 'SL::DB::ApGl' ? $ap_gl->gl_id : undef;
+
+ SL::DB::Manager::GLTransaction->delete_all(where => [ id => $gl_id ]) if $gl_id;
+ SL::DB::Manager::ApGl-> delete_all(where => [ ap_id => $form->{id} ]) if $gl_id;
+ SL::DB::Manager::RecordLink-> delete_all(where => [ from_table => 'ap', to_table => 'gl', from_id => $form->{id} ]);
+ # done gl delete for tax 94 case
+
+ # begin ap delete
my $query = qq|DELETE FROM ap WHERE id = ?|;
do_query($form, SL::DB->client->dbh, $query, $form->{id});
1;
# Permissions:
# - Always return invoices & AP transactions for projects the employee has "view invoices" permissions for, no matter what the other rules say.
# - Exclude AP transactions if no permissions for them exist.
- # - Limit to own invoices unless may edit all invoices.
- # - If may edit all, allow filtering by employee.
+ # - Limit to own invoices unless may edit all invoices or view invoices is allowed.
+ # - If may edit all or view invoices is allowed, allow filtering by employee.
my (@permission_where, @permission_values);
- if ($::auth->assert('vendor_invoice_edit', 1)) {
+ if ($::auth->assert('vendor_invoice_edit', 1) || $::auth->assert('purchase_invoice_view', 1)) {
if (!$::auth->assert('show_ap_transactions', 1)) {
push @permission_where, "NOT invoice = 'f'"; # remove ap transactions from Purchase -> Reports -> Invoices
}
- if (!$::auth->assert('purchase_all_edit', 1)) {
+ if (!$::auth->assert('purchase_all_edit', 1) && !$::auth->assert('purchase_invoice_view', 1)) {
# only show own invoices
push @permission_where, "a.employee_id = ?";
push @permission_values, SL::DB::Manager::Employee->current->id;
}
}
- if (@permission_where || !$::auth->assert('vendor_invoice_edit', 1)) {
+ if (@permission_where || (!$::auth->assert('vendor_invoice_edit', 1) && !$::auth->assert('purchase_invoice_view', 1))) {
my $permission_where_str = @permission_where ? "OR (" . join(" AND ", map { "($_)" } @permission_where) . ")" : "";
$where .= qq|
AND ( (a.globalproject_id IN (
__PACKAGE__->run_before('check_auth',
except => [ qw(update_stock_information) ]);
+ __PACKAGE__->run_before('check_auth_for_edit',
+ except => [ qw(update_stock_information edit show_customer_vendor_details_dialog price_popup stock_in_out_dialog load_second_rows) ]);
+
__PACKAGE__->run_before('get_unalterable_data',
only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_ap_transaction
print send_email) ]);
$::form->{id} = $self->order->id; # this is used in SL::Mailer to create a linked record to the mail
$::form->send_email(\%::myconfig, 'pdf');
- # internal notes
- my $intnotes = $self->order->intnotes;
- $intnotes .= "\n\n" if $self->order->intnotes;
- $intnotes .= t8('[email]') . "\n";
- $intnotes .= t8('Date') . ": " . $::locale->format_date_object(DateTime->now_local, precision => 'seconds') . "\n";
- $intnotes .= t8('To (email)') . ": " . $::form->{email} . "\n";
- $intnotes .= t8('Cc') . ": " . $::form->{cc} . "\n" if $::form->{cc};
- $intnotes .= t8('Bcc') . ": " . $::form->{bcc} . "\n" if $::form->{bcc};
- $intnotes .= t8('Subject') . ": " . $::form->{subject} . "\n\n";
- $intnotes .= t8('Message') . ": " . $::form->{message};
-
- $self->order->update_attributes(intnotes => $intnotes);
+ # internal notes unless no email journal
+ unless ($::instance_conf->get_email_journal) {
+
+ my $intnotes = $self->order->intnotes;
+ $intnotes .= "\n\n" if $self->order->intnotes;
+ $intnotes .= t8('[email]') . "\n";
+ $intnotes .= t8('Date') . ": " . $::locale->format_date_object(DateTime->now_local, precision => 'seconds') . "\n";
+ $intnotes .= t8('To (email)') . ": " . $::form->{email} . "\n";
+ $intnotes .= t8('Cc') . ": " . $::form->{cc} . "\n" if $::form->{cc};
+ $intnotes .= t8('Bcc') . ": " . $::form->{bcc} . "\n" if $::form->{bcc};
+ $intnotes .= t8('Subject') . ": " . $::form->{subject} . "\n\n";
+ $intnotes .= t8('Message') . ": " . $::form->{message};
+
+ $self->order->update_attributes(intnotes => $intnotes);
+ }
$self->save_history('MAILED');
sub check_auth {
my ($self) = @_;
- $::auth->assert($self->type_data->access || 'DOES_NOT_EXIST');
+ $::auth->assert($self->type_data->access('view') || 'DOES_NOT_EXIST');
+ }
+
+ sub check_auth_for_edit {
+ my ($self) = @_;
+
+ $::auth->assert($self->type_data->access('edit') || 'DOES_NOT_EXIST');
}
# build the selection box for contacts
my ($self, %params) = @_;
my $deletion_allowed = $self->type_data->show_menu("delete");
+ my $may_edit_create = $::auth->assert($self->type_data->access('edit') || 'DOES_NOT_EXIST', 1);
for my $bar ($::request->layout->get('actionbar')) {
$bar->add(
combobox => [
action => [
t8('Save'),
- call => [ 'kivi.DeliveryOrder.save', 'save', $::instance_conf->get_order_warn_duplicate_parts,
- $::instance_conf->get_order_warn_no_deliverydate,
- ],
+ call => [ 'kivi.DeliveryOrder.save', 'save', $::instance_conf->get_order_warn_duplicate_parts,
+ $::instance_conf->get_order_warn_no_deliverydate,
+ ],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save as new'),
- call => [ 'kivi.DeliveryOrder.save', 'save_as_new', $::instance_conf->get_order_warn_duplicate_parts ],
- disabled => $self->type eq 'supplier_delivery_order' ? t8('Need a workflow for Supplier Delivery Order')
- : !$self->order->id ? t8('This object has not been saved yet.')
- : undef,
+ call => [ 'kivi.DeliveryOrder.save', 'save_as_new', $::instance_conf->get_order_warn_duplicate_parts ],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : $self->type eq 'supplier_delivery_order' ? t8('Need a workflow for Supplier Delivery Order')
+ : !$self->order->id ? t8('This object has not been saved yet.')
+ : undef,
],
], # end of combobox "Save"
t8('Save and Quotation'),
submit => [ '#order_form', { action => "DeliveryOrder/sales_quotation" } ],
only_if => $self->type_data->show_menu("save_and_quotation"),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and RFQ'),
submit => [ '#order_form', { action => "DeliveryOrder/request_for_quotation" } ],
only_if => $self->type_data->show_menu("save_and_rfq"),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and Sales Order'),
submit => [ '#order_form', { action => "DeliveryOrder/sales_order" } ],
only_if => $self->type_data->show_menu("save_and_sales_order"),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and Purchase Order'),
- call => [ 'kivi.DeliveryOrder.purchase_order_check_for_direct_delivery' ],
+ call => [ 'kivi.DeliveryOrder.purchase_order_check_for_direct_delivery' ],
only_if => $self->type_data->show_menu("save_and_purchase_order"),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and Delivery Order'),
- call => [ 'kivi.DeliveryOrder.save', 'save_and_delivery_order', $::instance_conf->get_order_warn_duplicate_parts,
- $::instance_conf->get_order_warn_no_deliverydate,
- ],
+ call => [ 'kivi.DeliveryOrder.save', 'save_and_delivery_order', $::instance_conf->get_order_warn_duplicate_parts,
+ $::instance_conf->get_order_warn_no_deliverydate,
+ ],
only_if => $self->type_data->show_menu("save_and_delivery_order"),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and Invoice'),
- call => [ 'kivi.DeliveryOrder.save', 'save_and_invoice', $::instance_conf->get_order_warn_duplicate_parts ],
+ call => [ 'kivi.DeliveryOrder.save', 'save_and_invoice', $::instance_conf->get_order_warn_duplicate_parts ],
only_if => $self->type_data->show_menu("save_and_invoice"),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and AP Transaction'),
- call => [ 'kivi.DeliveryOrder.save', 'save_and_ap_transaction', $::instance_conf->get_order_warn_duplicate_parts ],
+ call => [ 'kivi.DeliveryOrder.save', 'save_and_ap_transaction', $::instance_conf->get_order_warn_duplicate_parts ],
only_if => $self->type_data->show_menu("save_and_ap_transaction"),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
], # end of combobox "Workflow"
],
action => [
t8('Save and preview PDF'),
- call => [ 'kivi.DeliveryOrder.save', 'preview_pdf', $::instance_conf->get_order_warn_duplicate_parts,
- $::instance_conf->get_order_warn_no_deliverydate,
- ],
+ call => [ 'kivi.DeliveryOrder.save', 'preview_pdf', $::instance_conf->get_order_warn_duplicate_parts,
+ $::instance_conf->get_order_warn_no_deliverydate,
+ ],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and print'),
- call => [ 'kivi.DeliveryOrder.show_print_options', $::instance_conf->get_order_warn_duplicate_parts,
- $::instance_conf->get_order_warn_no_deliverydate,
- ],
+ call => [ 'kivi.DeliveryOrder.show_print_options', $::instance_conf->get_order_warn_duplicate_parts,
+ $::instance_conf->get_order_warn_no_deliverydate,
+ ],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and E-mail'),
- id => 'save_and_email_action',
- call => [ 'kivi.DeliveryOrder.save', 'save_and_show_email_dialog', $::instance_conf->get_order_warn_duplicate_parts,
- $::instance_conf->get_order_warn_no_deliverydate,
- ],
- disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
+ id => 'save_and_email_action',
+ call => [ 'kivi.DeliveryOrder.save', 'save_and_show_email_dialog', $::instance_conf->get_order_warn_duplicate_parts,
+ $::instance_conf->get_order_warn_no_deliverydate,
+ ],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : !$self->order->id ? t8('This object has not been saved yet.')
+ : undef,
],
action => [
t8('Download attachments of all parts'),
call => [ 'kivi.File.downloadOrderitemsFiles', $::form->{type}, $::form->{id} ],
- disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : !$self->order->id ? t8('This object has not been saved yet.')
+ : undef,
only_if => $::instance_conf->get_doc_storage,
],
], # end of combobox "Export"
id => 'delete_action',
call => [ 'kivi.DeliveryOrder.delete_order' ],
confirm => $::locale->text('Do you really want to delete this object?'),
- disabled => !$self->order->id ? t8('This object has not been saved yet.') :
- $self->order->delivered ? t8('The parts for this order have already been transferred') : undef,
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : !$self->order->id ? t8('This object has not been saved yet.')
+ : $self->order->delivered ? t8('The parts for this order have already been transferred')
+ : undef,
only_if => $self->type_data->show_menu("delete"),
],
combobox => [
action => [
t8('Transfer out'),
- id => 'transfer_out_action',
- call => [ 'kivi.DeliveryOrder.save', 'transfer_stock' ],
- disabled => !$self->order->id ? t8('This object has not been saved yet.') :
- $self->order->delivered ? t8('The parts for this order have already been transferred') : undef,
- only_if => $self->type_data->properties('transfer') eq 'out',
+ id => 'transfer_out_action',
+ call => [ 'kivi.DeliveryOrder.save', 'transfer_stock' ],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : !$self->order->id ? t8('This object has not been saved yet.')
+ : $self->order->delivered ? t8('The parts for this order have already been transferred')
+ : undef,
+ only_if => $self->type_data->properties('transfer') eq 'out',
confirm => t8('Do you really want to transfer the stock and set this order to delivered?'),
],
action => [
t8('Transfer in'),
- id => 'transfer_in_action',
- call => [ 'kivi.DeliveryOrder.save', 'transfer_stock' ],
- disabled => !$self->order->id ? t8('This object has not been saved yet.') :
- $self->order->delivered ? t8('The parts for this order have already been transferred') : undef,
- only_if => $self->type_data->properties('transfer') eq 'in',
+ id => 'transfer_in_action',
+ call => [ 'kivi.DeliveryOrder.save', 'transfer_stock' ],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : !$self->order->id ? t8('This object has not been saved yet.')
+ : $self->order->delivered ? t8('The parts for this order have already been transferred')
+ : undef,
+ only_if => $self->type_data->properties('transfer') eq 'in',
confirm => t8('Do you really want to transfer the stock and set this order to delivered?'),
],
],
# safety
__PACKAGE__->run_before('check_auth');
+ __PACKAGE__->run_before('check_auth_for_edit',
+ except => [ qw(edit show_customer_vendor_details_dialog price_popup load_second_rows) ]);
+
__PACKAGE__->run_before('recalc',
only => [ qw(save save_as_new save_and_delivery_order save_and_invoice save_and_invoice_for_advance_payment save_and_final_invoice save_and_ap_transaction
print send_email) ]);
$::form->{id} = $self->order->id; # this is used in SL::Mailer to create a linked record to the mail
$::form->send_email(\%::myconfig, $::form->{print_options}->{format});
- # internal notes
- my $intnotes = $self->order->intnotes;
- $intnotes .= "\n\n" if $self->order->intnotes;
- $intnotes .= t8('[email]') . "\n";
- $intnotes .= t8('Date') . ": " . $::locale->format_date_object(DateTime->now_local, precision => 'seconds') . "\n";
- $intnotes .= t8('To (email)') . ": " . $::form->{email} . "\n";
- $intnotes .= t8('Cc') . ": " . $::form->{cc} . "\n" if $::form->{cc};
- $intnotes .= t8('Bcc') . ": " . $::form->{bcc} . "\n" if $::form->{bcc};
- $intnotes .= t8('Subject') . ": " . $::form->{subject} . "\n\n";
- $intnotes .= t8('Message') . ": " . SL::HTML::Util->strip($::form->{message});
-
- $self->order->update_attributes(intnotes => $intnotes);
+ # internal notes unless no email journal
+ unless ($::instance_conf->get_email_journal) {
+ my $intnotes = $self->order->intnotes;
+ $intnotes .= "\n\n" if $self->order->intnotes;
+ $intnotes .= t8('[email]') . "\n";
+ $intnotes .= t8('Date') . ": " . $::locale->format_date_object(DateTime->now_local, precision => 'seconds') . "\n";
+ $intnotes .= t8('To (email)') . ": " . $::form->{email} . "\n";
+ $intnotes .= t8('Cc') . ": " . $::form->{cc} . "\n" if $::form->{cc};
+ $intnotes .= t8('Bcc') . ": " . $::form->{bcc} . "\n" if $::form->{bcc};
+ $intnotes .= t8('Subject') . ": " . $::form->{subject} . "\n\n";
+ $intnotes .= t8('Message') . ": " . SL::HTML::Util->strip($::form->{message});
+
+ $self->order->update_attributes(intnotes => $intnotes);
+ }
$self->save_history('MAILED');
sub check_auth {
my ($self) = @_;
+ my $right_for = { map { $_ => $_.'_edit' . ' | ' . $_.'_view' } @{$self->valid_types} };
+
+ my $right = $right_for->{ $self->type };
+ $right ||= 'DOES_NOT_EXIST';
+
+ $::auth->assert($right);
+ }
+
+ sub check_auth_for_edit {
+ my ($self) = @_;
+
my $right_for = { map { $_ => $_.'_edit' } @{$self->valid_types} };
my $right = $right_for->{ $self->type };
$has_final_invoice = any {'SL::DB::Invoice' eq ref $_ && "final_invoice" eq $_->type} @$lr;
}
+ my $right_for = { map { $_ => $_.'_edit' } @{$self->valid_types} };
+ my $right = $right_for->{ $self->type };
+ $right ||= 'DOES_NOT_EXIST';
+ my $may_edit_create = $::auth->assert($right, 'may fail');
+
for my $bar ($::request->layout->get('actionbar')) {
$bar->add(
combobox => [
checks => [ 'kivi.Order.check_save_active_periodic_invoices', ['kivi.validate_form','#order_form'],
@req_trans_cost_art, @req_cusordnumber,
],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save as new'),
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
@req_trans_cost_art, @req_cusordnumber,
],
- disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : !$self->order->id ? t8('This object has not been saved yet.')
+ : undef,
],
], # end of combobox "Save"
submit => [ '#order_form', { action => "Order/sales_quotation" } ],
checks => [ @req_trans_cost_art, @req_cusordnumber ],
only_if => (any { $self->type eq $_ } (sales_order_type())),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and RFQ'),
submit => [ '#order_form', { action => "Order/request_for_quotation" } ],
only_if => (any { $self->type eq $_ } (purchase_order_type())),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and Sales Order'),
submit => [ '#order_form', { action => "Order/sales_order" } ],
checks => [ @req_trans_cost_art ],
only_if => (any { $self->type eq $_ } (sales_quotation_type(), purchase_order_type())),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and Purchase Order'),
call => [ 'kivi.Order.purchase_order_check_for_direct_delivery' ],
checks => [ @req_trans_cost_art, @req_cusordnumber ],
only_if => (any { $self->type eq $_ } (sales_order_type(), request_quotation_type())),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and Delivery Order'),
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
@req_trans_cost_art, @req_cusordnumber,
],
- only_if => (any { $self->type eq $_ } (sales_order_type(), purchase_order_type()))
+ only_if => (any { $self->type eq $_ } (sales_order_type(), purchase_order_type())),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and Supplier Delivery Order'),
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
@req_trans_cost_art, @req_cusordnumber,
],
- only_if => (any { $self->type eq $_ } (purchase_order_type()))
+ only_if => (any { $self->type eq $_ } (purchase_order_type())),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and Invoice'),
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
@req_trans_cost_art, @req_cusordnumber,
],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
($has_invoice_for_advance_payment ? t8('Save and Further Invoice for Advance Payment') : t8('Save and Invoice for Advance Payment')),
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
@req_trans_cost_art, @req_cusordnumber,
],
- disabled => $has_final_invoice ? t8('This order has already a final invoice.')
- : undef,
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : $has_final_invoice ? t8('This order has already a final invoice.')
+ : undef,
only_if => (any { $self->type eq $_ } (sales_order_type())),
],
action => [
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
@req_trans_cost_art, @req_cusordnumber,
],
- disabled => $has_final_invoice ? t8('This order has already a final invoice.')
- : undef,
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : $has_final_invoice ? t8('This order has already a final invoice.')
+ : undef,
only_if => (any { $self->type eq $_ } (sales_order_type())) && $has_invoice_for_advance_payment,
],
action => [
t8('Save and AP Transaction'),
call => [ 'kivi.Order.save', 'save_and_ap_transaction', $::instance_conf->get_order_warn_duplicate_parts ],
- only_if => (any { $self->type eq $_ } (purchase_order_type()))
+ only_if => (any { $self->type eq $_ } (purchase_order_type())),
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
], # end of combobox "Workflow"
],
action => [
t8('Save and preview PDF'),
- call => [ 'kivi.Order.save', 'preview_pdf', $::instance_conf->get_order_warn_duplicate_parts,
- $::instance_conf->get_order_warn_no_deliverydate,
- ],
- checks => [ @req_trans_cost_art, @req_cusordnumber ],
+ call => [ 'kivi.Order.save', 'preview_pdf', $::instance_conf->get_order_warn_duplicate_parts,
+ $::instance_conf->get_order_warn_no_deliverydate,
+ ],
+ checks => [ @req_trans_cost_art, @req_cusordnumber ],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and print'),
- call => [ 'kivi.Order.show_print_options', $::instance_conf->get_order_warn_duplicate_parts,
- $::instance_conf->get_order_warn_no_deliverydate,
- ],
- checks => [ @req_trans_cost_art, @req_cusordnumber ],
+ call => [ 'kivi.Order.show_print_options', $::instance_conf->get_order_warn_duplicate_parts,
+ $::instance_conf->get_order_warn_no_deliverydate,
+ ],
+ checks => [ @req_trans_cost_art, @req_cusordnumber ],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
],
action => [
t8('Save and E-mail'),
- id => 'save_and_email_action',
- call => [ 'kivi.Order.save', 'save_and_show_email_dialog', $::instance_conf->get_order_warn_duplicate_parts,
- $::instance_conf->get_order_warn_no_deliverydate,
- ],
- disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
+ id => 'save_and_email_action',
+ call => [ 'kivi.Order.save', 'save_and_show_email_dialog', $::instance_conf->get_order_warn_duplicate_parts,
+ $::instance_conf->get_order_warn_no_deliverydate,
+ ],
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : !$self->order->id ? t8('This object has not been saved yet.')
+ : undef,
],
action => [
t8('Download attachments of all parts'),
t8('Delete'),
call => [ 'kivi.Order.delete_order' ],
confirm => $::locale->text('Do you really want to delete this object?'),
- disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
+ disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
+ : !$self->order->id ? t8('This object has not been saved yet.')
+ : undef,
only_if => $deletion_allowed,
],
- combobox => [
- action => [
- t8('more')
- ],
- action => [
- t8('History'),
- call => [ 'set_history_window', $self->order->id, 'id' ],
- disabled => !$self->order->id ? t8('This record has not been saved yet.') : undef,
- ],
- action => [
- t8('Follow-Up'),
- call => [ 'kivi.Order.follow_up_window' ],
- disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
- only_if => $::auth->assert('productivity', 1),
- ],
- ], # end of combobox "more"
);
}
}
'Cancel Accounts Payables Transaction' => 'Kreditorenbuchung stornieren',
'Cancel Accounts Receivables Transaction' => 'Debitorenbuchung stornieren',
'Cancelling is disallowed. Either undo or balance the current payments until the open amount matches the invoice amount' => 'Storno verboten, da Zahlungen zum Beleg vorhanden sind. Entweder die Zahlungen löschen oder mit umgekehrten Vorzeichen ausbuchen, sodass der offene Betrag dem Rechnungsbetrag entspricht.',
+ 'Cannot Post AP transaction with tax included!' => 'Kann diesen kreditorischen Beleg nicht mit "Steuer im Preis inbegriffen" verbuchen!',
'Cannot add Booking, reason: #1 DB: #2 ' => 'Kann die Buchung nicht hinzufügen, Grund: #1 DB: #2',
'Cannot allocate parts.' => 'Es sind nicht genügend Artikel vorhanden',
'Cannot change transaction in a closed period!' => 'In einem bereits abgeschlossenen Zeitraum kann keine Buchung verändert werden!',
'This sales order has an active configuration for periodic invoices. If you save then all subsequently created invoices will contain those changes as well, but not those that have already been created. Do you want to continue?' => 'Dieser Auftrag besitzt eine aktive Konfiguration für wiederkehrende Rechnungen. Wenn Sie jetzt speichern, so werden alle zukünftig hieraus erzeugten Rechnungen die Änderungen enthalten, nicht aber die bereits erzeugten Rechnungen. Möchten Sie speichern?',
'This status output will be refreshed every five seconds.' => 'Diese Statusausgabe wird alle fünf Sekunden aktualisiert.',
'This transaction has to be split into several transactions manually.' => 'Diese Buchung muss manuell in mehrere Buchungen aufgeteilt werden.',
+ 'This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.' => 'Diese Buchung ist mit einer Kreditorenbuchung verknüpft. Bitte Löschen oder Ändern Sie die Kreditorenbuchung nötigenfalls.',
'This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.' => 'Ein oder mehrere Zahlungen des Belegs sind über das Verbuchen von Kontoauszüge erstellt worden, falls notwendig kann eine Neuverbuchung über Zahlungsverkehr -> Bericht Bankbewegung möglich gemacht werden.',
+ 'This transaction is linked with a gl transaction. Please delete the ap transaction booking if needed.' => 'Diese Buchung ist mit einer Dialogbuchung verknüpft. Bitte Löschen oder Ändern Sie diese Kreditorenbuchung nötigenfalls.',
'This update will change the nature the onhand of goods is tracked.' => 'Dieses update ändert die Art und Weise wie Lagermengen gezält werden.',
'This user is a member in the following groups' => 'Dieser Benutzer ist Mitglied in den folgenden Gruppen',
'This user will have access to the following clients' => 'Dieser Benutzer wird Zugriff auf die folgenden Mandanten haben',
'Version actions' => 'Aktionen für Versionen',
'Version number' => 'Versionsnummer',
'Versions' => 'Versionen',
+ 'View RFQs' => 'Lieferantenanfragen ansehen',
'View SEPA export' => 'SEPA-Export-Details ansehen',
'View background job execution result' => 'Verlauf der Hintergrund-Job-Ausführungen anzeigen',
+ 'View purchase delivery orders' => 'Einkaufslieferscheine ansehen',
+ 'View purchase invoices' => 'Einkaufsrechungen ansehen',
+ 'View purchase orders' => 'Lieferantenaufträge ansehen',
'View record links from Sales Order' => 'Verknüpfte Belege immer vom Verkaufsauftrag ansehen',
+ 'View sales delivery orders' => 'Verkaufslieferscheine ansehen',
+ 'View sales invoices and credit notes' => 'Rechnungen und Gutschriften ansehen',
+ 'View sales orders' => 'Auftragsbestätigungen ansehen',
+ 'View sales quotations' => 'Angebote ansehen',
'View sent email' => 'Verschickte E-Mail anzeigen',
'View warehouse content' => 'Lagerbestand ansehen',
'View/edit all employees purchase documents' => 'Bearbeiten/ansehen der Einkaufsdokumente aller Mitarbeiter',
'Cancel Accounts Payables Transaction' => '',
'Cancel Accounts Receivables Transaction' => '',
'Cancelling is disallowed. Either undo or balance the current payments until the open amount matches the invoice amount' => '',
+ 'Cannot Post AP transaction with tax included!' => '',
'Cannot add Booking, reason: #1 DB: #2 ' => '',
'Cannot allocate parts.' => '',
'Cannot change transaction in a closed period!' => '',
'This sales order has an active configuration for periodic invoices. If you save then all subsequently created invoices will contain those changes as well, but not those that have already been created. Do you want to continue?' => '',
'This status output will be refreshed every five seconds.' => '',
'This transaction has to be split into several transactions manually.' => '',
+ 'This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.' => '',
'This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.' => '',
+ 'This transaction is linked with a gl transaction. Please delete the ap transaction booking if needed.' => '',
'This update will change the nature the onhand of goods is tracked.' => '',
'This user is a member in the following groups' => '',
'This user will have access to the following clients' => '',
'Version actions' => '',
'Version number' => '',
'Versions' => '',
+ 'View RFQs' => '',
'View SEPA export' => '',
'View background job execution result' => '',
+ 'View purchase delivery orders' => '',
+ 'View purchase invoices' => '',
+ 'View purchase orders' => '',
'View record links from Sales Order' => '',
+ 'View sales delivery orders' => '',
+ 'View sales invoices and credit notes' => '',
+ 'View sales orders' => '',
+ 'View sales quotations' => '',
'View sent email' => '',
'View warehouse content' => '',
'View/edit all employees purchase documents' => '',