This PR adds several new features to the logistics web app:
Volumetric weight calculation: The price calculation function has been modified to consider volumetric weight. If the volumetric weight is higher than the actual weight, it will be used for price calculation.
Multiple package addition: Users can now add multiple packages at once using the package addition function.
Location variables: The package details now include location variables for From and To.
Admin price update: An interface has been added for the admin to update the standard price used for calculation.
Summary of Changes
Modified PriceCalculator.php:
Added calculateVolumetricWeight() function to calculate volumetric weight based on package dimensions.
Modified calculatePrice() function to use the higher value between volumetric weight and actual weight for price calculation.
Modified PackageController.php:
Modified addPackage() function to accept an array of packages and iterate over them to add each package.
Added location variables From and To in the package details.
Modified AdminController.php:
Added updateStandardPrice() function to update the standard price in the database.
Modified price_calculator_view.php:
Modified the form to include input fields for package dimensions for volumetric weight calculation.
Modified the form to allow users to add multiple packages at once.
Modified admin_view.php:
Added a form for the admin to input the new standard price and a button to update the standard price.
Please review and merge this PR to add the requested features.
Fixes #1.
To checkout this PR branch, run the following command in your terminal:
git checkout {pull_request.branch_name}
🎉 Latest improvements to Sweep:
Use Sweep Map to break large issues into smaller sub-issues, perfect for large tasks like "Sweep (map): migrate from React class components to function components"
Getting Sweep to format before committing! Check out Sweep Sandbox Configs to set it up.
We released a demo of our chunker, where you can find the corresponding blog and code.
💡 To get Sweep to edit this pull request, you can:
Leave a comment below to get Sweep to edit the entire PR
Leave a comment in the code will only modify the file
Edit the original issue to get Sweep to recreate the PR from scratch
Description
This PR adds several new features to the logistics web app:
Summary of Changes
PriceCalculator.php
:calculateVolumetricWeight()
function to calculate volumetric weight based on package dimensions.calculatePrice()
function to use the higher value between volumetric weight and actual weight for price calculation.PackageController.php
:addPackage()
function to accept an array of packages and iterate over them to add each package.AdminController.php
:updateStandardPrice()
function to update the standard price in the database.price_calculator_view.php
:admin_view.php
:Please review and merge this PR to add the requested features.
Fixes #1.
To checkout this PR branch, run the following command in your terminal:
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: