Revision a8cba95a
Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt
SL/DO.pm | ||
---|---|---|
746 | 746 |
$sth = prepare_execute_query($form, $dbh, $query, $form->{id}); |
747 | 747 |
|
748 | 748 |
$ref = $sth->fetchrow_hashref("NAME_lc"); |
749 |
delete $ref->{id}; |
|
750 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
|
749 |
$form->{$_} = $ref->{$_} for grep { m{^shipto(?!_id$)} } keys %$ref; |
|
751 | 750 |
$sth->finish(); |
752 | 751 |
|
753 |
if ($form->{shipto_id}) {
|
|
752 |
if ($ref->{shipto_id}) {
|
|
754 | 753 |
my $cvars = CVar->get_custom_variables( |
755 | 754 |
dbh => $dbh, |
756 | 755 |
module => 'ShipTo', |
757 |
trans_id => $form->{shipto_id},
|
|
756 |
trans_id => $ref->{shipto_id},
|
|
758 | 757 |
); |
759 | 758 |
$form->{"shiptocvar_$_->{name}"} = $_->{value} for @{ $cvars }; |
760 | 759 |
} |
SL/IS.pm | ||
---|---|---|
1969 | 1969 |
# get shipto |
1970 | 1970 |
$query = qq|SELECT * FROM shipto WHERE (trans_id = ?) AND (module = 'AR')|; |
1971 | 1971 |
$ref = selectfirst_hashref_query($form, $dbh, $query, $id); |
1972 |
delete($ref->{id}); |
|
1973 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
|
1972 |
$form->{$_} = $ref->{$_} for grep { m{^shipto(?!_id$)} } keys %$ref; |
|
1974 | 1973 |
|
1975 | 1974 |
# get printed, emailed |
1976 | 1975 |
$query = qq|SELECT printed, emailed, spoolfile, formname FROM status WHERE trans_id = ?|; |
SL/OE.pm | ||
---|---|---|
1051 | 1051 |
$sth = prepare_execute_query($form, $dbh, $query, $form->{id}); |
1052 | 1052 |
|
1053 | 1053 |
$ref = $sth->fetchrow_hashref("NAME_lc"); |
1054 |
delete($ref->{id}); |
|
1055 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
|
1054 |
$form->{$_} = $ref->{$_} for grep { m{^shipto(?!_id$)} } keys %$ref; |
|
1056 | 1055 |
$sth->finish; |
1057 | 1056 |
|
1058 |
if ($form->{shipto_id}) {
|
|
1057 |
if ($ref->{shipto_id}) {
|
|
1059 | 1058 |
my $cvars = CVar->get_custom_variables( |
1060 | 1059 |
dbh => $dbh, |
1061 | 1060 |
module => 'ShipTo', |
1062 |
trans_id => $form->{shipto_id},
|
|
1061 |
trans_id => $ref->{shipto_id},
|
|
1063 | 1062 |
); |
1064 | 1063 |
$form->{"shiptocvar_$_->{name}"} = $_->{value} for @{ $cvars }; |
1065 | 1064 |
} |
Auch abrufbar als: Unified diff
Verkaufs-/Einkaufsbelege: beim Laden der Lieferadresse $form->{shipto_id} nicht überschreiben
Die Semantik in der Datenbank sieht so aus, dass z.B. oe.shipto_id nur
dann gesetzt ist, wenn eine der Lieferadressen aus den Stammdaten
ausgewählt ist. Genauer:
• Stammdatenlieferadresse:
oe.shipto_id == shipto.shipto_id,
shipto.module = 'CT',
shipto.trans_id = customer.id (oder vendor.id)
• Individuelle Lieferadresse:
oe.shipto_id == NULL,
shipto.module = 'OE',
shipto.trans_id == oe.id
Der Inhalt von $form muss das genau so reflektieren, denn anhand dieses
Feldes $form->{shipto_id} wird dann in den Masken entschieden, was wie
angezeigt wird.