Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement of the functionality - total price calculator #843

Open
7 tasks done
fredericalpers opened this issue Jun 19, 2024 · 9 comments · May be fixed by #845
Open
7 tasks done

Enhancement of the functionality - total price calculator #843

fredericalpers opened this issue Jun 19, 2024 · 9 comments · May be fixed by #845
Assignees
Labels
component: property detail page Issue, Pull Request or Discussion related to property detail page feature New feature QA Issue or Pull request that is in review

Comments

@fredericalpers
Copy link
Member

fredericalpers commented Jun 19, 2024

Enhancement of the functionality - total price calculator

User Story

As a real estate agent, I would like to see a visual representation in the detailed view of my properties that breaks down the total price of a property so that my clients have a clear overview of the costs. The chart should be calculated automatically from the values entered in onOffice enterprise and fixed values stored in the plugin. This feature provides a transparent breakdown of the total cost of a property and helps potential buyers to see all the costs involved at a glance, making it easier to make a decision.

Requirements / Tasks

  • Add new box "Total costs calculator" in detail view in the backend of the onOffice for WP-Websites Plugin.

  • Add checkbox to activate / deactivate the feature in the frontend. Default = not checked.

  • Integration of all necessary queries for values from onOffice enterprise (kaufpreis (purchase price), aussen_courtage (broker commmission), bundesland (state)). If only one of these fields do not have values in onOffice enterprise the features checkbox should be disabled. The "aussen_courtage" (Broker commission) field is a text field. For calculations we only want to use the %-value. E.g. 3,57%, all other text needs to be filtered out.

  • Implementation of the Property transfer tax (see Notes) into the plugin. The values should be used for the calculation according to the "Bundesland" field value in onOffice enterprise.

  • Implementation of the Notary fees with a standard value of 1,5% into the plugin.

  • Implementation of the Land register entry with a standard value of: 0,5% into the plugin.

  • Implementation of the costs overview in the frontend as seen in Design/Screenshot "Frontend".

Notes

  • Baden-Württemberg: 5 %
  • Bayern: 3,5 %
  • Berlin: 6 %
  • Brandenburg: 6,5%
  • Bremen: 5 %
  • Hamburg: 5,5 %
  • Hessen: 6 %
  • Mecklenburg-Vorpommern: 6 %
  • Niedersachsen: 5 %
  • Nordrhein-Westfalen:6,5 %
  • Rheinland-Pfalz: 5 %
  • Saarland: 6,5 %
  • Sachsen: 5,5 %
  • Sachsen-Anhalt: 5 %
  • Schleswig-Holstein: 6,5 %
  • Thüringen: 5 %

Design / Screenshots

Plugin Backend:
pluginbackend2

Frontend:
calculator

@fredericalpers fredericalpers added feature New feature component: property detail page Issue, Pull Request or Discussion related to property detail page labels Jun 19, 2024
@fredericalpers fredericalpers added this to the v4.25 milestone Jun 19, 2024
@dai-eastgate
Copy link
Contributor

dai-eastgate commented Jun 21, 2024

@fredericalpers During my investigate, I found that when calculating values such as "Notary fees", "Land register", "Property transfer tax", "broker commission", rounding needs to be applied for display on the Frontend. Therefore, the rounding rule I will implement is like the example below:

  • For costs with decimal fractions greater than 0.5, ex: 99.65 will rounded to 100
  • For costs with decimal fractions less than 0.5, ex: 99.26 will rounded down to 99

=> Is the rounding method I suggested correct? If not, please help me figure out the proper way to round

  • Integration of all necessary queries for values from onOffice enterprise (kaufpreis (purchase price), aussen_courtage (broker commmission), bundesland (state)). If only one of these fields does not have values in onOffice enterprise the features checkbox should be disabled

In the backend, we can only check the existence of 3 fields "kaufpreis", "aussen_courtage", "bundesland" in the field list
=> Enable/disable the checkbox "show total costs calculator"
image

