Revision fec397bf
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
js/requirement_spec.js | ||
---|---|---|
153 | 153 |
|
154 | 154 |
ns.create_context_menus(data.is_template); |
155 | 155 |
$('#requirement_spec_tabs').on("tabsbeforeactivate", ns.tabs_before_activate); |
156 |
|
|
157 |
ns.time_based_units = data.time_based_units; |
|
156 | 158 |
}; |
157 | 159 |
|
158 | 160 |
// ------------------------------------------------------------------------- |
... | ... | |
565 | 567 |
}).each(function(idx, elt) { |
566 | 568 |
$(elt).val(order_part_name); |
567 | 569 |
}); |
570 |
|
|
571 |
var unit = $('#quotations_and_orders_order_id').closest('td').data('unit'); |
|
572 |
var text = ns.time_based_units[unit] ? kivi.t8("time and effort based position") : kivi.t8("flat-rate position"); |
|
573 |
|
|
574 |
$('#quotations_and_orders_form [data-unit-column=1]').html(unit); |
|
575 |
$('#quotations_and_orders_form [data-position-type-column=1]').html(text); |
|
576 |
}; |
|
577 |
|
|
578 |
ns.assign_order_part_on_part_picked = function(event, item) { |
|
579 |
if (!item || !item.unit) |
|
580 |
return; |
|
581 |
|
|
582 |
var $elt = $(this), |
|
583 |
id = $elt.prop('id'); |
|
584 |
|
|
585 |
if (id == 'quotations_and_orders_order_id') |
|
586 |
$elt.closest('td').data('unit', item.unit); |
|
587 |
|
|
588 |
else { |
|
589 |
var $tr = $elt.closest('tr'); |
|
590 |
var text = ns.time_based_units[item.unit] ? kivi.t8("time and effort based position") : kivi.t8("flat-rate position"); |
|
591 |
|
|
592 |
$tr.find('[data-unit-column=1]').html(item.unit); |
|
593 |
$tr.find('[data-position-type-column=1]').html(text); |
|
594 |
} |
|
568 | 595 |
}; |
569 | 596 |
|
570 | 597 |
// ------------------------------------------------------------------------- |
... | ... | |
1037 | 1064 |
}; |
1038 | 1065 |
|
1039 | 1066 |
}); // end of namespace(...., function() {... |
1067 |
|
|
1068 |
function local_reinit_widgets() { |
|
1069 |
kivi.run_once_for('#quotations_and_orders_order_id,[name="sections[].order_part_id"]', "assign_order_part_on_part_picked", function(elt) { |
|
1070 |
$(elt).on('set_item:PartPicker', kivi.requirement_spec.assign_order_part_on_part_picked); |
|
1071 |
}); |
|
1072 |
} |
Auch abrufbar als: Unified diff
Pflichtenheftaufträge: beliebige Artikel auswählen können
Zusätzlich werden dann Spalten angezeigt, die die Einheit und den im
Angebot/Auftrag verwendeten Positionstypen (Pauschalposition/
Auwandsposition) angeben.