# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
#======================================================================
#
# Delivery Order entry module
$sth = prepare_execute_query($form, $dbh, $query, $form->{id});
$ref = $sth->fetchrow_hashref("NAME_lc");
- delete $ref->{id};
- map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $form->{$_} = $ref->{$_} for grep { m{^shipto(?!_id$)} } keys %$ref;
$sth->finish();
- if ($form->{shipto_id}) {
+ if ($ref->{shipto_id}) {
my $cvars = CVar->get_custom_variables(
dbh => $dbh,
module => 'ShipTo',
- trans_id => $form->{shipto_id},
+ trans_id => $ref->{shipto_id},
);
$form->{"shiptocvar_$_->{name}"} = $_->{value} for @{ $cvars };
}
my @dolinks = RecordLinks->get_links('dbh' => $dbh,
'from_table' => 'oe',
'to_table' => 'delivery_orders',
- 'from_id' => @oe_ids);
+ 'from_id' => \@oe_ids);
my @do_ids = map { $_->{to_id} } @dolinks ;
if (scalar (@do_ids) == 0) {