mirror of
https://github.com/frappe/books.git
synced 2025-01-25 16:18:33 +00:00
26 lines
680 B
JavaScript
26 lines
680 B
JavaScript
import { t } from 'frappe';
|
|
import { cloneDeep } from 'lodash';
|
|
import PurchaseInvoiceItemOriginal from './PurchaseInvoiceItem';
|
|
|
|
export default function getAugmentedPurchaseInvoiceItem({ country }) {
|
|
const PurchaseInvoiceItem = cloneDeep(PurchaseInvoiceItemOriginal);
|
|
if (!country) {
|
|
return PurchaseInvoiceItem;
|
|
}
|
|
|
|
if (country === 'India') {
|
|
PurchaseInvoiceItem.fields = [
|
|
...PurchaseInvoiceItem.fields,
|
|
{
|
|
fieldname: 'hsnCode',
|
|
label: t`HSN/SAC`,
|
|
fieldtype: 'Int',
|
|
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
|
|
formulaDependsOn: ['item'],
|
|
},
|
|
];
|
|
}
|
|
|
|
return PurchaseInvoiceItem;
|
|
}
|