<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://jmix.io/schema/ui/window"
        xmlns:ext="http://jmix.io/schema/ui/window-ext"
        caption="msg://purchaseRequirementItemEdit.caption"
        extends="tech/opus/wp/web/screens/base/base-edit.xml">
    <data>
        <instance id="editDc"
                  class="tech.opus.wp.entity.purchase.PurchaseRequirementItem">
            <fetchPlan extends="_base">
                <property name="nomenclator" fetchPlan="_instance_name">
                    <property name="nomenType" fetchPlan="_instance_name"/>
                    <property name="unitMeasure" fetchPlan="_instance_name"/>
                    <property name="code"/>
                </property>
                <property name="purchaseGroup" fetchPlan="_instance_name"/>
                <property name="status" fetchPlan="_instance_name"/>
                <property name="createdBy"/>
            </fetchPlan>
            <loader id="editDl"/>
        </instance>
        <collection id="documentsDc" class="tech.opus.wp.entity.purchase.PurchaseDocument"/>
        <collection id="matchingSchemeDc" class="tech.opus.wp.entity.purchase.PurchaseMatchingScheme"/>
        <collection id="limitControlDc" class="tech.opus.wp.entity.purchase.PurchaseLimitControl"/>
    </data>
    <dialogMode height="1000px" width="100%"/>
    <layout expand="tabSheet">
        <tabSheet id="tabSheet" tabsVisible="true" ext:index="0">
            <tab id="mainTab" expand="grid" caption="msg://purchaseSubject">
                <gridLayout id="grid" width="100%" margin="true" spacing="true">
                    <columns>
                        <column flex="2"/>
                        <column flex="1"/>
                        <column flex="1"/>
                    </columns>
                    <rows>
                        <row flex="4">
                            <groupBox id="truDataBox" caption="msg://truDataBox" spacing="true"
                                      orientation="horizontal" width="100%" height="100%">
                                <form id="truDataForm1" dataContainer="editDc" captionPosition="TOP"
                                      childrenCaptionAlignment="RIGHT" height="AUTO">
                                    <column width="150px">
                                        <field property="nomenclator.code" caption="msg://truCode" colspan="2"
                                               width="100%" editable="false"/>
                                        <field id="nomenclatorField" property="nomenclator" colspan="2" width="100%"/>
                                        <field id="nomenTypeField" property="nomenclator.nomenType"
                                               caption="msg://truGroup" editable="false" colspan="2" width="100%"/>
                                        <field id="regulatoryDocumentField" property="regulatoryDocument" colspan="2"
                                               width="100%"/>
                                        <field id="quantityField" property="quantity"/>
                                    </column>
                                    <column width="150px">
                                        <field id="unitMeasureField" property="nomenclator.unitMeasure"/>
                                    </column>
                                </form>
                                <form id="truDataForm2" dataContainer="editDc" captionPosition="TOP"
                                      childrenCaptionAlignment="RIGHT" height="AUTO">
                                    <column width="300px">
                                        <field id="okvedUnitField" property="okvedUnit"/>
                                        <field id="okpdUnitField" property="okpdUnit"/>
                                        <field id="deliveryTypeField" property="deliveryType"/>
                                        <field id="mspField" property="msp"/>
                                        <field id="questionListField" property="questionList"/>
                                        <field id="possibleEquivalentField" property="possibleEquivalent"/>
                                    </column>
                                </form>
                            </groupBox>
                            <groupBox id="priceBox" caption="msg://priceBox"
                                      orientation="horizontal" width="100%" height="100%">
                                <form id="priceForm" dataContainer="editDc" captionPosition="TOP"
                                      childrenCaptionAlignment="RIGHT" height="AUTO">
                                    <column width="150px">
                                        <field id="currencyUnitField" property="currencyUnit"
                                               editable="false"/>
                                        <field id="costWoutNdsField" property="costWoutNds" colspan="2" width="100%"/>
                                        <field id="paymentCurrencyWoutNdsField" property="paymentCurrencyWoutNds"
                                               colspan="2" width="100%"/>
                                        <field id="ndsField" property="nds" colspan="2" width="100%"/>
                                        <field id="paymentCurrencyField" property="paymentCurrency" colspan="2"
                                               width="100%"/>
                                    </column>
                                    <column width="150px">
                                        <field id="ndsTaxField" property="ndsTax"/>
                                    </column>
                                </form>
                            </groupBox>
                            <groupBox id="limitationDateBox" caption="msg://limitationDateBox"
                                      orientation="horizontal" width="100%" height="100%">
                                <form id="limitationDateForm" dataContainer="editDc" captionPosition="TOP"
                                      childrenCaptionAlignment="RIGHT" height="AUTO">
                                    <column width="150px">
                                        <field id="deliveryStartDateField" property="deliveryStartDate" colspan="2"
                                               width="100%"/>
                                        <field id="deliveryEndDateField" property="deliveryEndDate" colspan="2"
                                               width="100%"/>
                                        <field id="tskField" property="tsk"/>
                                    </column>
                                    <column width="150px">
                                        <field id="tspField" property="tsp"/>
                                    </column>
                                </form>
                            </groupBox>
                        </row>
                        <row flex="3">
                            <groupBox id="addressDataBox" caption="msg://addressDataBox" spacing="true"
                                      orientation="horizontal" width="100%" height="100%">
                                <form id="addressDataForm" dataContainer="editDc" captionPosition="TOP"
                                      childrenCaptionAlignment="RIGHT" width="100%" height="AUTO">
                                    <column>
                                        <field id="customerField" property="customer"/>
                                        <field id="deliveryMethodField" property="deliveryMethod"/>
                                        <field id="consigneeField" property="consignee"/>
                                        <field id="contactPersonNameField" property="contactPersonName"/>
                                    </column>
                                    <column>
                                        <field id="deliveryCountryField" property="deliveryCountry"/>
                                        <field id="deliveryRegionsField" property="deliveryRegions"/>
                                        <field id="deliveryAddressField" property="deliveryAddress"
                                               height="100px" rowspan="2"/>
                                    </column>
                                </form>
                            </groupBox>
                            <groupBox id="supplySourceBox" caption="msg://supplySourceBox" colspan="2"
                                      orientation="horizontal" width="100%" height="100%">
                                <form id="supplySourceForm" dataContainer="editDc" captionPosition="TOP"
                                      childrenCaptionAlignment="RIGHT" width="100%" height="AUTO">
                                    <field id="soloVendorField" property="soloVendor"/>
                                    <field id="contractNumberField" property="contractNumber"/>
                                    <field id="companyField" property="company"/>
                                </form>
                            </groupBox>
                        </row>
                    </rows>
                </gridLayout>
            </tab>
            <tab id="informationAndDocumentsTab" caption="msg://informationAndDocumentsTab"
                 expand="informationAndDocumentsGrid" margin="true">
                <gridLayout id="informationAndDocumentsGrid" width="100%" margin="true" spacing="true">
                    <columns count="2"/>
                    <rows>
                        <row>
                            <groupBox id="informationBox" caption="msg://informationBox" width="100%">
                                <form id="informationForm" dataContainer="editDc" captionPosition="TOP"
                                      childrenCaptionAlignment="RIGHT">
                                    <column width="100%">
                                        <field id="itemNumField" property="itemNum" editable="false"/>
                                        <field id="purchaseRequirementItemTypeField"
                                               property="purchaseRequirementItemType"/>
                                        <field id="noteField" property="note" height="150px"/>
                                    </column>
                                    <column width="100%">
                                        <field id="agreementStepField" property="agreementStep" dataContainer="editDc"/>
                                        <field id="gostTuField" property="gostTu" dataContainer="editDc"/>
                                        <field id="statusField" property="status" editable="false"
                                               dataContainer="editDc"/>
                                    </column>
                                </form>
                            </groupBox>
                            <groupBox id="responsibleBox" caption="msg://responsibleBox" width="100%" height="100%">
                                <form id="responsibleForm" dataContainer="editDc" captionPosition="TOP"
                                      childrenCaptionAlignment="RIGHT">
                                    <column width="100%">
                                        <field id="purchasingGroupField" property="purchasingGroup"/>
                                        <field id="responsibleDepartmentField" property="responsibleDepartment"/>
                                    </column>
                                    <column width="100%">
                                        <field id="createdByField" property="createdBy" editable="false"/>
                                    </column>
                                </form>
                            </groupBox>
                        </row>
                        <row flex="2">
                            <groupBox id="documentsBox" caption="msg://documentsBox"
                                      width="100%" height="100%" colspan="2">
                                <table id="informationAndDocumentsTable" dataContainer="documentsDc"
                                       width="100%" height="100%">
                                    <columns>
                                        <column id="questionList"/>
                                        <column id="documentType"/>
                                        <column id="documentNum"/>
                                        <column id="documentDes"/>
                                        <column id="extension"/>
                                        <column id="createdBy"/>
                                        <column id="createTs"/>
                                        <column id="updateTs"/>
                                        <column id="description"/>
                                    </columns>
                                </table>
                            </groupBox>
                        </row>
                    </rows>
                </gridLayout>
            </tab>
            <tab id="matchingSchemeTab" caption="msg://matchingSchemeTab"
                 expand="matchingSchemeTable" margin="true">
                <table id="matchingSchemeTable" caption="msg://matchingSchemeTable"
                       dataContainer="matchingSchemeDc" width="100%">
                    <columns>
                        <column id="num"/>
                        <column id="step"/>
                        <column id="stepName"/>
                        <column id="status"/>
                    </columns>
                </table>
            </tab>
            <tab id="limitControlTab" caption="msg://limitControlTab"
                 expand="limitControlTable" margin="true">
                <table id="limitControlTable" dataContainer="limitControlDc"
                       width="100%">
                    <columns>
                        <column id="num"/>
                        <column id="articleCode"/>
                        <column id="cfoCode"/>
                        <column id="fundingSourceCode"/>
                        <column id="projectId"/>
                        <column id="limitControlObject"/>
                    </columns>
                </table>
            </tab>
        </tabSheet>
    </layout>
</window>
