TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Variable Cost Calculation for Quotations

1 pointsby j0hannover 2 years ago
I hope you can help me on this one, since I was unable to find anything relatable on HN or elsewhere:<p>I am currently building a variable cost calculation function for cost quotations. Craftsman and Installer should be able to create a variable cost quotation for their service which works for different sizes of buildings. Such as the installation of a heat pump or air conditioning.<p>The calculation should look like this:<p>(variables are given by the system)<p>cost block A: variable_1 x 100<p>cost block B: if variable_2 = true +200<p>(add all to get the sum)<p>The current setup works as follows:<p>1. Create calculation in Form (DnD)<p>2. Convert to json-logic `https:&#x2F;&#x2F;github.com&#x2F;jwadhams&#x2F;json-logic-js`<p>3. Save to Database in json field<p>-- Display Product or Service --<p>4. Get json-logic from DB and apply for each cost block with variables<p>5. Return in API<p>6. Display for Customer in Front End<p>Am I missing something, is there a better way?

no comments

no comments