KOEN
All notes
DOCUMENTS & CODE

Who recalculates the quotation?

I changed a quantity from seven to nine, but the total stayed at ₩84,000. Univer’s example prompted a look at saved numbers and the relationships needed to calculate again.

Two paper quotation grids with coral quantity counters: one gold total token is pasted down while the other connects to the counters through threads and a wooden wheel

Changing only the quantity

I put down a quantity of seven, a unit price of ₩12,000, and a total of ₩84,000. Then I changed the quantity to nine. The total still said ₩84,000.

The arithmetic had not gone wrong. It had not run again.

This did not happen in a quotation product. I made a small JavaScript object with those three numbers and changed one value. Multiplying separately gives ₩108,000 for nine items. These are invented amounts without tax or discounts.

Draw that object as a table and it could initially look convincing. Add cell borders, right-align the amounts, and make the total bold. It would look like somebody had calculated a quotation.

Bold type will not do the next multiplication.

I made the example while reading Univer’s official documentation. The SDK embeds document and spreadsheet editing in web applications. Its quotation example puts formulas in cells, changes a quantity from application code, and waits for calculation results before reading the total.

Unlike my plain object, that example retains the relationship between quantity and amount. Changing one cell is connected to recalculating another.

What I actually executed here was changing my own object and multiplying two numbers. I did not install Univer and run this quotation through it.

A formula need not live in a cell for calculation to happen. Application code can multiply quantity by unit price and update the total. My object could be wired up that way too.

Somebody still has to supply the connection. Making the screen look like a spreadsheet does not create it.

Being able to edit it tomorrow

Suppose I close this imagined table today and reopen it tomorrow. Is seeing the same ₩84,000 enough to call the reopening successful?

I would like to change the quantity again. Could the next quotation be made here without asking the person who created the file to calculate it?

More than the displayed numbers must survive for that. Where do quantity and unit price live? Which edit triggers another calculation? If a formula holds the relationship, it needs to remain available. If application code holds it, there needs to be a way to apply that rule again.

That is why the persistence part of Univer’s example caught my attention. It describes workbook.save() returning a document snapshot, with the application responsible for storing and restoring it. The example uses browser storage.

Calling a save method still leaves the work of retaining the document that should be opened next time.

Reading that example did not verify every file format or export path. I would not treat its saved snapshot as interchangeable with an Excel file.

A copy meant to show an amount already sent might appropriately keep its numbers fixed. I am considering a working quotation whose quantities are still being edited before it is sent. Identical-looking tables can have different next steps.

When asking an AI to make a table, I would like one more step after checking the initial total: change the quantity, close and reopen it, then change the quantity again. Has the calculation relationship survived that trip?

Back in the quantity cell, I enter nine. The multiplication gives ₩108,000. I look down at the total and imagine what the next person might ask.

“I changed the quantity. Do I have to fix the total separately too?”

Sources

All notes