fine tuning
This commit is contained in:
parent
99f6204695
commit
7207f6bded
1 changed files with 20 additions and 41 deletions
|
|
@ -7,80 +7,66 @@
|
|||
|
||||
|
||||
<h:panelGroup layout="block" styleClass="imixs-form-section"
|
||||
id="oderlist" binding="#{orderlistContainer}">
|
||||
id="oderlist" binding="#{orderlistContainer}">
|
||||
|
||||
<f:ajax render="oderlist" onevent="updateOrderItems">
|
||||
<table class="imixsdatatable imixs-orderitems">
|
||||
|
||||
<tr>
|
||||
<th style="width: 10px;">Pos.</th>
|
||||
<th style="width: 120px;">Positionsnummer<span class="imixs-required"> *</span></th>
|
||||
<th style="">#</th>
|
||||
<th style="">Positionsnummer<span class="imixs-required"> *</span></th>
|
||||
<th style="width: 50px;">Buchungsperiode</th>
|
||||
<th style="width: 30px;">Steuer</th>
|
||||
<th style="width: 100px;">Betrag</th>
|
||||
<th style="width: 5px;">
|
||||
<th style="width: 150px;">Steuer</th>
|
||||
<th style="width: 150px;text-align:right;">Betrag</th>
|
||||
<th style="">
|
||||
<!-- delete -->
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<ui:repeat var="orderitem" value="#{childItemController.childItems}">
|
||||
|
||||
|
||||
<tr>
|
||||
<!-- pos -->
|
||||
<td><h:outputText value="#{orderitem.item['numpos']}" /></td>
|
||||
|
||||
<!-- Name -->
|
||||
<td><h:inputText value="#{orderitem.item['name']}" /></td>
|
||||
|
||||
<td><h:inputText value="#{orderitem.item['name']}" style="width:100%;"/></td>
|
||||
|
||||
<!-- periode -->
|
||||
<td><h:inputText value="#{orderitem.item['period']}" /></td>
|
||||
|
||||
<td><h:inputText value="#{orderitem.item['period']}" style="width:100%;" /></td>
|
||||
|
||||
<!-- Steuer -->
|
||||
<td><h:inputText value="#{orderitem.item['tax']}" /></td>
|
||||
<td><h:inputText value="#{orderitem.item['tax']}" style="width:100%;" /></td>
|
||||
|
||||
|
||||
<!-- Betrag -->
|
||||
<td><h:inputText value="#{orderitem.item['amount']}"
|
||||
a:data-id="orderitem_amount" style="text-align: right;"
|
||||
onchange="calculateSummary()">
|
||||
<td style="text-align:right;"><h:inputText value="#{orderitem.item['amount']}"
|
||||
a:data-id="orderitem_amount" style="text-align: right;width:100%;">
|
||||
<f:convertNumber minFractionDigits="2" locale="de" />
|
||||
</h:inputText></td>
|
||||
</h:inputText>
|
||||
</td>
|
||||
|
||||
<td><h:commandLink
|
||||
actionListener="#{childItemController.remove(orderitem.item['numpos'])}">
|
||||
<td><h:commandLink actionListener="#{childItemController.remove(orderitem.item['numpos'])}">
|
||||
<span class="typcn typcn-trash imixs-state-info"></span>
|
||||
<f:ajax render="#{orderlistContainer.clientId}"
|
||||
onevent="updateOrderItems" />
|
||||
</h:commandLink>
|
||||
|
||||
|
||||
<!-- item summary -->
|
||||
<h:inputHidden value="#{orderitem.item['total']}" a:data-id="orderitem_total"/>
|
||||
<h:inputHidden value="#{orderitem.item['total_dsp']}" a:data-id="orderitem_total_dsp" />
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</ui:repeat>
|
||||
|
||||
<!-- summary -->
|
||||
<tr>
|
||||
<td />
|
||||
|
||||
<td />
|
||||
<td />
|
||||
<td />
|
||||
<td data-id="orderlist_summary" style="text-align: right;font-wight:bold;"></td>
|
||||
<td data-id="orderlist_summary" style="text-align: right;padding-right:10px;font-wight:bold;"></td>
|
||||
<td />
|
||||
</tr>
|
||||
</table>
|
||||
<!-- total summary -->
|
||||
<h:inputHidden value="#{workitem.item['order.total']}" a:data-id="orderitems_capacity" />
|
||||
<h:inputHidden value="#{workitem.item['order.total_dsp']}" a:data-id="orderitems_capacity_dsp" />
|
||||
|
||||
<!-- add button -->
|
||||
<h:commandButton value="#{message.add}" a:data-id="addposbutton_id"
|
||||
actionListener="#{childItemController.add}">
|
||||
|
|
@ -112,8 +98,8 @@
|
|||
// This method refreshs the layout
|
||||
function updateOrderItems(data) {
|
||||
if (data.status === 'success') {
|
||||
$('[id$=oderlist]').imixsLayout();
|
||||
calculateSummary();
|
||||
calculateSummary();
|
||||
$('[id$=oderlist]').imixsLayout();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -132,24 +118,17 @@
|
|||
// round
|
||||
sum = Math.round(sum * 100) / 100;
|
||||
total = total + sum;
|
||||
|
||||
$("[data-id='orderitem_total']",tableRow).val(sum);
|
||||
sum = convertToCurrency(sum);
|
||||
console.log('sum=' + sum);
|
||||
$("[data-id='orderitem_total_dsp']",tableRow).val(sum);
|
||||
$("[data-id='orderitem_summary']", tableRow).empty();
|
||||
$("[data-id='orderitem_summary']", tableRow).append(sum);
|
||||
|
||||
|
||||
//console.log('sum=' + sum);
|
||||
$("[data-id='orderitem_amount']",tableRow).val(sum);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// update total _capacity
|
||||
// update orderlist_summary
|
||||
$("[data-id='orderitems_capacity']").val(total);
|
||||
total = convertToCurrency(total);
|
||||
$("[data-id='orderitems_capacity_dsp']").val(total);
|
||||
$("[data-id='orderlist_summary']", ".imixs-orderitems").empty();
|
||||
$("[data-id='orderlist_summary']", ".imixs-orderitems").append(total);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue