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

fix: Discount and taxes in return document should follow the reference document #41911

Merged

Conversation

nabinhait
Copy link
Member

If a credit note is created against a sales invoice, the credit note should follow the same discount (based on the pricing rule) and tax template as in the original sales invoice.

Previously, if we changed the discount on the pricing rule after creating the original sales invoice, the system overwrites the discount on the credit note based on the updated pricing rule.

Similarly, the item tax template and tax table is overwritten based on the updated item tax template in the Item master.

@github-actions github-actions bot added accounts needs-tests This PR needs automated unit-tests. labels Jun 15, 2024
@nabinhait nabinhait requested review from ruthra-kumar and removed request for rohitwaghchaure June 15, 2024 13:39
@ruthra-kumar
Copy link
Member

This causes

frappe.throw(
_("Row # {0}: Rate cannot be greater than the rate used in {1} {2}").format(
d.idx, doc.doctype, doc.return_against
)
to throw

@nabinhait
Copy link
Member Author

This causes

frappe.throw(
_("Row # {0}: Rate cannot be greater than the rate used in {1} {2}").format(
d.idx, doc.doctype, doc.return_against
)

to throw

When are you getting this validation? Are you manually changing the item rate?

@ruthra-kumar
Copy link
Member

Are you manually changing the item rate?

No.
Just try submitting the Credit Note. Above validation will throw.

@stale stale bot added the inactive label Jul 18, 2024
@frappe frappe deleted a comment from stale bot Aug 1, 2024
@nabinhait nabinhait force-pushed the sales_purchase_return_discount_and_taxes branch from a2163e2 to 5c56f94 Compare August 1, 2024 07:53
@nabinhait nabinhait removed the needs-tests This PR needs automated unit-tests. label Aug 1, 2024
@nabinhait nabinhait removed the request for review from deepeshgarg007 August 1, 2024 09:20
@nabinhait nabinhait marked this pull request as ready for review August 1, 2024 09:20
@nabinhait nabinhait merged commit 2811984 into frappe:develop Aug 1, 2024
18 checks passed
mergify bot pushed a commit that referenced this pull request Aug 1, 2024
…e document (#41911)

* fix: Discount and taxes in return document should follow the reference document

* fix: Ignore Pricing rule on debit/credit note if created against PI/SI with test cases

* fix: linter issue

(cherry picked from commit 2811984)
mergify bot pushed a commit that referenced this pull request Aug 1, 2024
…e document (#41911)

* fix: Discount and taxes in return document should follow the reference document

* fix: Ignore Pricing rule on debit/credit note if created against PI/SI with test cases

* fix: linter issue

(cherry picked from commit 2811984)

# Conflicts:
#	erpnext/controllers/sales_and_purchase_return.py
nabinhait added a commit that referenced this pull request Aug 1, 2024
…e document (backport #41911) (#42574)

fix: Discount and taxes in return document should follow the reference document (#41911)

* fix: Discount and taxes in return document should follow the reference document

* fix: Ignore Pricing rule on debit/credit note if created against PI/SI with test cases

* fix: linter issue

(cherry picked from commit 2811984)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Aug 7, 2024
# [15.32.0](v15.31.5...v15.32.0) (2024-08-07)

### Bug Fixes

* 'undefined' in PL and BS report summary on Consolidated report ([3da7071](3da7071))
* all warehouse filter for the stock report (backport [#42584](#42584)) ([#42604](#42604)) ([830b95b](830b95b))
* company filter for filtring tax withheld vouchers ([3ad1f2d](3ad1f2d))
* disable primary action button only when there are no active capitalization ([2d644ac](2d644ac))
* Discount and taxes in return document should follow the reference document (backport [#41911](#41911)) ([#42574](#42574)) ([9321408](9321408))
* do not update item price and last purchase rate for inter transf… (backport [#42616](#42616)) ([#42633](#42633)) ([59b9b7d](59b9b7d))
* german translations ([f27e9f3](f27e9f3))
* inter transfer delivery note issue with batch (backport [#42552](#42552)) ([#42556](#42556)) ([97cc308](97cc308))
* min height for rows in sales funnel ([2f81c99](2f81c99))
* resolved conflict ([#42557](#42557)) ([c3293d1](c3293d1))
* reverse debit credit for party gl entry in payment entry based on negative amount ([#42367](#42367)) ([14f9aef](14f9aef))
* set currency on change of company considering customer default currency (backport [#42405](#42405)) ([#42547](#42547)) ([7c8d13c](7c8d13c))
* set query filters for sales / purchase tax template on PE ([dc9cf74](dc9cf74))
* use get_last_day to get the correct date (backport [#42564](#42564)) ([#42598](#42598)) ([2de86eb](2de86eb))

### Features

* expiry date column in Available Batch Report (backport [#42628](#42628)) ([#42642](#42642)) ([d8768c5](d8768c5))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants