@classytic/stage 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.mjs +18 -0
- package/dist/atomic/aufbau.d.mts +144 -0
- package/dist/atomic/aufbau.mjs +384 -0
- package/dist/atomic/elements.d.mts +67 -0
- package/dist/atomic/elements.mjs +785 -0
- package/dist/atomic/emission.d.mts +112 -0
- package/dist/atomic/emission.mjs +179 -0
- package/dist/atomic/index.d.mts +8 -0
- package/dist/atomic/index.mjs +9 -0
- package/dist/atomic/periodic.d.mts +82 -0
- package/dist/atomic/periodic.mjs +231 -0
- package/dist/atomic/properties.d.mts +100 -0
- package/dist/atomic/properties.mjs +574 -0
- package/dist/atomic/shells.d.mts +137 -0
- package/dist/atomic/shells.mjs +170 -0
- package/dist/atomic/trends.d.mts +148 -0
- package/dist/atomic/trends.mjs +225 -0
- package/dist/chem/chromatography.d.mts +66 -0
- package/dist/chem/chromatography.mjs +63 -0
- package/dist/chem/complex.d.mts +114 -0
- package/dist/chem/complex.mjs +234 -0
- package/dist/chem/cycle.d.mts +75 -0
- package/dist/chem/cycle.mjs +145 -0
- package/dist/chem/equation.d.mts +86 -0
- package/dist/chem/equation.mjs +168 -0
- package/dist/chem/formula.d.mts +90 -0
- package/dist/chem/formula.mjs +201 -0
- package/dist/chem/functional-groups.d.mts +31 -0
- package/dist/chem/functional-groups.mjs +187 -0
- package/dist/chem/hazard.d.mts +94 -0
- package/dist/chem/hazard.mjs +329 -0
- package/dist/chem/index.d.mts +34 -33
- package/dist/chem/index.mjs +34 -28
- package/dist/chem/ionic.d.mts +98 -0
- package/dist/chem/ionic.mjs +156 -0
- package/dist/chem/layout.d.mts +46 -0
- package/dist/chem/layout.mjs +342 -0
- package/dist/chem/lewis.d.mts +79 -0
- package/dist/chem/lewis.mjs +163 -0
- package/dist/chem/molecular-orbital.d.mts +114 -0
- package/dist/chem/molecular-orbital.mjs +201 -0
- package/dist/chem/molecule.d.mts +154 -0
- package/dist/chem/molecule.mjs +282 -0
- package/dist/chem/nmr.d.mts +153 -0
- package/dist/chem/nmr.mjs +165 -0
- package/dist/chem/polymer.d.mts +65 -0
- package/dist/chem/polymer.mjs +179 -0
- package/dist/chem/redox.d.mts +138 -0
- package/dist/chem/redox.mjs +328 -0
- package/dist/chem/relations.d.mts +183 -0
- package/dist/chem/relations.mjs +299 -0
- package/dist/chem/skeleton.d.mts +51 -0
- package/dist/chem/skeleton.mjs +186 -0
- package/dist/chem/solution.d.mts +116 -0
- package/dist/chem/solution.mjs +186 -0
- package/dist/chem/species.d.mts +47 -0
- package/dist/chem/species.mjs +128 -0
- package/dist/chem/stereo.d.mts +108 -0
- package/dist/chem/stereo.mjs +286 -0
- package/dist/chem/stoichiometry.d.mts +95 -0
- package/dist/chem/stoichiometry.mjs +145 -0
- package/dist/chem/synthesis.d.mts +113 -0
- package/dist/chem/synthesis.mjs +281 -0
- package/dist/chem/vsepr.d.mts +80 -0
- package/dist/chem/vsepr.mjs +247 -0
- package/dist/circuit/ac.d.mts +163 -0
- package/dist/circuit/ac.mjs +452 -0
- package/dist/circuit/dc.d.mts +92 -0
- package/dist/circuit/dc.mjs +333 -0
- package/dist/circuit/index.d.mts +5 -92
- package/dist/circuit/index.mjs +5 -332
- package/dist/circuit/network.d.mts +99 -0
- package/dist/circuit/network.mjs +440 -0
- package/dist/circuit/topology.d.mts +102 -0
- package/dist/circuit/topology.mjs +143 -0
- package/dist/colour/absorption.d.mts +79 -0
- package/dist/colour/absorption.mjs +137 -0
- package/dist/colour/index.d.mts +6 -0
- package/dist/colour/index.mjs +7 -0
- package/dist/colour/name.d.mts +14 -0
- package/dist/colour/name.mjs +76 -0
- package/dist/colour/observer.d.mts +31 -0
- package/dist/colour/observer.mjs +46 -0
- package/dist/colour/spectrum.d.mts +61 -0
- package/dist/colour/spectrum.mjs +108 -0
- package/dist/colour/srgb.d.mts +49 -0
- package/dist/colour/srgb.mjs +108 -0
- package/dist/core/constants.d.mts +138 -0
- package/dist/core/constants.mjs +139 -0
- package/dist/core/index.d.mts +3 -1
- package/dist/core/index.mjs +3 -1
- package/dist/core/vec3.d.mts +94 -0
- package/dist/core/vec3.mjs +123 -0
- package/dist/core/worked.d.mts +35 -0
- package/dist/core/worked.mjs +44 -0
- package/dist/electro/cell.d.mts +102 -0
- package/dist/electro/cell.mjs +170 -0
- package/dist/electro/conductivity.d.mts +157 -0
- package/dist/electro/conductivity.mjs +156 -0
- package/dist/electro/couples.d.mts +114 -0
- package/dist/electro/couples.mjs +334 -0
- package/dist/electro/electrolysis.d.mts +96 -0
- package/dist/electro/electrolysis.mjs +274 -0
- package/dist/electro/faraday.d.mts +150 -0
- package/dist/electro/faraday.mjs +118 -0
- package/dist/electro/index.d.mts +6 -0
- package/dist/electro/index.mjs +7 -0
- package/dist/finance/accounting/adjustments.d.mts +17 -0
- package/dist/finance/accounting/adjustments.mjs +202 -0
- package/dist/finance/accounting/analysis.d.mts +8 -0
- package/dist/finance/accounting/analysis.mjs +205 -0
- package/dist/finance/accounting/clubs.d.mts +21 -0
- package/dist/finance/accounting/clubs.mjs +217 -0
- package/dist/finance/accounting/company-statements.d.mts +7 -0
- package/dist/finance/accounting/company-statements.mjs +150 -0
- package/dist/finance/accounting/harness.d.mts +7 -0
- package/dist/finance/accounting/harness.mjs +45 -0
- package/dist/finance/accounting/index.d.mts +18 -0
- package/dist/finance/accounting/index.mjs +18 -0
- package/dist/finance/accounting/journalize.d.mts +16 -0
- package/dist/finance/accounting/journalize.mjs +128 -0
- package/dist/finance/accounting/manufacturing.d.mts +8 -0
- package/dist/finance/accounting/manufacturing.mjs +236 -0
- package/dist/finance/accounting/partnership.d.mts +7 -0
- package/dist/finance/accounting/partnership.mjs +152 -0
- package/dist/finance/accounting/period-case.d.mts +6 -0
- package/dist/finance/accounting/period-case.mjs +71 -0
- package/dist/finance/accounting/post.d.mts +9 -0
- package/dist/finance/accounting/post.mjs +84 -0
- package/dist/finance/accounting/precision.d.mts +9 -0
- package/dist/finance/accounting/precision.mjs +15 -0
- package/dist/finance/accounting/rules.d.mts +21 -0
- package/dist/finance/accounting/rules.mjs +37 -0
- package/dist/finance/accounting/solve.d.mts +28 -0
- package/dist/finance/accounting/solve.mjs +92 -0
- package/dist/finance/accounting/statements.d.mts +7 -0
- package/dist/finance/accounting/statements.mjs +142 -0
- package/dist/finance/accounting/types.d.mts +649 -0
- package/dist/finance/accounting/validate.d.mts +7 -0
- package/dist/finance/accounting/validate.mjs +67 -0
- package/dist/finance/accounting/verification.d.mts +24 -0
- package/dist/finance/accounting/verification.mjs +386 -0
- package/dist/finance/bizsim.d.mts +21 -39
- package/dist/finance/bizsim.mjs +276 -97
- package/dist/finance/index.d.mts +20 -43
- package/dist/finance/index.mjs +19 -77
- package/dist/finance/investment-math.d.mts +7 -0
- package/dist/finance/investment-math.mjs +18 -0
- package/dist/finance/management-accounting/budgeting.d.mts +7 -0
- package/dist/finance/management-accounting/budgeting.mjs +189 -0
- package/dist/finance/management-accounting/cash-budget.d.mts +7 -0
- package/dist/finance/management-accounting/cash-budget.mjs +154 -0
- package/dist/finance/management-accounting/costing.d.mts +8 -0
- package/dist/finance/management-accounting/costing.mjs +175 -0
- package/dist/finance/management-accounting/decisions.d.mts +8 -0
- package/dist/finance/management-accounting/decisions.mjs +164 -0
- package/dist/finance/management-accounting/index.d.mts +13 -0
- package/dist/finance/management-accounting/index.mjs +13 -0
- package/dist/finance/management-accounting/integrated-budget.d.mts +8 -0
- package/dist/finance/management-accounting/integrated-budget.mjs +67 -0
- package/dist/finance/management-accounting/inventory-costing.d.mts +7 -0
- package/dist/finance/management-accounting/inventory-costing.mjs +173 -0
- package/dist/finance/management-accounting/investment-appraisal.d.mts +7 -0
- package/dist/finance/management-accounting/investment-appraisal.mjs +148 -0
- package/dist/finance/management-accounting/management-case.d.mts +8 -0
- package/dist/finance/management-accounting/management-case.mjs +91 -0
- package/dist/finance/management-accounting/master-budget.d.mts +7 -0
- package/dist/finance/management-accounting/master-budget.mjs +137 -0
- package/dist/finance/management-accounting/production-costing.d.mts +8 -0
- package/dist/finance/management-accounting/production-costing.mjs +214 -0
- package/dist/finance/management-accounting/types.d.mts +644 -0
- package/dist/finance/management-accounting/variances.d.mts +7 -0
- package/dist/finance/management-accounting/variances.mjs +150 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +1 -1
- package/dist/math/analysis.d.mts +61 -0
- package/dist/math/analysis.mjs +187 -0
- package/dist/math/answer-check.d.mts +50 -0
- package/dist/math/answer-check.mjs +106 -0
- package/dist/math/calculus.d.mts +4 -9
- package/dist/math/calculus.mjs +216 -7
- package/dist/math/complex.d.mts +93 -0
- package/dist/math/complex.mjs +239 -0
- package/dist/math/expr.d.mts +23 -0
- package/dist/math/expr.mjs +36 -0
- package/dist/math/index.d.mts +8 -22
- package/dist/math/index.mjs +8 -37
- package/dist/math/latex.mjs +2 -1
- package/dist/math/parse.mjs +1 -1
- package/dist/math/poly.d.mts +55 -0
- package/dist/math/poly.mjs +273 -0
- package/dist/math/rearrange.d.mts +14 -0
- package/dist/math/rearrange.mjs +125 -0
- package/dist/math/solve.d.mts +21 -0
- package/dist/math/solve.mjs +75 -0
- package/dist/networking/addressing.d.mts +26 -0
- package/dist/networking/addressing.mjs +33 -0
- package/dist/networking/cloud/access.d.mts +36 -0
- package/dist/networking/cloud/access.mjs +95 -0
- package/dist/networking/cloud/containers.d.mts +43 -0
- package/dist/networking/cloud/containers.mjs +54 -0
- package/dist/networking/cloud/edge.d.mts +17 -0
- package/dist/networking/cloud/edge.mjs +31 -0
- package/dist/networking/cloud/failure-domains.d.mts +19 -0
- package/dist/networking/cloud/failure-domains.mjs +22 -0
- package/dist/networking/cloud/geo-routing.d.mts +22 -0
- package/dist/networking/cloud/geo-routing.mjs +64 -0
- package/dist/networking/cloud/index.d.mts +18 -0
- package/dist/networking/cloud/index.mjs +19 -0
- package/dist/networking/cloud/inference-reliability.d.mts +30 -0
- package/dist/networking/cloud/inference-reliability.mjs +76 -0
- package/dist/networking/cloud/inference.d.mts +118 -0
- package/dist/networking/cloud/inference.mjs +179 -0
- package/dist/networking/cloud/infrastructure.d.mts +45 -0
- package/dist/networking/cloud/infrastructure.mjs +96 -0
- package/dist/networking/cloud/observability.d.mts +24 -0
- package/dist/networking/cloud/observability.mjs +34 -0
- package/dist/networking/cloud/orchestration.d.mts +32 -0
- package/dist/networking/cloud/orchestration.mjs +38 -0
- package/dist/networking/cloud/recovery.d.mts +21 -0
- package/dist/networking/cloud/recovery.mjs +27 -0
- package/dist/networking/cloud/releases.d.mts +42 -0
- package/dist/networking/cloud/releases.mjs +135 -0
- package/dist/networking/cloud/scaling.d.mts +25 -0
- package/dist/networking/cloud/scaling.mjs +65 -0
- package/dist/networking/cloud/secrets.d.mts +39 -0
- package/dist/networking/cloud/secrets.mjs +68 -0
- package/dist/networking/cloud/server-deployment.d.mts +29 -0
- package/dist/networking/cloud/server-deployment.mjs +72 -0
- package/dist/networking/cloud/storage.d.mts +16 -0
- package/dist/networking/cloud/storage.mjs +58 -0
- package/dist/networking/cloud/vpc.d.mts +18 -0
- package/dist/networking/cloud/vpc.mjs +100 -0
- package/dist/networking/delivery.d.mts +34 -0
- package/dist/networking/delivery.mjs +52 -0
- package/dist/networking/index.d.mts +47 -0
- package/dist/networking/index.mjs +47 -0
- package/dist/networking/ipv6.d.mts +28 -0
- package/dist/networking/ipv6.mjs +17 -0
- package/dist/networking/journeys.d.mts +83 -0
- package/dist/networking/journeys.mjs +161 -0
- package/dist/networking/models/airtime.d.mts +87 -0
- package/dist/networking/models/airtime.mjs +130 -0
- package/dist/networking/models/cellular.d.mts +157 -0
- package/dist/networking/models/cellular.mjs +252 -0
- package/dist/networking/models/encapsulation.d.mts +98 -0
- package/dist/networking/models/encapsulation.mjs +132 -0
- package/dist/networking/models/handover.d.mts +116 -0
- package/dist/networking/models/handover.mjs +209 -0
- package/dist/networking/models/handshake.d.mts +90 -0
- package/dist/networking/models/handshake.mjs +122 -0
- package/dist/networking/models/index.d.mts +14 -0
- package/dist/networking/models/index.mjs +15 -0
- package/dist/networking/models/media.d.mts +82 -0
- package/dist/networking/models/media.mjs +188 -0
- package/dist/networking/models/satellite.d.mts +86 -0
- package/dist/networking/models/satellite.mjs +121 -0
- package/dist/networking/models/spectrum.d.mts +83 -0
- package/dist/networking/models/spectrum.mjs +235 -0
- package/dist/networking/models/switch.d.mts +80 -0
- package/dist/networking/models/switch.mjs +155 -0
- package/dist/networking/models/vlan.d.mts +62 -0
- package/dist/networking/models/vlan.mjs +100 -0
- package/dist/networking/models/vpn.d.mts +66 -0
- package/dist/networking/models/vpn.mjs +125 -0
- package/dist/networking/models/wifi-privacy.d.mts +82 -0
- package/dist/networking/models/wifi-privacy.mjs +130 -0
- package/dist/networking/models/wifi.d.mts +240 -0
- package/dist/networking/models/wifi.mjs +562 -0
- package/dist/networking/nat-traversal.d.mts +24 -0
- package/dist/networking/nat-traversal.mjs +38 -0
- package/dist/networking/protocols.d.mts +17 -0
- package/dist/networking/protocols.mjs +57 -0
- package/dist/networking/queue.d.mts +12 -0
- package/dist/networking/queue.mjs +18 -0
- package/dist/networking/route-learning.d.mts +23 -0
- package/dist/networking/route-learning.mjs +43 -0
- package/dist/networking/routing.d.mts +11 -0
- package/dist/networking/routing.mjs +25 -0
- package/dist/networking/signals.d.mts +26 -0
- package/dist/networking/signals.mjs +35 -0
- package/dist/networking/subnet.d.mts +49 -0
- package/dist/networking/subnet.mjs +89 -0
- package/dist/networking/tcp-reliability.d.mts +24 -0
- package/dist/networking/tcp-reliability.mjs +38 -0
- package/dist/networking/topology/contract.d.mts +123 -0
- package/dist/networking/topology/index.d.mts +4 -0
- package/dist/networking/topology/index.mjs +4 -0
- package/dist/networking/topology/presets.d.mts +7 -0
- package/dist/networking/topology/presets.mjs +302 -0
- package/dist/networking/topology/simulation.d.mts +8 -0
- package/dist/networking/topology/simulation.mjs +179 -0
- package/dist/networking/wireless.d.mts +11 -0
- package/dist/networking/wireless.mjs +17 -0
- package/dist/optics/imaging.d.mts +218 -0
- package/dist/optics/imaging.mjs +276 -0
- package/dist/optics/index.d.mts +7 -0
- package/dist/optics/index.mjs +8 -0
- package/dist/optics/laws.d.mts +70 -0
- package/dist/optics/laws.mjs +195 -0
- package/dist/optics/prism.d.mts +148 -0
- package/dist/optics/prism.mjs +197 -0
- package/dist/optics/refraction.d.mts +201 -0
- package/dist/optics/refraction.mjs +270 -0
- package/dist/optics/wave-optics.d.mts +171 -0
- package/dist/optics/wave-optics.mjs +259 -0
- package/dist/physics/ac/index.d.mts +183 -0
- package/dist/physics/ac/index.mjs +203 -0
- package/dist/physics/dynamics/forces.d.mts +98 -0
- package/dist/physics/dynamics/forces.mjs +153 -0
- package/dist/physics/dynamics/friction.d.mts +76 -0
- package/dist/physics/dynamics/friction.mjs +119 -0
- package/dist/physics/dynamics/system.d.mts +68 -0
- package/dist/physics/dynamics/system.mjs +125 -0
- package/dist/physics/electrostatics/index.d.mts +169 -0
- package/dist/physics/electrostatics/index.mjs +249 -0
- package/dist/physics/energy/centre-of-mass.d.mts +115 -0
- package/dist/physics/energy/centre-of-mass.mjs +180 -0
- package/dist/physics/energy/conservation.d.mts +81 -0
- package/dist/physics/energy/conservation.mjs +129 -0
- package/dist/physics/energy/power.d.mts +90 -0
- package/dist/physics/energy/power.mjs +167 -0
- package/dist/physics/energy/spring.d.mts +73 -0
- package/dist/physics/energy/spring.mjs +129 -0
- package/dist/physics/energy/store.d.mts +63 -0
- package/dist/physics/energy/store.mjs +108 -0
- package/dist/physics/energy/theorem.d.mts +65 -0
- package/dist/physics/energy/theorem.mjs +113 -0
- package/dist/physics/energy/work.d.mts +114 -0
- package/dist/physics/energy/work.mjs +219 -0
- package/dist/physics/gravitation/body.d.mts +85 -0
- package/dist/physics/gravitation/body.mjs +168 -0
- package/dist/physics/gravitation/kepler.d.mts +127 -0
- package/dist/physics/gravitation/kepler.mjs +216 -0
- package/dist/physics/gravitation/law.d.mts +117 -0
- package/dist/physics/gravitation/law.mjs +175 -0
- package/dist/physics/gravitation/orbit.d.mts +119 -0
- package/dist/physics/gravitation/orbit.mjs +202 -0
- package/dist/physics/gravitation/potential.d.mts +114 -0
- package/dist/physics/gravitation/potential.mjs +202 -0
- package/dist/physics/gravitation/variation.d.mts +97 -0
- package/dist/physics/gravitation/variation.mjs +175 -0
- package/dist/physics/index.d.mts +35 -0
- package/dist/physics/index.mjs +36 -0
- package/dist/physics/integral-sweep.d.mts +63 -0
- package/dist/physics/integral-sweep.mjs +126 -0
- package/dist/physics/kinematics/equations.d.mts +47 -0
- package/dist/physics/kinematics/equations.mjs +126 -0
- package/dist/physics/kinematics/free-fall.d.mts +53 -0
- package/dist/physics/kinematics/free-fall.mjs +71 -0
- package/dist/physics/kinematics/given.d.mts +16 -0
- package/dist/physics/kinematics/given.mjs +55 -0
- package/dist/physics/kinematics/roots.d.mts +41 -0
- package/dist/physics/kinematics/roots.mjs +72 -0
- package/dist/physics/kinematics/solve.d.mts +52 -0
- package/dist/physics/kinematics/solve.mjs +172 -0
- package/dist/physics/magnetism/biot-savart.d.mts +161 -0
- package/dist/physics/magnetism/biot-savart.mjs +353 -0
- package/dist/physics/magnetism/flux.d.mts +94 -0
- package/dist/physics/magnetism/flux.mjs +313 -0
- package/dist/physics/magnetism/geomagnetism.d.mts +151 -0
- package/dist/physics/magnetism/geomagnetism.mjs +184 -0
- package/dist/physics/magnetism/index.d.mts +12 -0
- package/dist/physics/magnetism/index.mjs +74 -0
- package/dist/physics/magnetism/lorentz.d.mts +28 -0
- package/dist/physics/magnetism/lorentz.mjs +88 -0
- package/dist/physics/magnetism/magnetic-force.d.mts +102 -0
- package/dist/physics/magnetism/magnetic-force.mjs +169 -0
- package/dist/physics/momentum/collide.d.mts +77 -0
- package/dist/physics/momentum/collide.mjs +115 -0
- package/dist/physics/momentum/impulse.d.mts +89 -0
- package/dist/physics/momentum/impulse.mjs +159 -0
- package/dist/physics/momentum/planar.d.mts +60 -0
- package/dist/physics/momentum/planar.mjs +110 -0
- package/dist/physics/projectile.d.mts +107 -0
- package/dist/physics/projectile.mjs +185 -0
- package/dist/physics/rotation/angular.d.mts +85 -0
- package/dist/physics/rotation/angular.mjs +130 -0
- package/dist/physics/rotation/circular.d.mts +79 -0
- package/dist/physics/rotation/circular.mjs +131 -0
- package/dist/physics/rotation/inertia.d.mts +164 -0
- package/dist/physics/rotation/inertia.mjs +332 -0
- package/dist/physics/rotation/torque.d.mts +65 -0
- package/dist/physics/rotation/torque.mjs +134 -0
- package/dist/physics/vectors.d.mts +64 -0
- package/dist/physics/vectors.mjs +114 -0
- package/dist/quantity/index.d.mts +119 -0
- package/dist/quantity/index.mjs +417 -0
- package/dist/relation/derive.d.mts +74 -0
- package/dist/relation/derive.mjs +73 -0
- package/dist/relation/index.d.mts +56 -0
- package/dist/relation/index.mjs +234 -0
- package/dist/scene/evaluators.mjs +1 -1
- package/dist/sim/thermal.mjs +45 -20
- package/dist/thermo/calorimetry.d.mts +207 -0
- package/dist/thermo/calorimetry.mjs +345 -0
- package/dist/thermo/cycles.d.mts +142 -0
- package/dist/thermo/cycles.mjs +256 -0
- package/dist/thermo/entropy.d.mts +87 -0
- package/dist/thermo/entropy.mjs +140 -0
- package/dist/thermo/expansion.d.mts +130 -0
- package/dist/thermo/expansion.mjs +178 -0
- package/dist/thermo/gas.d.mts +197 -0
- package/dist/thermo/gas.mjs +279 -0
- package/dist/thermo/heat-transfer.d.mts +164 -0
- package/dist/thermo/heat-transfer.mjs +217 -0
- package/dist/thermo/index.d.mts +9 -82
- package/dist/thermo/index.mjs +9 -132
- package/dist/thermo/processes.d.mts +95 -0
- package/dist/thermo/processes.mjs +154 -0
- package/dist/thermo/temperature.d.mts +174 -0
- package/dist/thermo/temperature.mjs +236 -0
- package/dist/waves/damping.d.mts +224 -0
- package/dist/waves/damping.mjs +317 -0
- package/dist/waves/doppler.d.mts +72 -0
- package/dist/waves/doppler.mjs +125 -0
- package/dist/waves/index.d.mts +10 -0
- package/dist/waves/index.mjs +10 -0
- package/dist/waves/pendulum.d.mts +130 -0
- package/dist/waves/pendulum.mjs +211 -0
- package/dist/waves/pitch.d.mts +125 -0
- package/dist/waves/pitch.mjs +158 -0
- package/dist/waves/shm.d.mts +170 -0
- package/dist/waves/shm.mjs +279 -0
- package/dist/waves/springs.d.mts +103 -0
- package/dist/waves/springs.mjs +176 -0
- package/dist/waves/superposition.d.mts +124 -0
- package/dist/waves/superposition.mjs +196 -0
- package/dist/waves/wave.d.mts +154 -0
- package/dist/waves/wave.mjs +178 -0
- package/package.json +74 -2
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { DEFAULT_ACCOUNTING_POLICY } from "../accounting/precision.mjs";
|
|
2
|
+
import { evaluateRelevantCostDecision, optimizeLimitedFactor } from "./decisions.mjs";
|
|
3
|
+
import { appraiseInvestment } from "./investment-appraisal.mjs";
|
|
4
|
+
import { costJobOrBatch, costProcessWithLosses } from "./production-costing.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/finance/management-accounting/management-case.ts
|
|
7
|
+
/** Runs independent authored tasks through their authoritative solvers; it contains no accounting formulas. */
|
|
8
|
+
function runManagementAccountingCase(caseDefinition, policy = DEFAULT_ACCOUNTING_POLICY) {
|
|
9
|
+
const diagnostics = [];
|
|
10
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11
|
+
const tasks = caseDefinition.tasks.map((task) => {
|
|
12
|
+
if (seen.has(task.id)) diagnostics.push({
|
|
13
|
+
code: "duplicate-task",
|
|
14
|
+
severity: "error",
|
|
15
|
+
taskId: task.id,
|
|
16
|
+
message: `Task ${task.id} is duplicated.`
|
|
17
|
+
});
|
|
18
|
+
seen.add(task.id);
|
|
19
|
+
const result = runTask(task, policy);
|
|
20
|
+
if (!result.completed) diagnostics.push({
|
|
21
|
+
code: "task-failed",
|
|
22
|
+
severity: "error",
|
|
23
|
+
taskId: task.id,
|
|
24
|
+
message: `Task ${task.id} contains invalid facts.`
|
|
25
|
+
});
|
|
26
|
+
return result;
|
|
27
|
+
});
|
|
28
|
+
const trace = tasks.flatMap((task) => task.solution.trace.map((step) => ({
|
|
29
|
+
...step,
|
|
30
|
+
id: `${task.id}:${step.id}`
|
|
31
|
+
})));
|
|
32
|
+
return {
|
|
33
|
+
caseId: caseDefinition.id,
|
|
34
|
+
completed: diagnostics.length === 0,
|
|
35
|
+
tasks,
|
|
36
|
+
diagnostics,
|
|
37
|
+
trace
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function runTask(task, policy) {
|
|
41
|
+
switch (task.kind) {
|
|
42
|
+
case "job-batch": {
|
|
43
|
+
const solution = costJobOrBatch(task.facts, policy);
|
|
44
|
+
return {
|
|
45
|
+
id: task.id,
|
|
46
|
+
kind: task.kind,
|
|
47
|
+
completed: solution.completed,
|
|
48
|
+
solution
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
case "process-loss": {
|
|
52
|
+
const solution = costProcessWithLosses(task.facts, policy);
|
|
53
|
+
return {
|
|
54
|
+
id: task.id,
|
|
55
|
+
kind: task.kind,
|
|
56
|
+
completed: solution.completed,
|
|
57
|
+
solution
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
case "limited-factor": {
|
|
61
|
+
const solution = optimizeLimitedFactor(task.products, task.resourceAvailable, policy);
|
|
62
|
+
return {
|
|
63
|
+
id: task.id,
|
|
64
|
+
kind: task.kind,
|
|
65
|
+
completed: solution.completed,
|
|
66
|
+
solution
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
case "relevant-cost": {
|
|
70
|
+
const solution = evaluateRelevantCostDecision(task.alternatives, policy);
|
|
71
|
+
return {
|
|
72
|
+
id: task.id,
|
|
73
|
+
kind: task.kind,
|
|
74
|
+
completed: solution.completed,
|
|
75
|
+
solution
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
case "investment-appraisal": {
|
|
79
|
+
const solution = appraiseInvestment(task.facts, policy);
|
|
80
|
+
return {
|
|
81
|
+
id: task.id,
|
|
82
|
+
kind: task.kind,
|
|
83
|
+
completed: solution.completed,
|
|
84
|
+
solution
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
export { runManagementAccountingCase };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AccountingPolicy } from "../accounting/types.mjs";
|
|
2
|
+
import { MasterBudgetFacts, MasterBudgetResult } from "./types.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/finance/management-accounting/master-budget.d.ts
|
|
5
|
+
declare function composeMasterBudget(facts: MasterBudgetFacts, policy?: AccountingPolicy): MasterBudgetResult;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { composeMasterBudget };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { fromMinor, toMinor } from "../accounting/precision.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/finance/management-accounting/master-budget.ts
|
|
4
|
+
const DEFAULT_POLICY = { decimalPlaces: 2 };
|
|
5
|
+
function composeMasterBudget(facts, policy = DEFAULT_POLICY) {
|
|
6
|
+
const diagnostics = [];
|
|
7
|
+
if (!facts.operating.completed) diagnostics.push({
|
|
8
|
+
code: "incomplete-source",
|
|
9
|
+
severity: "error",
|
|
10
|
+
message: "Operating budget must be complete."
|
|
11
|
+
});
|
|
12
|
+
if (!facts.cash.completed) diagnostics.push({
|
|
13
|
+
code: "incomplete-source",
|
|
14
|
+
severity: "error",
|
|
15
|
+
message: "Cash budget must be complete."
|
|
16
|
+
});
|
|
17
|
+
if (!Number.isFinite(facts.openingFinishedGoodsValue) || facts.openingFinishedGoodsValue < 0) diagnostics.push({
|
|
18
|
+
code: "invalid-input",
|
|
19
|
+
severity: "error",
|
|
20
|
+
message: "Opening finished-goods value must be finite and non-negative."
|
|
21
|
+
});
|
|
22
|
+
const policies = /* @__PURE__ */ new Map();
|
|
23
|
+
for (const item of facts.periodPolicies) {
|
|
24
|
+
if (policies.has(item.periodId)) diagnostics.push({
|
|
25
|
+
code: "period-mismatch",
|
|
26
|
+
severity: "error",
|
|
27
|
+
periodId: item.periodId,
|
|
28
|
+
message: `Policy for ${item.periodId} is duplicated.`
|
|
29
|
+
});
|
|
30
|
+
policies.set(item.periodId, item);
|
|
31
|
+
if (![item.variableSellingAdministrationPerUnit, item.fixedSellingAdministration].every((value) => Number.isFinite(value) && value >= 0)) diagnostics.push({
|
|
32
|
+
code: "invalid-input",
|
|
33
|
+
severity: "error",
|
|
34
|
+
periodId: item.periodId,
|
|
35
|
+
message: "Selling and administration assumptions must be finite and non-negative."
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
if (facts.operating.periods.length !== facts.cash.periods.length) diagnostics.push({
|
|
39
|
+
code: "period-mismatch",
|
|
40
|
+
severity: "error",
|
|
41
|
+
message: "Operating and cash budgets must cover the same periods."
|
|
42
|
+
});
|
|
43
|
+
facts.operating.periods.forEach((period, index) => {
|
|
44
|
+
if (facts.cash.periods[index]?.id !== period.id) diagnostics.push({
|
|
45
|
+
code: "period-mismatch",
|
|
46
|
+
severity: "error",
|
|
47
|
+
periodId: period.id,
|
|
48
|
+
message: `Cash period does not align with ${period.label}.`
|
|
49
|
+
});
|
|
50
|
+
if (!policies.has(period.id)) diagnostics.push({
|
|
51
|
+
code: "period-mismatch",
|
|
52
|
+
severity: "error",
|
|
53
|
+
periodId: period.id,
|
|
54
|
+
message: `Selling and administration policy is missing for ${period.label}.`
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
if (diagnostics.length > 0) return emptyResult(diagnostics);
|
|
58
|
+
const periods = [];
|
|
59
|
+
const trace = [];
|
|
60
|
+
let openingFinishedGoodsValue = money(facts.openingFinishedGoodsValue, policy);
|
|
61
|
+
for (let index = 0; index < facts.operating.periods.length; index += 1) {
|
|
62
|
+
const operating = facts.operating.periods[index];
|
|
63
|
+
const cash = facts.cash.periods[index];
|
|
64
|
+
const periodPolicy = policies.get(operating.id);
|
|
65
|
+
const materialUsageCost = money(operating.materialsUsage.materialUnitsRequired * operating.materialsPurchases.costPerUnit, policy);
|
|
66
|
+
const manufacturingCost = money(materialUsageCost + operating.directLabour.labourCost + operating.productionOverhead.totalOverhead, policy);
|
|
67
|
+
const goodsAvailableUnits = operating.production.openingFinishedGoodsUnits + operating.production.unitsToProduce;
|
|
68
|
+
const goodsAvailableValue = money(openingFinishedGoodsValue + manufacturingCost, policy);
|
|
69
|
+
const averageUnitCost = goodsAvailableUnits === 0 ? 0 : goodsAvailableValue / goodsAvailableUnits;
|
|
70
|
+
const closingFinishedGoodsValue = money(operating.production.desiredClosingFinishedGoodsUnits * averageUnitCost, policy);
|
|
71
|
+
const costOfSales = money(goodsAvailableValue - closingFinishedGoodsValue, policy);
|
|
72
|
+
const grossProfit = money(operating.sales.revenue - costOfSales, policy);
|
|
73
|
+
const variableSellingAdministration = money(operating.sales.units * periodPolicy.variableSellingAdministrationPerUnit, policy);
|
|
74
|
+
const operatingProfit = money(grossProfit - variableSellingAdministration - periodPolicy.fixedSellingAdministration, policy);
|
|
75
|
+
periods.push({
|
|
76
|
+
id: operating.id,
|
|
77
|
+
label: operating.label,
|
|
78
|
+
revenue: operating.sales.revenue,
|
|
79
|
+
materialUsageCost,
|
|
80
|
+
labourCost: operating.directLabour.labourCost,
|
|
81
|
+
productionOverhead: operating.productionOverhead.totalOverhead,
|
|
82
|
+
manufacturingCost,
|
|
83
|
+
goodsAvailableValue,
|
|
84
|
+
closingFinishedGoodsValue,
|
|
85
|
+
costOfSales,
|
|
86
|
+
grossProfit,
|
|
87
|
+
variableSellingAdministration,
|
|
88
|
+
fixedSellingAdministration: periodPolicy.fixedSellingAdministration,
|
|
89
|
+
operatingProfit,
|
|
90
|
+
closingCashBalance: cash.closingCashBalance,
|
|
91
|
+
financingRequired: cash.financingRequired
|
|
92
|
+
});
|
|
93
|
+
trace.push({
|
|
94
|
+
id: `${operating.id}:master-profit`,
|
|
95
|
+
kind: "derive",
|
|
96
|
+
rule: "Operating profit = revenue − cost of sales − variable selling/administration − fixed selling/administration.",
|
|
97
|
+
working: `${operating.sales.revenue} − ${costOfSales} − ${variableSellingAdministration} − ${periodPolicy.fixedSellingAdministration}`,
|
|
98
|
+
result: operatingProfit
|
|
99
|
+
});
|
|
100
|
+
openingFinishedGoodsValue = closingFinishedGoodsValue;
|
|
101
|
+
}
|
|
102
|
+
const total = (select) => money(periods.reduce((sum, period) => sum + select(period), 0), policy);
|
|
103
|
+
return {
|
|
104
|
+
completed: true,
|
|
105
|
+
periods,
|
|
106
|
+
totals: {
|
|
107
|
+
revenue: total((period) => period.revenue),
|
|
108
|
+
manufacturingCost: total((period) => period.manufacturingCost),
|
|
109
|
+
costOfSales: total((period) => period.costOfSales),
|
|
110
|
+
grossProfit: total((period) => period.grossProfit),
|
|
111
|
+
sellingAdministration: total((period) => period.variableSellingAdministration + period.fixedSellingAdministration),
|
|
112
|
+
operatingProfit: total((period) => period.operatingProfit),
|
|
113
|
+
financingRequired: total((period) => period.financingRequired)
|
|
114
|
+
},
|
|
115
|
+
diagnostics,
|
|
116
|
+
trace
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const money = (value, policy) => fromMinor(toMinor(value, policy), policy);
|
|
120
|
+
const emptyResult = (diagnostics) => ({
|
|
121
|
+
completed: false,
|
|
122
|
+
periods: [],
|
|
123
|
+
totals: {
|
|
124
|
+
revenue: 0,
|
|
125
|
+
manufacturingCost: 0,
|
|
126
|
+
costOfSales: 0,
|
|
127
|
+
grossProfit: 0,
|
|
128
|
+
sellingAdministration: 0,
|
|
129
|
+
operatingProfit: 0,
|
|
130
|
+
financingRequired: 0
|
|
131
|
+
},
|
|
132
|
+
diagnostics,
|
|
133
|
+
trace: []
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
//#endregion
|
|
137
|
+
export { composeMasterBudget };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AccountingPolicy } from "../accounting/types.mjs";
|
|
2
|
+
import { JobBatchCostFacts, JobBatchCostResult, ProcessCostFacts, ProcessCostResult } from "./types.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/finance/management-accounting/production-costing.d.ts
|
|
5
|
+
declare function costJobOrBatch(facts: JobBatchCostFacts, policy?: AccountingPolicy): JobBatchCostResult;
|
|
6
|
+
declare function costProcessWithLosses(facts: ProcessCostFacts, policy?: AccountingPolicy): ProcessCostResult;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { costJobOrBatch, costProcessWithLosses };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { fromMinor, toMinor } from "../accounting/precision.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/finance/management-accounting/production-costing.ts
|
|
4
|
+
const DEFAULT_POLICY = { decimalPlaces: 2 };
|
|
5
|
+
function costJobOrBatch(facts, policy = DEFAULT_POLICY) {
|
|
6
|
+
const diagnostics = [];
|
|
7
|
+
const positive = [[facts.outputUnits, "Output units"]];
|
|
8
|
+
const nonNegative = [
|
|
9
|
+
[facts.directMaterials, "Direct materials"],
|
|
10
|
+
[facts.directLabourHours, "Direct labour hours"],
|
|
11
|
+
[facts.directLabourRatePerHour, "Direct labour rate"],
|
|
12
|
+
[facts.directExpenses ?? 0, "Direct expenses"],
|
|
13
|
+
[facts.productionOverhead.basisQuantity, "Overhead basis quantity"],
|
|
14
|
+
[facts.productionOverhead.ratePerBasisUnit, "Overhead rate"],
|
|
15
|
+
[facts.nonProductionOverhead ?? 0, "Non-production overhead"]
|
|
16
|
+
];
|
|
17
|
+
for (const [value, label] of positive) if (!Number.isFinite(value) || value <= 0) diagnostics.push({
|
|
18
|
+
code: "invalid-input",
|
|
19
|
+
severity: "error",
|
|
20
|
+
message: `${label} must be finite and positive.`
|
|
21
|
+
});
|
|
22
|
+
for (const [value, label] of nonNegative) if (!Number.isFinite(value) || value < 0) diagnostics.push({
|
|
23
|
+
code: "invalid-input",
|
|
24
|
+
severity: "error",
|
|
25
|
+
message: `${label} must be finite and non-negative.`
|
|
26
|
+
});
|
|
27
|
+
if (diagnostics.length > 0) return {
|
|
28
|
+
completed: false,
|
|
29
|
+
kind: facts.kind,
|
|
30
|
+
directLabour: 0,
|
|
31
|
+
primeCost: 0,
|
|
32
|
+
productionOverhead: 0,
|
|
33
|
+
productionCost: 0,
|
|
34
|
+
totalCost: 0,
|
|
35
|
+
costPerUnit: 0,
|
|
36
|
+
diagnostics,
|
|
37
|
+
trace: []
|
|
38
|
+
};
|
|
39
|
+
const directLabour = money(facts.directLabourHours * facts.directLabourRatePerHour, policy);
|
|
40
|
+
const primeCost = money(facts.directMaterials + directLabour + (facts.directExpenses ?? 0), policy);
|
|
41
|
+
const productionOverhead = money(facts.productionOverhead.basisQuantity * facts.productionOverhead.ratePerBasisUnit, policy);
|
|
42
|
+
const productionCost = money(primeCost + productionOverhead, policy);
|
|
43
|
+
const totalCost = money(productionCost + (facts.nonProductionOverhead ?? 0), policy);
|
|
44
|
+
const costPerUnit = money(totalCost / facts.outputUnits, policy);
|
|
45
|
+
const trace = [
|
|
46
|
+
{
|
|
47
|
+
id: `${facts.kind}:prime`,
|
|
48
|
+
kind: "derive",
|
|
49
|
+
rule: "Prime cost = direct materials + direct labour + direct expenses.",
|
|
50
|
+
working: `${facts.directMaterials} + ${directLabour} + ${facts.directExpenses ?? 0}`,
|
|
51
|
+
result: primeCost
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: `${facts.kind}:overhead`,
|
|
55
|
+
kind: "derive",
|
|
56
|
+
rule: `Production overhead = ${facts.productionOverhead.basisLabel} × overhead rate.`,
|
|
57
|
+
working: `${facts.productionOverhead.basisQuantity} × ${facts.productionOverhead.ratePerBasisUnit}`,
|
|
58
|
+
result: productionOverhead
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: `${facts.kind}:unit`,
|
|
62
|
+
kind: "derive",
|
|
63
|
+
rule: `Cost per ${facts.kind === "job" ? "output unit" : "batch unit"} = total assigned cost ÷ output units.`,
|
|
64
|
+
working: `${totalCost} ÷ ${facts.outputUnits}`,
|
|
65
|
+
result: costPerUnit
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
return {
|
|
69
|
+
completed: true,
|
|
70
|
+
kind: facts.kind,
|
|
71
|
+
directLabour,
|
|
72
|
+
primeCost,
|
|
73
|
+
productionOverhead,
|
|
74
|
+
productionCost,
|
|
75
|
+
totalCost,
|
|
76
|
+
costPerUnit,
|
|
77
|
+
diagnostics,
|
|
78
|
+
trace
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function costProcessWithLosses(facts, policy = DEFAULT_POLICY) {
|
|
82
|
+
const diagnostics = [];
|
|
83
|
+
const positive = [[facts.inputUnits, "Input units"]];
|
|
84
|
+
const nonNegative = [
|
|
85
|
+
[facts.directMaterials, "Direct materials"],
|
|
86
|
+
[facts.conversionCost, "Conversion cost"],
|
|
87
|
+
[facts.normalLossUnits, "Normal loss units"],
|
|
88
|
+
[facts.normalLossScrapValuePerUnit, "Normal-loss scrap value"],
|
|
89
|
+
[facts.actualOutputUnits, "Actual output units"]
|
|
90
|
+
];
|
|
91
|
+
for (const [value, label] of positive) if (!Number.isFinite(value) || value <= 0) diagnostics.push({
|
|
92
|
+
code: "invalid-input",
|
|
93
|
+
severity: "error",
|
|
94
|
+
message: `${label} must be finite and positive.`
|
|
95
|
+
});
|
|
96
|
+
for (const [value, label] of nonNegative) if (!Number.isFinite(value) || value < 0) diagnostics.push({
|
|
97
|
+
code: "invalid-input",
|
|
98
|
+
severity: "error",
|
|
99
|
+
message: `${label} must be finite and non-negative.`
|
|
100
|
+
});
|
|
101
|
+
if (facts.normalLossUnits >= facts.inputUnits) diagnostics.push({
|
|
102
|
+
code: "impossible-flow",
|
|
103
|
+
severity: "error",
|
|
104
|
+
message: "Normal loss must be lower than input units."
|
|
105
|
+
});
|
|
106
|
+
if (facts.actualOutputUnits > facts.inputUnits) diagnostics.push({
|
|
107
|
+
code: "impossible-flow",
|
|
108
|
+
severity: "error",
|
|
109
|
+
message: "Actual output cannot exceed input units."
|
|
110
|
+
});
|
|
111
|
+
if (diagnostics.length > 0) return emptyProcess(diagnostics);
|
|
112
|
+
const actualLossUnits = facts.inputUnits - facts.actualOutputUnits;
|
|
113
|
+
const expectedOutputUnits = facts.inputUnits - facts.normalLossUnits;
|
|
114
|
+
const totalProcessCost = money(facts.directMaterials + facts.conversionCost, policy);
|
|
115
|
+
const normalLossScrapValue = money(facts.normalLossUnits * facts.normalLossScrapValuePerUnit, policy);
|
|
116
|
+
const netProcessCost = money(totalProcessCost - normalLossScrapValue, policy);
|
|
117
|
+
if (netProcessCost < 0) return emptyProcess([{
|
|
118
|
+
code: "impossible-flow",
|
|
119
|
+
severity: "error",
|
|
120
|
+
message: "Normal-loss scrap value cannot exceed total process cost."
|
|
121
|
+
}]);
|
|
122
|
+
const exactCostPerExpectedUnit = netProcessCost / expectedOutputUnits;
|
|
123
|
+
const costPerExpectedUnit = money(exactCostPerExpectedUnit, policy);
|
|
124
|
+
const outputValue = money(facts.actualOutputUnits * exactCostPerExpectedUnit, policy);
|
|
125
|
+
const difference = actualLossUnits - facts.normalLossUnits;
|
|
126
|
+
const abnormalKind = difference > 0 ? "loss" : difference < 0 ? "gain" : "none";
|
|
127
|
+
const abnormalUnits = Math.abs(difference);
|
|
128
|
+
const grossValue = abnormalKind === "loss" ? money(totalProcessCost - normalLossScrapValue - outputValue, policy) : abnormalKind === "gain" ? money(outputValue + normalLossScrapValue - totalProcessCost, policy) : 0;
|
|
129
|
+
const scrapAdjustment = money(abnormalUnits * facts.normalLossScrapValuePerUnit, policy);
|
|
130
|
+
const netCostImpact = money(grossValue - scrapAdjustment, policy);
|
|
131
|
+
const processDebit = money(totalProcessCost + (abnormalKind === "gain" ? grossValue : 0), policy);
|
|
132
|
+
const processCredit = money(outputValue + normalLossScrapValue + (abnormalKind === "loss" ? grossValue : 0), policy);
|
|
133
|
+
const balances = processDebit === processCredit;
|
|
134
|
+
const trace = [
|
|
135
|
+
{
|
|
136
|
+
id: "process:expected-output",
|
|
137
|
+
kind: "derive",
|
|
138
|
+
rule: "Expected good output = input units − normal loss units.",
|
|
139
|
+
working: `${facts.inputUnits} − ${facts.normalLossUnits}`,
|
|
140
|
+
result: expectedOutputUnits
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "process:unit-cost",
|
|
144
|
+
kind: "derive",
|
|
145
|
+
rule: "Cost per expected good unit = (process cost − normal-loss scrap value) ÷ expected output.",
|
|
146
|
+
working: `(${totalProcessCost} − ${normalLossScrapValue}) ÷ ${expectedOutputUnits}`,
|
|
147
|
+
result: costPerExpectedUnit
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: "process:abnormal",
|
|
151
|
+
kind: "derive",
|
|
152
|
+
rule: "Actual loss compared with normal loss identifies abnormal loss or gain; it is valued at the expected good-unit cost.",
|
|
153
|
+
working: `${actualLossUnits} actual loss − ${facts.normalLossUnits} normal loss`,
|
|
154
|
+
result: `${abnormalKind}:${abnormalUnits}`
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "process:balance",
|
|
158
|
+
kind: "check",
|
|
159
|
+
rule: "The process account balances after output, normal scrap, and abnormal loss/gain are recognized.",
|
|
160
|
+
working: `${processDebit} debit = ${processCredit} credit`,
|
|
161
|
+
result: balances
|
|
162
|
+
}
|
|
163
|
+
];
|
|
164
|
+
return {
|
|
165
|
+
completed: true,
|
|
166
|
+
actualLossUnits,
|
|
167
|
+
expectedOutputUnits,
|
|
168
|
+
netProcessCost,
|
|
169
|
+
costPerExpectedUnit,
|
|
170
|
+
outputValue,
|
|
171
|
+
normalLossScrapValue,
|
|
172
|
+
abnormal: {
|
|
173
|
+
kind: abnormalKind,
|
|
174
|
+
units: abnormalUnits,
|
|
175
|
+
grossValue,
|
|
176
|
+
scrapAdjustment,
|
|
177
|
+
netCostImpact
|
|
178
|
+
},
|
|
179
|
+
processAccount: {
|
|
180
|
+
debit: processDebit,
|
|
181
|
+
credit: processCredit,
|
|
182
|
+
balances
|
|
183
|
+
},
|
|
184
|
+
diagnostics,
|
|
185
|
+
trace
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
const money = (value, policy) => fromMinor(toMinor(value, policy), policy);
|
|
189
|
+
const emptyProcess = (diagnostics) => ({
|
|
190
|
+
completed: false,
|
|
191
|
+
actualLossUnits: 0,
|
|
192
|
+
expectedOutputUnits: 0,
|
|
193
|
+
netProcessCost: 0,
|
|
194
|
+
costPerExpectedUnit: 0,
|
|
195
|
+
outputValue: 0,
|
|
196
|
+
normalLossScrapValue: 0,
|
|
197
|
+
abnormal: {
|
|
198
|
+
kind: "none",
|
|
199
|
+
units: 0,
|
|
200
|
+
grossValue: 0,
|
|
201
|
+
scrapAdjustment: 0,
|
|
202
|
+
netCostImpact: 0
|
|
203
|
+
},
|
|
204
|
+
processAccount: {
|
|
205
|
+
debit: 0,
|
|
206
|
+
credit: 0,
|
|
207
|
+
balances: false
|
|
208
|
+
},
|
|
209
|
+
diagnostics,
|
|
210
|
+
trace: []
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
//#endregion
|
|
214
|
+
export { costJobOrBatch, costProcessWithLosses };
|