+
+var euwindow = false;
+function eu_popup(event)
+{
+ var content = ['<div id="eubody">',
+ '<input type="hidden" id="eu_nr">',
+ '<label for="eu_uid"></label>',
+ '<input type="text" id="eu_uid" style="width:100%;">',
+ '<br>',
+ '<button style="margin-top:5px;">Speichern</button>',
+ '</div>'];
+
+ if (!euwindow) {
+ euwindow = new Popup('Inner-EU-Rechnung', '250px', false, content.join(''));
+ euwindow.centerPopup();
+ $('div#eubody button').click(function(event){
+ $.invoke('Sales/SetUID',
+ {id: $('#eu_nr').val(),
+ uid: $('#eu_uid').val()},
+ function(data){
+ euwindow.closePopup();
+ show_message('UID des Lieferanten für innergemeinschaftlichen Erwerb gespeichert', 3);
+ });
+ });
+ } else {
+ euwindow.openPopup();
+ }
+
+ $('#eu_nr').val($(event.target).attr('item_id'));
+ $.invoke('Sales/GetUID',
+ {id: $(event.target).attr('item_id')},
+ function(data){
+ $('label[for="eu_uid"]').text(data.description);
+ $('#eu_uid').val(data.uid);
+ });
+}
+