You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2007/04/26 15:32:41 UTC

svn commit: r532739 - in /ofbiz/trunk/applications/accounting: config/ data/ webapp/accounting/WEB-INF/ webapp/accounting/invoice/ widget/

Author: hansbak
Date: Thu Apr 26 06:32:40 2007
New Revision: 532739

URL: http://svn.apache.org/viewvc?view=rev&rev=532739
Log:
have separate menus for creation of sales and pruchase invoices and make sure the organizationCompany is in the proper party field. In the editInvoice screen do not allow the organization party to be changed and that the sequential numbering is interupted. also put in the proper classes for the buttons in invoice and payment. Also changed the demo data to show the seq numbering on the party company. Needs a reload of seed data

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
    ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
    ofbiz/trunk/applications/accounting/data/DemoOrganizationData.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml
    ofbiz/trunk/applications/accounting/widget/CommonScreens.xml
    ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml
    ofbiz/trunk/applications/accounting/widget/Menus.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties?view=diff&rev=532739&r1=532738&r2=532739
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties Thu Apr 26 06:32:40 2007
@@ -122,7 +122,8 @@
 AccountingCreateFixedAssetMaintOrderPermissionError = Security Error: to run createFixedAssetMaintOrder you must have the ACCOUNTING_CREATEUPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_CREATE permission
 AccountingCreateNewCreditCard=Create New Credit Card
 AccountingCreateNewEftAccount=Create New EFT Account
-AccountingCreateNewInvoice=New Invoice
+AccountingCreateNewSalesInvoice=New Sales Invoice
+AccountingCreateNewPurchaseInvoice=New Purchase Invoice
 AccountingCreatePayment=Create Payment
 AccountingCreatePaymentPermissionError=Security Error : To Create a Payment you must either be the to or from party or have the PAY_INFO_CREATE or PAY_INFO_ADMIN permissions.
 AccountingCreatePermissionError=Security Error: to run createGlAccount you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission<br>

Modified: ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml?view=diff&rev=532739&r1=532738&r2=532739
==============================================================================
--- ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml Thu Apr 26 06:32:40 2007
@@ -341,11 +341,11 @@
     <InvoiceItemType description="Commission Invoice Line Item" hasTable="N" invoiceItemTypeId="COMM_INV_ITEM" parentTypeId=""/>
     <InvoiceItemType description="Commission Invoice Adjustment" hasTable="N" invoiceItemTypeId="COMM_INV_ADJ" parentTypeId=""/>
     
-    <InvoiceType description="Purchase Invoice" hasTable="N" invoiceTypeId="PURCHASE_INVOICE" parentTypeId=""/>
-    <InvoiceType description="Sales Invoice" hasTable="N" invoiceTypeId="SALES_INVOICE" parentTypeId=""/>
-    <InvoiceType description="Customer Return" hasTable="N" invoiceTypeId="CUST_RTN_INVOICE" parentTypeId=""/>
-    <InvoiceType description="Commission" hasTable="N" invoiceTypeId="COMMISSION_INVOICE" parentTypeId=""/>
-    <InvoiceType description="Interest" hasTable="N" invoiceTypeId="INTEREST_INVOICE" parentTypeId=""/>
+    <InvoiceType description="Purchase Invoice" hasTable="N" invoiceTypeId="PURCHASE_INVOICE" parentTypeId="PURCHASE_INVOICE"/>
+    <InvoiceType description="Sales Invoice" hasTable="N" invoiceTypeId="SALES_INVOICE" parentTypeId="SALES_INVOICE"/>
+    <InvoiceType description="Customer Return" hasTable="N" invoiceTypeId="CUST_RTN_INVOICE" parentTypeId="PURCHASE_INVOICE"/>
+    <InvoiceType description="Commission" hasTable="N" invoiceTypeId="COMMISSION_INVOICE" parentTypeId="PURCHASE_INVOICE"/>
+    <InvoiceType description="Interest" hasTable="N" invoiceTypeId="INTEREST_INVOICE" parentTypeId="SALES_INVOICE"/>
 
     <!-- maps line items such as order items to invoice item types.  separate mapping for sales and purchase invoices -->
     <InvoiceItemTypeMap invoiceTypeId="SALES_INVOICE" invoiceItemMapKey="FINISHED_GOOD" invoiceItemTypeId="INV_FPROD_ITEM"/>

