Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GSTR-I reports for B2B #277

Merged
merged 41 commits into from
Dec 21, 2021

Conversation

ankitsinghaniyaz
Copy link
Contributor

No description provided.

@ankitsinghaniyaz ankitsinghaniyaz marked this pull request as ready for review December 14, 2021 07:39
export default async function makeJSON(data, savePath) {
fs.writeFile(savePath, data, (error) => {
if (error) throw error;
return shell.openPath(savePath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening .json by default will in most cases just launch the text editor, raw json isn't something people generally would want to look at other than to verify that it did get saved.

I feel we should do one of these:

  1. Open the folder where it's saved.
  2. Show a toast saying that the file was saved at whatever path and clicking the toast opens the folder.

I don't know if we have UI for a toast, if we don't you can go with 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totaly 💯

Have identified a way to add toast too, but for now opening the directly seems like a good thing to do.

Comment on lines -34 to -41
{
label: 'Clear Filters',
type: 'secondary',
action: async report => {
await report.getReportData({});
report.usedToReRender += 1;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for removing the Clear Filter from this and General Ledger?

I noticed, prior to this PR this action wasn't implemented, I don't think we should remove it. If it doesn't work we can fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we'll have to make it work I guess. I've removed them so that we can add them later as required.

Copy link
Member

@18alantom 18alantom Dec 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed them so that we can add them later as required.

This doesn't make sense 😅

The problem I see is that someone'll end up implementing a whole other thing to add Clear Filter if we remove it. So since it's already there might as well leave it in. I don't mind pushing commits to fix it.

Comment on lines 183 to 186
message: _('Export failed!'),
description: _(
'Report cannot be exported if company gst details are not configured'
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title (message) can be "Export Failed", no need for punctuation in the title. Also full stop at the end of description.

p.s. I know this is very pedantic but these are almost zero cost improvements to maintain consistency

Copy link
Member

@18alantom 18alantom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ankitsinghaniyaz I've added some comments, let me know once you're through with them, I'll re-review and we can merge.

I have yet to check report generation and calculations.

Copy link
Member

@18alantom 18alantom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two things:

  • Item Code to HSN/SAC and shifting it to a regional file.
  • Undelete the Clear Filter.

I'll push commits for the other small things, either in this PR or later as fixes.

@ankitsinghaniyaz
Copy link
Contributor Author

Sure @18alantom let me push these changes and ping you.

Copy link
Member

@18alantom 18alantom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, still haven't cross checked the calculations, will do it when the report is complete, also made a few minor changes:

  • Rebased onto master
  • HSN code is not required: 1
  • Remove HSN code from SalesInvoiceItem.js cause it's in RegionalChanges.js
  • Renamed Clear Filter to Reset Filters and moved it to report since it's common and existing implementation is dead code.
  • Added group for Export, all exports should be under it
  • Remove unnecessary Promise wrap around showMessageDialog, reworded the message, action calls to receive getReportData so that filtered rows are fetched.

@18alantom 18alantom merged commit ca8739f into frappe:master Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants