Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix VIEW INVOICE button#476

Merged
akhilgkrishnan merged 3 commits intodevelopfrom
bugfix/view-invoice-button
Jun 16, 2022
Merged

Fix VIEW INVOICE button#476
akhilgkrishnan merged 3 commits intodevelopfrom
bugfix/view-invoice-button

Conversation

@harshaanNihal
Copy link
Contributor

@harshaanNihal harshaanNihal commented Jun 15, 2022

Notion card

https://www.notion.so/saeloun/View-invoice-not-working-when-opened-via-email-ba00ef36db9d41ba8ad5a4ccc4439409

Summary

  • Removed Direct Dependency of env variables on invoice_url
  • Made review comments mentioned here

Preview

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Checklist:

  • I have manually tested all workflows
  • I have performed a self-review of my own code
  • I have added automated tests for my code

@pr-triage pr-triage bot added the PR: draft label Jun 15, 2022
@github-actions
Copy link

github-actions bot commented Jun 15, 2022

Current Code Coverage Percent of this PR:

89.18 %

Files having coverage below 100%

Impacted Files Coverage
/lib/custom_failure.rb 80.0 %
/app/controllers/users/invitations_controller.rb 86.36 %
/app/controllers/users/sessions_controller.rb 85.71 %
/app/services/invoice_payment/checkout.rb 44.0 %
/app/services/invoice_payment/pdf_generation.rb 70.97 %
/app/controllers/internal_api/v1/companies_controller.rb 95.45 %
/app/controllers/internal_api/v1/profile_controller.rb 96.88 %
/app/controllers/internal_api/v1/payment_settings_controller.rb 93.33 %
/app/controllers/internal_api/v1/wise/recipients_controller.rb 90.0 %
/app/controllers/internal_api/v1/payments/providers_controller.rb 94.74 %
/lib/benchmarking/benchmarker.rb 0.0 %

@harshaanNihal harshaanNihal force-pushed the bugfix/view-invoice-button branch from 6d2b358 to a7d130f Compare June 15, 2022 08:28
@harshaanNihal harshaanNihal marked this pull request as ready for review June 15, 2022 09:07
@harshaanNihal harshaanNihal marked this pull request as draft June 15, 2022 09:08
@harshaanNihal harshaanNihal force-pushed the bugfix/view-invoice-button branch from aaa0ae7 to c68af6b Compare June 16, 2022 04:36
@harshaanNihal harshaanNihal marked this pull request as ready for review June 16, 2022 04:36
Copy link
Contributor

@rohitjoshixyz rohitjoshixyz left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

Copy link
Member

@akhilgkrishnan akhilgkrishnan left a comment

Choose a reason for hiding this comment

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

LGTM


def invoice
@_invoice ||= Invoice.includes(:client, :invoice_line_items).find_by(external_view_key: params[:id])
@_invoice ||= Invoice.includes(:client, :invoice_line_items).find_by!(external_view_key: params[:id])
Copy link
Member

Choose a reason for hiding this comment

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

can you check, what happen if the external is invalid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@akhilgkrishnan
With find_by invoice will be nil and it will hit 500 error in view.
Screenshot from 2022-06-16 11-41-08


With find_by! it raises 404.

Screenshot from 2022-06-16 11-40-00

Copy link
Member

Choose a reason for hiding this comment

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

okay 404 is fine

@akhilgkrishnan akhilgkrishnan merged commit 9440386 into develop Jun 16, 2022
@akhilgkrishnan akhilgkrishnan deleted the bugfix/view-invoice-button branch June 16, 2022 07:22
@harshaanNihal harshaanNihal restored the bugfix/view-invoice-button branch November 25, 2022 15:52
@akhilgkrishnan akhilgkrishnan deleted the bugfix/view-invoice-button branch September 5, 2023 16:43
vipulnsward pushed a commit that referenced this pull request Feb 15, 2026
* Convert anchor ta to link_to
- fix review comments

* fix invoice_url

* passed external_view_key as param
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants