svn commit: r1824436 - in /ofbiz/ofbiz-framework/trunk/applications: accounting/config/ accounting/servicedef/ accounting/webapp/accounting/WEB-INF/ accounting/widget/ datamodel/data/seed/ datamodel/entitydef/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1824436 - in /ofbiz/ofbiz-framework/trunk/applications: accounting/config/ accounting/servicedef/ accounting/webapp/accounting/WEB-INF/ accounting/widget/ datamodel/data/seed/ datamodel/entitydef/

nmalin
Author: nmalin
Date: Fri Feb 16 09:04:06 2018
New Revision: 1824436

URL: http://svn.apache.org/viewvc?rev=1824436&view=rev
Log:
Implemented: Add PartyPrefDocTypeTpl entity to link official template document to organisational party (OFBIZ-10186)
With this entity we can link a customScreen with an organisational party for a document type like salesinvoice, product quote and so on.
I added screen, form and menu to manage them on the organisation party configuration page accounting/control/ListCompanies
Currently this isn't useful alone but needed for issues OFBIZ-10215, OFBIZ-10216, OFBIZ-10217 that will be completed soon

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/config/AccountingUiLabels.xml
    ofbiz/ofbiz-framework/trunk/applications/accounting/servicedef/services_admin.xml
    ofbiz/ofbiz-framework/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/ofbiz-framework/trunk/applications/accounting/widget/AccountingMenus.xml
    ofbiz/ofbiz-framework/trunk/applications/accounting/widget/GlSetupForms.xml
    ofbiz/ofbiz-framework/trunk/applications/accounting/widget/GlSetupScreens.xml
    ofbiz/ofbiz-framework/trunk/applications/datamodel/data/seed/AccountingSeedData.xml
    ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=1824436&r1=1824435&r2=1824436&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/config/AccountingUiLabels.xml Fri Feb 16 09:04:06 2018
@@ -542,6 +542,10 @@
         <value xml:lang="zh">添加会员总账账户</value>
         <value xml:lang="zh-TW">增加團體總帳科目</value>
     </property>
+    <property key="AccountingAddPartyPrefDocTypeTpl">
+        <value xml:lang="en">Add document type template</value>
+        <value xml:lang="fr">Ajouter un modèle pour le type de document</value>
+    </property>
     <property key="AccountingAddPaymentGroupMember">
         <value xml:lang="ar">إضافة عضو لمجموعة الدفعات</value>
         <value xml:lang="de">Zahlungsgruppen-Mitglied hinzufügen</value>
@@ -4550,6 +4554,10 @@
         <value xml:lang="zh">描述</value>
         <value xml:lang="zh-TW">描述</value>
     </property>
+    <property key="AccountingDocumentTypeTemplate">
+        <value xml:lang="en">Doc. Type template</value>
+        <value xml:lang="fr">Modèle de type de doc.</value>
+    </property>
     <property key="AccountingDueDate">
         <value xml:lang="ar">تعديل الدفعة</value>
         <value xml:lang="cs">Datum splatnosti</value>
@@ -15436,6 +15444,18 @@
         <value xml:lang="zh">现存数量合计</value>
         <value xml:lang="zh-TW">現存數量合計</value>
     </property>
+    <property key="AccountingTplInvoiceType">
+        <value xml:lang="en">Template for invoice</value>
+        <value xml:lang="fr">Modèle pour facture</value>
+    </property>
+    <property key="AccountingTplOrderType">
+        <value xml:lang="en">Template for order</value>
+        <value xml:lang="fr">Modèle pour commande</value>
+    </property>
+    <property key="AccountingTplQuoteType">
+        <value xml:lang="en">Template for quote</value>
+        <value xml:lang="fr">Modèle pour devis</value>
+    </property>
     <property key="AccountingTransactionHasBeenAlreadyPosted">
         <value xml:lang="ar">لقد تم رصد العملية سابقا</value>
         <value xml:lang="de">Buchung wurde bereits ausgeführt</value>

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/servicedef/services_admin.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/servicedef/services_admin.xml?rev=1824436&r1=1824435&r2=1824436&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/servicedef/services_admin.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/servicedef/services_admin.xml Fri Feb 16 09:04:06 2018
@@ -60,6 +60,19 @@ under the License.
         </auto-attributes>
     </service>
 
