2
0
mirror of https://github.com/frappe/books.git synced 2025-02-03 12:38:34 +00:00

26 lines
653 B
JavaScript
Raw Normal View History

2022-02-16 11:49:16 +05:30
import { t } from 'frappe';
2021-12-16 11:47:25 +05:30
import { cloneDeep } from 'lodash';
import SalesInvoiceItemOriginal from './SalesInvoiceItem';
export default function getAugmentedSalesInvoiceItem({ country }) {
const SalesInvoiceItem = cloneDeep(SalesInvoiceItemOriginal);
if (!country) {
return SalesInvoiceItem;
}
if (country === 'India') {
SalesInvoiceItem.fields = [
...SalesInvoiceItem.fields,
{
fieldname: 'hsnCode',
2022-02-16 11:49:16 +05:30
label: t`HSN/SAC`,
2021-12-16 11:47:25 +05:30
fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
formulaDependsOn: ['item'],
},
];
}
return SalesInvoiceItem;
}