Modified: ofbiz/trunk/applications/accounting/data/DemoOrganizationData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/DemoOrganizationData.xml?view=diff&rev=532739&r1=532738&r2=532739
==============================================================================
--- ofbiz/trunk/applications/accounting/data/DemoOrganizationData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/DemoOrganizationData.xml Thu Apr 26 06:32:40 2007
@@ -31,7 +31,7 @@
     <PartyContactMechPurpose partyId="Company" contactMechId="9000" contactMechPurposeTypeId="BILLING_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
     <PartyContactMechPurpose partyId="Company" contactMechId="9000" contactMechPurposeTypeId="GENERAL_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
     <PartyContactMechPurpose partyId="Company" contactMechId="9000" contactMechPurposeTypeId="PAYMENT_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
-    <PartyAcctgPreference partyId="Company" taxFormId="US_IRS_1120" cogsMethodId="COGS_AVG_COST" baseCurrencyUomId="USD"/>
+    <PartyAcctgPreference partyId="Company" taxFormId="US_IRS_1120" cogsMethodId="COGS_AVG_COST" baseCurrencyUomId="USD" invoiceSequenceEnumId="INVSQ_ENF_SEQ" invoiceIdPrefix="compInv" lastInvoiceNumber="000000" quoteSequenceEnumId="INVSQ_ENF_SEQ" quoteIdPrefix="compQuo" lastQuoteNumber="000000" orderSequenceEnumId="INVSQ_ENF_SEQ" orderIdPrefix="compOrd" lastOrderNumber="000000"/>
     
     <!-- Sub-Organizations -->
     <Party partyId="MARKETING" partyTypeId="PARTY_GROUP" createdDate="2004-03-27 09:37:40.989" createdByUserLogin="admin" lastModifiedDate="2004-03-27 09:37:40.989" lastModifiedByUserLogin="admin" lastUpdatedStamp="2004-03-27 09:37:41.016" lastUpdatedTxStamp="2004-03-27 09:37:41.016" createdStamp="2004-03-27 09:37:41.016" createdTxStamp="2004-03-27 09:37:41.016"/>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?view=diff&rev=532739&r1=532738&r2=532739
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Thu Apr 26 06:32:40 2007
@@ -184,6 +184,10 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="invoiceOverview"/>
     </request-map>
+    <request-map uri="newInvoice">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="newInvoice"/>
+    </request-map> 
     <request-map uri="editInvoice">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="editInvoice"/>
@@ -191,8 +195,8 @@
     <request-map uri="createInvoice">
         <security https="true" auth="true"/>
         <event type="service" invoke="createInvoice"/>
-        <response name="success" type="view" value="listInvoiceItems"/>
-        <response name="error" type="view" value="editInvoice"/>
+        <response name="success" type="request" value="editInvoice"/>
+        <response name="error" type="view" value="newInvoice"/>
     </request-map>
     <request-map uri="copyInvoice">
         <security https="true" auth="true"/>
@@ -1332,6 +1336,7 @@
     <!-- Invoice -->
     <view-map name="invoiceOverview" type="screen" page="component://accounting/widget/InvoiceScreens.xml#invoiceOverview"/>
     <view-map name="findInvoices" type="screen" page="component://accounting/widget/InvoiceScreens.xml#FindInvoices"/>
