<commit_before><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<object-views xmlns="http://axelor.com/xml/ns/object-views"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://axelor.com/xml/ns/object-views http://axelor.com/xml/ns/object-views/object-views_4.0.xsd">
    
    <!-- VUE GENERALE -->
    
    <grid name="invoice-grid" title="Invoices" model="com.axelor.apps.account.db.Invoice" orderBy="-invoiceDate">
    	<toolbar>
			<button name="printInvoices" title="Print invoices" icon="fa-print" onClick="action-invoice-method-show-invoice"/>
			<button name="massInvoiceValidation" title="Validate selected invoices" prompt="Are you sure you want to validate all selected invoices ?" onClick="action-invoice-method-mass-validation"/>
			<button name="massInvoiceVentilation" title="Ventilate selected invoices" prompt="Are you sure you want to ventilate all selected invoices ?" onClick="action-invoice-method-mass-ventilation"/>
    	</toolbar>   
    	<hilite color="info" if="statusSelect == 1"/>
	    <hilite color="danger" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining &gt; 0 &amp;&amp; $moment(dueDate).diff(todayDate,'days') &lt; 0"/>
	    <hilite color="warning" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining &gt; 0 &amp;&amp; $moment(dueDate).diff(todayDate,'days') &lt;= 5"/>
	    <hilite color="success" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining == 0"/>
        <field name="invoiceId"/>
        <field name="operationTypeSelect" />
        <field name="partner" form-view="partner-form" grid-view="partner-grid"/>
        <field name="paymentMode" grid-view="payment-mode-grid" form-view="payment-mode-form"/>
        <field name="invoiceDate"/>
        <field name="dueDate"/>
        <field name="exTaxTotal"/>
        <field name="inTaxTotal"/>
        <field name="amountPaid"/>
        <field name="statusSelect"/>
        <field name="companyInTaxTotalRemaining" hidden="true"/>
        <button name="showInvoice" title="Print" icon="fa-print" onClick="action-invoice-method-show-invoice"/>
        <button name="sendByEmail" title="Send email" icon="fa-envelope" onClick="action-send-by-email-with-template"/>
    </grid>
    
    <grid name="invoice-light-grid" title="Invoices" model="com.axelor.apps.account.db.Invoice" orderBy="-invoiceDate">
    	<toolbar>
			<button name="printInvoices" title="Print invoices" icon="fa-print" onClick="action-invoice-method-show-invoice"/>
			<button name="massInvoiceValidation" title="Validate selected invoices" prompt="Are you sure you want to validate all selected invoices ?" onClick="action-invoice-method-mass-validation"/>
			<button name="massInvoiceVentilation" title="Ventilate selected invoices" prompt="Are you sure you want to ventilate all selected invoices ?" onClick="action-invoice-method-mass-ventilation"/>
    	</toolbar>   
    	<hilite color="info" if="statusSelect == 1"/>
	    <hilite color="danger" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining &gt; 0 &amp;&amp; $moment(dueDate).diff(todayDate,'days') &lt; 0"/>
	    <hilite color="warning" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining &gt; 0 &amp;&amp; $moment(dueDate).diff(todayDate,'days') &lt;= 5"/>
	    <hilite color="success" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining == 0"/>
        <field name="invoiceId"/>
        <field name="operationTypeSelect" />
        <field name="invoiceDate"/>
        <field name="exTaxTotal"/>
        <field name="amountPaid"/>
        <field name="statusSelect"/>
        <field name="companyInTaxTotalRemaining" hidden="true"/>
        <button name="showInvoice" title="Print" icon="fa-print" onClick="action-invoice-method-show-invoice"/>
        <button name="sendByEmail" title="Send email" icon="fa-envelope" onClick="action-send-by-email-with-template"/>
    </grid>
    
	<form name="invoice-form" title="Invoice" model="com.axelor.apps.account.db.Invoice"  
	onNew="action-account-invoice-onnew-group" onLoad="action-account-invoice-onload-group">
	
		<toolbar>
		  <button name="showInvoice" title="Print" icon="fa-print" onClick="save,action-invoice-method-show-invoice"/>
		  <button name="sendByEmail" title="Send email" icon="fa-envelope" onClick="save,action-send-by-email-with-template"/>
		</toolbar>
	  
		<panel >
			<field name="invoiceId"/>
			<panel colSpan="6">
				<field name="operationTypeSelect" colSpan="12" onChange="action-group-account-invoice-operationtype-onchange" readonlyIf="statusSelect != 1" showIf="!operationTypeSelect"/>
				<field name="operationTypeSelect" colSpan="12" onChange="action-group-account-invoice-operationtype-onchange" readonlyIf="statusSelect != 1" selection='iinvoice.operation.type.select' selection-in="[1, 2]" showIf="operationTypeSelect == 1 || operationTypeSelect == 2"/>
				<field name="operationTypeSelect" colSpan="12" onChange="action-group-account-invoice-operationtype-onchange" readonlyIf="statusSelect != 1" selection='iinvoice.operation.type.select' selection-in="[3, 4]" showIf="operationTypeSelect == 3 || operationTypeSelect == 4"/>
			</panel>	
			<field name="company" widget="SuggestBox" onChange="action-group-account-invoice-company-onchange" form-view="company-form" grid-view="company-grid" readonlyIf="statusSelect != 1"/>
			<field name="companyBankDetails" widget="SuggestBox" onSelect="action-accounting-batch-attrs-company-bank-details-domain" form-view="bank-details-form" grid-view="bank-details-grid"/>
			<field name="currency" onChange="action-invoice-attrs-change-total-title" readonlyIf="statusSelect != 1" form-view="currency-form" grid-view="currency-grid"/>
			<field name="project" if-module="axelor-business-project" onSelect="action-invoice-attrs-domain-project" form-view="project-form" grid-view="project-grid"/>
			<field name="inAti" onChange="action-invoice-attrs-in-ati"/>
			<field name="hideDiscount"/>
			<field name="isSubscription" hidden="true"/>
		</panel>
	  
		<panel title="Invoicing informations">
			<field name="partner" form-view="partner-form" grid-view="partner-grid" readonlyIf="statusSelect != 1" onChange="action-group-account-invoice-partner-onchange" onSelect="action-set-partner-domain"/>
			<field name="contactPartner"  onSelect="action-set-partner-domain" domain="self.isContact = true" form-view="partner-contact-form" grid-view="partner-contact-grid"
					readonlyIf="partner != null &amp;&amp; partner.partnerTypeSelect == 2"/>
			<field name="address" onSelect="action-invoice-attrs-domain-address" form-view="address-partner-address-form" canNew="true" />
			<field name="paymentMode" grid-view="payment-mode-grid" form-view="payment-mode-form" widget="SuggestBox" onSelect="action-set-payment-mode-domain"/>
			<field name="paymentCondition" readonlyIf="statusSelect == 3" widget="SuggestBox" onChange="action-invoice-record-due-date" form-view="payment-condition-form" grid-view="payment-condition-grid"/>
			<field name="bankDetails" hideIf="operationTypeSelect &gt;= 3" widget="SuggestBox" onSelect="action-invoice-attrs-bank-details-from-partner-domain" form-view="bank-details-form" grid-view="bank-details-grid"/>
			<field name="priceList" onChange="action-invoice-record-hide-discount" readonlyIf="statusSelect != 1" onSelect="action-invoice-attrs-domain-priceList" form-view="price-list-form" grid-view="price-list-grid"/>
			<field name="saleOrder" if="!__config__.general.getManageInvoicedAmountByLine()" if-module="axelor-supplychain" onChange="action-invoice-method-fill-in-lines" form-view="sale-order-form" grid-view="sale-order-grid"/>
			<field name="message" />
			<field name="supplierInvoiceNb" showIf="operationTypeSelect == 1 || operationTypeSelect == 2"/>
		</panel>
	  
		<panel-tabs>
			<panel title="Invoice content" showTitle="false">
				<panel-related field="invoiceLineList" colSpan="12" form-view="invoice-line-form" grid-view="invoice-line-drag-drop-grid" onChange="action-invoice-method-compute" canMove="true" orderBy="sequence"/>
				<panel-related field="invoiceLineTaxList" colSpan="12" form-view="invoice-line-tax-form" grid-view="invoice-line-tax-grid"/>
			</panel>
			<panel title="Accounting" showTitle="false">
				<panel title="Accounting details"  colSpan="12">
					<field name="journal" readonlyIf="statusSelect == 3" domain="self.statusSelect = 1 AND self.company = :company" form-view="journal-form" grid-view="journal-grid"/>
					<field name="partnerAccount" readonlyIf="statusSelect == 3" onSelect="action-invoice-partner-account-domain" domain="self.company = :company" form-view="account-form" grid-view="account-grid"/>
					<field name="move" readonly="true" form-view="move-form" grid-view="move-grid"/>
					<field name="move.accountingOk" readonly="true"/>
					<field name="doubtfulCustomerOk" readonly="true" showIf="doubtfulCustomerOk &amp;&amp; statusSelect == 3 &amp;&amp; (operationTypeSelect == 1 || operationTypeSelect == 3)"/>
					<field name="usherPassageOk" showIf="statusSelect == 3 &amp;&amp; (operationTypeSelect == 1 || operationTypeSelect == 3)" onChange="save,com.axelor.apps.account.web.InvoiceController:usherProcess"/>
					<field name="oldMove" readonly="true" showIf="oldMove" form-view="move-form" grid-view="move-grid"/>
				</panel>
				<panel title="Refund" showIf="statusSelect != 1 || originalInvoice"  colSpan="12" showTitle="false">
					<button name="createRefund" title="Generate refund" colSpan="3" showIf="statusSelect != 1" onClick="save,action-invoice-method-create-refund,save" />
					<field name="originalInvoice" readonly="true" showIf="originalInvoice" form-view="invoice-form" grid-view="invoice-grid"/>
					<panel-related field="refundInvoiceList" readonly="true" showIf="refundInvoiceList != null &amp;&amp; !refundInvoiceList.isEmpty()" colSpan="12" form-view="invoice-form" grid-view="invoice-grid"/>
				</panel>
				<panel colSpan="12"  title="Irrecoverable" showIf="statusSelect == 3 &amp;&amp; (operationTypeSelect == 1 || operationTypeSelect == 3)"  showTitle="false">
					<field name="irrecoverableStatusSelect"/>
					<field name="managementObject" form-view="management-object-form" grid-view="management-object-grid"/>
					<button name="passInIrrecoverable" title="Shift to irrecoverable"   onClick="com.axelor.apps.account.web.InvoiceController:passInIrrecoverable"/>
					<button name="notPassInIrrecoverable" title="Do not shit into irrecoverable"   onClick="com.axelor.apps.account.web.InvoiceController:notPassInIrrecoverable"/>
				</panel>
			</panel>
			<panel title="Blockings" showIf="statusSelect == 3" showTitle="false">
				<field name="debitBlockingOk"/>
				<field name="reminderBlockingOk"/>
				<panel name="debitBlockingGroup" title="Direct debit blocking"  showIf="debitBlockingOk" colSpan="12">
					<field name="debitBlockingByUser" form-view="user-form" grid-view="user-grid"/>
					<field name="debitBlockingToDate" />
					<field name="debitBlockingReason" form-view="stop-reason-form" grid-view="stop-reason-grid" />
				</panel>
				<panel showIf="reminderBlockingOk" title="Reminder blocking" colSpan="12">
					<field name="reminderBlockingByUser" form-view="user-form" grid-view="user-grid"/>
					<field name="reminderBlockingToDate"/>
					<field name="reminderBlockingReason" form-view="stop-reason-form" grid-view="stop-reason-grid" />
				</panel>
			</panel>
			<panel title="Notes" colSpan="12">
				<field name="note" showTitle="false" colSpan="12"/>
			</panel>
			<panel-related title="Payments details" field="invoicePaymentList" colSpan="12" grid-view="invoice-payment-grid" form-view="invoice-payment-form" canNew="false" canRemove="false"/>
			<panel  title="Direct debit" showIf="statusSelect == 3" showTitle="false">
				<panel  title="Payment schedule" colSpan="12" >
					<field name="schedulePaymentOk" readonly="true" showIf="schedulePaymentOk"/>
					<field name="paymentSchedule" readonly="true" showIf="schedulePaymentOk" domain="self.company = :company AND self.partner = :partner" form-view="payment-schedule-form" grid-view="payment-schedule-grid"/>
				</panel>
				<panel title="Direct debit" colSpan="12">
					<field name="debitNumber"/>
					<field name="directDebitManagement" form-view="direct-debit-management-form-invoice" grid-view="direct-debit-management-grid"/>
					<field name="paymentMove" form-view="move-form" grid-view="move-grid"/>
				</panel>
				<panel title="Reject" colSpan="12">
					<field name="rejectMoveLine" grid-view="move-line-grid" form-view="move-line-form"/>
					<field name="rejectDate"/>
					<field name="interbankCodeLine" grid-view="interbank-code-line-grid" form-view="interbank-code-line-form"/>
				</panel>
			</panel>
		</panel-tabs>
	
		<panel-stack sidebar="true">
			<panel title="Reference documents" itemSpan="6">
				<field name="internalReference"/>
				<field name="externalReference"/>
			</panel>
			<panel title="Dates" readonlyIf="statusSelect == 3">
				<field name="invoiceDate" onChange="action-invoice-record-due-date,action-invoice-record-estimated-payment-date"/>
				<field name="dueDate" onChange="action-invoice-record-estimated-payment-date"/>
				<field name="estimatedPaymentDate" readonly="true" if-module="axelor-cash-management"/>
			</panel>
		</panel-stack>
	 
	    <panel sidebar="true" title="Actions" >
	        <button name="validate" title="Validate" showIf="statusSelect == 1" onClick="save,action-invoice-method-compute,action-invoice-method-validate,save"/>
	        <button name="cancel" title="Cancel" onClick="save,action-invoice-method-cancel,save" prompt="Are you sure you want to cancel the invoice ?"/>
	        <button name="ventilate" title="Ventilate" showIf="statusSelect == 2" onClick="save,action-invoice-method-ventilate,save" prompt="Are you sure you want to ventilate the invoice ?"/>
	        <button name="draft" title="Draft" showIf="statusSelect == 4" onClick="save,action-invoice-record-draft,save"/>
      	  	<button name="addPayment" title="Register payment" showIf="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining &gt; 0" colSpan="12" onClick="save,action-invoice-view-register-payment"/>
	        <field name="statusSelect"/>
	        <field name="validatedByUser" grid-view="user-grid" form-view="user-form"/>
	    </panel>
	    
		<panel sidebar="true" title="Totals" itemSpan="6">
		    <field name="currency.symbol" hidden="true"/>
			<field name="inTaxTotal" css="order-subtotal" showTitle="false" colSpan="12">
		       <viewer><![CDATA[ 
		         <dl class="dl-horizontal">
		           <dt x-translate>Total W.T.</dt>
		           <dd>{{record.exTaxTotal}} {{record.currency.symbol}}</dd>
		           <dt x-translate>Total tax</dt>
		           <dd>{{record.taxTotal}} {{record.currency.symbol}}</dd>
		           <dt class="order-subtotal-total" x-translate>Total A.T.I.</dt>
		           <dd class="order-subtotal-total">{{record.inTaxTotal}} {{record.currency.symbol}}</dd>
		         </dl>]]>
		       </viewer>
		     </field>
		     <field name="invoicePaymentList" colSpan="12" showTitle="false" readonly="true" css="order-subtotal">
              	<viewer><![CDATA[ 
				  <span class="form-item-container">
         			<dl class="dl-horizontal">
               			<dt ng-if="record.statusSelect == 1"><i class="fa fa-link"></i> <font x-translate>Paid on</font><font> {{record.paymentDate | date : 'dd/MM/yyyy'}}<font/></dt>
 	           		 	<dt ng-if="record.statusSelect == 1 class="hilite-info-text"> <i class="fa fa-chain-broken"></i> <font x-translate>Paid on</font><font> {{record.paymentDate | date : 'dd/MM/yyyy'}}<font/></dt>
	           		 	
	           		 	<dd ng-if="record.statusSelect == 1">-{{record.amount}} {{record.currency.symbol}}</dd>
	           		 	<dd ng-if="record.statusSelect == 2" class="hilite-danger-text">(-{{record.amount}} {{record.currency.symbol}})</dd>
	           		</dl> 
           	      </span>]]>  <commit_msg>Fixed issue with invoice payment display on invoice sub total<commit_after><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<object-views xmlns="http://axelor.com/xml/ns/object-views"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://axelor.com/xml/ns/object-views http://axelor.com/xml/ns/object-views/object-views_4.0.xsd">
    
    <!-- VUE GENERALE -->
    
    <grid name="invoice-grid" title="Invoices" model="com.axelor.apps.account.db.Invoice" orderBy="-invoiceDate">
    	<toolbar>
			<button name="printInvoices" title="Print invoices" icon="fa-print" onClick="action-invoice-method-show-invoice"/>
			<button name="massInvoiceValidation" title="Validate selected invoices" prompt="Are you sure you want to validate all selected invoices ?" onClick="action-invoice-method-mass-validation"/>
			<button name="massInvoiceVentilation" title="Ventilate selected invoices" prompt="Are you sure you want to ventilate all selected invoices ?" onClick="action-invoice-method-mass-ventilation"/>
    	</toolbar>   
    	<hilite color="info" if="statusSelect == 1"/>
	    <hilite color="danger" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining &gt; 0 &amp;&amp; $moment(dueDate).diff(todayDate,'days') &lt; 0"/>
	    <hilite color="warning" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining &gt; 0 &amp;&amp; $moment(dueDate).diff(todayDate,'days') &lt;= 5"/>
	    <hilite color="success" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining == 0"/>
        <field name="invoiceId"/>
        <field name="operationTypeSelect" />
        <field name="partner" form-view="partner-form" grid-view="partner-grid"/>
        <field name="paymentMode" grid-view="payment-mode-grid" form-view="payment-mode-form"/>
        <field name="invoiceDate"/>
        <field name="dueDate"/>
        <field name="exTaxTotal"/>
        <field name="inTaxTotal"/>
        <field name="amountPaid"/>
        <field name="statusSelect"/>
        <field name="companyInTaxTotalRemaining" hidden="true"/>
        <button name="showInvoice" title="Print" icon="fa-print" onClick="action-invoice-method-show-invoice"/>
        <button name="sendByEmail" title="Send email" icon="fa-envelope" onClick="action-send-by-email-with-template"/>
    </grid>
    
    <grid name="invoice-light-grid" title="Invoices" model="com.axelor.apps.account.db.Invoice" orderBy="-invoiceDate">
    	<toolbar>
			<button name="printInvoices" title="Print invoices" icon="fa-print" onClick="action-invoice-method-show-invoice"/>
			<button name="massInvoiceValidation" title="Validate selected invoices" prompt="Are you sure you want to validate all selected invoices ?" onClick="action-invoice-method-mass-validation"/>
			<button name="massInvoiceVentilation" title="Ventilate selected invoices" prompt="Are you sure you want to ventilate all selected invoices ?" onClick="action-invoice-method-mass-ventilation"/>
    	</toolbar>   
    	<hilite color="info" if="statusSelect == 1"/>
	    <hilite color="danger" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining &gt; 0 &amp;&amp; $moment(dueDate).diff(todayDate,'days') &lt; 0"/>
	    <hilite color="warning" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining &gt; 0 &amp;&amp; $moment(dueDate).diff(todayDate,'days') &lt;= 5"/>
	    <hilite color="success" if="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining == 0"/>
        <field name="invoiceId"/>
        <field name="operationTypeSelect" />
        <field name="invoiceDate"/>
        <field name="exTaxTotal"/>
        <field name="amountPaid"/>
        <field name="statusSelect"/>
        <field name="companyInTaxTotalRemaining" hidden="true"/>
        <button name="showInvoice" title="Print" icon="fa-print" onClick="action-invoice-method-show-invoice"/>
        <button name="sendByEmail" title="Send email" icon="fa-envelope" onClick="action-send-by-email-with-template"/>
    </grid>
    
	<form name="invoice-form" title="Invoice" model="com.axelor.apps.account.db.Invoice"  
	onNew="action-account-invoice-onnew-group" onLoad="action-account-invoice-onload-group">
	
		<toolbar>
		  <button name="showInvoice" title="Print" icon="fa-print" onClick="save,action-invoice-method-show-invoice"/>
		  <button name="sendByEmail" title="Send email" icon="fa-envelope" onClick="save,action-send-by-email-with-template"/>
		</toolbar>
	  
		<panel >
			<field name="invoiceId"/>
			<panel colSpan="6">
				<field name="operationTypeSelect" colSpan="12" onChange="action-group-account-invoice-operationtype-onchange" readonlyIf="statusSelect != 1" showIf="!operationTypeSelect"/>
				<field name="operationTypeSelect" colSpan="12" onChange="action-group-account-invoice-operationtype-onchange" readonlyIf="statusSelect != 1" selection='iinvoice.operation.type.select' selection-in="[1, 2]" showIf="operationTypeSelect == 1 || operationTypeSelect == 2"/>
				<field name="operationTypeSelect" colSpan="12" onChange="action-group-account-invoice-operationtype-onchange" readonlyIf="statusSelect != 1" selection='iinvoice.operation.type.select' selection-in="[3, 4]" showIf="operationTypeSelect == 3 || operationTypeSelect == 4"/>
			</panel>	
			<field name="company" widget="SuggestBox" onChange="action-group-account-invoice-company-onchange" form-view="company-form" grid-view="company-grid" readonlyIf="statusSelect != 1"/>
			<field name="companyBankDetails" widget="SuggestBox" onSelect="action-accounting-batch-attrs-company-bank-details-domain" form-view="bank-details-form" grid-view="bank-details-grid"/>
			<field name="currency" onChange="action-invoice-attrs-change-total-title" readonlyIf="statusSelect != 1" form-view="currency-form" grid-view="currency-grid"/>
			<field name="project" if-module="axelor-business-project" onSelect="action-invoice-attrs-domain-project" form-view="project-form" grid-view="project-grid"/>
			<field name="inAti" onChange="action-invoice-attrs-in-ati"/>
			<field name="hideDiscount"/>
			<field name="isSubscription" hidden="true"/>
		</panel>
	  
		<panel title="Invoicing informations">
			<field name="partner" form-view="partner-form" grid-view="partner-grid" readonlyIf="statusSelect != 1" onChange="action-group-account-invoice-partner-onchange" onSelect="action-set-partner-domain"/>
			<field name="contactPartner"  onSelect="action-set-partner-domain" domain="self.isContact = true" form-view="partner-contact-form" grid-view="partner-contact-grid"
					readonlyIf="partner != null &amp;&amp; partner.partnerTypeSelect == 2"/>
			<field name="address" onSelect="action-invoice-attrs-domain-address" form-view="address-partner-address-form" canNew="true" />
			<field name="paymentMode" grid-view="payment-mode-grid" form-view="payment-mode-form" widget="SuggestBox" onSelect="action-set-payment-mode-domain"/>
			<field name="paymentCondition" readonlyIf="statusSelect == 3" widget="SuggestBox" onChange="action-invoice-record-due-date" form-view="payment-condition-form" grid-view="payment-condition-grid"/>
			<field name="bankDetails" hideIf="operationTypeSelect &gt;= 3" widget="SuggestBox" onSelect="action-invoice-attrs-bank-details-from-partner-domain" form-view="bank-details-form" grid-view="bank-details-grid"/>
			<field name="priceList" onChange="action-invoice-record-hide-discount" readonlyIf="statusSelect != 1" onSelect="action-invoice-attrs-domain-priceList" form-view="price-list-form" grid-view="price-list-grid"/>
			<field name="saleOrder" if="!__config__.general.getManageInvoicedAmountByLine()" if-module="axelor-supplychain" onChange="action-invoice-method-fill-in-lines" form-view="sale-order-form" grid-view="sale-order-grid"/>
			<field name="message" />
			<field name="supplierInvoiceNb" showIf="operationTypeSelect == 1 || operationTypeSelect == 2"/>
		</panel>
	  
		<panel-tabs>
			<panel title="Invoice content" showTitle="false">
				<panel-related field="invoiceLineList" colSpan="12" form-view="invoice-line-form" grid-view="invoice-line-drag-drop-grid" onChange="action-invoice-method-compute" canMove="true" orderBy="sequence"/>
				<panel-related field="invoiceLineTaxList" colSpan="12" form-view="invoice-line-tax-form" grid-view="invoice-line-tax-grid"/>
			</panel>
			<panel title="Accounting" showTitle="false">
				<panel title="Accounting details"  colSpan="12">
					<field name="journal" readonlyIf="statusSelect == 3" domain="self.statusSelect = 1 AND self.company = :company" form-view="journal-form" grid-view="journal-grid"/>
					<field name="partnerAccount" readonlyIf="statusSelect == 3" onSelect="action-invoice-partner-account-domain" domain="self.company = :company" form-view="account-form" grid-view="account-grid"/>
					<field name="move" readonly="true" form-view="move-form" grid-view="move-grid"/>
					<field name="move.accountingOk" readonly="true"/>
					<field name="doubtfulCustomerOk" readonly="true" showIf="doubtfulCustomerOk &amp;&amp; statusSelect == 3 &amp;&amp; (operationTypeSelect == 1 || operationTypeSelect == 3)"/>
					<field name="usherPassageOk" showIf="statusSelect == 3 &amp;&amp; (operationTypeSelect == 1 || operationTypeSelect == 3)" onChange="save,com.axelor.apps.account.web.InvoiceController:usherProcess"/>
					<field name="oldMove" readonly="true" showIf="oldMove" form-view="move-form" grid-view="move-grid"/>
				</panel>
				<panel title="Refund" showIf="statusSelect != 1 || originalInvoice"  colSpan="12" showTitle="false">
					<button name="createRefund" title="Generate refund" colSpan="3" showIf="statusSelect != 1" onClick="save,action-invoice-method-create-refund,save" />
					<field name="originalInvoice" readonly="true" showIf="originalInvoice" form-view="invoice-form" grid-view="invoice-grid"/>
					<panel-related field="refundInvoiceList" readonly="true" showIf="refundInvoiceList != null &amp;&amp; !refundInvoiceList.isEmpty()" colSpan="12" form-view="invoice-form" grid-view="invoice-grid"/>
				</panel>
				<panel colSpan="12"  title="Irrecoverable" showIf="statusSelect == 3 &amp;&amp; (operationTypeSelect == 1 || operationTypeSelect == 3)"  showTitle="false">
					<field name="irrecoverableStatusSelect"/>
					<field name="managementObject" form-view="management-object-form" grid-view="management-object-grid"/>
					<button name="passInIrrecoverable" title="Shift to irrecoverable"   onClick="com.axelor.apps.account.web.InvoiceController:passInIrrecoverable"/>
					<button name="notPassInIrrecoverable" title="Do not shit into irrecoverable"   onClick="com.axelor.apps.account.web.InvoiceController:notPassInIrrecoverable"/>
				</panel>
			</panel>
			<panel title="Blockings" showIf="statusSelect == 3" showTitle="false">
				<field name="debitBlockingOk"/>
				<field name="reminderBlockingOk"/>
				<panel name="debitBlockingGroup" title="Direct debit blocking"  showIf="debitBlockingOk" colSpan="12">
					<field name="debitBlockingByUser" form-view="user-form" grid-view="user-grid"/>
					<field name="debitBlockingToDate" />
					<field name="debitBlockingReason" form-view="stop-reason-form" grid-view="stop-reason-grid" />
				</panel>
				<panel showIf="reminderBlockingOk" title="Reminder blocking" colSpan="12">
					<field name="reminderBlockingByUser" form-view="user-form" grid-view="user-grid"/>
					<field name="reminderBlockingToDate"/>
					<field name="reminderBlockingReason" form-view="stop-reason-form" grid-view="stop-reason-grid" />
				</panel>
			</panel>
			<panel title="Notes" colSpan="12">
				<field name="note" showTitle="false" colSpan="12"/>
			</panel>
			<panel-related title="Payments details" field="invoicePaymentList" colSpan="12" grid-view="invoice-payment-grid" form-view="invoice-payment-form" canNew="false" canRemove="false"/>
			<panel  title="Direct debit" showIf="statusSelect == 3" showTitle="false">
				<panel  title="Payment schedule" colSpan="12" >
					<field name="schedulePaymentOk" readonly="true" showIf="schedulePaymentOk"/>
					<field name="paymentSchedule" readonly="true" showIf="schedulePaymentOk" domain="self.company = :company AND self.partner = :partner" form-view="payment-schedule-form" grid-view="payment-schedule-grid"/>
				</panel>
				<panel title="Direct debit" colSpan="12">
					<field name="debitNumber"/>
					<field name="directDebitManagement" form-view="direct-debit-management-form-invoice" grid-view="direct-debit-management-grid"/>
					<field name="paymentMove" form-view="move-form" grid-view="move-grid"/>
				</panel>
				<panel title="Reject" colSpan="12">
					<field name="rejectMoveLine" grid-view="move-line-grid" form-view="move-line-form"/>
					<field name="rejectDate"/>
					<field name="interbankCodeLine" grid-view="interbank-code-line-grid" form-view="interbank-code-line-form"/>
				</panel>
			</panel>
		</panel-tabs>
	
		<panel-stack sidebar="true">
			<panel title="Reference documents" itemSpan="6">
				<field name="internalReference"/>
				<field name="externalReference"/>
			</panel>
			<panel title="Dates" readonlyIf="statusSelect == 3">
				<field name="invoiceDate" onChange="action-invoice-record-due-date,action-invoice-record-estimated-payment-date"/>
				<field name="dueDate" onChange="action-invoice-record-estimated-payment-date"/>
				<field name="estimatedPaymentDate" readonly="true" if-module="axelor-cash-management"/>
			</panel>
		</panel-stack>
	 
	    <panel sidebar="true" title="Actions" >
	        <button name="validate" title="Validate" showIf="statusSelect == 1" onClick="save,action-invoice-method-compute,action-invoice-method-validate,save"/>
	        <button name="cancel" title="Cancel" onClick="save,action-invoice-method-cancel,save" prompt="Are you sure you want to cancel the invoice ?"/>
	        <button name="ventilate" title="Ventilate" showIf="statusSelect == 2" onClick="save,action-invoice-method-ventilate,save" prompt="Are you sure you want to ventilate the invoice ?"/>
	        <button name="draft" title="Draft" showIf="statusSelect == 4" onClick="save,action-invoice-record-draft,save"/>
      	  	<button name="addPayment" title="Register payment" showIf="statusSelect == 3 &amp;&amp; companyInTaxTotalRemaining &gt; 0" colSpan="12" onClick="save,action-invoice-view-register-payment"/>
	        <field name="statusSelect"/>
	        <field name="validatedByUser" grid-view="user-grid" form-view="user-form"/>
	    </panel>
	    
		<panel sidebar="true" title="Totals" itemSpan="6">
		    <field name="currency.symbol" hidden="true"/>
			<field name="inTaxTotal" css="order-subtotal" showTitle="false" colSpan="12">
		       <viewer><![CDATA[ 
		         <dl class="dl-horizontal">
		           <dt x-translate>Total W.T.</dt>
		           <dd>{{record.exTaxTotal}} {{record.currency.symbol}}</dd>
		           <dt x-translate>Total tax</dt>
		           <dd>{{record.taxTotal}} {{record.currency.symbol}}</dd>
		           <dt class="order-subtotal-total" x-translate>Total A.T.I.</dt>
		           <dd class="order-subtotal-total">{{record.inTaxTotal}} {{record.currency.symbol}}</dd>
		         </dl>]]>
		       </viewer>
		     </field>
		     <field name="invoicePaymentList" colSpan="12" showTitle="false" readonly="true" css="order-subtotal">
              	<viewer><![CDATA[ 
				  <span class="form-item-container">
         			<dl class="dl-horizontal">
               			<dt ng-if="record.statusSelect == 1"><i class="fa fa-link"></i> <font x-translate>Paid on</font><font> {{record.paymentDate | date : 'dd/MM/yyyy'}}<font/></dt>
           		 		<dt ng-if="record.statusSelect == 2" class="hilite-danger-text"> <i class="fa fa-chain-broken"></i> <font x-translate>Paid on</font><font> {{record.paymentDate | date : 'dd/MM/yyyy'}}<font/></dt>
	           		 	
	           		 	<dd ng-if="record.statusSelect == 1">-{{record.amount}} {{record.currency.symbol}}</dd>
	           		 	<dd ng-if="record.statusSelect == 2" class="hilite-danger-text">(-{{record.amount}} {{record.currency.symbol}})</dd>
	           		</dl> 
           	      </span>]]>  
{'fraction_non_alphanumeric': 0.17276091319618667, 'fraction_numerical': 0.007400903161063723, 'mean_word_length': 4.813855970829535, 'pattern_counts': {'":': 0, '<': 421, '<?xml version=': 2, '>': 421, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 2, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6737724', 'n_tokens_mistral': 10889, 'n_tokens_neox': 9867, 'n_words': 1693}