In the bulk fuel logistics industry, miscalculating the landed cost of a tanker load destroys profit margins instantly. A dispatcher cannot rely on manual spreadsheet math when pricing out tens of thousands of liters of Motor Spirit (MS) or High-Speed Diesel (HSD). Because transport rates and base fuel costs fluctuate wildly depending on the specific loading depot—whether it's Chennai, Cochin, or Irugur—a static pricing model is functionally useless. This Memento system acts as a rigid, automated financial routing engine, forcing the user to define the exact geographical parameters before it executes highly complex, depot-specific pricing algorithms.
Locking the Fuel Parameters
Before any financial calculation can occur, the physical volume and current market rates must be established. The template forces a strict input baseline to prevent calculation errors downstream.
The user must explicitly declare the payload using boolean checkboxes: "MS" (Motor Spirit/Petrol) and/or "HSD" (Diesel). It then requires the raw numerical inputs for the current "MS Rate" and "HSD Rate". Crucially, it demands the exact volume via "MS Ltrs (in KL)" and "HSD Ltrs (in KL)". By forcing the volume into Kiloliter metrics rather than raw liters, the system standardizes the input for the heavy industrial math that follows, ensuring that a simple typo doesn't result in a million-dollar invoicing error.
The Geographical Routing Matrix
The core intelligence of this database lies in its routing logic. A load out of Chennai carries a vastly different transport cost than a load out of Cochin.
The template forces the dispatcher to select the exact "Source" (Chennai, Cochin, Irugur, Karur) and, if applicable, the specific "Depot" (Reliance Chennai vs. ETTPL Chennai). Once this geographical anchor is set, the system takes over. It completely abandons manual entry for the final pricing, relying entirely on dozens of hidden calculation fields that trigger based on the chosen location.
Automated Depot-Specific Algorithms
The database executes brutal, unyielding math tailored to the selected route. If the source is Chennai, it ignores the rest of the database and runs the Estimated MS rate (chn) script: #{ms rate}-3.283385-1.73625.
It scales this logic up to determine the final invoice. It calculates the Estimated MS Load amt (chn) by multiplying the specific rate by the Kiloliters and then by 1000. It simultaneously calculates the TT Rent (chn) (Transport Truck Rent) using a specific locational multiplier: (#{ms ltrs _in kl_}+#{hsd ltrs _in kl_})*1.73616666*1000. The system houses these exact, highly specific mathematical loops for every single depot—Cochin, Irugur, and Karur. The final output is an unassailable "Total Payable" figure that factors in base rate, depot-specific deductions, and exact freight costs, ready for immediate invoicing.