sub action_edit {
my ($self, %params) = @_;
+ $self->{posting_options} = [ { title => $::locale->text("never"), value => 0 },
+ { title => $::locale->text("every time"), value => 1 },
+ { title => $::locale->text("on the same day"), value => 2 }, ];
$self->{payment_options} = [ { title => $::locale->text("never"), value => 0 },
{ title => $::locale->text("every time"), value => 1 },
{ title => $::locale->text("on the same day"), value => 2 }, ];
$self->{profit_options} = [ { title => $::locale->text("balance"), value => "balance" },
{ title => $::locale->text("income"), value => "income" }, ];
+ map { $self->{$_} = SL::DB::Default->get->$_ } qw(is_changeable ir_changeable ar_changeable ap_changeable gl_changeable);
+
$self->{payments_changeable} = SL::DB::Default->get->payments_changeable;
map { $self->{$_} = SL::DB::Default->get->$_ } qw(accounting_method inventory_system profit_determination);
sub action_save {
my ($self, %params) = @_;
+ map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(is_changeable ir_changeable ar_changeable ap_changeable gl_changeable);
+
SL::DB::Default->get->update_attributes('payments_changeable' => $::form->{payments_changeable});
map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(accounting_method inventory_system profit_determination);
datev_check_on_ar_transaction => { type => 'boolean', default => 'true' },
datev_check_on_ap_transaction => { type => 'boolean', default => 'true' },
datev_check_on_gl_transaction => { type => 'boolean', default => 'true' },
+ is_changeable => { type => 'integer', default => 2, not_null => 1 },
+ ir_changeable => { type => 'integer', default => 2, not_null => 1 },
+ ar_changeable => { type => 'integer', default => 2, not_null => 1 },
+ ap_changeable => { type => 'integer', default => 2, not_null => 1 },
+ gl_changeable => { type => 'integer', default => 2, not_null => 1 },
],
primary_key_columns => [ 'id' ],
return $self->{data}->{profit_determination};
}
+sub get_is_changeable {
+ my ($self) = @_;
+ return $self->{data}->{is_changeable};
+}
+
+sub get_ir_changeable {
+ my ($self) = @_;
+ return $self->{data}->{ir_changeable};
+}
+
+sub get_ar_changeable {
+ my ($self) = @_;
+ return $self->{data}->{ar_changeable};
+}
+
+sub get_ap_changeable {
+ my ($self) = @_;
+ return $self->{data}->{ap_changeable};
+}
+
+sub get_gl_changeable {
+ my ($self) = @_;
+ return $self->{data}->{gl_changeable};
+}
+
sub get_datev_check_on_sales_invoice {
my ($self) = @_;
return $self->{data}->{datev_check_on_sales_invoice};
Returns the default profit determination method, balance or income
+
+=item C<get_is_changeable>
+
+=item C<get_ir_changeable>
+
+=item C<get_ar_changeable>
+
+=item C<get_ap_changeable>
+
+=item C<get_gl_changeable>
+
+Returns if and when these record types are changeable or deleteable after
+posting. 0 means never, 1 means always and 2 means on the same day.
+
=item C<get_datev_check_on_sales_invoice>
Returns true if datev check should be performed on sales invoices
}
my $readonly = ($form->{id}) ? "readonly" : "";
- $form->{radier} = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
+ $form->{radier} = ($::instance_conf->get_ap_changeable == 2)
+ ? ($form->current_date(\%myconfig) eq $form->{gldate})
+ : ($::instance_conf->get_ap_changeable == 1);
$readonly = ($form->{radier}) ? "" : $readonly;
$form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'sell');
#/show history button js
$readonly = ($form->{id}) ? "readonly" : "";
- $form->{radier} = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
+ $form->{radier} = ($::instance_conf->get_ar_changeable == 2)
+ ? ($form->current_date(\%myconfig) eq $form->{gldate})
+ : ($::instance_conf->get_ar_changeable == 1);
$readonly = ($form->{radier}) ? "" : $readonly;
# set option selected
$follow_ups_due = sum map { $_->{due} * 1 } @{ $follow_ups || [] };
}
- my $radieren = $::form->current_date(\%::myconfig) eq $::form->{gldate};
+ my $radieren = ($::instance_conf->get_gl_changeable == 2)
+ ? ($::form->current_date(\%::myconfig) eq $::form->{gldate})
+ : ($::instance_conf->get_gl_changeable == 1);
print $::form->parse_html_template('gl/form_footer', {
radieren => $radieren,
totalpaid => $totalpaid,
paid_missing => $form->{invtotal} - $totalpaid,
show_storno => $form->{id} && !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ap") && !$totalpaid,
- show_delete => ($form->current_date(\%myconfig) eq $form->{gldate}),
+ show_delete => ($::instance_conf->get_ir_changeable == 2)
+ ? ($form->current_date(\%myconfig) eq $form->{gldate})
+ : ($::instance_conf->get_ir_changeable == 1),
});
##print $form->parse_html_template('ir/_payments'); # parser
##print $form->parse_html_template('webdav/_list'); # parser
paid_missing => $form->{invtotal} - $totalpaid,
print_options => print_options(inline => 1),
show_storno => $form->{id} && !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && !$totalpaid,
- show_delete => ($form->current_date(\%myconfig) eq $form->{gldate}),
+ show_delete => ($::instance_conf->get_is_changeable == 2)
+ ? ($form->current_date(\%myconfig) eq $form->{gldate})
+ : ($::instance_conf->get_is_changeable == 1),
});
##print $form->parse_html_template('is/_payments'); # parser
##print $form->parse_html_template('webdav/_list'); # parser
'AP Transaction Storno (one letter abbreviation)' => 'S',
'AP Transaction with Storno (abbreviation)' => 'K(S)',
'AP Transactions' => 'Kreditorenbuchungen',
+ 'AP transactions changeable' => 'Änderbarkeit von Kreditorenbuchungen',
'AP transactions with sales taxkeys and/or AR transactions with input taxkeys' => 'Kreditorenbuchungen mit Umsatzsteuer-Steuerschlüsseln und/oder Debitorenbuchungen mit Vorsteuer-Steuerschlüsseln',
'AR' => 'Verkauf',
'AR Aging' => 'Offene Forderungen',
'AR Transaction' => 'Debitorenbuchung',
'AR Transaction (abbreviation)' => 'D',
'AR Transactions' => 'Debitorenbuchungen',
+ 'AR transactions changeable' => 'Änderbarkeit von Debitorenbuchungen',
'ASSETS' => 'AKTIVA',
'ATTENTION! If you enabled this feature you can not simply turn it off again without taking care that best_before fields are emptied in the database.' => 'ACHTUNG! Wenn Sie diese Einstellung aktivieren, dann können Sie sie später nicht ohne Weiteres deaktivieren, ohne dafür zu sorgen, dass die Felder der Mindeshaltbarkeitsdaten in der Datenbank leer gemacht werden.',
'ATTENTION! You can not simply change it from periodic to perpetual once you started posting.' => 'ACHTUNG! Es kann nicht ohne Weiteres im laufenden Betrieb von der Aufwandsmethode zur Bestandsmethode gewechselt werden.',
'Full access to all functions' => 'Vollzugriff auf alle Funktionen',
'Fwd' => 'Vorwärts',
'GL Transaction' => 'Dialogbuchung',
+ 'GL transactions changeable' => 'Änderbarkeit von Dialogbuchungen',
'Gegenkonto' => 'Gegenkonto',
'Gender' => 'Geschlecht',
'General Ledger' => 'Finanzbuchhaltung',
'Purchase Prices' => 'Einkaufspreise',
'Purchase delivery order' => 'Lieferschein (Einkauf)',
'Purchase invoices' => 'Einkaufsrechnungen',
+ 'Purchase invoices changeable' => 'Änderbarkeit von Einkaufsrechnunen',
'Purchase net amount' => 'EK-Betrag',
'Purchase price' => 'EK-Preis',
'Purchase price total' => 'EK-Betrag',
'Sales delivery order' => 'Lieferschein (Verkauf)',
'Sales invoice number' => 'Ausgangsrechnungsnummer',
'Sales invoices' => 'Verkaufsrechnungen',
+ 'Sales invoices changeable' => 'Änderbarkeit von Verkaufsrechnungen',
'Sales margin' => 'Marge',
'Sales margin %' => 'Marge prozentual',
'Sales net amount' => 'VK-Betrag',
'Shipto is in use and was flagged invalid.' => 'Lieferadresse ist noch in Verwendung, und wurde als ungültig markiert.',
'Shopartikel' => 'Shopartikel',
'Short' => 'Knapp',
+ 'Should ap transactions be and when should they be changeable or deleteable after posting?' => 'Sollen Kreditorenbuchungen nach der Buchung zu ändern oder zu löschen sein?',
+ 'Should ar transactions be and when should they be changeable or deleteable after posting?' => 'Sollen Debitorenbuchungen nach der Buchung zu ändern oder zu löschen sein?',
+ 'Should gl transactions be and when should they be changeable or deleteable after posting?' => 'Sollen Dialogbuchungen nach der Buchung zu ändern oder zu löschen sein?',
'Should payments be and when should they be changeable after posting?' => 'Sollen Zahlungen nach dem Buchen änderbar sein, und wenn ja, wann?',
+ 'Should purchase invoices be and when should they be deleteable after posting?' => 'Sollen Einkaufsrechnungen nach der Buchung zu löschen sein?',
+ 'Should sales invoices be and when should they be changeable or deleteable after posting?' => 'Sollen Verkaufrechnung nach der Buchung zu ändern oder zu löschen sein?',
'Show' => 'Zeigen',
'Show Bestbefore' => 'Mindesthaltbarkeit anzeigen',
'Show Filter' => 'Filter zeigen',
'AP Transaction Storno (one letter abbreviation)' => 'S',
'AP Transaction with Storno (abbreviation)' => 'K(S)',
'AP Transactions' => 'Eingangsrechnungen',
+ 'AP transactions changeable' => 'Änderbarkeit von Kreditorenbuchungen',
'AP transactions with sales taxkeys and/or AR transactions with input taxkeys' => 'Kreditorenbuchungen mit Umsatzsteuer-Steuerschlüsseln und/oder Debitorenbuchungen mit Vorsteuer-Steuerschlüsseln',
'AR' => 'Verkauf',
'AR Aging' => 'Forderungen',
'AR Transaction' => 'Debitorenbuchung',
'AR Transaction (abbreviation)' => 'D',
'AR Transactions' => 'Debitorenbuchungen',
+ 'AR transactions changeable' => 'Änderbarkeit von Debitorenbuchungen',
'ASSETS' => 'AKTIVA',
'ATTENTION! If you enabled this feature you can not simply turn it off again without taking care that best_before fields are emptied in the database.' => 'ACHTUNG! Wenn Sie diese Einstellung aktivieren, dann können Sie sie später nicht ohne Weiteres deaktivieren, ohne dafür zu sorgen, dass die Felder der Mindeshaltbarkeitsdaten in der Datenbank leer gemacht werden.',
'ATTENTION! You can not simply change it from periodic to perpetual once you started posting.' => 'ACHTUNG! Es kann nicht ohne Weiteres im laufenden Betrieb von der Aufwandsmethode zur Bestandsmethode gewechselt werden.',
'Full access to all functions' => 'Vollzugriff auf alle Funktionen',
'Fwd' => 'Vorwärts',
'GL Transaction' => 'Dialogbuchung',
+ 'GL transactions changeable' => 'Änderbarkeit von Dialogbuchungen',
'Gegenkonto' => 'Gegenkonto',
'Gender' => 'Geschlecht',
'General Ledger' => 'Buchhaltung',
'Purchase Prices' => 'Einkaufspreise',
'Purchase delivery order' => 'Lieferschein (Einkauf)',
'Purchase invoices' => 'Einkaufsrechnungen',
+ 'Purchase invoices changeable' => 'Änderbarkeit von Einkaufsrechnunen',
'Purchase net amount' => 'EK-Summe',
'Purchase price' => 'EK-Preis',
'Purchase price total' => 'EK-Summe',
'Sales delivery order' => 'Lieferschein (Verkauf)',
'Sales invoice number' => 'Ausgangsrechnungsnummer',
'Sales invoices' => 'Verkaufsrechnungen',
+ 'Sales invoices changeable' => 'Änderbarkeit von Verkaufsrechnungen',
'Sales margin' => 'Marge',
'Sales margin %' => 'Marge prozentual',
'Sales net amount' => 'VK-Netto',
'Shipto is in use and was flagged invalid.' => 'Lieferadresse ist noch in Verwendung, und wurde als ungültig markiert.',
'Shopartikel' => 'Shopartikel',
'Short' => 'Knapp',
+ 'Should ap transactions be and when should they be changeable or deleteable after posting?' => 'Sollen Kreditorenbuchungen nach der Buchung zu ändern oder zu löschen sein?',
+ 'Should ar transactions be and when should they be changeable or deleteable after posting?' => 'Sollen Debitorenbuchungen nach der Buchung zu ändern oder zu löschen sein?',
+ 'Should gl transactions be and when should they be changeable or deleteable after posting?' => 'Sollen Dialogbuchungen nach der Buchung zu ändern oder zu löschen sein?',
'Should payments be and when should they be changeable after posting?' => 'Sollen Zahlungen nach dem Buchen änderbar sein, und wenn ja, wann?',
+ 'Should purchase invoices be and when should they be deleteable after posting?' => 'Sollen Einkaufsrechnungen nach der Buchung zu löschen sein?',
+ 'Should sales invoices be and when should they be changeable or deleteable after posting?' => 'Sollen Verkaufrechnung nach der Buchung zu ändern oder zu löschen sein?',
'Show' => 'Zeigen',
'Show Bestbefore' => 'Mindesthaltbarkeit anzeigen',
'Show Salesman' => 'Verkäufer anzeigen',
'AP Transaction Storno (one letter abbreviation)' => '',
'AP Transaction with Storno (abbreviation)' => '',
'AP Transactions' => 'Purchase Transactions',
+ 'AP transactions changeable' => '',
'AP transactions with sales taxkeys and/or AR transactions with input taxkeys' => '',
'AR' => 'Sales',
'AR Aging' => 'Debtor Aging',
'AR Transaction' => 'Sales Transaction',
'AR Transaction (abbreviation)' => '',
'AR Transactions' => 'Sales Transactions',
+ 'AR transactions changeable' => '',
'ASSETS' => '',
'ATTENTION! If you enabled this feature you can not simply turn it off again without taking care that best_before fields are emptied in the database.' => '',
'ATTENTION! You can not simply change it from periodic to perpetual once you started posting.' => '',
'Full access to all functions' => '',
'Fwd' => 'Forward',
'GL Transaction' => '',
+ 'GL transactions changeable' => '',
'Gegenkonto' => '',
'Gender' => '',
'General Ledger' => '',
'Purchase Prices' => '',
'Purchase delivery order' => '',
'Purchase invoices' => '',
+ 'Purchase invoices changeable' => '',
'Purchase net amount' => '',
'Purchase price' => '',
'Purchase price total' => '',
'Sales delivery order' => '',
'Sales invoice number' => '',
'Sales invoices' => '',
+ 'Sales invoices changeable' => '',
'Sales margin' => '',
'Sales margin %' => '',
'Sales net amount' => '',
'Shipto is in use and was flagged invalid.' => '',
'Shopartikel' => '',
'Short' => '',
+ 'Should ap transactions be and when should they be changeable or deleteable after posting?' => '',
+ 'Should ar transactions be and when should they be changeable or deleteable after posting?' => '',
+ 'Should gl transactions be and when should they be changeable or deleteable after posting?' => '',
'Should payments be and when should they be changeable after posting?' => '',
+ 'Should purchase invoices be and when should they be deleteable after posting?' => '',
+ 'Should sales invoices be and when should they be changeable or deleteable after posting?' => '',
'Show' => '',
'Show Bestbefore' => '',
'Show Filter' => '',
--- /dev/null
+-- @tag: defaults_posting_records_config
+-- @description: Einstellung, ob und wann Belegbuchungen änderbar/löschbar sind.
+-- @depends: release_2_7_0
+-- @charset: utf-8
+
+ALTER TABLE defaults ADD COLUMN is_changeable integer NOT NULL DEFAULT 2;
+ALTER TABLE defaults ADD COLUMN ir_changeable integer NOT NULL DEFAULT 2;
+ALTER TABLE defaults ADD COLUMN ar_changeable integer NOT NULL DEFAULT 2;
+ALTER TABLE defaults ADD COLUMN ap_changeable integer NOT NULL DEFAULT 2;
+ALTER TABLE defaults ADD COLUMN gl_changeable integer NOT NULL DEFAULT 2;
<tr class='listheading'>
<th colspan="3">[% 'Posting Configuration' | $T8 %]</th>
</tr>
+
+ <tr>
+ <td align="right">[% 'Sales invoices changeable' | $T8 %]</td>
+ <td>[% L.select_tag('is_changeable', SELF.posting_options, value_key => 'value', title_key => 'title', default => SELF.is_changeable) %]</td>
+ <td>[% 'Should sales invoices be and when should they be changeable or deleteable after posting?' | $T8 %]</td>
+ </tr>
+ <tr>
+ <td align="right">[% 'Purchase invoices changeable' | $T8 %]</td>
+ <td>[% L.select_tag('ir_changeable', SELF.posting_options, value_key => 'value', title_key => 'title', default => SELF.ir_changeable) %]</td>
+ <td>[% 'Should purchase invoices be and when should they be deleteable after posting?' | $T8 %]</td>
+ </tr>
+ <tr>
+ <td align="right">[% 'AR transactions changeable' | $T8 %]</td>
+ <td>[% L.select_tag('ar_changeable', SELF.posting_options, value_key => 'value', title_key => 'title', default => SELF.ar_changeable) %]</td>
+ <td>[% 'Should ar transactions be and when should they be changeable or deleteable after posting?' | $T8 %]</td>
+ </tr>
+ <tr>
+ <td align="right">[% 'AP transactions changeable' | $T8 %]</td>
+ <td>[% L.select_tag('ap_changeable', SELF.posting_options, value_key => 'value', title_key => 'title', default => SELF.ap_changeable) %]</td>
+ <td>[% 'Should ap transactions be and when should they be changeable or deleteable after posting?' | $T8 %]</td>
+ </tr>
+ <tr>
+ <td align="right">[% 'GL transactions changeable' | $T8 %]</td>
+ <td>[% L.select_tag('gl_changeable', SELF.posting_options, value_key => 'value', title_key => 'title', default => SELF.gl_changeable) %]</td>
+ <td>[% 'Should gl transactions be and when should they be changeable or deleteable after posting?' | $T8 %]</td>
+ </tr>
+
+ <tr> </tr>
+ <tr> </tr>
+
<tr>
<td align="right">[% 'Payments Changeable' | $T8 %]</td>
<td>[% L.select_tag('payments_changeable', SELF.payment_options, value_key => 'value', title_key => 'title', default => SELF.payments_changeable) %]</td>
<td>[% 'Should payments be and when should they be changeable after posting?' | $T8 %]</td>
</tr>
+
+ <tr> </tr>
+ <tr> </tr>
+
<tr>
<td align="right">[% 'Accounting method' | $T8 %]</td>
<td>[% L.select_tag('accounting_method', SELF.accounting_options, value_key => 'value', title_key => 'title', default => SELF.accounting_method) %]</td>