<th width=10%>Datum</th>
<th width=10%>Buchung</th>
<th width=10%>Kategorie</th>
- <th width=60%>Verwendungszweck</th>
+ <th width=2%> </th>
+ <th width=58%>Verwendungszweck</th>
<th width=10%>Betrag</th>
</tr>
<?
printf ("<td width=\"10%%\" align=\"right\">%s</td>", $date);
printf ("<td width=\"10%%\" align=\"right\">%s</td>", $billing_date);
printf ("<td width=\"10%%\" align=\"center\">%s</td>", $row['category']);
- printf ("<td width=\"0%%\"><span class=\"edit\" route=\"Sales/EditDescription\" item_id=\"%d\">%s</span></td>",
+ printf ("<td width=\"2%%\" align=\"center\"><img src=\"<root_prefix>pix/if_europeanunion_4618.png\" class=\"eu\" alt=\"\" item_id=\"%d\"></td>",
+ $row['nr']);
+ printf ("<td width=\"58%%\"><span class=\"edit\" route=\"Sales/EditDescription\" item_id=\"%d\">%s</span></td>",
$row['nr'], $row['description']);
printf ("<td width=\"10%%\" align=\"right\">%5.2f</td>", $row['price']);
$sum += $row['price'];
$color = !$color;
}
printf ("<tr class=\"t%d\">", $color);
- echo ("<td width=\"85%\" colspan=\"4\"><b>Summe</b></td>");
+ echo ("<td width=\"85%\" colspan=\"5\"><b>Summe</b></td>");
printf ("<td width=\"15%%\" align=\"right\"><b>%5.2f</b></td>", $sum);
echo ("</tr>");
echo ("</table>");
<protect>
$(function(){
make_editable('table.smallfont tr span.edit');
+
+ $('table.smallfont tr img.eu').click(eu_popup);
});
+
+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);
+ });
+}
+
</protect>
</script>
</page>