Revision 7ede2933
Von Sven Schöling vor mehr als 8 Jahren hinzugefügt
js/kivi.Order.js | ||
---|---|---|
1 | 1 |
namespace('kivi.Order', function(ns) { |
2 | 2 |
ns.check_cv = function() { |
3 | 3 |
if ($('#type').val() == 'sales_order') { |
4 |
if ($('#order_customer_id').val() == '') { |
|
4 |
if ($('#order_customer_id').val() === '') {
|
|
5 | 5 |
alert(kivi.t8('Please select a customer.')); |
6 | 6 |
return false; |
7 | 7 |
} |
8 | 8 |
} else { |
9 |
if ($('#order_vendor_id').val() == '') { |
|
9 |
if ($('#order_vendor_id').val() === '') {
|
|
10 | 10 |
alert(kivi.t8('Please select a vendor.')); |
11 | 11 |
return false; |
12 | 12 |
} |
... | ... | |
199 | 199 |
kivi.run_once_for('.row_entry', 'on_kbd_click_show_hide', function(elt) { |
200 | 200 |
$(elt).keydown(function(event) { |
201 | 201 |
var row; |
202 |
if(event.keyCode == 40 && event.shiftKey == true) { |
|
202 |
if(event.keyCode == 40 && event.shiftKey === true) {
|
|
203 | 203 |
// shift arrow down |
204 | 204 |
event.preventDefault(); |
205 | 205 |
row = $(event.target).parents(".row_entry").first(); |
206 | 206 |
$(row).children().not(':first').show(); |
207 | 207 |
return false; |
208 | 208 |
} |
209 |
if(event.keyCode == 38 && event.shiftKey == true) { |
|
209 |
if(event.keyCode == 38 && event.shiftKey === true) {
|
|
210 | 210 |
// shift arrow up |
211 | 211 |
event.preventDefault(); |
212 | 212 |
row = $(event.target).parents(".row_entry").first(); |
... | ... | |
246 | 246 |
} else { |
247 | 247 |
dir = "1"; |
248 | 248 |
src = "image/down.png"; |
249 |
};
|
|
249 |
} |
|
250 | 250 |
|
251 | 251 |
$('#' + order_by + '_header_id a').append('<img border=0 data-sort-dir=' + dir + ' src=' + src + ' alt="' + kivi.t8('sort items') + '">'); |
252 | 252 |
|
... | ... | |
269 | 269 |
}; |
270 | 270 |
|
271 | 271 |
ns.add_item = function() { |
272 |
if ($('#add_item_parts_id').val() == '') return; |
|
272 |
if ($('#add_item_parts_id').val() === '') return;
|
|
273 | 273 |
if (!ns.check_cv()) return; |
274 | 274 |
|
275 | 275 |
$('#row_table_id thead a img').remove(); |
... | ... | |
379 | 379 |
|
380 | 380 |
var editable_div_elt = $(row).find('[name="editable_price"]'); |
381 | 381 |
var not_editable_div_elt = $(row).find('[name="not_editable_price"]'); |
382 |
if (price_editable == 1 && source == '') { |
|
382 |
if (price_editable == 1 && source === '') {
|
|
383 | 383 |
// editable |
384 | 384 |
$(editable_div_elt).show(); |
385 | 385 |
$(not_editable_div_elt).hide(); |
... | ... | |
414 | 414 |
|
415 | 415 |
var editable_div_elt = $(row).find('[name="editable_discount"]'); |
416 | 416 |
var not_editable_div_elt = $(row).find('[name="not_editable_discount"]'); |
417 |
if (price_editable == 1 && source == '') { |
|
417 |
if (price_editable == 1 && source === '') {
|
|
418 | 418 |
// editable |
419 | 419 |
$(editable_div_elt).show(); |
420 | 420 |
$(not_editable_div_elt).hide(); |
Auch abrufbar als: Unified diff
Order: javascript Kleinigkeiten