Revision 82c4717d
Von Jan Büren vor mehr als 11 Jahren hinzugefügt
bin/mozilla/ic.pl | ||
---|---|---|
1586 | 1586 |
|
1587 | 1587 |
$form->get_lists('price_factors' => 'ALL_PRICE_FACTORS', |
1588 | 1588 |
'partsgroup' => 'all_partsgroup', |
1589 |
'vendors' => 'ALL_VENDORS',); |
|
1589 |
'vendors' => 'ALL_VENDORS', |
|
1590 |
'warehouses' => { 'key' => 'WAREHOUSES', |
|
1591 |
'bins' => 'BINS', }); |
|
1592 |
# leerer wert für Lager und Lagerplatz korrekt einstellt |
|
1593 |
# ID 0 sollte in Ordnung sein, da der Zähler sowieso höher ist |
|
1594 |
my $no_default_bin_entry = { 'id' => '0', description => '--', 'BINS' => [ { id => '0', description => ''} ] }; |
|
1595 |
push @ { $form->{WAREHOUSES} }, $no_default_bin_entry; |
|
1596 |
if (my $max = scalar @{ $form->{WAREHOUSES} }) { |
|
1597 |
|
|
1598 |
my $default_warehouse_id = $::instance_conf->get_default_warehouse_id; |
|
1599 |
my $default_bin_id = $::instance_conf->get_default_bin_id; |
|
1600 |
$form->{warehouse_id} ||= $default_warehouse_id || $form->{WAREHOUSES}->[$max -1]->{id}; |
|
1601 |
$form->{bin_id} ||= $default_bin_id || $form->{WAREHOUSES}->[$max -1]->{BINS}->[0]->{id}; |
|
1602 |
} |
|
1590 | 1603 |
|
1591 | 1604 |
|
1592 | 1605 |
IC->retrieve_buchungsgruppen(\%myconfig, $form); |
... | ... | |
1847 | 1860 |
$form->error($locale->text('Description must not be empty!')) unless $form->{description}; |
1848 | 1861 |
$form->error($locale->text('Partnumber must not be set to empty!')) if $form->{id} && !$form->{partnumber}; |
1849 | 1862 |
|
1863 |
# undef warehouse_id if the empty value is selected |
|
1864 |
if ( ($form->{warehouse_id} == 0) && ($form->{bin_id} == 0) ) { |
|
1865 |
undef $form->{warehouse_id}; |
|
1866 |
undef $form->{bin_id}; |
|
1867 |
} |
|
1850 | 1868 |
# save part |
1851 | 1869 |
if (IC->save(\%myconfig, \%$form) == 3) { |
1852 | 1870 |
$form->error($locale->text('Partnumber not unique!')); |
Auch abrufbar als: Unified diff
Migration von parts.bin nach wirklichen Lager und Lagerplatz s.a. Ticket 2284