1 [% USE HTML %][% USE L %][% USE LxERP %][%- USE JavaScript -%]
 
   3 <script type="text/javascript">
 
   5     { shiptoname:         "[% JavaScript.escape(vc_obj.name) %]",
 
   6       shiptodepartment_1: "[% JavaScript.escape(vc_obj.department_1) %]",
 
   7       shiptodepartment_2: "[% JavaScript.escape(vc_obj.department_2) %]",
 
   8       shiptostreet:       "[% JavaScript.escape(vc_obj.street) %]",
 
   9       shiptozipcode:      "[% JavaScript.escape(vc_obj.zipcode) %]",
 
  10       shiptocity:         "[% JavaScript.escape(vc_obj.city) %]",
 
  11       shiptocountry:      "[% JavaScript.escape(vc_obj.country) %]",
 
  12       shiptocontact:      "[% JavaScript.escape(vc_obj.contact) %]",
 
  13       shiptocp_gender:    "[% JavaScript.escape(vc_obj.cp_gender) %]",
 
  14       shiptophone:        "[% JavaScript.escape(vc_obj.phone) %]",
 
  15       shiptofax:          "[% JavaScript.escape(vc_obj.fax) %]",
 
  16       shiptoemail:        "[% JavaScript.escape(vc_obj.email) %]"
 
  19   [% FOREACH shipto = vc_obj.shipto %]
 
  21     { shiptoname:         "[% JavaScript.escape(shipto.shiptoname) %]",
 
  22       shiptodepartment_1: "[% JavaScript.escape(shipto.shiptodepartment_1) %]",
 
  23       shiptodepartment_2: "[% JavaScript.escape(shipto.shiptodepartment_2) %]",
 
  24       shiptostreet:       "[% JavaScript.escape(shipto.shiptostreet) %]",
 
  25       shiptozipcode:      "[% JavaScript.escape(shipto.shiptozipcode) %]",
 
  26       shiptocity:         "[% JavaScript.escape(shipto.shiptocity) %]",
 
  27       shiptocountry:      "[% JavaScript.escape(shipto.shiptocountry) %]",
 
  28       shiptocontact:      "[% JavaScript.escape(shipto.shiptocontact) %]",
 
  29       shiptocp_gender:    "[% JavaScript.escape(shipto.shiptocp_gender) %]",
 
  30       shiptophone:        "[% JavaScript.escape(shipto.shiptophone) %]",
 
  31       shiptofax:          "[% JavaScript.escape(shipto.shiptofax) %]",
 
  32       shiptoemail:        "[% JavaScript.escape(shipto.shiptoemail) %]"
 
  37   function copy_address() {
 
  38     var shipto = addresses[ $('#shipto_to_copy').val() ];
 
  40       $('#' + key).val(shipto[key]);
 
  43   function clear_fields() {
 
  44     var shipto = addresses[0];
 
  47     $('#shiptocp_gender').val('m');
 
  50   function clear_shipto_id_before_submit() {
 
  51     var shipto = addresses[0];
 
  53       if ((key != 'shiptocp_gender') && ($('#' + key).val() != '')) {
 
  54         $('#shipto_id').val('');
 
  62 [% select_options = [ [ 0, LxERP.t8("Billing Address") ] ] ;
 
  63    FOREACH shipto = vc_obj.shipto ;
 
  64      city  = shipto.shiptozipcode _ ' ' _ shipto.shiptocity ;
 
  65      title = [ shipto.shiptoname, shipto.shiptostreet, city ] ;
 
  66      CALL select_options.import([ [ loop.count, title.grep('\S').join("; ") ] ]) ;
 
  70  <form method="post" action="[% HTML.escape(script) %]">
 
  71   [% L.hidden_tag("shipto_id", shipto_id) %]
 
  74    [% LxERP.t8("Copy address from master data") %]:
 
  75    [% L.select_tag("", select_options, id="shipto_to_copy", style="width: 400px") %]
 
  76    [% L.button_tag("copy_address()", LxERP.t8("Copy")) %]
 
  77    [% L.button_tag("clear_fields()", LxERP.t8("Clear fields")) %]
 
  81    <tr class="listheading">
 
  82     <th colspan="2" width="50%">[% LxERP.t8('Billing Address') %]</th>
 
  83     <th width="50%">[% LxERP.t8('Shipping Address') %]</th>
 
  87     <th align="right" nowrap>[%- IF vc == "customer" %][%- LxERP.t8('Customer Number') %][%- ELSE %][%- LxERP.t8('Vendor Number') %][%- END %]</th>
 
  88     <td>[%- IF vc == "customer" %][%- HTML.escape(customernumber) %][%- ELSE %][%- HTML.escape(vendornumber) %][%- END %]</td>
 
  91     <th align="right" nowrap>[% LxERP.t8('Company Name') %]</th>
 
  92     <td>[% HTML.escape(name) %]</td>
 
  93     <td>[% L.input_tag("shiptoname", shiptoname, "size", "35") %]</td>
 
  96     <th align="right" nowrap>[% LxERP.t8('Department') %]</th>
 
  97     <td>[% HTML.escape(department_1) %]</td>
 
  98     <td>[% L.input_tag("shiptodepartment_1", shiptodepartment_1, "size", "35") %]</td>
 
 101     <th align="right" nowrap> </th>
 
 102     <td>[% HTML.escape(department_2) %]</td>
 
 103     <td>[% L.input_tag("shiptodepartment_2", shiptodepartment_2, "size", "35") %]</td>
 
 106     <th align="right" nowrap>[% LxERP.t8('Street') %]</th>
 
 107     <td>[% HTML.escape(street) %]</td>
 
 108     <td>[% L.input_tag("shiptostreet", shiptostreet, "size", "35") %]</td>
 
 111     <th align="right" nowrap>[% LxERP.t8('Zipcode') %]</th>
 
 112     <td>[% HTML.escape(zipcode) %]</td>
 
 113     <td>[% L.input_tag("shiptozipcode", shiptozipcode, "size", "35") %]</td>
 
 116     <th align="right" nowrap>[% LxERP.t8('City') %]</th>
 
 117     <td>[% HTML.escape(city) %]</td>
 
 118     <td>[% L.input_tag("shiptocity", shiptocity, "size", "35") %]</td>
 
 121     <th align="right" nowrap>[% LxERP.t8('Country') %]</th>
 
 122     <td>[% HTML.escape(country) %]</td>
 
 123     <td>[% L.input_tag("shiptocountry", shiptocountry, "size", "35") %]</td>
 
 126     <th align="right" nowrap>[% LxERP.t8('Contact') %]</th>
 
 127     <td>[% HTML.escape(contact) %]</td>
 
 128     <td>[% L.input_tag("shiptocontact", shiptocontact, "size", "35") %]</td>
 
 131     <th align="right" nowrap>[% LxERP.t8('Gender') %]</th>
 
 134      [% L.select_tag('shiptocp_gender', [ [ 'm', LxERP.t8('male') ], [ 'f', LxERP.t8('female') ] ], 'default' = shiptocp_gender) %]
 
 138     <th align="right" nowrap>[% LxERP.t8('Phone') %]</th>
 
 139     <td>[% HTML.escape(phone) %]</td>
 
 140     <td>[% L.input_tag("shiptophone", shiptophone, "size", "35") %]</td>
 
 143     <th align="right" nowrap>[% LxERP.t8('Fax') %]</th>
 
 144     <td>[% HTML.escape(fax) %]</td>
 
 145     <td>[% L.input_tag("shiptofax", shiptofax, "size", "35") %]</td>
 
 148     <th align="right" nowrap>[% LxERP.t8('E-mail') %]</th>
 
 149     <td>[% HTML.escape(email) %]</td>
 
 150     <td>[% L.input_tag("shiptoemail", shiptoemail, "size", "35") %]</td>
 
 154   <hr size="3" noshade>
 
 156   [% L.hidden_tag("action", "ship_to_entered") %]
 
 157   [% L.hidden_tag("nextsub", nextsub) %]
 
 158   [% L.hidden_tag("previousform", previousform) %]
 
 160   [% L.button_tag("clear_shipto_id_before_submit()", LxERP.t8("Continue")) %]