Skip to content

Releases: qorud02/fnb-margin-kit

v0.5.0

Choose a tag to compare

@qorud02 qorud02 released this 07 Oct 00:52
74dc04c

F&B Margin Kit 0.5.0 calculates menu ingredient costs from purchase pack prices, recipe quantities and usable yields.

Run fnb-recipe ingredients.csv recipes.csv --menu menu.csv --output-dir recipe-report. Recipe quantities are edible use per sold menu unit. For each ingredient, cost equals purchase price multiplied by recipe quantity, divided by purchase pack quantity and usable yield, with both quantities expressed in the same base unit. The command supports g/kg, ml/l and each, with unit conversions within the same dimension.

The audit reports preserve exact rational line and menu costs alongside decimal values. Menu CSV costs round once from the exact value using half-up rounding within the existing numeric input limits. With --menu, the generated costed-menu.csv can be passed directly to fnb-margin; other menu values and row order are preserved.

Both input CSVs and the optional menu are protected from planned output aliases before any report is written. Existing margin, comparison and dashboard commands retain their behavior. The package has no runtime dependencies.

The worked synthetic example includes purchase prices, usable yields, recipe quantities and an existing menu plan, with generated audit and downstream contribution results. Its latte uses 18 g of beans and 180 ml of milk. Beans cost 24,000 per kg; milk costs 3,000 per litre with 0.95 usable yield. The exact recipe cost is 19008/19, exported as 1000.421052631579 per menu unit.

Validation passed 107 unit tests, including 22 recipe tests, and hosted Python 3.10, 3.12 and 3.14 checks. Independent review passed 13 oracle scenarios with 1,189 assertions, 52 invalid-input probes, 42 input/output alias probes, and byte comparisons of 18 report files from six legacy command scenarios.

The actual tagged wheel and linux/amd64 container each passed 16 recipe-command execution checks, including consuming the exported menu with the existing margin command. Their existing margin-package checks also passed: 32 for the installed wheel and 31 for the exact container. The tested container image was then published.

v0.4.0

Choose a tag to compare

@qorud02 qorud02 released this 06 Oct 01:03
6563cf9

F&B Margin Kit 0.4.0 compares two explicitly entered menu plans, including selling prices, ingredient and packaging costs, platform fees and quantities.

Use --compare-menu proposed.csv with the same eight-column schema as the baseline. Both files must contain the same menu/category identities; their row order may differ. The command writes comparison.json and comparison.md beside the existing baseline reports. The comparison shows changed inputs, menu and category amounts, and proposed-minus-baseline totals.

Provide each plan's period-level channel costs separately with --channel-costs and --compare-channel-costs. An omitted cost CSV means zero additional channel costs for that side. The same supplied --fixed-cost applies to both plans.

For a menu with positive baseline contribution and positive proposed unit contribution, the report calculates the minimum whole quantity needed to retain the baseline menu contribution. This threshold uses exact rational arithmetic on the original price, VAT, fee and cost inputs, before period-level channel and fixed costs. Currency reports keep the existing 50-digit per-menu calculation and exact aggregation. Menus with nonpositive baseline contribution, zero proposed unit contribution or negative proposed unit contribution have distinct status values, and quantities beyond the CSV input limit are flagged.

All supplied CSVs are protected against direct, hard-link and symlink aliases of report outputs before files are written. The comparison option preserves the baseline JSON, Markdown and optional offline HTML reports. The release also includes the previously reviewed exact-aggregation and literal-Markdown-name fixes from PRs 7 and 8.

Assets include an installable dependency-free wheel, checksums, and a worked synthetic example. The example ZIP contains four input CSVs, the comparison results and baseline reports, with the regeneration command. In the example, a store latte's price changes from 5,500 to 6,050, ingredient cost from 1,200 to 1,350, and units from 100 to 90. Its original menu contribution requires at least 92 units under the proposed inputs.

Validation passed 85 unit tests and hosted Python 3.10, 3.12 and 3.14 checks. Independent review passed nine scenario probes with 461 exact assertions, 55 input-protection and error probes, and byte comparisons of 14 legacy report files. The tagged-source package workflow passed 32 installed-wheel execution checks and 31 linux/amd64 container checks, then published that tested container image.

v0.3.0

Choose a tag to compare

@qorud02 qorud02 released this 05 Oct 01:04
a1a8a21

F&B Margin Kit 0.3.0 adds an offline dashboard for menu and category contribution reports.

Use --html to write a self-contained report.html alongside the existing JSON and Markdown. Open the file in a browser to view summary cards and channel comparisons, search menus, combine category and unit-margin filters, sort by contribution or sales quantity, and view unrounded calculation values. Korean labels include English field names. Tables support narrow screens and keyboard scrolling.

The dashboard separates contribution before additional channel and fixed costs, after channel costs and after a supplied fixed cost. It uses the input monetary unit and preserves the calculator's existing JSON and Markdown output. All report data and controls remain in the HTML file; no external fonts, scripts or requests are used. CSV names are escaped, and both inputs are protected from HTML report aliases.

The release contains an installable wheel, checksums, and a synthetic example HTML that can be opened directly. The example ZIP includes its input CSVs and JSON/Markdown reports for regeneration. The example's amounts come from illustrative data.

The release passed 59 unit tests on Python 3.10, 3.12 and 3.14, twelve legacy byte comparisons, and independent numeric/security probes. Browser checks covered search, filters, sorting, exact-value display, mobile layout, keyboard scrolling and absence of external requests. A print layout is included.

v0.2.0

Choose a tag to compare

@qorud02 qorud02 released this 04 Oct 06:57
ef1347f

F&B Margin Kit 0.2.0 adds period-level variable costs for sales channels.

Use --channel-costs with a CSV containing category,additional_variable_cost to include delivery subsidies, merchant-funded promotions or other charges that are recorded as a period total. Each category's amount is deducted once. Menu unit margins and rankings retain their existing calculation basis.

The supplied costs must cover the same period and currency as the sales data and exclude VAT. The tool rejects duplicate, unmatched, malformed, negative and nonfinite cost inputs and protects both input CSVs from report-file aliases.

The included synthetic example applies an additional delivery cost of 60,000: delivery contribution becomes 47,000, total contribution becomes 417,000, and contribution after a supplied fixed cost of 300,000 becomes 117,000. Omitting the new option preserves the previous report format.

The release includes the installable Python wheel and its SHA-256 checksum file. See the repository's channel-cost example for the input and calculation details.

fnb-margin-kit 0.1.0

Choose a tag to compare

@qorud02 qorud02 released this 03 Oct 18:00

Calculate menu contribution from a CSV of prices, VAT rates, ingredient and packaging costs, gross-price platform fees, and sold units. The command writes JSON amounts as decimal strings and a readable Markdown report. An optional same-period fixed cost is subtracted from the contribution total.

The release includes a Python 3.10+ wheel with no runtime dependencies and the Linux amd64 image ghcr.io/qorud02/fnb-margin-kit:0.1.0. Download the wheel and SHA256SUMS, then run:

python -m pip install --no-index --no-deps ./fnb_margin_kit-0.1.0-py3-none-any.whl
fnb-margin --help

See the 매장·배달 comparison for the two-row fixture, VAT and fee calculations, generated reports, and fixed-cost scenario. Container runs need a readable input mount and a separate writable output mount; the README gives copyable commands.