Calculating Total Charges Script for Docbits
The "Calculating Total Charges" script automates the process of summing up various charges and additional amounts within invoice documents. This guide walks you through the script setup, logic, and application to ensure accurate total charge calculations across your documents.
Purpose
This script aims to provide a dynamic way to calculate the total charges on an invoice by adding up different charge types, such as base charges, freight (Fracht), and packaging (Verpackung). It then updates the invoice's total charges field with the calculated sum, ensuring accurate billing information.
Script Overview
The script retrieves values from specified fields, converts them to floats, sums them up, and then updates the total_charges
field with the result. If the total_charges
field doesn't exist, the script creates this field and sets its value accordingly.
Code Snippet
Last updated