Add a custom calculated field in the Grand Total section of a quoted worksheet

Hi SugarCRM Devs,

I would like to ask on how to add a custom calculated field in the Grand Total section of Quote Worksheet (e.g. Credit Card Fees, etc.)

* That field will display and selectable in the Fields legend

* The field can be placed in the middle of the Tax and Shipping field in the layout section (left side).

Thank you and I'm looking forward for your response.

- Rekell 

  • The grand total footer can be found in modules\Quotes\clients\base\views\quote-data-grand-totals-footer\quote-data-grand-totals-footer.php.

    Here you could add an additional field and install the customized metdata file in \custom\modules\Quotes\clients\base\views\quote-data-grand-totals-footer\quote-data-grand-totals-footer.php

    $viewdefs['Quotes']['base']['view']['quote-data-grand-totals-footer'] = array(
        'panels' => array(
            array(
                'name' => 'panel_quote_data_grand_totals_footer',
                'label' => 'LBL_QUOTE_DATA_GRAND_TOTALS_FOOTER',
                'fields' => array(
                    array(
                        'name' => 'new_sub',
                        'type' => 'currency',
                    ),
                    array(
                        'name' => 'tax',
                        'type' => 'currency',
                        'related_fields' => array(
                            'taxrate_value',
                        ),
                    ),
    // ADD CUSTOM FIELD HERE in the same way as the other fields                
                    array(
                        'name' => 'shipping',
                        'type' => 'quote-footer-currency',
                        'css_class' => 'quote-footer-currency',
                        'default' => '0.00',
                    ),
                    array(
                        'name' => 'total',
                        'label' => 'LBL_LIST_GRAND_TOTAL',
                        'type' => 'currency',
                        'css_class' => 'grand-total',
                        'convertToBase' => false,
                    ),
                ),
            ),
        ),
    );

    But I suppose you have already some customizations in your system. So, you should discuss that with the developers of the the other changes.