mirror of
https://github.com/frappe/books.git
synced 2025-01-23 07:08:36 +00:00
26 lines
653 B
JavaScript
26 lines
653 B
JavaScript
import { t } from 'frappe';
|
|
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',
|
|
label: t`HSN/SAC`,
|
|
fieldtype: 'Int',
|
|
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
|
|
formulaDependsOn: ['item'],
|
|
},
|
|
];
|
|
}
|
|
|
|
return SalesInvoiceItem;
|
|
}
|