2
0
mirror of https://github.com/frappe/books.git synced 2025-01-24 15:48:25 +00:00

Fixed the fp value to match the last date of range

This commit is contained in:
Piyush Singhania 2021-12-10 22:22:31 +05:30 committed by Alan
parent 228e069096
commit 8c0e5d4e75
3 changed files with 5 additions and 6 deletions

View File

@ -60,7 +60,7 @@ const IGST = {
}; };
export async function generateGstr1Json(report, transferType) { export async function generateGstr1Json(report, { transferType, toDate }) {
const printSettings = await frappe.getSingle('PrintSettings'); const printSettings = await frappe.getSingle('PrintSettings');
// TODO: if self gstin is not provided throw an error message // TODO: if self gstin is not provided throw an error message
// telling that that report cannot be exported if company gst details are not configured // telling that that report cannot be exported if company gst details are not configured
@ -75,8 +75,7 @@ export async function generateGstr1Json(report, transferType) {
// fp is the the MMYYYY for the last month of the report // 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 // for example if you are extracting report for 1st July 2020 to 31st September 2020 then
// fb = 092020 // fb = 092020
// TODO: fix this value to match the last date of range fp: DateTime.fromISO(toDate).toFormat('MMyyyy'),
fp: DateTime.local().toFormat('MMyyyy'),
gstin: printSettings.gstin, gstin: printSettings.gstin,
}; };

View File

@ -43,8 +43,8 @@ export default {
{ {
label: 'Export as JSON', label: 'Export as JSON',
type: 'primary', type: 'primary',
action: async (report, transferType) => { action: async (report, filters) => {
generateGstr1Json(report, transferType); generateGstr1Json(report, filters);
}, },
}, },
], ],

View File

@ -4,7 +4,7 @@
<h1 slot="title" class="text-2xl font-bold">{{ report.title }}</h1> <h1 slot="title" class="text-2xl font-bold">{{ report.title }}</h1>
<template slot="actions"> <template slot="actions">
<Button <Button
@click="link.action(reportData, filters.transferType)" @click="link.action(reportData, filters)"
v-for="link of report.linkFields" v-for="link of report.linkFields"
:key="link.label" :key="link.label"
type="primary" type="primary"