+    <service name="createPartyPrefDocTypeTpl" default-entity-name="PartyPrefDocTypeTpl" engine="entity-auto" invoke="create" auth="true">
+        <description>Create a documentType preference for a party (organization)</description>
+        <permission-service service-name="acctgPrefPermissionCheck" main-action="CREATE"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <attribute name="partyPrefDocTypeTplId" type="String" mode="OUT"/>
+        <override name="partylId" mode="IN" optional="false"/>
+    </service>
+    <service name="expirePartyPrefDocTypeTpl" default-entity-name="PartyPrefDocTypeTpl" engine="entity-auto" invoke="expire" auth="true">
+        <description>Expire a documentType preference for a party (organization)</description>
+        <permission-service service-name="acctgPrefPermissionCheck" main-action="UPDATE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
+
     <service name="getPartyAccountingPreferences" default-entity-name="PartyAcctgPreference" engine="groovy"
             location="component://accounting/groovyScripts/admin/AcctgAdminServices.groovy" invoke="getPartyAccountingPreferences" auth="true">
         <description>Get accounting preferences for a party (organization)</description>

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=1824436&r1=1824435&r2=1824436&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Fri Feb 16 09:04:06 2018
@@ -1541,13 +1541,25 @@ under the License.
         <response name="success" type="view" value="PartyAcctgPreference"/>
         <response name="error" type="view" value="PartyAcctgPreference"/>
     </request-map>
-
     <request-map uri="updatePartyAcctgPreference">
         <security https="true" auth="true"/>
         <event type="service" invoke="updatePartyAcctgPreference"/>
         <response name="success" type="view" value="PartyAcctgPreference"/>
         <response name="error" type="view" value="PartyAcctgPreference"/>
     </request-map>
+    <request-map uri="ListPartyPrefDocTypeTpl"><security https="true" auth="true"/><response name="success" type="view" value="ListPartyPrefDocTypeTpl"/></request-map>
+    <request-map uri="createPartyPrefDocTypeTpl">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createPartyPrefDocTypeTpl"/>
+        <response name="success" type="view" value="ListPartyPrefDocTypeTpl"/>
+        <response name="error" type="view" value="ListPartyPrefDocTypeTpl"/>
+    </request-map>
+    <request-map uri="expirePartyPrefDocTypeTpl">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="expirePartyPrefDocTypeTpl"/>
+        <response name="success" type="view" value="ListPartyPrefDocTypeTpl"/>
+        <response name="error" type="view" value="ListPartyPrefDocTypeTpl"/>
+    </request-map>
 
     <request-map uri="GlAccountAssignment">
         <security https="true" auth="true"/>
@@ -2743,6 +2755,7 @@ under the License.
     <view-map name="AddCompany" type="screen" page="component://accounting/widget/GlSetupScreens.xml#AddCompany"/>
     <view-map name="TimePeriods" type="screen" page="component://accounting/widget/GlSetupScreens.xml#TimePeriods"/>
     <view-map name="PartyAcctgPreference" type="screen" page="component://accounting/widget/GlSetupScreens.xml#PartyAcctgPreference"/>
+    <view-map name="ListPartyPrefDocTypeTpl" type="screen" page="component://accounting/widget/GlSetupScreens.xml#ListPartyPrefDocTypeTpl"/>
     <view-map name="ListGlAccountOrganization" type="screen" page="component://accounting/widget/GlSetupScreens.xml#ListGlAccountOrganization"/>
     <view-map name="SetupGlJournals" type="screen" page="component://accounting/widget/GlSetupScreens.xml#SetupGlJournals"/>
     <view-map name="ViewFXConversions" type="screen" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ViewFXConversions"/>

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/widget/AccountingMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/widget/AccountingMenus.xml?rev=1824436&r1=1824435&r2=1824436&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/widget/AccountingMenus.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/widget/AccountingMenus.xml Fri Feb 16 09:04:06 2018
@@ -1013,6 +1013,11 @@ under the License.
                 <parameter param-name="organizationPartyId"/>
             </link>
         </menu-item>
