Revision 4cb932ab
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
bin/mozilla/oe.pl | ||
---|---|---|
51 | 51 |
use SL::DB::Customer; |
52 | 52 |
use SL::DB::TaxZone; |
53 | 53 |
use SL::DB::PaymentTerm; |
54 |
use SL::DB::Vendor; |
|
54 | 55 |
|
55 | 56 |
require "bin/mozilla/common.pl"; |
56 | 57 |
require "bin/mozilla/io.pl"; |
... | ... | |
451 | 452 |
if ($form->{id}) { |
452 | 453 |
$TMPL_VAR{oe_obj} = SL::DB::Order->new(id => $form->{id})->load; |
453 | 454 |
} |
455 |
$TMPL_VAR{vc_obj} = SL::DB::Customer->new(id => $form->{customer_id})->load if $form->{customer_id}; |
|
456 |
$TMPL_VAR{vc_obj} = SL::DB::Vendor->new(id => $form->{vendor_id})->load if $form->{vendor_id}; |
|
454 | 457 |
|
455 | 458 |
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig); |
456 | 459 |
|
... | ... | |
592 | 595 |
$TMPL_VAR{HIDDENS} = [ map { name => $_, value => $form->{$_} }, |
593 | 596 |
qw(id action type vc formname media format proforma queued printed emailed |
594 | 597 |
title creditlimit creditremaining tradediscount business |
595 |
max_dunning_level dunning_amount shiptoname shiptostreet shiptozipcode |
|
596 |
CFDD_shipto CFDD_shipto_id shiptocity shiptocountry shiptogln shiptocontact shiptophone shiptofax |
|
597 |
shiptodepartment_1 shiptodepartment_2 shiptoemail shiptocp_gender |
|
598 |
max_dunning_level dunning_amount |
|
599 |
CFDD_shipto CFDD_shipto_id |
|
598 | 600 |
message email subject cc bcc taxpart taxservice taxaccounts cursor_fokus |
599 | 601 |
show_details useasnew), |
600 | 602 |
@custom_hiddens, |
js/kivi.SalesPurchase.js | ||
---|---|---|
134 | 134 |
$.post('is.pl', data, kivi.eval_json_result); |
135 | 135 |
}); |
136 | 136 |
}; |
137 |
|
|
138 |
// Functions dialog with entering shipping addresses. |
|
139 |
this.shipto_addresses = []; |
|
140 |
|
|
141 |
this.copy_shipto_address = function () { |
|
142 |
var shipto = this.shipto_addresses[ $('#shipto_to_copy').val() ]; |
|
143 |
for (var key in shipto) |
|
144 |
$('#' + key).val(shipto[key]); |
|
145 |
}; |
|
146 |
|
|
147 |
this.clear_shipto_fields = function() { |
|
148 |
var shipto = this.shipto_addresses[0]; |
|
149 |
for (var key in shipto) |
|
150 |
$('#' + key).val(''); |
|
151 |
$('#shiptocp_gender').val('m'); |
|
152 |
}; |
|
153 |
|
|
154 |
this.clear_shipto_id_before_submit = function() { |
|
155 |
var shipto = this.shipto_addresses[0]; |
|
156 |
for (var key in shipto) |
|
157 |
if ((key != 'shiptocp_gender') && ($('#' + key).val() !== '')) { |
|
158 |
$('#shipto_id').val(''); |
|
159 |
break; |
|
160 |
} |
|
161 |
}; |
|
162 |
|
|
163 |
this.setup_shipto_dialog = function() { |
|
164 |
var $dlg = $('#shipto_dialog'); |
|
165 |
|
|
166 |
$('#shipto_dialog [name^="shipto"]').each(function(idx, elt) { |
|
167 |
$dlg.data("original-" + $(elt).prop("name"), $(elt).val()); |
|
168 |
}); |
|
169 |
|
|
170 |
$dlg.data('confirmed', false); |
|
171 |
|
|
172 |
$('#shiptoname').focus(); |
|
173 |
}; |
|
174 |
|
|
175 |
this.submit_custom_shipto = function() { |
|
176 |
$('#shipto_id').val(''); |
|
177 |
$('#shipto_dialog').data('confirmed', true); |
|
178 |
$('#shipto_dialog').dialog('close'); |
|
179 |
}; |
|
180 |
|
|
181 |
this.reset_shipto_fields = function() { |
|
182 |
var $dlg = $('#shipto_dialog'); |
|
183 |
|
|
184 |
$('#shipto_dialog [name^="shipto"]').each(function(idx, elt) { |
|
185 |
$(elt).val($dlg.data("original-" + $(elt).prop("name"))); |
|
186 |
}); |
|
187 |
}; |
|
188 |
|
|
189 |
this.finish_shipto_dialog = function() { |
|
190 |
if (!$('#shipto_dialog').data('confirmed')) |
|
191 |
kivi.SalesPurchase.reset_shipto_fields(); |
|
192 |
|
|
193 |
$('#shipto_dialog').children().remove().appendTo('#shipto_inputs'); |
|
194 |
|
|
195 |
return true; |
|
196 |
}; |
|
197 |
|
|
198 |
this.edit_custom_shipto = function() { |
|
199 |
$('#shipto_inputs').children().remove().appendTo('#shipto_dialog'); |
|
200 |
|
|
201 |
kivi.popup_dialog({ |
|
202 |
id: 'shipto_dialog', |
|
203 |
dialog: { |
|
204 |
height: 600, |
|
205 |
title: kivi.t8('Edit custom shipto'), |
|
206 |
open: kivi.SalesPurchase.setup_shipto_dialog, |
|
207 |
close: kivi.SalesPurchase.finish_shipto_dialog, |
|
208 |
} |
|
209 |
}); |
|
210 |
}; |
|
137 | 211 |
}); |
js/locale/de.js | ||
---|---|---|
48 | 48 |
"Download picture":"Bild herunterladen", |
49 | 49 |
"Edit":"Bearbeiten", |
50 | 50 |
"Edit article/section assignments":"Zuweisung Artikel/Abschnitte bearbeiten", |
51 |
"Edit custom shipto":"Individuelle Lieferadresse bearbeiten", |
|
51 | 52 |
"Edit picture":"Bild bearbeiten", |
52 | 53 |
"Edit project link":"Projektverknüpfung bearbeiten", |
53 | 54 |
"Edit text block":"Textblock bearbeiten", |
locale/de/all | ||
---|---|---|
286 | 286 |
'Ap aging on %s' => 'Offene Verbindlichkeiten an %s', |
287 | 287 |
'Application Error. No Format given' => 'Fehler in der Anwendung. Das Ausgabeformat fehlt.', |
288 | 288 |
'Application Error. Wrong Format' => 'Fehler in der Anwendung. Falsches Format: ', |
289 |
'Apply' => 'Anwenden', |
|
289 | 290 |
'Apply to all parts' => 'Bei allen Artikeln setzen', |
290 | 291 |
'Apply to all transfers' => 'Bei allen Lagerbewegungen setzen', |
291 | 292 |
'Apply to parts without booking group' => 'Bei allen Artikeln ohne gültige Buchungsgruppe setzen', |
... | ... | |
765 | 766 |
'Current year' => 'Aktuelles Jahr', |
766 | 767 |
'Currently #1 delivery orders can be converted into invoices and printed.' => 'Momentan können #1 Lieferscheine in Rechnungen umgewandelt werden.', |
767 | 768 |
'Custom Variables' => 'Benutzerdefinierte Variablen', |
769 |
'Custom shipto' => 'Individuelle Lieferadresse', |
|
768 | 770 |
'Custom variables for module' => 'Benutzerdefinierte Variablen für Modul', |
769 | 771 |
'Customer' => 'Kunde', |
770 | 772 |
'Customer (database ID)' => 'Kunde (Datenbank-ID)', |
... | ... | |
1116 | 1118 |
'Edit booking group' => 'Buchungsgruppe bearbeiten', |
1117 | 1119 |
'Edit business' => 'Kunden-/Lieferantentyp bearbeiten', |
1118 | 1120 |
'Edit complexity' => 'Komplexitätsgrad bearbeiten', |
1121 |
'Edit custom shipto' => 'Individuelle Lieferadresse bearbeiten', |
|
1119 | 1122 |
'Edit custom variable' => 'Benutzerdefinierte Variable bearbeiten', |
1120 | 1123 |
'Edit delivery term' => 'Lieferbedingungen bearbeiten', |
1121 | 1124 |
'Edit department' => 'Abteilung bearbeiten', |
templates/webpages/common/_ship_to_dialog.html | ||
---|---|---|
1 |
[% USE HTML %][% USE L %][% USE LxERP %][%- USE JavaScript -%] |
|
2 |
|
|
3 |
<script type="text/javascript"> |
|
4 |
$(function() { |
|
5 |
kivi.SalesPurchase.shipto_addresses = [ |
|
6 |
{ shiptoname: "[% JavaScript.escape(vc_obj.name) %]", |
|
7 |
shiptodepartment_1: "[% JavaScript.escape(vc_obj.department_1) %]", |
|
8 |
shiptodepartment_2: "[% JavaScript.escape(vc_obj.department_2) %]", |
|
9 |
shiptostreet: "[% JavaScript.escape(vc_obj.street) %]", |
|
10 |
shiptozipcode: "[% JavaScript.escape(vc_obj.zipcode) %]", |
|
11 |
shiptocity: "[% JavaScript.escape(vc_obj.city) %]", |
|
12 |
shiptocountry: "[% JavaScript.escape(vc_obj.country) %]", |
|
13 |
shiptogln: "[% JavaScript.escape(vc_obj.gln) %]", |
|
14 |
shiptocontact: "[% JavaScript.escape(vc_obj.contact) %]", |
|
15 |
shiptocp_gender: "[% JavaScript.escape(vc_obj.cp_gender) %]", |
|
16 |
shiptophone: "[% JavaScript.escape(vc_obj.phone) %]", |
|
17 |
shiptofax: "[% JavaScript.escape(vc_obj.fax) %]", |
|
18 |
shiptoemail: "[% JavaScript.escape(vc_obj.email) %]" |
|
19 |
[% FOREACH var = cvars %] |
|
20 |
, "shiptocvar_[% JavaScript.escape(var.config.name) %]": "" |
|
21 |
[% END %] |
|
22 |
} |
|
23 |
|
|
24 |
[% FOREACH shipto = vc_obj.shipto %] |
|
25 |
, |
|
26 |
{ shiptoname: "[% JavaScript.escape(shipto.shiptoname) %]", |
|
27 |
shiptodepartment_1: "[% JavaScript.escape(shipto.shiptodepartment_1) %]", |
|
28 |
shiptodepartment_2: "[% JavaScript.escape(shipto.shiptodepartment_2) %]", |
|
29 |
shiptostreet: "[% JavaScript.escape(shipto.shiptostreet) %]", |
|
30 |
shiptozipcode: "[% JavaScript.escape(shipto.shiptozipcode) %]", |
|
31 |
shiptocity: "[% JavaScript.escape(shipto.shiptocity) %]", |
|
32 |
shiptocountry: "[% JavaScript.escape(shipto.shiptocountry) %]", |
|
33 |
shiptogln: "[% JavaScript.escape(shipto.shiptogln) %]", |
|
34 |
shiptocontact: "[% JavaScript.escape(shipto.shiptocontact) %]", |
|
35 |
shiptocp_gender: "[% JavaScript.escape(shipto.shiptocp_gender) %]", |
|
36 |
shiptophone: "[% JavaScript.escape(shipto.shiptophone) %]", |
|
37 |
shiptofax: "[% JavaScript.escape(shipto.shiptofax) %]", |
|
38 |
shiptoemail: "[% JavaScript.escape(shipto.shiptoemail) %]" |
|
39 |
[% FOREACH var = shipto.cvars_by_config %] |
|
40 |
, "shiptocvar_[% JavaScript.escape(var.config.name) %]": "[% JavaScript.escape(var.value_as_text) %]" |
|
41 |
[% END %] |
|
42 |
} |
|
43 |
[% END %] |
|
44 |
]; |
|
45 |
}); |
|
46 |
</script> |
|
47 |
|
|
48 |
[% select_options = [ [ 0, LxERP.t8("Billing Address") ] ] ; |
|
49 |
FOREACH shipto = vc_obj.shipto ; |
|
50 |
tmpcity = shipto.shiptozipcode _ ' ' _ shipto.shiptocity ; |
|
51 |
tmptitle = [ shipto.shiptoname, shipto.shiptostreet, tmpcity ] ; |
|
52 |
CALL select_options.import([ [ loop.count, tmptitle.grep('\S').join("; ") ] ]) ; |
|
53 |
END ; |
|
54 |
'' %] |
|
55 |
|
|
56 |
<p> |
|
57 |
[% LxERP.t8("Copy address from master data") %]: |
|
58 |
[% L.select_tag("", select_options, id="shipto_to_copy", style="width: 300px") %] |
|
59 |
[% L.button_tag("kivi.SalesPurchase.copy_shipto_address()", LxERP.t8("Copy")) %] |
|
60 |
</p> |
|
61 |
|
|
62 |
<table> |
|
63 |
<tr class="listheading"> |
|
64 |
<th></th> |
|
65 |
<th>[% LxERP.t8('Billing Address') %]</th> |
|
66 |
<th>[% LxERP.t8('Shipping Address') %]</th> |
|
67 |
</tr> |
|
68 |
<tr height="5"></tr> |
|
69 |
<tr> |
|
70 |
<th align="right" nowrap>[%- IF vc == "customer" %][%- LxERP.t8('Customer Number') %][%- ELSE %][%- LxERP.t8('Vendor Number') %][%- END %]</th> |
|
71 |
<td>[%- IF vc == "customer" %][%- HTML.escape(vc_obj.customernumber) %][%- ELSE %][%- HTML.escape(vc_obj.vendornumber) %][%- END %]</td> |
|
72 |
</tr> |
|
73 |
<tr> |
|
74 |
<th align="right" nowrap>[% LxERP.t8('Company Name') %]</th> |
|
75 |
<td>[% HTML.escape(vc_obj.name) %]</td> |
|
76 |
<td>[% L.input_tag("shiptoname", shiptoname, "size", "35") %]</td> |
|
77 |
</tr> |
|
78 |
<tr> |
|
79 |
<th align="right" nowrap>[% LxERP.t8('Department') %]</th> |
|
80 |
<td>[% HTML.escape(vc_obj.department_1) %]</td> |
|
81 |
<td>[% L.input_tag("shiptodepartment_1", shiptodepartment_1, "size", "35") %]</td> |
|
82 |
</tr> |
|
83 |
<tr> |
|
84 |
<th align="right" nowrap> </th> |
|
85 |
<td>[% HTML.escape(vc_obj.department_2) %]</td> |
|
86 |
<td>[% L.input_tag("shiptodepartment_2", shiptodepartment_2, "size", "35") %]</td> |
|
87 |
</tr> |
|
88 |
<tr> |
|
89 |
<th align="right" nowrap>[% LxERP.t8('Street') %]</th> |
|
90 |
<td>[% HTML.escape(vc_obj.street) %]</td> |
|
91 |
<td>[% L.input_tag("shiptostreet", shiptostreet, "size", "35") %]</td> |
|
92 |
</tr> |
|
93 |
<tr> |
|
94 |
<th align="right" nowrap>[% LxERP.t8('Zipcode') %]</th> |
|
95 |
<td>[% HTML.escape(vc_obj.zipcode) %]</td> |
|
96 |
<td>[% L.input_tag("shiptozipcode", shiptozipcode, "size", "35") %]</td> |
|
97 |
</tr> |
|
98 |
<tr> |
|
99 |
<th align="right" nowrap>[% LxERP.t8('City') %]</th> |
|
100 |
<td>[% HTML.escape(vc_obj.city) %]</td> |
|
101 |
<td>[% L.input_tag("shiptocity", shiptocity, "size", "35") %]</td> |
|
102 |
</tr> |
|
103 |
<tr> |
|
104 |
<th align="right" nowrap>[% LxERP.t8('Country') %]</th> |
|
105 |
<td>[% HTML.escape(vc_obj.country) %]</td> |
|
106 |
<td>[% L.input_tag("shiptocountry", shiptocountry, "size", "35") %]</td> |
|
107 |
</tr> |
|
108 |
<tr> |
|
109 |
<th align="right" nowrap>[% LxERP.t8('GLN') %]</th> |
|
110 |
<td>[% HTML.escape(vc_obj.gln) %]</td> |
|
111 |
<td>[% L.input_tag("shiptogln", shiptogln, "size", "35") %]</td> |
|
112 |
</tr> |
|
113 |
<tr> |
|
114 |
<th align="right" nowrap>[% LxERP.t8('Contact') %]</th> |
|
115 |
<td>[% HTML.escape(vc_obj.contact) %]</td> |
|
116 |
<td>[% L.input_tag("shiptocontact", shiptocontact, "size", "35") %]</td> |
|
117 |
</tr> |
|
118 |
<tr> |
|
119 |
<th align="right" nowrap>[% LxERP.t8('Gender') %]</th> |
|
120 |
<td></td> |
|
121 |
<td> |
|
122 |
[% L.select_tag('shiptocp_gender', [ [ 'm', LxERP.t8('male') ], [ 'f', LxERP.t8('female') ] ], 'default' = shiptocp_gender) %] |
|
123 |
</td> |
|
124 |
</tr> |
|
125 |
<tr> |
|
126 |
<th align="right" nowrap>[% LxERP.t8('Phone') %]</th> |
|
127 |
<td>[% HTML.escape(vc_obj.phone) %]</td> |
|
128 |
<td>[% L.input_tag("shiptophone", shiptophone, "size", "35") %]</td> |
|
129 |
</tr> |
|
130 |
<tr> |
|
131 |
<th align="right" nowrap>[% LxERP.t8('Fax') %]</th> |
|
132 |
<td>[% HTML.escape(vc_obj.fax) %]</td> |
|
133 |
<td>[% L.input_tag("shiptofax", shiptofax, "size", "35") %]</td> |
|
134 |
</tr> |
|
135 |
<tr> |
|
136 |
<th align="right" nowrap>[% LxERP.t8('E-mail') %]</th> |
|
137 |
<td>[% HTML.escape(vc_obj.email) %]</td> |
|
138 |
<td>[% L.input_tag("shiptoemail", shiptoemail, "size", "35") %]</td> |
|
139 |
</tr> |
|
140 |
[% FOREACH var = cvars %] |
|
141 |
<tr valign="top"> |
|
142 |
<th align="right" nowrap>[% HTML.escape(var.config.description) %]</th> |
|
143 |
<td></td> |
|
144 |
<td>[% INCLUDE 'common/render_cvar_input.html' cvar_name_prefix='shiptocvar_' %]</td> |
|
145 |
</tr> |
|
146 |
[% END %] |
|
147 |
</table> |
|
148 |
|
|
149 |
<p> |
|
150 |
[% L.button_tag("kivi.SalesPurchase.submit_custom_shipto()", LxERP.t8("Apply")) %] |
|
151 |
[% L.button_tag("kivi.SalesPurchase.reset_shipto_fields()", LxERP.t8("Reset")) %] |
|
152 |
[% L.button_tag("kivi.SalesPurchase.clear_shipto_fields()", LxERP.t8("Clear fields")) %] |
|
153 |
[% L.button_tag("\$('#shipto_dialog').dialog('close');", LxERP.t8("Abort")) %] |
|
154 |
</p> |
templates/webpages/oe/form_footer.html | ||
---|---|---|
143 | 143 |
<input type="hidden" name="vendor_discount" value="[% HTML.escape(vendor_discount) %]"> |
144 | 144 |
[% END %] |
145 | 145 |
|
146 |
<div id="shipto_inputs" class="hidden"> |
|
147 |
[%- PROCESS 'common/_ship_to_dialog.html' %] |
|
148 |
</div> |
|
146 | 149 |
</form> |
150 |
|
|
151 |
<div id="shipto_dialog" class="hidden"></div> |
templates/webpages/oe/form_header.html | ||
---|---|---|
73 | 73 |
</td> |
74 | 74 |
</tr> |
75 | 75 |
[%- END %] |
76 |
[%- IF ALL_SHIPTO.size %] |
|
77 | 76 |
<tr> |
78 | 77 |
<th align="right">[% 'Shipping Address' | $T8 %]</th> |
79 | 78 |
<td> |
79 |
[%- IF ALL_SHIPTO.size %] |
|
80 | 80 |
[% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ; |
81 | 81 |
L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', style='width: 250px') %] |
82 |
[% L.submit_tag('action_ship_to', LxERP.t8('Ship to')) %] |
|
82 |
[%- END %] |
|
83 |
[% L.button_tag("kivi.SalesPurchase.edit_custom_shipto()", LxERP.t8("Custom shipto")) %] |
|
83 | 84 |
</td> |
84 | 85 |
</tr> |
85 |
[%- END %] |
|
86 | 86 |
[%- IF is_order %] |
87 | 87 |
<tr> |
88 | 88 |
<td align="right">[% 'Credit Limit' | $T8 %]</td> |
Auch abrufbar als: Unified diff
ActionBar: Angebote/Aufträge: Lieferadresse via Popup bearbeiten