Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5fdf1ffd

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 5fdf1ffda5ef2d463208c38f96a2f97b07711c91
  • Vorgänger 160fa214
  • Nachfolger 22bcb6b1

ActionBar: nicht mehr benötigte Lieferadressenmaske entfernt

Unterschiede anzeigen:

bin/mozilla/io.pl
1702 1702
  $main::lxdebug->leave_sub();
1703 1703
}
1704 1704

  
1705
sub ship_to {
1706
  $main::lxdebug->enter_sub();
1707

  
1708
  _check_io_auth();
1709

  
1710
  $::form->{print_and_post} = 0 if $::form->{second_run};
1711

  
1712
  map { $::form->{$_} = $::form->parse_amount(\%::myconfig, $::form->{$_}) } qw(exchangerate creditlimit creditremaining);
1713

  
1714
  # get details for customer/vendor
1715
  call_sub($::form->{vc} . "_details", qw(name department_1 department_2 street zipcode city country gln contact email phone fax), $::form->{vc} . "number");
1716
  $::form->{rowcount}--;
1717

  
1718
  my $cvars         = SL::DB::Shipto->new->cvars_by_config;
1719
  my @shipto_vars   = qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptogln
1720
                         shiptocontact shiptocp_gender shiptophone shiptofax shiptoemail
1721
                         shiptodepartment_1 shiptodepartment_2);
1722
  my $previous_form = $::auth->save_form_in_session(skip_keys => [ @shipto_vars, qw(header shipto_id), map { "shiptocvar_" . $_->config->name } @{ $cvars } ]);
1723
  $::form->{title}  = $::locale->text('Ship to');
1724
  $::form->header;
1725

  
1726
  my $vc_obj = ($::form->{vc} eq 'customer' ? "SL::DB::Customer" : "SL::DB::Vendor")->new(id => $::form->{$::form->{vc} . "_id"})->load;
1727

  
1728
  $_->value($::form->{"shiptocvar_" . $_->config->name}) for @{ $cvars };
1729

  
1730
  print $::form->parse_html_template('io/ship_to', { previousform => $previous_form,
1731
                                                     nextsub      => $::form->{display_form} || 'display_form',
1732
                                                     vc_obj       => $vc_obj,
1733
                                                     cvars        => $cvars,
1734
                                                   });
1735

  
1736
  $main::lxdebug->leave_sub();
1737
}
1738

  
1739
sub ship_to_entered {
1740
  $::auth->restore_form_from_session(delete $::form->{previousform});
1741
  call_sub($::form->{nextsub});
1742
}
1743

  
1744 1705
sub relink_accounts {
1745 1706
  $main::lxdebug->enter_sub();
1746 1707

  
locale/de/all
2615 2615
  'Set to paid missing'         => 'Fehlbetrag setzen',
2616 2616
  'Settings'                    => 'Einstellungen',
2617 2617
  'Setup Menu'                  => 'Menü-Variante',
2618
  'Ship to'                     => 'Lieferadresse',
2619 2618
  'Ship to (database ID)'       => 'Lieferadresse (Datenbank-ID)',
2620 2619
  'Ship via'                    => 'Transportmittel',
2621 2620
  'Shipping Address'            => 'Lieferadresse',
templates/webpages/io/ship_to.html
1
[% USE HTML %][% USE L %][% USE LxERP %][%- USE JavaScript -%]
2

  
3
<script type="text/javascript">
4
  var addresses = [
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
      shiptogln:          "[% JavaScript.escape(vc_obj.gln) %]",
13
      shiptocontact:      "[% JavaScript.escape(vc_obj.contact) %]",
14
      shiptocp_gender:    "[% JavaScript.escape(vc_obj.cp_gender) %]",
15
      shiptophone:        "[% JavaScript.escape(vc_obj.phone) %]",
16
      shiptofax:          "[% JavaScript.escape(vc_obj.fax) %]",
17
      shiptoemail:        "[% JavaScript.escape(vc_obj.email) %]"
18
[% FOREACH var = cvars %]
19
      , "shiptocvar_[% JavaScript.escape(var.config.name) %]": ""
20
[% END %]
21
    }
22

  
23
  [% FOREACH shipto = vc_obj.shipto %]
24
    ,
25
    { shiptoname:         "[% JavaScript.escape(shipto.shiptoname) %]",
26
      shiptodepartment_1: "[% JavaScript.escape(shipto.shiptodepartment_1) %]",
27
      shiptodepartment_2: "[% JavaScript.escape(shipto.shiptodepartment_2) %]",
28
      shiptostreet:       "[% JavaScript.escape(shipto.shiptostreet) %]",
29
      shiptozipcode:      "[% JavaScript.escape(shipto.shiptozipcode) %]",
30
      shiptocity:         "[% JavaScript.escape(shipto.shiptocity) %]",
31
      shiptocountry:      "[% JavaScript.escape(shipto.shiptocountry) %]",
32
      shiptogln:          "[% JavaScript.escape(shipto.shiptogln) %]",
33
      shiptocontact:      "[% JavaScript.escape(shipto.shiptocontact) %]",
34
      shiptocp_gender:    "[% JavaScript.escape(shipto.shiptocp_gender) %]",
35
      shiptophone:        "[% JavaScript.escape(shipto.shiptophone) %]",
36
      shiptofax:          "[% JavaScript.escape(shipto.shiptofax) %]",
37
      shiptoemail:        "[% JavaScript.escape(shipto.shiptoemail) %]"
38
    [% FOREACH var = shipto.cvars_by_config %]
39
      , "shiptocvar_[% JavaScript.escape(var.config.name) %]": "[% JavaScript.escape(var.value_as_text) %]"
40
    [% END %]
41
    }
42
  [% END %]
43
  ];
