[% USE Koha %]
[% BLOCK 'display-alt-address-style' %]
[% IF Koha.Preference( 'AddressFormat' ) %]
[% PROCESS "member-alt-display-address-style-${ Koha.Preference( 'AddressFormat' ) }" %]
[% ELSE %]
[% PROCESS 'member-alt-display-address-style-us' %]
[% END %]
[% END %]
[% BLOCK 'member-alt-display-address-style-us' %]
[% IF ( patron.B_address or patron.B_address2 ) %]
[% IF ( patron.B_address ) %]
[% SET roadtype_desc = '' %]
[% IF patron.B_streettype %]
[% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %]
[% END %]
[% if (patron.B_streetnumber) | html %][% patron.B_streetnumber | html %][% end | html %] [% patron.B_address | html %] [% IF roadtype_desc %][% roadtype_desc | html %] [% END %][% end | html %]
[% END %]
[% IF ( patron.B_address2 ) %]
[% patron.B_address2 | html %]
[% END %]
[% END %]
[% IF ( patron.B_city || patron.B_state || patron.B_country || patron.B_zipcode ) %]
[% patron.B_city | html %][% IF ( patron.B_state ) %][% IF ( patron.B_city ) %], [% END %][%~ patron.B_state | html ~%][%~ END ~%]
[% IF ( patron.B_zipcode ) %][%~ " " _ patron.B_zipcode |html ~%][% END %][% IF ( patron.B_country ) %][% IF ( patron.B_zipcode || patron.B_state || patron.B_city ) %], [% END %][% patron.B_country | html %][% END %]
[% END %]
[% END %]
[% BLOCK 'member-alt-display-address-style-de' %]
[% IF ( patron.B_address or patron.B_address2 ) %]
[% IF ( patron.B_address ) %]
[% SET roadtype_desc = '' %]
[% IF patron.B_streettype %]
[% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %]
[% END %]
[% patron.B_address | html %][%IF roadtype_desc %] [% roadtype_desc | html %][% END %][% IF patron.B_streetnumber %] [% patron.B_streetnumber | html %][% END %]
[% END %]
[% IF ( patron.B_address2 ) %]
[% patron.B_address2 | html %]
[% END %]
[% END %]
[% IF ( patron.B_city || patron.B_state || patron.B_country || patron.B_zipcode ) %]
[%IF ( patron.B_zipcode ) %][% patron.B_zipcode | html %] [% END %][% patron.B_city | html %][% IF ( patron.B_state ) %][% patron.B_state | html %][% END %]
[% IF ( patron.B_country ) %]
[% patron.B_country | html %][% END %]
[% END %]
[% END %]
[% BLOCK 'member-alt-display-address-style-fr' %]
[% IF ( patron.B_address or patron.B_address2 ) %]
[% IF ( patron.B_address ) %]
[% SET roadtype_desc = '' %]
[% IF patron.B_streettype %]
[% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %]
[% END %]
[% IF patron.B_streetnumber %][% patron.B_streetnumber | html %][% END %]
[%IF roadtype_desc %][% roadtype_desc | html %] [% END %]
[% patron.B_address | html %]
[% END %]
[% IF ( patron.B_address2 ) %]
[% patron.B_address2 | html %]
[% END %]
[% END %]
[% IF ( patron.B_city || patron.B_state || patron.B_country || patron.B_zipcode ) %]
[%IF ( patron.B_zipcode ) %][% patron.B_zipcode | html %] [% END %]
[% patron.B_city | html %]
[% IF ( patron.B_state ) %][% patron.B_state | html %][% END %]
[% IF ( patron.B_country ) %]
[% patron.B_country | html %][% END %]
[% END %]
[% END %]