Skip to content

Commit

Permalink
Merge pull request #7546 from ehuelsmann/fix/1.9/saved-shipto
Browse files Browse the repository at this point in the history
Save 'Ship To' data
  • Loading branch information
ehuelsmann committed Jul 26, 2023
2 parents ee6bff7 + 56c9809 commit d15f3b1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
12 changes: 4 additions & 8 deletions old/bin/io.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1694,17 +1694,15 @@ sub ship_to {

print qq|
<tr>
<td><input type=radio data-dojo-type="dijit/form/RadioButton" name=shiptoradio id="shiptoradio_$i" value="$i" $checked ></td>
<input name="shiptolocationid_$i" id="shiptolocationid_$i" type="hidden" value="$form->{"shiptolocationid_$i"}" readonly>
<td><input type=radio data-dojo-type="dijit/form/RadioButton" name=shiptoradio id="shiptoradio_$i" value="$i" $checked >
<input name="shiptolocationid_$i" id="shiptolocationid_$i" type="hidden" value="$form->{"shiptolocationid_$i"}" readonly></td>
<td><input data-dojo-type="dijit/form/TextBox" name=shiptoaddress1_$i size=12 maxlength=64 id="ad1_$i" value="$form->{"shiptoaddress1_$i"}" readonly></td>
<td><input data-dojo-type="dijit/form/TextBox" name=shiptoaddress2_$i size=12 maxlength=64 id="ad2_$i" value="$form->{"shiptoaddress2_$i"}" readonly></td>
<td><input data-dojo-type="dijit/form/TextBox" name=shiptoaddress3_$i size=12 maxlength=64 id="ad3_$i" value="$form->{"shiptoaddress3_$i"}" readonly></td>
<td><input data-dojo-type="dijit/form/TextBox" name=shiptocity_$i size=8 maxlength=32 id="ci_$i" value="$form->{"shiptocity_$i"}" readonly></td>
<td><input data-dojo-type="dijit/form/TextBox" name=shiptostate_$i size=10 maxlength=32 id="st_$i" value="$form->{"shiptostate_$i"}" readonly></td>
<td><input data-dojo-type="dijit/form/TextBox" name=shiptozipcode_$i size=8 maxlength=10 id="zi_$i" value="$form->{"shiptozipcode_$i"}" readonly></td>
<td><input data-dojo-type="dijit/form/TextBox" name=shiptocountry_$i size=5 maxlength=32 id="co_$i" value="$form->{"shiptocountry_$i"}" readonly></td>
<tr>
|;
Expand Down Expand Up @@ -2000,11 +1998,9 @@ sub setlocation_id

my $loc_id_index=$form->{"shiptoradio"};

my $index="locationid_".$loc_id_index;

$form->{"locationid"}=$form->{$index};

my $index="shiptolocationid_".$loc_id_index;

$form->{"shiptolocationid"}=$form->{$index};
}

1;
2 changes: 1 addition & 1 deletion old/bin/ir.pl
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ sub form_header {
qw(id title vc type terms creditlimit creditremaining closedto locked
shipped oldtransdate recurring reverse batch_id subtype form_id
separate_duties nextsub default_reportable address city is_return
cash_accno)
cash_accno shiptolocationid)
);

print qq|
Expand Down
2 changes: 1 addition & 1 deletion old/bin/is.pl
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ sub form_header {
creditlimit creditremaining tradediscount business closedto locked
shipped oldtransdate recurring reverse batch_id subtype tax_id
meta_number separate_duties lock_description nextsub
default_reportable address city is_return cash_accno)
default_reportable address city is_return cash_accno shiptolocationid)
);

if ($form->{notice}){
Expand Down
4 changes: 2 additions & 2 deletions old/lib/LedgerSMB/Form.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ If $is_oe is true, the value of trans_id is NULL and of oe_id is $id.
sub add_shipto {

my ($self, $id, $is_oe) = @_;
if (! $self->{locationid}) {
if (! $self->{shiptolocationid}) {
return;
}

Expand All @@ -1343,7 +1343,7 @@ sub add_shipto {
$sth->execute(
$trans_id,
$oe_id,
$self->{locationid}
$self->{shiptolocationid}
) || $self->dberror($query);

$sth->finish;
Expand Down
2 changes: 1 addition & 1 deletion old/lib/LedgerSMB/IS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ sub list_locations_contacts
WITH eca AS (select * from entity_credit_account
where id = ?
)
select id as locationid,line_one as shiptoaddress1,line_two as shiptoaddress2,line_three as shiptoaddress3,city as shiptocity,
select id as shiptolocationid,line_one as shiptoaddress1,line_two as shiptoaddress2,line_three as shiptoaddress3,city as shiptocity,
state as shiptostate,mail_code as shiptozipcode,country as shiptocountry
from (
select (eca__list_locations(id)).*
Expand Down

0 comments on commit d15f3b1

Please sign in to comment.