How to make subtotal row inside the body of table using autotable?

59 Views Asked by At

How do i make subtotal row inside a body of a table like this screenshot below? the subtotal will be looped for every unique code inside a "kode" column, there will be a subtotal row that will output the total of every value of "Qty" column.

table with subtotal

So far, I only able to recreate only like this, this is the table body function that i use to map all the data to put it inside the body of the table

function bodyRows(datas) {
rowCount = _.size(datas) || 10
var body = []
_.map(datas, (v) => {
    console.log(v)
    const issued_qty = _.isNull(v.issued_qty) ? '0' : v.issued_qty
    body.push([v.itemcode, v.itemdescription, v.locationcode, v.jobcode, issued_qty , v.uomcode, v.mrnotes])
})
return body
}

recreated table

0

There are 0 best solutions below