(OFBIZ-8445) (OFBIZ-8447) (OFBIZ-8448) (OFBIZ-8450) ( OFBIZ-8451) (OFBIZ-8653) (OFBIZ-8740) (OFBIZ-8741) (OFBIZ-8742) (OFBIZ-8743) Thanks: Devanshu Vyas, Anuj Jain, Sega Patidar, Abhijeet Ashapure for your patches git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1768209 13f79535-47bb-0310-9956-ffa450edef68
61 lines
3.5 KiB
XML
61 lines
3.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
|
|
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
|
|
|
|
<simple-method method-name="createInvoiceItemPayrol" short-description="Create a new Invoice Item with Payrol Item Type">
|
|
<entity-condition entity-name="InvoiceItemType" list="PayrolGroup">
|
|
<condition-expr field-name="parentTypeId" value="PAYROL"/>
|
|
</entity-condition>
|
|
<entity-condition entity-name="InvoiceItemType" list="PayrolList"/>
|
|
<iterate list="PayrolGroup" entry="payrolGroup">
|
|
<iterate list="PayrolList" entry="payrolList">
|
|
<if-compare field="payrolList.parentTypeId" value="${payrolGroup.invoiceItemTypeId}" operator="equals">
|
|
<set field="AddInvoiceItem" value="N"/>
|
|
<set field="createInvoiceItem.invoiceId" from-field="parameters.invoiceId"/>
|
|
<set field="createInvoiceItem.invoiceItemTypeId" from-field="payrolList.invoiceItemTypeId"/>
|
|
<set field="createInvoiceItem.description" value="${payrolGroup.description} : ${payrolList.description}"/>
|
|
<set field="createInvoiceItem.quantity" from-field="parameters.${payrolList.invoiceItemTypeId}_Quantity"/>
|
|
<if-not-empty field="parameters.${payrolList.invoiceItemTypeId}_Quantity">
|
|
<set field="AddInvoiceItem" value="Y"/>
|
|
</if-not-empty>
|
|
<set field="createInvoiceItem.amount" from-field="parameters.${payrolList.invoiceItemTypeId}_Amount"/>
|
|
<if-not-empty field="parameters.${payrolList.invoiceItemTypeId}_Amount">
|
|
<set field="AddInvoiceItem" value="Y"/>
|
|
</if-not-empty>
|
|
<if-compare field="AddInvoiceItem" value="Y" operator="equals">
|
|
<!-- negate amount if required -->
|
|
<if-compare field="payrolGroup.invoiceItemTypeId" value="PAYROL_EARN_HOURS" operator="not-equals">
|
|
<calculate field="createInvoiceItem.amount">
|
|
<calcop operator="multiply" field="createInvoiceItem.amount">
|
|
<number value="-1"/>
|
|
</calcop>
|
|
</calculate>
|
|
</if-compare>
|
|
<call-service service-name="createInvoiceItem" in-map-name="createInvoiceItem"/>
|
|
</if-compare>
|
|
</if-compare>
|
|
</iterate>
|
|
</iterate>
|
|
</simple-method>
|
|
|
|
</simple-methods>
|