-# This file has been auto-generated only because it didn't exist.
-# Feel free to modify it at will; it will not be overwritten automatically.
-
package SL::DB::DeliveryTerm;
use strict;
use SL::DB::Helper::ActsAsList;
use SL::DB::Helper::TranslatedAttributes;
+__PACKAGE__->meta->initialize;
sub validate {
my ($self) = @_;
delivery_orders => 'delivery_order',
delivery_order_items => 'delivery_order_item',
delivery_order_items_stock => 'delivery_order_items_stock',
+ delivery_terms => 'delivery_term',
department => 'department',
drafts => 'draft',
dunning => 'dunning',
use base qw(SL::DB::Object);
-__PACKAGE__->meta->setup(
- table => 'delivery_terms',
+__PACKAGE__->meta->table('delivery_terms');
- columns => [
- id => { type => 'integer', not_null => 1, sequence => 'id' },
- description => { type => 'text' },
- description_long => { type => 'text' },
- sortkey => { type => 'integer', not_null => 1 },
- itime => { type => 'timestamp', default => 'now()' },
- mtime => { type => 'timestamp' },
- ],
+__PACKAGE__->meta->columns(
+ description => { type => 'text' },
+ description_long => { type => 'text' },
+ id => { type => 'integer', not_null => 1, sequence => 'id' },
+ itime => { type => 'timestamp', default => 'now()' },
+ mtime => { type => 'timestamp' },
+ sortkey => { type => 'integer', not_null => 1 },
+);
- primary_key_columns => [ 'id' ],
+__PACKAGE__->meta->primary_key_columns([ 'id' ]);
- allow_inline_column_values => 1,
-);
+__PACKAGE__->meta->allow_inline_column_values(1);
1;
;
if (IS->has_storno(\%myconfig, $form, "ar")) {
$form->error($locale->text("Invoice has already been storno'd!"));
}
+ if ($form->datetonum($form->{invdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig)) {
+ $form->error($locale->text('Cannot storno invoice for a closed period!'));
+ }
map({ my $key = $_; delete($form->{$key}) unless (grep({ $key eq $_ } qw(id login password type))); } keys(%{ $form }));
;(function($) {
$.fn.extend({
- checkall: function(target, property) {
+ checkall: function(target, property, inverted) {
if (property == null)
property = 'checked';
return $(this).click(function() {
- $(target).prop(property, $(this).prop('checked'));
+ $(target).prop(property, inverted ? !$(this).prop('checked') : $(this).prop('checked'));
});
}
});
'Cannot save order!' => 'Auftrag kann nicht gespeichert werden!',
'Cannot save preferences!' => 'Einstellungen können nicht gespeichert werden!',
'Cannot save quotation!' => 'Angebot kann nicht gespeichert werden!',
+ 'Cannot storno invoice for a closed period!' => 'Das Rechnungsdatum der zu stornierenden Rechnung fällt in einen abgeschlossen Zeitraum!',
'Cannot storno storno invoice!' => 'Kann eine Stornorechnung nicht stornieren',
'Cannot transfer. <br> Reason:<br>#1' => 'Kann nicht auslagern. <br>Grund:<br>#1',
'Carry over shipping address' => 'Lieferadresse übernehmen',
my @dbs = find_pms('SL/DB');
my @metasetups = find_pms('SL/DB/MetaSetup');
my %metasetup_content = map { ($_ => scalar(read_file("SL/DB/MetaSetup/$_"))) } @metasetups;
+my %db_content = map { ($_ => scalar(read_file("SL/DB/$_"))) } @dbs;
my $all_content = read_file('SL/DB/Helper/ALL.pm');
my $mapping_content = read_file('SL/DB/Helper/Mappings.pm');
}
}
+sub test_db_contains_meta_initialize {
+ foreach my $pm (grep { !m{^(?:Object|VC)\.pm$} } @dbs) {
+ ok($db_content{$pm} =~ m/\n__PACKAGE__->meta->initialize;/, "$pm contains __PACKAGE__->meta->initialize;");
+ }
+}
+
test_db_has_metasetup();
test_metasetup_has_db();
test_db_included_in_all();
test_use_in_all_exists_as_db();
test_metasetup_has_table_to_class_mapping();
+test_db_contains_meta_initialize();
done_testing();
<table id="unit_list">
<thead>
<tr class="listheading">
- <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
+ <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
<th>[% 'Delete' | $T8 %]</th>
<th>[% 'Unit' | $T8 %]</th>
<th>[% 'Base unit' | $T8 %]</th>
<tbody>
[% FOREACH row = UNITS %]
<tr class="listrow[% loop.count % 2 %]" id="unit_id_[% row.id %]">
- <td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
+ <td align="center" class="dragdrop"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></td>
[% IF row.in_use %]
<td>
<input type="hidden" name="unchangeable_[% loop.count %]" value="1">
<table width="100%" id="price_factor_list">
<thead>
<tr class="listheading">
- <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
+ <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
<th width="80%">[% 'Description' | $T8 %]</th>
<th width="20%">[% 'Factor' | $T8 %]</th>
</tr>
<tbody>
[% FOREACH factor = PRICE_FACTORS %]
<tr class="listrow[% loop.count % 2 %]" id="price_factor_id_[% factor.id %]">
- <td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
+ <td align="center" class="dragdrop"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></td>
<td><a href="[% url_base %]&action=edit_price_factor&id=[% HTML.url(factor.id) %]">[% HTML.escape(factor.description) %]</a></td>
<td>[% HTML.escape(factor.factor) %]</td>
</tr>
<p>
<table width="100%" id="warehouse_list">
<tr class="listheading">
- <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
+ <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
<th width="70%">[% 'Description' | $T8 %]</th>
<th width="20%">[% 'Number of bins' | $T8 %]</th>
<th width="10%">[% 'Invalid' | $T8 %]</th>
[% FOREACH warehouse = WAREHOUSES %]
<tr class="listrow[% loop.count % 2 %]" id="warehouse_id_[% warehouse.id %]">
- <td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
+ <td align="center" class="dragdrop"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></td>
<td><a href="[% url_base %]&action=edit_warehouse&id=[% HTML.url(warehouse.id) %]">[% HTML.escape(warehouse.description) %]</a></td>
<td>[% HTML.escape(warehouse.number_of_bins) %]</td>
<td>[% IF warehouse.invalid %][% 'Yes' | $T8 %][% ELSE %][% 'No' | $T8 %][% END %]</td>
<table width="100%" id="cvarcfg_list">
<thead>
<tr class="listheading">
- <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
+ <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
<th width="20%">[% 'Name' | $T8 %]</th>
<th width="20%">[% 'Description' | $T8 %]</th>
<th width="20%">[% 'Type' | $T8 %]</th>
<tbody>
[%- FOREACH cfg = CONFIGS %]
<tr class="listrow" id="cvarcfg_id_[% cfg.id %]">
- <td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
+ <td align="center" class="dragdrop"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></td>
<td><a href="[% SELF.url_for(action='edit', module=SELF.module, id=cfg.id) %]">[% HTML.escape(cfg.name) %]</a></td>
<th align="right" nowrap>[% 'Zipcode' | $T8 %]/[% 'City' | $T8 %]</th>
<td>
- [% L.input_tag('shipto.shiptozipcode', SELF.shipto.shiptostreet, size = 5, maxlength = 75) %]
+ [% L.input_tag('shipto.shiptozipcode', SELF.shipto.shiptozipcode, size = 5, maxlength = 75) %]
[% L.input_tag('shipto.shiptocity', SELF.shipto.shiptocity, size = 30, maxlength = 75) %]
</td>
</tr>
<table id="delivery_term_list">
<thead>
<tr class="listheading">
- <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
+ <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
<th>[%- 'Description' | $T8 %]</th>
<th>[%- 'Long Description' | $T8 %]</th>
</tr>
<tbody>
[%- FOREACH delivery_term = DELIVERY_TERMS %]
<tr class="listrow[% loop.count % 2 %]" id="delivery_term_id_[% delivery_term.id %]">
- <td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
+ <td align="center" class="dragdrop"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></td>
<td>
<a href="[% SELF.url_for(action => 'edit', id => delivery_term.id) %]">
[%- HTML.escape(delivery_term.description) %]
</form>
<script type='text/javascript'>
$(function() {
- $("select[name='language_id']").prop('disabled', $('#force_lang').prop('checked'));
- $('#force_lang').checkall('select[name="language_id"]', 'disabled');
+ $("select[name='language_id']").prop('disabled', !$('#force_lang').prop('checked'));
+ $('#force_lang').checkall('select[name="language_id"]', 'disabled', 'inverted');
});
</script>
<table id="payment_term_list">
<thead>
<tr class="listheading">
- <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
+ <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
<th>[%- 'Description' | $T8 %]</th>
<th>[%- 'Long Description' | $T8 %]</th>
<th align="right">[%- 'Netto Terms' | $T8 %]</th>
<tbody>
[%- FOREACH payment_term = PAYMENT_TERMS %]
<tr class="listrow[% loop.count % 2 %]" id="payment_term_id_[% payment_term.id %]">
- <td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
+ <td align="center" class="dragdrop"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></td>
<td>
<a href="[% SELF.url_for(action => 'edit', id => payment_term.id) %]">
[%- HTML.escape(payment_term.description) %]