<?xml version="1.0" encoding="UTF-8"?>
<definition xmlns="http://www.xmlportletfactory.org/xml/xmlportletfactory" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xmlportletfactory.org/xml/xmlportletfactory xmlportletfactory.xsd">
<!-- 

	This is a XMLPortletFactory (v.-2.5) XML definition file for Calculated Field testing purposes
	Tested on Liferay 6.0.x, 6.1.x and 6.2.x
	Colaboration lead by Davide Rossi - November 2012

 -->
	<commonData>
        <client>Xmlpf</client>
		<projectName>Calculated</projectName>
        <version>1</version>
	</commonData>
	<applications>
		<application>
			<classDef>
				<name>Calculated</name>
				<title>Calculated Fields</title>
			</classDef>
			<fileDef>
				<name>Calculated</name>
				<fields>
					<field>
						<name>calculatedId</name>
						<title>Calculated Id</title>
						<type>
							<long>
								<length>5</length>
								<signed>false</signed>
								<nullable>false</nullable>
							</long>
						</type>
						<showFieldInView>false</showFieldInView>
					</field>
					<field>
						<name>calculatedName</name>
						<title>Name</title>
						<type>
							<varchar>
								<filter>true</filter>
								<length>20</length>
								<order>true</order>
							</varchar>
						</type>
						<showFieldInView>true</showFieldInView>
						<required>true</required>
					</field>
					<field>
						<name>price</name>
						<title>Price</title>
						<type>
							<float>
								<length>8</length>
								<decimals>2</decimals>
							</float>
						</type>
						<showFieldInView>true</showFieldInView>
						<required>true</required>
					</field>
					<field>
						<name>percentDiscount</name>
						<title>Discount percentage</title>
						<type>
							<float>
								<length>8</length>
								<decimals>2</decimals>
							</float>
						</type>
						<showFieldInView>true</showFieldInView>
						<required>true</required>
					</field>
					<field>
						<name>percentVAT</name>
						<title>VAT percentage</title>
						<type>
							<float>
								<length>8</length>
								<decimals>2</decimals>
							</float>
						</type>
						<showFieldInView>true</showFieldInView>
						<required>true</required>
					</field>
					<field>
						<name>calculatedTotal</name>
						<title>Total</title> 
						<type> 
 							<calculated>(price-(price*(percentDiscount/100)))+(price*(percentVAT/100))</calculated>
						</type>
						<showFieldInView>true</showFieldInView>
						<required>true</required>
					</field>
				</fields>
			</fileDef>
		</application>
	</applications>
</definition>