+    <view-map name="newInvoice" type="screen" page="component://accounting/widget/InvoiceScreens.xml#NewInvoice"/>
     <view-map name="editInvoice" type="screen" page="component://accounting/widget/InvoiceScreens.xml#EditInvoice"/>
     <view-map name="listInvoiceItems" type="screen" page="component://accounting/widget/InvoiceScreens.xml#EditInvoiceItems"/>
     <view-map name="editInvoiceItem" type="screen" page="component://accounting/widget/InvoiceScreens.xml#EditInvoiceItem"/>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml?view=diff&rev=532739&r1=532738&r2=532739
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/InvoiceForms.xml Thu Apr 26 06:32:40 2007
@@ -22,7 +22,7 @@
     xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-form.xsd">
     <!-- Invoice forms -->
     <form name="FindInvoices" type="single" target="findInvoices" title="Find and list invoices">
-        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field> 
+        <field name="noConditionFind"><hidden value="Y"/></field> 
         <field name="hideSearch"><hidden value="Y"/></field>
         <field name="invoiceId"><text-find default-option="contains" ignore-case="true"/></field>
         <field name="description"><text-find default-option="contains" ignore-case="true"/></field>
@@ -180,6 +180,51 @@
         <field name="paymentId"><hidden/></field>
     </form>
     
+    <form name="NewSalesInvoice" type="single" target="createInvoice" title="Edit Invoice Header" default-map-name="invoice">
+        <field name="statusId"><hidden value="INVOICE_IN_PROCESS"/></field>
+        <field position="2" name="invoiceTypeId">
+            <drop-down allow-empty="false" no-current-selected-key="SALES_INVOICE">
+                <entity-options description="${description}" entity-name="InvoiceType">
+                    <entity-constraint name="parentTypeId" value="SALES_INVOICE"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field> 
+        <field position="1" name="organizationPartyId" parameter-name="partyIdFrom">
+            <drop-down allow-empty="false">
+                <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId">
+                    <entity-order-by field-name="partyId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field position="2" name="partyIdTo" parameter-name="partyId" required-field="true"><lookup target-form-name="LookupPartyName"/></field>
+        <field position="1" name="createButton" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <form name="NewPurchaseInvoice" type="single" target="createInvoice" title="Edit Invoice Header" default-map-name="invoice">
+        <field name="statusId"><hidden value="INVOICE_IN_PROCESS"/></field>
+        <field position="2" name="invoiceTypeId">
+            <drop-down allow-empty="false" no-current-selected-key="PURCHASE_INVOICE">
+                <entity-options description="${description}" entity-name="InvoiceType">
+                    <entity-constraint name="parentTypeId" value="PURCHASE_INVOICE"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field> 
+        <field position="1" name="organizationPartyId" parameter-name="partyId">
+            <drop-down allow-empty="false">
+                <entity-options description="${partyId}" entity-name="PartyAcctgPreference" key-field-name="partyId">
+                    <entity-order-by field-name="partyId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field position="2" name="partyIdFrom" required-field="true"><lookup target-form-name="LookupPartyName"/></field>
+        <field position="1" name="createButton" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+
     <form name="EditInvoice" type="single" target="updateInvoice" title="Edit Invoice Header" default-map-name="invoice">
         <alt-target use-when="invoice==null" target="createInvoice"/>
         <field name="invoiceId"><hidden/></field>
@@ -187,7 +232,7 @@
         <field position="2" name="dueDate"><date-time/></field>
         <field position="1" name="invoiceTypeId" use-when="invoice!=null"><display-entity entity-name="InvoiceType" description="${description}"/></field>
         <field position="1" name="invoiceTypeId" use-when="invoice==null">
-                <drop-down allow-empty="false" no-current-selected-key="SALES_INVOICE">
+            <drop-down allow-empty="false" no-current-selected-key="SALES_INVOICE">
                 <entity-options description="${description}" entity-name="InvoiceType">
                     <entity-order-by field-name="description"/>
                 </entity-options>
