Make calculations in custom composite truthly

Created on 3 July 2024, 5 months ago
Updated 22 July 2024, 4 months ago

Problem/Motivation

Almost all companies need to send an invoice to customer,so have a way to calculate in custom composite elements line?Such as
price * qty = amount
price * 1.13 =tax
please see demo as following,

Steps to reproduce

custom composite settings in webform(such as invoice)

Fields in custom composite settings,such as qty2/price2/tax2/amount2 filelds.
There seems to be no place to input the calculation formula?such as : qty2 * : price2 or using twig.

Calculation is not supported by webform default settings,

part yaml data of this webfom as following:
flexbox_03:
'#type': flexbox
product_list2:
'#type': custom_composite
'#title': 'product list 2'
'#multiple__no_items_message': '

input your messege

'
'#multiple__add_more_input_label': 行
'#format_items': table
'#element':
sku2:
'#type': textfield
'#title': Sku
'#size': 50%
'#attributes':
class:
- sku2-class
product_desc:
'#type': textarea
'#title': Desc.
size2:
'#type': textfield
'#title': Size
qty2:
'#type': number
'#title': Qty
price2:
'#type': number
'#title': 'Price with tax'
tax2:
'#type': number
'#title': Tax
amount2:
'#type': number
'#title': amount
lot2:
'#type': textfield
'#title': 'Lot#'
others2:
'#type': textfield
'#title': Others

Proposed resolution

Computed twig elements have performance limitations via Ajax. Any additional support should be handled via custom code or dedicated contributed module.
refer:
https://git.drupalcode.org/project/webform/-/blob/6.2.x/modules/webform_...

Feature request
Status

Needs work

Version

1.0

Component

Miscellaneous

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024