44

  
45
  function copy_address() {
46
    var shipto = addresses[ $('#shipto_to_copy').val() ];
47
    for (key in shipto)
48
      $('#' + key).val(shipto[key]);
49
  }
50

  
51
  function clear_fields() {
52
    var shipto = addresses[0];
53
    for (key in shipto)
54
      $('#' + key).val('');
55
    $('#shiptocp_gender').val('m');
56
  }
57

  
58
  function clear_shipto_id_before_submit() {
59
    var shipto = addresses[0];
60
    for (key in shipto)
61
      if ((key != 'shiptocp_gender') && ($('#' + key).val() != '')) {
62
        $('#shipto_id').val('');
63
        break;
64
      }
65

  
66
    $('form').submit();
67
  }
68
</script>
69

  
70
[% select_options = [ [ 0, LxERP.t8("Billing Address") ] ] ;
71
   FOREACH shipto = vc_obj.shipto ;
72
     tmpcity  = shipto.shiptozipcode _ ' ' _ shipto.shiptocity ;
73
     tmptitle = [ shipto.shiptoname, shipto.shiptostreet, tmpcity ] ;
74
     CALL select_options.import([ [ loop.count, tmptitle.grep('\S').join("; ") ] ]) ;
75
   END ;
76
   '' %]
77

  
78
 <form method="post" action="[% HTML.escape(script) %]">
79
  [% L.hidden_tag("shipto_id", shipto_id) %]
80

  
81
  <p>
82
   [% LxERP.t8("Copy address from master data") %]:
83
   [% L.select_tag("", select_options, id="shipto_to_copy", style="width: 400px") %]
84
   [% L.button_tag("copy_address()", LxERP.t8("Copy")) %]
85
   [% L.button_tag("clear_fields()", LxERP.t8("Clear fields")) %]
86
  </p>
87

  
88
  <table>
89
   <tr class="listheading">
90
    <th colspan="2" width="50%">[% LxERP.t8('Billing Address') %]</th>
91
    <th width="50%">[% LxERP.t8('Shipping Address') %]</th>
92
   </tr>
93
   <tr height="5"></tr>
94
   <tr>
95
    <th align="right" nowrap>[%- IF vc == "customer" %][%- LxERP.t8('Customer Number') %][%- ELSE %][%- LxERP.t8('Vendor Number') %][%- END %]</th>
96
    <td>[%- IF vc == "customer" %][%- HTML.escape(customernumber) %][%- ELSE %][%- HTML.escape(vendornumber) %][%- END %]</td>
97
   </tr>
98
   <tr>
99
    <th align="right" nowrap>[% LxERP.t8('Company Name') %]</th>
100
    <td>[% HTML.escape(name) %]</td>
101
    <td>[% L.input_tag("shiptoname", shiptoname, "size", "35") %]</td>
102
   </tr>
103
   <tr>
