Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-6802

be able to set accounting company in the header, so other companent can change it too.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: accounting
    • Labels:
      None
    • Environment:

      any

      Description

      Currently it is possible to set the current accounting company in the option under organization GL settings and in party preferences.

      The proposal is to remove it from accounting and set it in the theme header so it will be available in all components. In order to make the system not more complicated, this setting is only available when there is more than a single accounting company.

      Then replace the organization GL settings in accounting by

      "${organization} setup' and '${organization} accounting where ${organization} 
      

      is the current selected accounting company in the header.

      The global setting of the current organization is already done in the application decorator in the commonext component.

      1. OFBIZ-6802-fix.patch
        116 kB
        Parinya Wongjina
      2. OFBIZ-6802-fix-bug.patch
        23 kB
        Parinya Wongjina

        Activity

        Hide
        jacopoc Jacopo Cappellato added a comment -

        I like the idea of having a global session based company that all application will use as default for the logged in user.
        It would be great to select the default accounting company for the logged in user by looking at the UserLogin->Person->PartyRelationship (as employee or similar) to the given organization; if this data is not available then the current mechanism could be used (i.e. looking at all the organizations). If the user is an employee of an organization with children organizations, then the user may be allowed to select any of them as the default after she logs into the system.
        Of course these enhancements could be implemented in later steps.

        Show
        jacopoc Jacopo Cappellato added a comment - I like the idea of having a global session based company that all application will use as default for the logged in user. It would be great to select the default accounting company for the logged in user by looking at the UserLogin->Person->PartyRelationship (as employee or similar) to the given organization; if this data is not available then the current mechanism could be used (i.e. looking at all the organizations). If the user is an employee of an organization with children organizations, then the user may be allowed to select any of them as the default after she logs into the system. Of course these enhancements could be implemented in later steps.
        Hide
        hansbak Hans Bakker added a comment -

        Using the position the current user has in the company structure is an interesting idea and sure would be ideal implementation. This means however that this information needs to be available what is not always the case

        When no objections we will implement the following:

        When there is only a single INTERNAL_ORGANIZATIO company, then the header should not change and this company is automatically selected.

        When there are more than a single company, a click-able accounting company name should be shown in the header.

        Show the selected company in the user preferences, when not available use the system preferences, when not available use the oldest accounting company created, when nothing found show the accounting company setup screen where the partyid can be selected or created.

        When the accounting company name in the header is clicked, show a popup with a list of accounting companies.

        Check if the current user is part of an accounting company(partyRelationship), when yes, show that company and all accounting companies lower in the accounting company tree. A user can be part of more than a single company.

        When the current user is not part of an accounting company, show all companies alphabetically with the role INTERNAL_ORGANIZATIO.

        Let the user select the company and update the context and user preference.

        Show
        hansbak Hans Bakker added a comment - Using the position the current user has in the company structure is an interesting idea and sure would be ideal implementation. This means however that this information needs to be available what is not always the case When no objections we will implement the following: When there is only a single INTERNAL_ORGANIZATIO company, then the header should not change and this company is automatically selected. When there are more than a single company, a click-able accounting company name should be shown in the header. Show the selected company in the user preferences, when not available use the system preferences, when not available use the oldest accounting company created, when nothing found show the accounting company setup screen where the partyid can be selected or created. When the accounting company name in the header is clicked, show a popup with a list of accounting companies. Check if the current user is part of an accounting company(partyRelationship), when yes, show that company and all accounting companies lower in the accounting company tree. A user can be part of more than a single company. When the current user is not part of an accounting company, show all companies alphabetically with the role INTERNAL_ORGANIZATIO. Let the user select the company and update the context and user preference.
        Hide
        bank Parinya Wongjina added a comment -

        add 2 more file to patch. remove unnecessary space and line.

        Show
        bank Parinya Wongjina added a comment - add 2 more file to patch. remove unnecessary space and line.
        Hide
        bank Parinya Wongjina added a comment -

        How to test :

        1. Go to accounting application, select the Organization GL Settings menu then click the "Create new accounting company" button on the top right corner.
        2. Choose company and submit. It will redirect to accounting preference screen. If company is already has setup the accounting preference, system will set accounting company to user automatically.
        3. On setup accounting preference screen. If selected accounting company doesn't setup the accounting preference , user can click add to setup here. After user setup accounting preference, system will set accounting company to user automatically.
        6. After set up accounting preference more than 2 accounting company. The company name should show beside user's name on top right.
        7. Click at the accounting company name. System will redirect to change company screen. User can change existing accounting company here.
        8. All function on accounting should work with current selected accounting company.

        Show
        bank Parinya Wongjina added a comment - How to test : 1. Go to accounting application, select the Organization GL Settings menu then click the "Create new accounting company" button on the top right corner. 2. Choose company and submit. It will redirect to accounting preference screen. If company is already has setup the accounting preference, system will set accounting company to user automatically. 3. On setup accounting preference screen. If selected accounting company doesn't setup the accounting preference , user can click add to setup here. After user setup accounting preference, system will set accounting company to user automatically. 6. After set up accounting preference more than 2 accounting company. The company name should show beside user's name on top right. 7. Click at the accounting company name. System will redirect to change company screen. User can change existing accounting company here. 8. All function on accounting should work with current selected accounting company.
        Hide
        bank Parinya Wongjina added a comment -

        Add new patch file for fix some javascript line to prevent error when there're ID with some escape character

        on listVisualThemes.ftl :
        document.SetUserPreferences_$

        {visualTheme.visualThemeId}.submit() --> document.forms['SetUserPreferences_${visualTheme.visualThemeId}

        '].submit()

        on listCompanies.ftl :
        document.SetUserPreferences_$

        {company.partyId}.submit()" -->document.forms['SetUserPreferences_${company.partyId}

        '].submit()"

        Show
        bank Parinya Wongjina added a comment - Add new patch file for fix some javascript line to prevent error when there're ID with some escape character on listVisualThemes.ftl : document.SetUserPreferences_$ {visualTheme.visualThemeId}.submit() --> document.forms['SetUserPreferences_${visualTheme.visualThemeId} '].submit() on listCompanies.ftl : document.SetUserPreferences_$ {company.partyId}.submit()" -->document.forms['SetUserPreferences_${company.partyId} '].submit()"
        Hide
        hansbak Hans Bakker added a comment -

        I tested the patch according the test instructions and it works well.

        When the patch is applied there is no visible change in the ofbiz user interface when there is only a single accounting company. It becomes only visible when there is more than one in the header of all themes where it will show the current selected accounting company.

        Also the accounting company list in accounting is not changed (yet).

        Please provide your comments, when there are no objections, i will commit this change in a week.

        Show
        hansbak Hans Bakker added a comment - I tested the patch according the test instructions and it works well. When the patch is applied there is no visible change in the ofbiz user interface when there is only a single accounting company. It becomes only visible when there is more than one in the header of all themes where it will show the current selected accounting company. Also the accounting company list in accounting is not changed (yet). Please provide your comments, when there are no objections, i will commit this change in a week.
        Hide
        hansbak Hans Bakker added a comment -

        Committed revision 1728584. Thank you Parinya Wongjina for the patch.

        Show
        hansbak Hans Bakker added a comment - Committed revision 1728584. Thank you Parinya Wongjina for the patch.
        Hide
        bank Parinya Wongjina added a comment -

        Fix some bug on Reports section and FOP pdf.

        Show
        bank Parinya Wongjina added a comment - Fix some bug on Reports section and FOP pdf.
        Show
        hansbak Hans Bakker added a comment - jacopo reported a problem at https://demo-trunk-ofbiz.apache.org/accounting/control/IncomeStatement?organizationPartyId=Company
        Hide
        hansbak Hans Bakker added a comment -

        just committed the corrective patch for xml and pdf problem
        accounting/control/IncomeStatement?organizationPartyId=Company
        Thank you Bank for the patch

        Show
        hansbak Hans Bakker added a comment - just committed the corrective patch for xml and pdf problem accounting/control/IncomeStatement?organizationPartyId=Company Thank you Bank for the patch

          People

          • Assignee:
            Unassigned
            Reporter:
            hansbak Hans Bakker
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development