@@ -196,8 +241,10 @@
         <field name="statusId" use-when="invoice==null"><hidden value="INVOICE_IN_PROCESS"/></field>
         <field position="2" name="statusId" use-when="invoice!=null"><display-entity entity-name="StatusItem"/></field>
         <field position="1" name="description"><text size="100"/></field>
-        <field position="1" name="partyIdFrom"><lookup target-form-name="LookupPartyName"/></field>
-        <field position="2" name="partyIdTo" entry-name="partyId" parameter-name="partyId"><lookup target-form-name="LookupPartyName"/></field>
+        <field position="1" name="partyIdFrom" use-when="invoiceType.getString(&quot;parentTypeId&quot;).equals(&quot;SALES_INVOICE&quot;)"><display description="${invoice.partyIdFrom}"/></field>
+        <field position="1" name="partyIdFrom" use-when="invoiceType.getString(&quot;parentTypeId&quot;).equals(&quot;PURCHASE_INVOICE&quot;)"><lookup target-form-name="LookupPartyName"/></field>
+        <field position="1" name="partyIdTo" entry-name="partyId" parameter-name="partyId" use-when="invoiceType.getString(&quot;parentTypeId&quot;).equals(&quot;PURCHASE_INVOICE&quot;)"><display description="${invoice.partyId}"/></field>
+        <field position="1" name="partyIdTo" entry-name="partyId" parameter-name="partyId" use-when="invoiceType.getString(&quot;parentTypeId&quot;).equals(&quot;SALES_INVOICE&quot;)"><lookup target-form-name="LookupPartyName"/></field>
         <field position="1" name="roleTypeId">
             <drop-down allow-empty="true">
                 <entity-options description="${description}" entity-name="RoleType">
@@ -216,10 +263,7 @@
         </field>
         <field position="1" name="invoiceMessage"><text size="100"/></field>
         <!--field position="2" name="invoiceAmount" use-when="invoiceId!=null"><display/></field-->
-        <field position="1" use-when="invoice==null" name="createButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit">
-            <submit button-type="button"/>
-        </field>
-        <field position="1" use-when="invoice!=null" name="updateButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit">
+        <field position="1" name="updateButton" widget-style="smallSubmit">
             <submit button-type="button"/>
         </field>
     </form>

Modified: ofbiz/trunk/applications/accounting/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/CommonScreens.xml?view=diff&rev=532739&r1=532738&r2=532739
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/CommonScreens.xml Thu Apr 26 06:32:40 2007
@@ -57,7 +57,12 @@
                             <widgets>
                                 <include-menu name="InvoiceTabBar" location="component://accounting/widget/Menus.xml"/>
                                 <include-menu name="InvoiceSubTabBar" location="component://accounting/widget/Menus.xml"/>
-                                <label style="head1">${uiLabelMap.${labelTitleProperty}} ${uiLabelMap.CommonFor}: ${invoice.description} [${invoiceId}]  ${${extraFunctionName}}</label>
+                                <section>
+                                    <condition><not><if-empty field-name="parameters.invoiceId"/></not></condition>
+                                    <widgets>
+                                        <label style="head1" text="${uiLabelMap.${labelTitleProperty}} ${uiLabelMap.CommonFor}: ${invoice.description} [${invoiceId}]  ${${extraFunctionName}}"/>
+                                    </widgets>
+                                </section>
                                 <decorator-section-include name="body"/>
                             </widgets>
                             <fail-widgets>

Modified: ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml?view=diff&rev=532739&r1=532738&r2=532739
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/InvoiceScreens.xml Thu Apr 26 06:32:40 2007
@@ -33,7 +33,7 @@
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <container><link target="editInvoice" text="${uiLabelMap.AccountingCreateNewInvoice}" style="buttontext"/></container>                        
+                        <include-menu name="InvoiceSubTabBar" location="component://accounting/widget/Menus.xml"/>
                         <container><label style="head1" text="${uiLabelMap.AccountingFindInvoices}"/></container>
                         <include-form name="FindInvoices" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
                         <include-form name="ListInvoices"  location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