+        <menu-item name="PartyPrefDocTypeTpl" title="${uiLabelMap.AccountingDocumentTypeTemplate}">
+            <link target="ListPartyPrefDocTypeTpl">
+                <parameter param-name="partyId" from-field="organizationPartyId"/>
+            </link>
+        </menu-item>
         <menu-item name="SetupGlJournals" title="${uiLabelMap.AccountingGlJournals}">
             <link target="SetupGlJournals">
                 <parameter param-name="organizationPartyId"/>

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/widget/GlSetupForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/widget/GlSetupForms.xml?rev=1824436&r1=1824435&r2=1824436&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/widget/GlSetupForms.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/widget/GlSetupForms.xml Fri Feb 16 09:04:06 2018
@@ -34,6 +34,11 @@ under the License.
                 <parameter param-name="organizationPartyId" from-field="partyId"/>
             </hyperlink>
         </field>
+        <field name="documentTypeTpl" title=" " use-when="hasBasicPermission" widget-style="buttontext">
+            <hyperlink description="${uiLabelMap.AccountingDocumentTypeTemplate}" target="ListPartyPrefDocTypeTpl">
+                <parameter param-name="partyId"/>
+            </hyperlink>
+        </field>
         <field name="importexport" title=" " use-when="hasBasicPermission" widget-style="buttontext">
             <hyperlink description="${uiLabelMap.CommonImportExport}" target="ImportExport">
                 <parameter param-name="organizationPartyId" from-field="partyId"/>
@@ -381,6 +386,86 @@ under the License.
         </field>
     </form>
 
+    <form name="ListPartyPrefDocTypeTpl" type="list" title="" target="expirePartyPrefDocTypeTpl"
+        odd-row-style="alternate-row" default-table-style="basic-table hover-bar" separate-columns="true">
+        <actions>
+            <set field="sortField" from-field="parameters.sortField" default-value="-partyPrefDocTypeTplId"/>
+            <entity-condition entity-name="PartyPrefDocTypeTplAndCustomScreen">
+                <condition-expr field-name="partyId" from-field="partyId"/>
+                <order-by field-name="${sortField}"/>
+            </entity-condition>
+        </actions>
+        <field name="partyPrefDocTypeTplId"><hidden/></field>
+        <field name="invoiceTypeId" sort-field="true"><display-entity entity-name="InvoiceType"/></field>
+        <field name="quoteTypeId" sort-field="true"><display-entity entity-name="QuoteType"/></field>
+        <field name="orderTypeId" sort-field="true"><display-entity entity-name="OrderType"/></field>
+        <field name="customScreenId" sort-field="true" use-when="customScreenId != null"><display-entity entity-name="CustomScreen"/></field>
+        <field name="customScreenId" sort-field="true" use-when="customScreenId == null"><display description="${uiLabelMap.CommonDefaultScreen}"/></field>
+        <field name="fromDate" sort-field="true"><display type="date"/></field>
+        <field name="thruDate" use-when="thruDate != null"><display type="date"/></field>
+        <field name="thruDate" use-when="thruDate == null"><date-time type="date"/></   field>
+        <field name="expire" use-when="thruDate != null"><display description="-"/></field>
+        <field name="expire" use-when="thruDate == null"><submit/></field>
+    </form>
+
+    <form name="SelectPartyPrefDocTypeTpl" type="single" target="ListPartyPrefDocTypeTpl" title="" >
+        <field name="partyId"><hidden/></field>
+        <field name="documentType" title="">
+            <drop-down >
+                <option key="InvoiceType" description="${uiLabelMap.AccountingTplInvoiceType}"/>
+                <option key="QuoteType" description="${uiLabelMap.AccountingTplQuoteType}"/>
+                <option key="OrderType" description="${uiLabelMap.AccountingTplOrderType}"/>
+            </drop-down>
+        </field>
+        <field name="selectButton"><submit/></field>
+    </form>
+    <form name="AddPartyPrefDocTypeTpl" type="single" target="createPartyPrefDocTypeTpl" title="" >
+        <actions>
+            <script location="component://common/groovyScripts/ChildrenCustomScreenTypes.groovy"/>
+        </actions>
+        <field name="partyId"><hidden/></field>
+        <field name="fromDate"><date-time type="date"/></field>
+        <field name="customScreenId">
+            <drop-down>
+                <option key="" description="${uiLabelMap.CommonDefaultScreen}"/>
+                <entity-options entity-name="CustomScreen" description="${description}">
+                    <entity-constraint name="customScreenTypeId" operator="in" env-name="customScreenTypeIds"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton"><submit/></field>
+    </form>
+    <form name="AddPartyPrefInvoiceTypeTpl" extends="AddPartyPrefDocTypeTpl" >
+        <actions>
+            <set field="customScreenTypeId" value="CST_INVOICE_TPL" global="true"/>
+            <call-parent-actions/>
+        </actions>
+        <field name="invoiceTypeId">
+            <drop-down><entity-options entity-name="InvoiceType" description="${description}"/></drop-down>
+        </field>
+        <sort-order><sort-field name="invoiceTypeId"/></sort-order>
+    </form>
+    <form name="AddPartyPrefQuoteTypeTpl" extends="AddPartyPrefDocTypeTpl" >
+        <actions>
+            <set field="customScreenTypeId" value="CST_QUOTE_TPL"/>
+            <call-parent-actions/>
+        </actions>
+        <field name="quoteTypeId">
+            <drop-down><entity-options entity-name="QuoteType" description="${description}"/></drop-down>
+        </field>
+        <sort-order><sort-field name="quoteTypeId"/></sort-order>
+    </form>
+    <form name="AddPartyPrefOrderTypeTpl" extends="AddPartyPrefDocTypeTpl" >
+        <actions>
+            <set field="customScreenTypeId" value="CST_ORDER_TPL"/>
+            <call-parent-actions/>
+        </actions>
+        <field name="orderTypeId">
+            <drop-down><entity-options entity-name="OrderType" description="${description}"/></drop-down>
+        </field>
+        <sort-order><sort-field name="orderTypeId"/></sort-order>
+    </form>
+
     <!-- forms for managing FX rates -->
     <form name="ListConversions" type="list" list-name="conversions"
         odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/widget/GlSetupScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/widget/GlSetupScreens.xml?rev=1824436&r1=1824435&r2=1824436&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/widget/GlSetupScreens.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/widget/GlSetupScreens.xml Fri Feb 16 09:04:06 2018
