<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">

    <module name="account" package="com.axelor.apps.account.db"/>

    <entity name="CashInventory" lang="java">

        <string name="ref" title="Reference" namecolumn="true" required="false"/>
        <integer name="statusSelect" title="Status" default="1" readonly="true" selection="account.cash.status.select"/>
        <integer name="operationTypeSelect" title="Payment type" required="true" selection="account.cash.operation.type.select"/>

        <datetime name="realDate" />
        <decimal name="theoricalSolde" />
        <decimal name="physicalSolde" />
        <many-to-one name="company" ref="com.axelor.apps.base.db.Company" title="Company"/>
        <string name="amountInWords" title="Amount in words"/>
        <string name="theoricalSoldeInWords" title="Theorical solde in words"/>
        <decimal name="gap" title="Gap" />
        <decimal name="numbeLastCashPiece" title="Number of last cash piece" />
        <string name="numbeLastCashPieceStr" title="Last cash piece seq" />
        
        <many-to-one name="approvedByUser" ref="com.axelor.auth.db.User" readonly="true" title="Approved by"/> 
        <datetime name="approvalDate" title="Approval date" readonly="true"/>
        
        <many-to-one name="valdiatedByUser" ref="com.axelor.auth.db.User" readonly="true" title="Validated by"/> 
        <datetime name="validattionDate" title="Validation date" readonly="true"/>
        
        <many-to-one name="confirmedByUser" ref="com.axelor.auth.db.User" readonly="true" title="Confirmed by"/> 
        <datetime name="confirmationDate" title="Confirmation date" readonly="true"/>

        <decimal name="totalCoinsAmount" title="Total coins amount"  />
        <decimal name="totalBankNotesAmount" title="Total bank notes amount" />
        <decimal name="totalCash" title="Total cash" />

        
        <one-to-many ref="CashInventoryLine" name="cashInventoryLines" title="Cash inventory lines"/>
                
        <track>
      		<field name="name"/>
      		<field name="code"/>
      		<field name="denominationValue"/>
      		<field name="denominationQuantity"/>
      		<field name="theoricalSolde"/>
      		<field name="physicalSolde"/>
      	</track>

    </entity>
</domain-models>