As for the requirement "If only one of these fields do not have values in onOffice enterprise the features checkbox should be disabled", we cannot check it in the Admin.
=> My suggested solution: We will check condition "If only one of these fields do not have values in onOffice enterprise" in the Frontend to disable "chart".

  • I see that the value of the "broker commission" field is of type string
    => Can you provide the specific format of this field for me?(I need a specific format to be able to get the percentage value of the "broker commission" field)

Please let me know your opinion. Thanks!

@dai-eastgate dai-eastgate self-assigned this Jun 21, 2024
@dai-eastgate
Copy link
Contributor

@fredericalpers If possible, please answer my questions promptly so I can continue working on the issue. Thank you!

@fredericalpers
Copy link
Member Author

@dai-eastgate

For costs with decimal fractions greater than 0.5, ex: 99.65 will rounded to 100
For costs with decimal fractions less than 0.5, ex: 99.26 will rounded down to 99

This is correct :)

In the backend, we can only check the existence of 3 fields "kaufpreis", "aussen_courtage", "bundesland" in the field list

These fields should not necessarily have to be added to the fieldlist. This feature should also work without additionally adding these fields to the fieldlist.

My suggested solution: We will check condition "If only one of these fields do not have values in onOffice enterprise" in the Frontend to disable "chart".

Please go ahead and implement the check like this :)

Can you provide the specific format of this field for me?(I need a specific format to be able to get the percentage value of the "broker commission" field)

The field is a string exactly. Inside this string we need to check for the "X,XX%" and only this number. All of the rest has to be filtered out.
prov1

@dai-eastgate
Copy link
Contributor

@fredericalpers I got it, thank you

@dai-eastgate
Copy link
Contributor

dai-eastgate commented Jun 26, 2024

@fredericalpers We have found some issues to confirm with you when testing issue 843

  1. For the 3 field names in the text in the backend: Purchase Price, Broker Commission, and State
    Will they be text translations or labels of the file that has the response API of onOffice?
    Screenshot (7)
  2. In what style is the format currency in the overview box on the frontend formatted? (Note: these formats are similar when the language is set as Deutsch, but different when the language is set as English as below)
  • Similar to Purchase Pride on the Detail estate
    Screenshot (6)
  • Or similar to the parking lots field
    image
    Note: we have resolved the problem: If the Purchase price is set as "Price on request" on the Enterprise, the Total costs are not displayed.

@dai-eastgate
Copy link
Contributor

dai-eastgate commented Jun 27, 2024

@fredericalpers Please answer my questions as soon as possible, so I can continue working on the issue. Thank you!

@fredericalpers
Copy link
Member Author

For the 3 field names in the text in the backend: Purchase Price, Broker Commission, and State
Will they be text translations or labels of the file that has the response API of onOffice?

Please use the field names.

In what style is the format currency in the overview box on the frontend formatted? (Note: these formats are similar when the language is set as Deutsch, but different when the language is set as English as below)

Initially the feature is only working for the German customers. So the format currency should be as seen in your first screenshot. In the future we will enhance this feature to be able to match the regulations of other countries.

@dai-eastgate
Copy link
Contributor

@fredericalpers I have implemented the feature total price calculator. This is evidence

843.mp4

Please check and let me know your opinion. Thanks!
Note: This feature will affect backward compatibility. Old users need to update the template.dist folder to use this feature

@fredericalpers
Copy link
Member Author

@dai-eastgate thank you, it looks good so far :) we will review this as soon as possible.

@fredericalpers fredericalpers added the QA Issue or Pull request that is in review label Jul 1, 2024
@fredericalpers fredericalpers modified the milestones: v5.4, v5.3 Oct 7, 2024
@fredericalpers fredericalpers modified the milestones: v5.3, v5.3.1 Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: property detail page Issue, Pull Request or Discussion related to property detail page feature New feature QA Issue or Pull request that is in review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants