Quotes: a line can carry its cost each and a markup, margin or set price in the Edit Line window, with quick-pick percentages and what the line makes, a line added from a product takes the product's cost, the cost shows under the line while the quote can be changed and the quote's Margin counts each line's own cost, all for agents only; Admin Settings Quotes sets the starting method, percent and quick picks; Copy Quote keeps each line's product; database 3.8.7 adds quote_items.item_cost, item_price_method and item_price_percent and the pricing settings; 26.11.9 changelog entries

This commit is contained in:
johnnyq
2026-11-17 21:24:27 -05:00
parent cad50ebecf
commit bd62f4af22
14 changed files with 531 additions and 26 deletions

View File

@@ -2,7 +2,8 @@
/*
* Admin > Settings > Quotes - how quotes are numbered, the footer under each
* one, and who hears when a client accepts or declines one online. Saved by
* one, who hears when a client accepts or declines one online, and how a
* line's price comes from its cost (functions/quote_pricing.php). Saved by
* edit_quote_settings (admin/post/settings_quote.php).
*/
@@ -31,6 +32,18 @@ echo settingsPageStart('quote');
'placeholder' => 'sales@company.com', 'help' => 'A shared mailbox or list works best. Empty, nobody is emailed - the quote still shows the answer.']) ?>
<?= settingsSectionEnd() ?>
<?php if (quotePricingReady()) {
$pricing = quotePricingSettings(); ?>
<?= settingsSectionStart('pricing', 'Pricing', 'A quote line can carry what it costs you, and its price can come from that cost - a markup or a margin. Only agents see the cost, in a line\'s Edit window and the quote\'s Margin - never the PDF, the guest link or the portal.') ?>
<?= settingsSelect('config_quote_price_method', $pricing['method'], ['markup' => 'Markup - a % added to the cost', 'margin' => 'Margin - a % of the price'], ['icon' => 'fa-calculator',
'help' => 'What a line is priced by when a cost is typed in. Markup 25% on a cost of 80.00 is 100.00; margin 25% on 80.00 is 106.67.']) ?>
<?= settingsInput('config_quote_price_percent', quotePricePercentText($pricing['percent']), ['icon' => 'fa-percent', 'inputmode' => 'decimal', 'maxlength' => 8,
'help' => 'The % a line starts with.']) ?>
<?= settingsInput('config_quote_price_presets', implode(', ', array_map('quotePricePercentText', $pricing['presets'])), ['icon' => 'fa-hand-pointer', 'maxlength' => 100,
'placeholder' => '15, 20, 25, 35', 'help' => 'The % buttons in a quote line\'s Edit window, to pick one in a click - up to eight, separated by commas.']) ?>
<?= settingsSectionEnd() ?>
<?php } ?>
<?= settingsSaveBar('edit_quote_settings') ?>
</div>
</div>