<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/screen/window.xsd"
        caption="msg://editorCaption"
        focusComponent="form"
        messagesPack="com.zhongda.zhongdaerp.web.screens.order">
    <data>
        <instance id="orderDc"
                  class="com.zhongda.zhongdaerp.entity.Order"
                  view="order-edit">
            <loader  id="orderDl"/>
            <collection id="orderServiceDc" property="orderService"/>
        </instance>
        <collection id="projectTypesDc" class="com.zhongda.zhongdaerp.entity.ProjectType" view="_minimal">
            <loader id="projectTypesLc">
                <query>
                    <![CDATA[select e from zhongdaerp_ProjectType e]]>
                </query>
            </loader>
        </collection>
        <collection id="procAttachmentsDc"
                    class="com.haulmont.bpm.entity.ProcAttachment"
                    view="procAttachment-browse">
            <loader id="procAttachmentsDl">
                <query><![CDATA[select e from bpm$ProcAttachment e
                                where e.procInstance.entity.entityId  = :entityId
                                order by e.createTs]]>
                </query>
            </loader>
        </collection>
    </data>
    <dialogMode height="600"
                width="800"/>
    <layout expand="scrollBox" spacing="true">
        <scrollBox id="scrollBox" spacing="true">
            <form id="form" dataContainer="orderDc">
                <column width="250px">
                    <groupBox>
                        <textField id="customerField" property="customer"/>
                    </groupBox>
                    <textField id="customerAddressField" property="customerAddress"/>
                        <textField id="customerPhoneField" property="customerPhone" />
                        <textField id="customerLinkmanField" property="customerLinkman"/>
                            <textField id="serviceProviderField" property="serviceProvider"/>
                            <textField id="serviceProviderAddressField" property="serviceProviderAddress"/>
                            <textField id="serviceProviderPhoneField" property="serviceProviderPhone"/>
                            <textField id="serviceProviderLinkmanField" property="serviceProviderLinkman"/>


                                <textField id="orderCodeField" property="orderCode"/>
                                <textField id="purchaseOrderCompanyField" property="purchaseOrderCompany"/>


                    <textField id="contractNumberField" property="contractNumber"/>
                               <dateField id="signingDateField" property="signingDate"/>


                                <lookupPickerField id="projectTypeField" optionsContainer="projectTypesDc" property="projectType">
                                    <actions>
                                        <action id="lookup" type="picker_lookup"/>
                                    </actions>
                                </lookupPickerField>
                                <textField id="industryField" property="industry"/>


                           <dateField id="purchaseOrderDateField" property="purchaseOrderDate"/>
                            <dateField id="serviceEndDateField" property="serviceEndDate"/>


                               <textField id="purchaseOrderPersonField" property="purchaseOrderPerson"/>
                              <textField id="sharingRatioField" property="sharingRatio"/>



                                   <textField id="receiptNumberField" property="receiptNumber"/>
                                 <textField id="contractAmountField" property="contractAmount"/>

                                 <textField id="receivedAmountField" property="receivedAmount"/>
                                    <dateField id="receivedDateField" property="receivedDate"/>


                                    <textField id="firstPaymentField" property="firstPayment"/>
                                   <dateField id="firstPaymentReceiptDateField" property="firstPaymentReceiptDate"/>
                           <textField id="balanceDueField" property="balanceDue"/>
                                   <dateField id="balanceDueReceivedDateField" property="balanceDueReceivedDate"/>

                                   <textField id="commissionAmountField" property="commissionAmount"/>


                    <textArea id="remarkField" property="remark" rows="5"/>
                </column>
            </form>
            <groupBox id="orderServiceBox" caption="msg://OrderServices">
                <table id="orderServiceTable" dataContainer="orderServiceDc" width="100%" height="200px">
                    <actions>
                        <action id="create" type="create"/>
                        <action id="edit" type="edit"/>
                        <action id="remove" type="remove"/>
                    </actions>
                    <columns>
                        <column id="serviceName"/>
                        <column id="serviceContent"/>
                        <column id="remark"/>
                    </columns>
                    <buttonsPanel>
                        <button action="orderServiceTable.create"/>
                        <button action="orderServiceTable.edit"/>
                        <button action="orderServiceTable.remove"/>
                    </buttonsPanel>
                </table>
            </groupBox>
            <groupBox id="procActionsBox"
                      caption="msg://process"
                      spacing="true"
                      width="AUTO"
                      orientation="vertical">
                <fragment id="procActionsFragment"
                          screen="bpm_ProcActionsFragment"/>
            </groupBox>
            <groupBox caption="msg://attachments"
                      height="300px"
                      spacing="true"
                      width="700px">
                <table id="attachmentsTable"
                       dataContainer="procAttachmentsDc"
                       height="100%"
                       width="100%">
                    <columns>
                        <column id="file.name"/>
                        <column id="author"/>
                        <column id="type"/>
                        <column id="comment"
                                maxTextLength="50"/>
                    </columns>
                </table>
            </groupBox>
        </scrollBox>
        <hbox id="editActions" spacing="true">
            <button action="windowCommitAndClose"/>
            <button action="windowClose"/>
        </hbox>
    </layout>
</window>