@@ -42,6 +42,29 @@
             </widgets>
         </section>
     </screen>
+    <screen name="NewInvoice">
+        <section>
+            <actions>
+                <set field="title" value="New Invoice"/>
+                <set field="titleProperty" value="PageTitleEditInvoice"/>
+                <entity-one entity-name="Invoice" value-name="invoice"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonInvoiceDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <label style="head1" text="${uiLabelMap.AccountingCreateNewSalesInvoice}"></label>
+                                <include-form name="NewSalesInvoice" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
+                                <label style="head1" text="${uiLabelMap.AccountingCreateNewPurchaseInvoice}"/>
+                                <include-form name="NewPurchaseInvoice" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
     <screen name="EditInvoice">
         <section>
             <actions>
@@ -51,13 +74,15 @@
                 <set field="invoiceId" from-field="parameters.invoiceId"/>
                 <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD" />
                 <entity-one entity-name="Invoice" value-name="invoice"/>
+                <entity-one entity-name="InvoiceType" value-name="invoiceType">
+                    <field-map field-name="invoiceTypeId" env-name="invoice.invoiceTypeId"/>
+                </entity-one>
             </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <section>
                             <widgets>
-                                <label style="head1" text="${uiLabelMap.AccountingInvoiceHeaderDetailedInformation}"/>
                                 <include-form name="EditInvoice" location="component://accounting/webapp/accounting/invoice/InvoiceForms.xml"/>
                             </widgets>
                         </section>

Modified: ofbiz/trunk/applications/accounting/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/Menus.xml?view=diff&rev=532739&r1=532738&r2=532739
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/Menus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/Menus.xml Thu Apr 26 06:32:40 2007
@@ -21,7 +21,7 @@
 <menus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-menu.xsd">
     
-    <menu name="InvoiceTabBar" default-menu-item-name="overview"> 
+    <menu name="InvoiceTabBar" menu-container-style="button-bar button-style-1" default-selected-style="selected"> 
         <menu-item name="find" title="${uiLabelMap.CommonFind}" >
             <condition>
                 <if-compare field-name="tabButtonItem" operator="not-equals" value="find"/>
@@ -106,13 +106,10 @@
             <link target="sendPerEmail?invoiceId=${invoice.invoiceId}"/>
         </menu-item>
     </menu>
-    <menu name="InvoiceSubTabBar" default-title-style="buttontext"> 
+    <menu name="InvoiceSubTabBar" menu-container-style="button-bar button-style-2" default-selected-style="selected">  
         
-        <menu-item name="createNew" title="${uiLabelMap.CommonCreateNew}">
-            <condition>
-                <not><if-empty field-name="invoice.invoiceId"/></not>
-            </condition>
-            <link target="editInvoice"/>
+        <menu-item name="createNew" title="${uiLabelMap.CommonCreateNew}" >
+            <link target="newInvoice"/>
         </menu-item>
         <menu-item name="copyInvoice" title="${uiLabelMap.CommonCopy}">
             <condition>
@@ -232,7 +229,7 @@
         
     </menu>
 
-    <menu name="PaymentTabBar" default-menu-item-name="overview"> 
+    <menu name="PaymentTabBar" menu-container-style="button-bar button-style-1" default-selected-style="selected">  
         <menu-item name="find" title="${uiLabelMap.CommonFind}" >
             <condition>
                 <if-compare field-name="tabButtonItem" operator="not-equals" value="find"/>
@@ -272,7 +269,7 @@
         </menu-item>
     </menu>  
           
-    <menu name="PaymentSubTabBar" default-title-style="buttontext">
+    <menu name="PaymentSubTabBar" menu-container-style="button-bar button-style-2" default-selected-style="selected"> 
         <actions>
             <set field="isDisbursement" value="${bsh:org.ofbiz.accounting.util.UtilAccounting.isDisbursement(payment)}"/>
         </actions>