Revision d7fef83a
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
bin/mozilla/oe.pl | ||
---|---|---|
1935 | 1935 |
$lxdebug->leave_sub(); |
1936 | 1936 |
} |
1937 | 1937 |
|
1938 |
sub check_delivered_flag { |
|
1939 |
$lxdebug->enter_sub(); |
|
1940 |
|
|
1941 |
if (($form->{type} ne 'sales_order') && ($form->{type} ne 'purchase_order')) { |
|
1942 |
return $lxdebug->leave_sub(); |
|
1943 |
} |
|
1944 |
|
|
1945 |
my $all_delivered = 0; |
|
1946 |
|
|
1947 |
foreach my $i (1 .. $form->{rowcount}) { |
|
1948 |
next if (!$form->{"id_$i"}); |
|
1949 |
|
|
1950 |
if ($form->parse_amount(\%myconfig, $form->{"qty_$i"}) == $form->parse_amount(\%myconfig, $form->{"ship_$i"})) { |
|
1951 |
$all_delivered = 1; |
|
1952 |
next; |
|
1953 |
} |
|
1954 |
|
|
1955 |
$all_delivered = 0; |
|
1956 |
last; |
|
1957 |
} |
|
1958 |
|
|
1959 |
$form->{delivered} = 1 if $all_delivered; |
|
1960 |
|
|
1961 |
$lxdebug->leave_sub(); |
|
1962 |
} |
|
1963 |
|
|
1938 | 1964 |
sub save_and_close { |
1939 | 1965 |
$lxdebug->enter_sub(); |
1940 | 1966 |
|
1941 | 1967 |
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig); |
1942 | 1968 |
|
1943 |
|
|
1944 | 1969 |
if ($form->{type} =~ /_order$/) { |
1945 | 1970 |
$form->isblank("transdate", $locale->text('Order Date missing!')); |
1946 | 1971 |
} else { |
... | ... | |
1993 | 2018 |
|
1994 | 2019 |
$err = $locale->text('Cannot save order!'); |
1995 | 2020 |
|
2021 |
check_delivered_flag(); |
|
2022 |
|
|
1996 | 2023 |
} else { |
1997 | 2024 |
if ($form->{type} eq 'sales_quotation') { |
1998 | 2025 |
$form->{label} = $locale->text('Quotation'); |
... | ... | |
2091 | 2118 |
|
2092 | 2119 |
$err = $locale->text('Cannot save order!'); |
2093 | 2120 |
|
2121 |
check_delivered_flag(); |
|
2122 |
|
|
2094 | 2123 |
} else { |
2095 | 2124 |
if ($form->{type} eq 'sales_quotation') { |
2096 | 2125 |
$form->{label} = $locale->text('Quotation'); |
Auch abrufbar als: Unified diff
Kundenauftrag/Lieferantenbestellung: Wenn alle Positionen vollständig geliefert wurden (also in allen Positionen der Lagerein-/-ausgang == Anzahl ist), so wird beim Speichern das Flag "Gelifert" automatisch gesetzt.