104
    <th align="right" nowrap>[% LxERP.t8('Department') %]</th>
105
    <td>[% HTML.escape(department_1) %]</td>
106
    <td>[% L.input_tag("shiptodepartment_1", shiptodepartment_1, "size", "35") %]</td>
107
   </tr>
108
   <tr>
109
    <th align="right" nowrap>&nbsp;</th>
110
    <td>[% HTML.escape(department_2) %]</td>
111
    <td>[% L.input_tag("shiptodepartment_2", shiptodepartment_2, "size", "35") %]</td>
112
   </tr>
113
   <tr>
114
    <th align="right" nowrap>[% LxERP.t8('Street') %]</th>
115
    <td>[% HTML.escape(street) %]</td>
116
    <td>[% L.input_tag("shiptostreet", shiptostreet, "size", "35") %]</td>
117
   </tr>
118
   <tr>
119
    <th align="right" nowrap>[% LxERP.t8('Zipcode') %]</th>
120
    <td>[% HTML.escape(zipcode) %]</td>
121
    <td>[% L.input_tag("shiptozipcode", shiptozipcode, "size", "35") %]</td>
122
   </tr>
123
   <tr>
124
    <th align="right" nowrap>[% LxERP.t8('City') %]</th>
125
    <td>[% HTML.escape(city) %]</td>
126
    <td>[% L.input_tag("shiptocity", shiptocity, "size", "35") %]</td>
127
   </tr>
128
   <tr>
129
    <th align="right" nowrap>[% LxERP.t8('Country') %]</th>
130
    <td>[% HTML.escape(country) %]</td>
131
    <td>[% L.input_tag("shiptocountry", shiptocountry, "size", "35") %]</td>
132
   </tr>
133
   <tr>
134
    <th align="right" nowrap>[% LxERP.t8('GLN') %]</th>
135
    <td>[% HTML.escape(gln) %]</td>
136
    <td>[% L.input_tag("shiptogln", shiptogln, "size", "35") %]</td>
137
   </tr>
138
   <tr>
139
    <th align="right" nowrap>[% LxERP.t8('Contact') %]</th>
140
    <td>[% HTML.escape(contact) %]</td>
141
    <td>[% L.input_tag("shiptocontact", shiptocontact, "size", "35") %]</td>
142
   </tr>
143
   <tr>
144
    <th align="right" nowrap>[% LxERP.t8('Gender') %]</th>
145
    <td></td>
146
    <td>
147
     [% L.select_tag('shiptocp_gender', [ [ 'm', LxERP.t8('male') ], [ 'f', LxERP.t8('female') ] ], 'default' = shiptocp_gender) %]
148
    </td>
149
   </tr>
150
   <tr>
151
    <th align="right" nowrap>[% LxERP.t8('Phone') %]</th>
152
    <td>[% HTML.escape(phone) %]</td>
153
    <td>[% L.input_tag("shiptophone", shiptophone, "size", "35") %]</td>
154
   </tr>
155
   <tr>
156
    <th align="right" nowrap>[% LxERP.t8('Fax') %]</th>
157
    <td>[% HTML.escape(fax) %]</td>
158
    <td>[% L.input_tag("shiptofax", shiptofax, "size", "35") %]</td>
159
   </tr>
160
   <tr>
161
    <th align="right" nowrap>[% LxERP.t8('E-mail') %]</th>
162
    <td>[% HTML.escape(email) %]</td>
163
    <td>[% L.input_tag("shiptoemail", shiptoemail, "size", "35") %]</td>
164
   </tr>
165
[% FOREACH var = cvars %]
166
   <tr valign="top">
167
    <th align="right" nowrap>[% HTML.escape(var.config.description) %]</th>
168
    <td></td>
169
    <td>[% INCLUDE 'common/render_cvar_input.html' cvar_name_prefix='shiptocvar_' %]</td>
170
   </tr>
171
[% END %]
172
  </table>
173

  
174
  <hr size="3" noshade>
175

  
176
  [% L.hidden_tag("action", "ship_to_entered") %]
177
  [% L.hidden_tag("nextsub", nextsub) %]
178
  [% L.hidden_tag("previousform", previousform) %]
179

  
180
  [% L.button_tag("clear_shipto_id_before_submit()", LxERP.t8("Continue")) %]
181
 </form>

Auch abrufbar als: Unified diff