2
0
mirror of https://github.com/frappe/books.git synced 2025-01-23 07:08:36 +00:00

Fix gstr-1 json format for validation

This commit is contained in:
Piyush Singhania 2021-12-12 14:00:32 +05:30 committed by Alan
parent 38713ee2d0
commit c18db1c406
5 changed files with 7 additions and 6 deletions

View File

@ -70,11 +70,11 @@ export async function generateGstr1Json(report, { transferType, toDate }) {
const gstData = {
version: 'GST3.0.4',
hash: 'hash',
gstin: printSettings.gstin,
// fp is the the MMYYYY for the last month of the report
// for example if you are extracting report for 1st July 2020 to 31st September 2020 then
// fb = 092020
fp: DateTime.fromISO(toDate).toFormat('MMyyyy'),
gstin: printSettings.gstin,
};
// based condition we need to triggered different methods
@ -107,9 +107,10 @@ async function getB2bData(invoices) {
idt: DateTime.fromFormat(row.invDate, 'yyyy-MM-dd').toFormat(
'dd-MM-yyyy'
),
value: row.invAmt,
val: row.invAmt,
pos: row.gstin && row.gstin.substring(0, 2),
rchrg: row.reverseCharge,
inv_typ: 'R',
itms: [],
};

View File

@ -115,7 +115,7 @@ export default {
{
fieldname: 'itemCode',
label: 'Item Code',
fieldtype: 'Data',
fieldtype: 'Int',
placeholder: 'Item Code',
},
],

View File

@ -89,7 +89,7 @@ export default {
{
fieldname: 'itemCode',
label: 'Item Code',
fieldtype: 'Data',
fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'itemCode'),
formulaDependsOn: ['item'],
},

View File

@ -90,7 +90,7 @@ export default {
{
fieldname: 'itemCode',
label: 'Item Code',
fieldtype: 'Data',
fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'itemCode'),
formulaDependsOn: ['item'],
},

View File

@ -16,6 +16,7 @@ export const IPC_ACTIONS = {
GET_DIALOG_RESPONSE: 'show-message-box',
GET_PRIMARY_DISPLAY_SIZE: 'get-primary-display-size',
SAVE_HTML_AS_PDF: 'save-html-as-pdf',
SAVE_REPORT_AS_JSON: 'save-report-as-json',
SHOW_ERROR: 'show-error',
};
@ -23,5 +24,4 @@ export const DB_CONN_FAILURE = {
INVALID_FILE: 'invalid-file',
CANT_OPEN: 'cant-open',
CANT_CONNECT: 'cant-connect',
SAVE_REPORT_AS_JSON: 'save-report-as-json',
};