@@ -221,6 +221,33 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="ListPartyPrefDocTypeTpl">
+        <section>
+            <actions>
+                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="titleProperty" value="AccountingPreference"/>
+                <set field="labelTitleProperty" from-field="uiLabelMap.AccountingPreference"/>
+                <set field="tabButtonItem" value="PartyPrefDocTypeTpl"/>
+                <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/>
+                <set field="organizationPartyId" value="${groovy:if(parameters.organizationPartyId!=null) return parameters.organizationPartyId else return parameters.get('ApplicationDecorator|organizationPartyId')}"/>
+                <set field="partyId" from-field="organizationPartyId"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonGlSetupDecorator" location="${parameters.commonGlSetupDecoratorLocation}">
+                    <decorator-section name="body">
+                        <include-form name="ListPartyPrefDocTypeTpl" location="component://accounting/widget/GlSetupForms.xml"/>
+                        <screenlet title="${uiLabelMap.AccountingAddPartyPrefDocTypeTpl}">
+                            <section>
+                                <condition><if-empty field="parameters.documentType"/></condition>
+                                <widgets><include-form name="SelectPartyPrefDocTypeTpl" location="component://accounting/widget/GlSetupForms.xml"/></widgets>
+                                <fail-widgets><include-form name="AddPartyPref${parameters.documentType}Tpl" location="component://accounting/widget/GlSetupForms.xml"/></fail-widgets>
+                            </section>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
     <screen name="SetupGlJournals">
         <section>
             <actions>

