onOffice-Web-Org / oo-wp-plugin

onOffice for WP-Websites
https://wp-plugin.onoffice.com
GNU General Public License v3.0
9 stars 9 forks source link

Enhancement of the functionality - total price calculator #843

Open fredericalpers opened 4 months ago

fredericalpers commented 4 months ago

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

Notes

Design / Screenshots

Plugin Backend: pluginbackend2

Frontend: calculator

dai-eastgate commented 4 months ago

@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:

=> 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".

Please let me know your opinion. Thanks!

dai-eastgate commented 4 months ago

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

fredericalpers commented 4 months ago

@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 commented 4 months ago

@fredericalpers I got it, thank you

dai-eastgate commented 4 months ago

@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 commented 4 months ago

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

fredericalpers commented 4 months ago

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 commented 4 months ago

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

https://github.com/onOffice-Web-Org/oo-wp-plugin/assets/106214469/363da7a4-f45e-4235-bce5-5c5fa4f9a69d

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 commented 4 months ago

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