Modified: ofbiz/ofbiz-framework/trunk/applications/datamodel/data/seed/AccountingSeedData.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/datamodel/data/seed/AccountingSeedData.xml?rev=1824436&r1=1824435&r2=1824436&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/datamodel/data/seed/AccountingSeedData.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/datamodel/data/seed/AccountingSeedData.xml Fri Feb 16 09:04:06 2018
@@ -860,6 +860,11 @@ under the License.
     <CustomMethod customMethodId="SECURE_RELEASE_OFBIZ" customMethodTypeId="CC_RELEASE" customMethodName="ofbScRelease" description="SecurePay payment release"/>
     <CustomMethod customMethodId="SECURE_CREDIT_OFBIZ" customMethodTypeId="CC_CREDIT" customMethodName="ofbScCCCredit" description="SecurePay Credit Card"/>
 
+    <!-- CustomScreenType available for official template document-->
+    <CustomScreenType customScreenTypeId="CST_INVOICE_TPL" description="Invoice types template"/>
+    <CustomScreenType customScreenTypeId="CST_ORDER_TPL" description="Order types template"/>
+    <CustomScreenType customScreenTypeId="CST_QUOTE_TPL" description="Quote types template"/>
+
     <!-- Credit Cart Types -->
     <EnumerationType description="Credit Card Type" enumTypeId="CREDIT_CARD_TYPE" hasTable="N" parentTypeId=""/>
     <Enumeration description="Visa" enumCode="Visa" enumId="CCT_VISA" sequenceId="01" enumTypeId="CREDIT_CARD_TYPE"/>

Modified: ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml?rev=1824436&r1=1824435&r2=1824436&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/accounting-entitymodel.xml Fri Feb 16 09:04:06 2018
@@ -2489,6 +2489,45 @@ under the License.
             <key-map field-name="oldOrderSequenceEnumId" rel-field-name="enumId"/>
         </relation>
     </entity>
+    <entity entity-name="PartyPrefDocTypeTpl"
+            package-name="org.apache.ofbiz.accounting.ledger"
+            title="Party (organization) preferences for document type template">
+        <field name="partyPrefDocTypeTplId" type="id"/>
+        <field name="partyId" type="id"/>
+        <field name="fromDate" type="date-time"/>
+        <field name="thruDate" type="date-time"/>
+        <field name="invoiceTypeId" type="id"/>
+        <field name="orderTypeId" type="id"/>
+        <field name="quoteTypeId" type="id"/>
+        <field name="customScreenId" type="id"/>
+        <prim-key field="partyPrefDocTypeTplId"/>
+        <relation type="one" rel-entity-name="Party" fk-name="PAPDTT_TO_PTY">
+            <key-map field-name="partyId"/>
+        </relation>
+        <relation type="one" rel-entity-name="PartyAcctgPreference" fk-name="PAPDTT_TO_PAP">
+            <key-map field-name="partyId"/>
+        </relation>
+        <relation type="one" rel-entity-name="InvoiceType" fk-name="PAPDTT_TO_INVT">
+            <key-map field-name="invoiceTypeId"/>
+        </relation>
+        <relation type="one" rel-entity-name="QuoteType" fk-name="PAPDTT_TO_QUOT">
+            <key-map field-name="quoteTypeId"/>
+        </relation>
+        <relation type="one" rel-entity-name="OrderType" fk-name="PAPDTT_TO_ORDT">
+            <key-map field-name="orderTypeId"/>
+        </relation>
+    </entity>
+    <view-entity entity-name="PartyPrefDocTypeTplAndCustomScreen"
+                 package-name="org.apache.ofbiz.accounting.ledger"
+                 title="Party (organization) accounting preferences for document type template and custom screen view">
+        <member-entity entity-alias="PAP" entity-name="PartyPrefDocTypeTpl"/>
+        <member-entity entity-alias="CS" entity-name="CustomScreen"/>
+        <alias-all entity-alias="PAP"/>
+        <alias-all entity-alias="CS"/>
+        <view-link entity-alias="PAP" rel-entity-alias="CS" rel-optional="true">
+            <key-map field-name="customScreenId"/>
+        </view-link>
+    </view-entity>
     <entity entity-name="ProductAverageCost"
             package-name="org.apache.ofbiz.accounting.ledger"
             title="Running tally of average cost">