Compare commits

...

1040 Commits

Author SHA1 Message Date
Deepesh Garg
60b61da290 Revert "fix: payment entry is already created on posawesome. (backport #34712) (#34753)"
This reverts commit b48fca3e5a.
2023-04-05 17:10:52 +05:30
mergify[bot]
b48fca3e5a fix: payment entry is already created on posawesome. (backport #34712) (#34753) 2023-04-05 13:55:33 +05:30
mergify[bot]
af828e4554 fix: Shop by category fixes (backport #34688) (#34751)
fix: Shop by category fixes (#34688)

* fix: Shop by category fixes

* chore: Update tests

(cherry picked from commit 56f5078357)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-05 13:09:49 +05:30
mergify[bot]
e76df6ff46 fix!: require sender and message for contact us page (#34707)
fix!: require sender and message for contact us page (#34707)

* fix: require sender and message for contact us page

* refactor: dont override frappe.send_message from client side

used override_whitelisted_method hook for the same

(cherry picked from commit f193393f57)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-04-05 12:46:56 +05:30
mergify[bot]
3007ac3c20 fix: don't include cancelled JVs in assdeprledger report (#34737)
fix: don't include cancelled JVs in assdeprledger report

(cherry picked from commit 3896d41e95)

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-04-05 11:56:38 +05:30
mergify[bot]
92a26dda3c fix: Allocate tax loss to tax account head on early payment discount (#34287)
* fix: Taxes aren't discounted on early payment discount

- Deductions in payment entry must be split into income loss and tax loss
- Compute total discount in percentage, makes discounting different amounts proportionately easier

(cherry picked from commit 768c3a4927)

* fix: Recalculate difference amount after setting deductions

(cherry picked from commit 75ec0a0a85)

* fix: Set deductions in base currency

- Use field precision to get more accurate values

(cherry picked from commit dc2998f544)

* fix: Back update discounted amount in Invoice based on discount type

- Discount value was always trated as a percentage on back updation

(cherry picked from commit 2ae5834290)

* test: PE from SI with early payment discount amount & PE assertions in discount % test

(cherry picked from commit c217bb2018)

* fix: Set deduction amount in company currency on Doctype

- Even via JS, deductions amount is always in company currency
- Since there is nothing dynamic about this field, set it in the doctype spec itself
- fixed: Inconsistency between label currency and field currency formatted value

(cherry picked from commit 7f2e7badff)

* fix: Don't add to deductions if amount is 0

- misc: better docstring

(cherry picked from commit f02fc8acf0)

* fix: Paid amount must be discounted considering accounting currency

- Accounting is in the same currency if party currency and company currency is the same
- If accounting is in the same currency, paid and recvd amount is in the base currency
- Then, discount amount must also be in the base currency as it is deducted from paid amount
- Received amount must be in base currency if not multi currency
- cleanup: Deductions setting broken into smaller functions

(cherry picked from commit 761f68d7bf)

* fix: Multi-currency SI with base currency PE

- Return total discount loss in base currency
- Allocate payment based on terms: Set allocated amount in references table in base currency if accounting is in that currency
- Allocate payment based on terms: While back updating set paid amount (payment schedule) in transaction currency always
- minor: discount msgprint in correct currency

(cherry picked from commit b09c2381ca)

* test: Multi currency SI with multi-currency accounting and single currency accounting + Early payment discount

(cherry picked from commit 9abf0ef615)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/test_payment_entry.py

* fix: Handle rounding more gracefully

- Round off pending discount loss to avoid miniscule losses rounded to 0.0 that are added in deductions
- Use base amounts to calculate base losses instead of using conversion factor which increases rounding error
- Round of total base loss instead of individual income and tax losses to reduce rounding error
- Use default round off account for pending rounding loss in deductions

(cherry picked from commit caa1a3dccf)

* fix: Provision to apply early payment discount if payment is recorded late

- Party could have paid on time but payment is recorded late
- Prompt for reference date so that discount is applied while mapping
- Prompt only if discount in payment schedule of valid doctypes
- test: Reference date and impact on PE
- `make_payment_entry` (JS) must be able to access `this`

(cherry picked from commit d6d0163514)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
#	erpnext/buying/doctype/purchase_order/purchase_order.js
#	erpnext/public/js/controllers/transaction.js

* feat: Make Tax loss booking optional

- Checkbox in Accounts Settings
- Apply checkbox in PE deductions setting logic
- Adjust tests

(cherry picked from commit 216a46bd66)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json

* fix: Merge conflicts

* fix: 'Donation' does not have `company_currency` field

- Make sure check uses this field only for eligible documents

---------

Co-authored-by: marination <maricadsouza221197@gmail.com>
2023-04-05 11:55:22 +05:30
Anand Baburajan
fed43aeb85 fix: asset monthly WDV and DD schedule [v13] (#34645)
fix: monthly wdv and dd schedule
2023-04-05 11:45:15 +05:30
RJPvT
892c480408 fix: format currency/float as per number format in work history (#34545)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2023-04-04 11:08:55 +05:30
Rucha Mahabal
50de045247 fix: filter out old allocation's cf leaves while fetching leave details (#34723) 2023-04-03 20:19:11 +05:30
rohitwaghchaure
313aecf0ff Merge pull request #34720 from frappe/mergify/bp/version-13-hotfix/pr-34715
fix: bom update log not working for large batch size (backport #34715)
2023-04-03 16:55:37 +05:30
Rohit Waghchaure
9cf30d7621 fix: bom update log not working for large batch size
(cherry picked from commit d56070301c)
2023-04-03 10:20:07 +00:00
Sagar Sharma
e7fd47ae82 Merge pull request #34698 from frappe/mergify/bp/version-13-hotfix/pr-34656
fix: BOM Update Cost, when no actual qty (backport #34656)
2023-04-02 14:59:31 +05:30
s-aga-r
9725698b79 fix: BOM Update Cost, when no actual qty
(cherry picked from commit a4112c75c5)
2023-04-01 10:54:51 +00:00
ruthra kumar
008c985392 Merge pull request #34685 from frappe/mergify/bp/version-13-hotfix/pr-34679
fix: enclose ternary operator in parenthesis (backport #34679)
2023-03-31 14:05:16 +05:30
ruthra kumar
198830a6c8 fix: enclose ternary operator in parentheses
(cherry picked from commit 986daa6578)
2023-03-31 08:02:11 +00:00
Sagar Sharma
2770840946 Merge pull request #34682 from frappe/mergify/bp/version-13-hotfix/pr-34677
chore: make `Production Plan Item Reference` table hidden in Production Plan (backport #34677)
2023-03-31 12:43:26 +05:30
s-aga-r
45eb440b68 chore: conflicts 2023-03-31 12:42:51 +05:30
s-aga-r
85d8ed989d chore: make Production Plan Item Reference table hidden in Production Plan
(cherry picked from commit 706be2a415)

# Conflicts:
#	erpnext/manufacturing/doctype/production_plan/production_plan.json
2023-03-31 07:05:19 +00:00
rohitwaghchaure
6b026280c7 Merge pull request #34670 from frappe/mergify/bp/version-13-hotfix/pr-34664
fix: incorrect balance qty in the stock ledger report (backport #34664)
2023-03-30 18:17:51 +05:30
rohitwaghchaure
74280e0557 Merge pull request #34672 from frappe/mergify/bp/version-13-hotfix/pr-34636
fix: posting time issue (backport #34636)
2023-03-30 18:17:14 +05:30
Anand Baburajan
5f32696158 Merge pull request #34666 from frappe/mergify/bp/version-13-hotfix/pr-34661
chore: improve asset depr posting failure msg (backport #34661)
2023-03-30 17:50:32 +05:30
Rohit Waghchaure
f22e7775b3 fix: posting time issue
(cherry picked from commit 345e6facbe)
2023-03-30 11:56:41 +00:00
Rohit Waghchaure
dab1f1a0d0 fix: incorrect balance qty in the stock ledger report
(cherry picked from commit cbdaab940d)
2023-03-30 11:56:28 +00:00
Anand Baburajan
503c58edf8 chore: improve asset depr posting failure msg (#34661)
* chore: improve asset depr posting error msg

* chore: add period

* chore: improve msg

(cherry picked from commit d999dea3e4)
2023-03-30 11:09:34 +00:00
mergify[bot]
e54ff346ca chore: auto fill asset name and available for use date (backport #34660) (#34663)
* chore: auto fill asset name and available for use date

(cherry picked from commit af3e807607)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.json

* Update asset.json

---------

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-03-30 16:36:56 +05:30
rohitwaghchaure
a872a7a9eb Merge pull request #34653 from frappe/mergify/bp/version-13-hotfix/pr-34648
fix: serial no with zero quantity issue in stock reco (backport #34648)
2023-03-30 13:39:28 +05:30
Anand Baburajan
60046feac3 Merge pull request #34651 from frappe/mergify/bp/version-13-hotfix/pr-34649
fix: incorrect arg name in asset value adjustment (backport #34649)
2023-03-30 13:10:07 +05:30
Rohit Waghchaure
46638b19db fix: serial no with zero quantity issue in stock reco
(cherry picked from commit 17131e5a02)
2023-03-30 07:35:38 +00:00
anandbaburajan
545807a91e fix: incorrect arg name in asset value adjustment
(cherry picked from commit 2b0470d1f5)
2023-03-30 07:34:09 +00:00
mergify[bot]
ab06cb42a3 fix: lost opportunity report issue (#34626)
fix: lost opportunity report issue (#34626)

* fix: lost opportunity report issue

* chore: Linting Issues

---------

Co-authored-by: Komal Saraf <komal@frappe.io>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit d0660ad222)

Co-authored-by: Komal-Saraf0609 <81952590+Komal-Saraf0609@users.noreply.github.com>
2023-03-29 17:04:40 +05:30
Bevan Tony Medrano
625b8e8005 Asset maintenance task add dropdown "3 Yearly" (#34607)
* feat(asset_maintenance.json):Add 3 yearly in periodicity dropdown

* add server side implications for 3 yearly
2023-03-29 16:59:49 +05:30
mergify[bot]
e53a96ae1d fix: incorrect Opening Value in Stock Balance report (backport #34461) (#34622)
* fix: incorrect `Opening Value` in `Stock Balance` report

(cherry picked from commit b04a101c11)

# Conflicts:
#	erpnext/stock/report/stock_balance/stock_balance.py

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-03-28 21:09:09 +05:30
mergify[bot]
3aab6e6fa8 fix: Percentage billing in Sales Order (#34606)
* fix: Percentage billing in Sales Order (#34606)

(cherry picked from commit 12ad2aa2e5)

# Conflicts:
#	erpnext/controllers/status_updater.py

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-28 18:38:52 +05:30
Deepesh Garg
2e9e6eef05 chore: Update ubuntu version (#34620) 2023-03-28 17:25:33 +05:30
mergify[bot]
4bdea436e3 fix: Party Name in SOA print when viewed from Customer/Supplier master (#34597)
fix: Party Name in SOA print when viewed from Customer/Supplier master (#34597)

fix: Party Name in SOA print when viewd from Customer/Supplier master
(cherry picked from commit 50c1172f29)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-28 16:49:20 +05:30
mergify[bot]
dbe289e734 fix: Search field not working for customer, supplier (#32693)
* fix: searchfield not working for cuctsomer, supplier as per customize form

(cherry picked from commit 46d148defd)

* test: added test case to validate seachfields for customer, supplier

(cherry picked from commit 5f84993bae)

* fix: not able to select customer / supplier

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2023-03-28 16:06:27 +05:30
Anand Baburajan
c8bde399e5 fix: recalculate WDV rate after asset repair [v13] (#34567)
fix: recalculate wdv rate after asset repair
2023-03-23 19:44:13 +05:30
mergify[bot]
7f83d15bda fix: unset address and contact on trash (backport #34495) (#34561)
fix: unset address and contact on trash (#34495)

* fix(Customer): unset address and contact on trash

* fix(Supplier): unset address and contact on trash

---------

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit f7bf1b8a0c)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-23 12:58:54 +05:30
rohitwaghchaure
ad5eb6da4e Merge pull request #34555 from rohitwaghchaure/dont-raise-error-while-mkaing-ste
fix: valuation rate issue while making stock entry from PO
2023-03-22 23:36:57 +05:30
Rohit Waghchaure
3574d490db fix: valuation rate issue while making stock entry from PO 2023-03-22 16:52:07 +05:30
mergify[bot]
8ddbac5158 fix: Blanket Order (backport #34279) (#34548)
* fix: hide `+` button based on `Blanket Order Type`

(cherry picked from commit abf9a28d6a)

* feat: add field `Over Order Allowance (%)` in `Buying Settings`

(cherry picked from commit f5937f46cb)

# Conflicts:
#	erpnext/buying/doctype/buying_settings/buying_settings.json

* refactor: rewrite `blanket_order.py` queries in `QB`

(cherry picked from commit f3993783a3)

* fix: don't map item row having `0` qty

(cherry picked from commit fc1088d9c4)

* feat: consider `over_order_allowance` while validating order qty

(cherry picked from commit 8bcbc45add)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* feat: add field `Over Order Allowance (%)` in `Selling Settings`

(cherry picked from commit d7da8928ac)

# Conflicts:
#	erpnext/selling/doctype/selling_settings/selling_settings.json

* feat: consider `over_order_allowance` while validating sales order qty

(cherry picked from commit 53701c37b1)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* test: add test cases for `Over Order Allowance` against `Blanket Order`

(cherry picked from commit 66f650061d)

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-03-22 13:50:29 +05:30
ruthra kumar
00518eb384 fix: exchange gain/loss GL's should be removed if advance is cancelled (#34529)
* fix: report GL for invoice when advance has different exchange rate

If deferred revenue/expense is enabled for any item, don't repost.

* test: cancelling advance should remove exchange gain/loss

If there are no deferred revenue/expense cancelling advance should
cancel the exchange gain/loss booked due to different exchange rates
of payment and its linked invoice
2023-03-21 16:16:36 +05:30
mergify[bot]
661030aba1 fix: german translations (#34312)
fix: german translations (#34312)

fix: some german translations
(cherry picked from commit 59c2e7ec3e)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-21 16:08:50 +05:30
mergify[bot]
19dda807d1 fix(client): Amount calculation for 0 qty debit notes (#34455)
fix(client): Amount calculation for 0 qty debit notes (#34455)

fix(client): Amount calculaton for 0 qty debit notes

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit ee6c107d58)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-21 16:06:10 +05:30
Anand Baburajan
0d5abf1c95 refactor: calc depr in asset repair and if statement (#34526)
refactor: minor asset repair of calc depr and if statement
2023-03-21 14:30:28 +05:30
Anand Baburajan
ae88ba5d18 fix: incorrect depr schedules after asset repair [v13] (#34520)
* fix: incorrect schedule after repair for WDV and DD

* chore: only fix schedules for assets with calc_depr true

* fix: incorrect schedule after repair for straight line and manual
2023-03-21 12:35:44 +05:30
ruthra kumar
d855b532e4 Merge pull request #34511 from ruthra-kumar/manual_backport_of_34456
fix: Gross Profit reports Invoices with -ve qty for Invoices with Cr Notes (manual backport to version 13)
2023-03-20 15:42:09 +05:30
ruthra kumar
4e38e8da1b test: Gross Profit report output for Cr notes
2 New test cases added.
1. Standalone Cr notes will be reported as normal Invoices
2. Cr notes against an Invoice will not overallocate qty if there are
multiple instances of same item

(cherry picked from commit cc61daeec4)
2023-03-20 14:48:53 +05:30
ruthra kumar
6eeac48f17 refactor: Ignore linked Cr Notes in Report output
(cherry picked from commit d0715a82eb)
2023-03-20 14:48:53 +05:30
ruthra kumar
d2a1acc2e2 fix: Overallocation of 'qty' from Cr Notes to Parent Invoice
Cr Notes 'qty' are overallocated to parent invoice, when there are
mulitple instances of same item in Invoice.

(cherry picked from commit e2f19c6a14)
2023-03-20 14:48:53 +05:30
mergify[bot]
a3aa4d536a chore: Update user manual link (#34478)
* chore: Update user manual link (#34478)

(cherry picked from commit be723bb9d4)

# Conflicts:
#	erpnext/patches.txt

* chore: resolve conflicts

* chore: Update version

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>

* chore: Update version

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-19 18:08:15 +05:30
Sagar Sharma
28027a9f94 Merge pull request #34449 from frappe/mergify/bp/version-13-hotfix/pr-34415
fix: operation time for multi-level BOM in WO (backport #34415)
2023-03-14 19:25:44 +05:30
Sagar Sharma
b4aabf3f35 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34415 2023-03-14 18:55:49 +05:30
Sagar Sharma
cf49b0effb Merge pull request #34451 from frappe/mergify/bp/version-13-hotfix/pr-34381
chore: fix french translation (backport #34381)
2023-03-14 18:55:19 +05:30
HENRY Florian
0bb43a1be5 chore: fix french translation (#34381)
chore: update french translation
(cherry picked from commit d267111e13)
2023-03-14 13:20:05 +00:00
s-aga-r
f4d07cc84e fix: operation time for multi-level BOM in WO
(cherry picked from commit 442ee3adba)
2023-03-14 13:18:29 +00:00
mergify[bot]
809d6d638e fix: Total row in trail balance report (backport #34395) (#34431)
fix: Total row in trail balance report (#34395)

* fix: Total row in trail balance report

* fix: Calculate total after preparing opening and closing

(cherry picked from commit c6999fc687)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-14 15:07:30 +05:30
Rucha Mahabal
0834cb1bb6 Merge pull request #34436 from ruchamahabal/fix-leave-balance-editing-v13 2023-03-14 12:57:52 +05:30
Rucha Mahabal
2f62a9641e fix: leave allocation tests 2023-03-14 12:24:56 +05:30
Rucha Mahabal
cdf73bb781 test: update for total leaves allocated post submission 2023-03-14 11:49:32 +05:30
Rucha Mahabal
238769e6b5 fix: precision for newly allocated leaves 2023-03-14 11:49:24 +05:30
Rucha Mahabal
91cad9e985 fix: exclude cancelled leave ledger entries 2023-03-14 11:49:14 +05:30
Rucha Mahabal
7b9784ce10 refactor(tests): create_leave_type usage 2023-03-14 11:49:02 +05:30
Rucha Mahabal
fc10c8e44e test: leaves updated after submission with carry forwarding 2023-03-14 11:48:53 +05:30
Rucha Mahabal
88c5de533a fix: exclude carry forwarding leaves while updating leaves after submission 2023-03-14 11:48:42 +05:30
mergify[bot]
a24f0507e1 fix: Use customer name instead of name(id) in PSOA (backport #34412) (#34426)
fix: Use customer name instead of name(id) in PSOA (#34412)

(cherry picked from commit fa776d2987)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-13 20:29:17 +05:30
mergify[bot]
470dc10b15 fix: Error in consolidated financial statement (#34330)
fix: Error in consolidated financial statement (#34330)

(cherry picked from commit aae53bb910)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-13 14:02:28 +05:30
Saurabh
4d25091196 Merge pull request #34359 from saurabh6790/consider-relieving-date-in-lwp-calculation
fix: consider relieving date while calculating payment days based on lwp
2023-03-13 13:11:28 +05:30
Saurabh
44df522655 chore: fix linter #nosemgrep 2023-03-13 12:43:20 +05:30
Rucha Mahabal
8694d22b7a Merge pull request #34388 from ruchamahabal/fix-balance-edge-cases-v13 2023-03-10 14:39:03 +05:30
Rucha Mahabal
072c7e913d chore: fix linter 2023-03-10 11:44:33 +05:30
Rucha Mahabal
bc12269ef4 fix: adjust excess cf leaves in new leaves taken if number exceeds cf leaves allocation 2023-03-10 11:41:36 +05:30
Rucha Mahabal
7717a8a5e3 test: leave details with application across and after cf leave expiry 2023-03-10 11:41:17 +05:30
Rucha Mahabal
fd5d2ed87f refactor: consider cases for partially consumed cf and new leaves
- the above two cases weren't considering the split between cf leaves taken and new leaves taken and substracting all consumed leaves from cf leaves
2023-03-10 11:29:18 +05:30
Rucha Mahabal
c01bed9862 fix(test): get_leave_allocation_records 2023-03-10 11:29:12 +05:30
Rucha Mahabal
52108d52e2 fix: consider leaves taken within carry-forwarded period separately while calculating balance 2023-03-10 11:29:04 +05:30
Rucha Mahabal
e74e02b765 fix: consider leaves taken while calculating expired carry-forwarded leaves 2023-03-10 11:28:56 +05:30
gavin
b70a37f6fa fix: Don't use get_list & get_all interchangeably
* fix: Fetch all fields via get_returned_qty_map_for_row

* fix(update_billing_percentage): Remove permlevel checks on aggregated
value
2023-03-09 16:05:54 +05:30
mergify[bot]
42bda6e37b Revert "fix: Default sales team not getting set" (#34376)
Revert "fix: Default sales team not getting set" (#34376)

Revert "fix: Default sales team not getting set (#34284)"

This reverts commit 7d0199d743.

(cherry picked from commit 9a8f8e8b7d)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-09 15:40:32 +05:30
Sagar Sharma
eb24f91341 Merge pull request #34369 from frappe/mergify/bp/version-13-hotfix/pr-34360
chore: `Alternative Item Code` error msg (backport #34360)
2023-03-09 13:54:59 +05:30
Saurabh
341eab2b2a fix: linter 2023-03-09 13:24:38 +05:30
Sagar Sharma
0857632359 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34360 2023-03-09 12:07:45 +05:30
Sagar Sharma
e23f1555bb Merge pull request #34367 from frappe/mergify/bp/version-13-hotfix/pr-34362
fix: `required_qty` get reset to `1` for Alternative Item in WO (backport #34362)
2023-03-09 11:09:06 +05:30
s-aga-r
75c844a15a chore: Alternative Item Code error msg
(cherry picked from commit baef5ae1ef)
2023-03-09 04:38:21 +00:00
s-aga-r
d1171016b3 fix: required_qty get reset to 1 for Alternative Item in WO
(cherry picked from commit 046834a97a)
2023-03-09 04:35:58 +00:00
Saurabh
563f83f0f5 fix: consider relieving date while calculating payment days based on lwp 2023-03-08 19:02:46 +05:30
Sagar Sharma
9844508066 Merge pull request #34357 from frappe/mergify/bp/version-13-hotfix/pr-34352
fix: `BOM Stock Report` (backport #34352)
2023-03-08 18:14:42 +05:30
s-aga-r
4824302811 fix(test): TestBomStockReport 2023-03-08 17:44:51 +05:30
s-aga-r
08b9aaff26 test: add test cases for BOM Stock Report
(cherry picked from commit b53dcb04ed)
2023-03-08 10:56:43 +00:00
s-aga-r
eb1f8f932d fix: BOM Stock Report
(cherry picked from commit a65b80911b)
2023-03-08 10:56:43 +00:00
Sagar Sharma
99b201d5d7 Merge pull request #34336 from frappe/mergify/bp/version-13-hotfix/pr-34313
perf: Stock Entry (Material Transfer) (backport #34313)
2023-03-07 21:34:09 +05:30
s-aga-r
5bc2b8f685 perf: update_completed_qty() in material_request.py
(cherry picked from commit 8ad9e99cea)
2023-03-07 12:33:46 +00:00
s-aga-r
7a159a7187 perf: Stock Entry (Material Transfer)
(cherry picked from commit de18f98c5c)
2023-03-07 12:33:46 +00:00
mergify[bot]
3a1475a90b fix(minor): Dirty the form after clicking on Get advances button in Invoices (#34323)
fix(minor): Dirty the form after clicking on Get advances button in Invoices (#34323)

fix(minor): Dirty form after clicking on Get advances button

(cherry picked from commit 2feb27e399)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2023-03-07 15:47:37 +05:30
mergify[bot]
65c0189c4d fix: Default sales team not getting set (#34284)
fix: Default sales team not getting set (#34284)

(cherry picked from commit 7d0199d743)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-07 13:33:55 +05:30
mergify[bot]
1b2c4bf868 chore: add german translations (#34167)
* chore: add german translations (#34167)

* chore: add german translations

* Apply suggestions from code review

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit bbb6a62a7d)

# Conflicts:
#	erpnext/translations/de.csv

* chore: resolve conflicts

---------

Co-authored-by: Patrick Eissler <77415730+PatrickDenis-stack@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-07 11:46:30 +05:30
ruthra kumar
88ed6e6cb4 Merge pull request #34304 from ruthra-kumar/ui_freeze_on_item_selection
fix: UI freeze while selecting batched items in sales invoice
2023-03-06 11:24:01 +05:30
ruthra kumar
8c5322c1cb fix(test): check for batch_no in returned dict 2023-03-05 20:47:31 +05:30
ruthra kumar
82a8f2b1b2 fix: UI freeze while selecting batched items in sales invoice 2023-03-05 20:47:29 +05:30
Sagar Sharma
3908b510bd Merge pull request #34276 from frappe/mergify/bp/version-13-hotfix/pr-34273
fix: `rejected_serial_no` not getting copied from PR to PR(Return) (backport #34273)
2023-03-04 15:35:00 +05:30
s-aga-r
14547d94b3 chore: conflicts 2023-03-04 15:04:50 +05:30
s-aga-r
9bea2fcdfc fix: Serial No is mandatory even if the qty is 0
(cherry picked from commit cb0b6de4b9)
2023-03-02 07:08:14 +00:00
s-aga-r
bb55210f49 fix: rejected_serial_no not getting copied from PR to PR(Return)
(cherry picked from commit a9f0a11ce6)

# Conflicts:
#	erpnext/controllers/sales_and_purchase_return.py
2023-03-02 07:08:14 +00:00
Suraj Shetty
5354169f31 Merge pull request #34262 from frappe/fix-general-ledger-report 2023-03-01 16:22:28 +05:30
Suraj Shetty
ba66a6714c fix: Wrap unexpectedly long text in remark 2023-03-01 16:16:58 +05:30
ruthra kumar
d65df443fc Merge pull request #34246 from frappe/mergify/bp/version-13-hotfix/pr-34241
fix: pos return throwing amount greater than grand total (backport #34241)
2023-02-28 18:33:47 +05:30
ruthra kumar
f6607a6050 fix: pos return throwing amount greater than grand total
(cherry picked from commit 35c70f39fa)
2023-02-28 12:53:30 +00:00
Sagar Sharma
75d98ef205 Merge pull request #34237 from frappe/mergify/bp/version-13-hotfix/pr-34060
fix: multiple Point of Sale conversion issue resolved (backport #34060)
2023-02-28 16:49:46 +05:30
Vishal
fd1d2cd203 chore: minor changes in pos_controller
(cherry picked from commit f18ae5856f)
2023-02-28 09:26:37 +00:00
Vishal
c66dc5658f chore: minor change
(cherry picked from commit a51bec0269)
2023-02-28 09:26:36 +00:00
Vishal
1ebf2dd2bf chore: minor changes added to code
(cherry picked from commit 3ebe7d861d)
2023-02-28 09:26:36 +00:00
Vishal
de631e65cc fix: multiple pos conversion issue resolved
(cherry picked from commit 1de531e56e)
2023-02-28 09:26:36 +00:00
ruthra kumar
02f2844db2 Merge pull request #34218 from frappe/mergify/bp/version-13-hotfix/pr-34207
fix: permission error while calling get_work_order_items (backport #34207)
2023-02-28 11:04:52 +05:30
Sagar Sharma
f105c1bd5e Merge pull request #34227 from frappe/mergify/bp/version-13-hotfix/pr-34225
fix: set `from_warehouse` and `to_warehouse` while mapping SE (backport #34225)
2023-02-27 17:56:08 +05:30
Sagar Sharma
264c314416 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34225 2023-02-27 17:32:34 +05:30
Sagar Sharma
a71a336e59 chore: conflicts 2023-02-27 17:32:05 +05:30
Anand Baburajan
7db3645298 Merge pull request #34215 from frappe/mergify/bp/version-13-hotfix/pr-34205
fix: asset manual depr schedule (backport #34205)
2023-02-27 13:31:44 +05:30
s-aga-r
b1ecca3a16 fix: set from_warehouse and to_warehouse while mapping SE
(cherry picked from commit c09a61f360)

# Conflicts:
#	erpnext/stock/doctype/material_request/material_request.py
2023-02-27 07:23:20 +00:00
Anand Baburajan
cbfa188d3d Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34205 2023-02-27 12:41:45 +05:30
Sagar Sharma
4f7344c278 Merge pull request #34224 from frappe/mergify/bp/version-13-hotfix/pr-34212
fix: Remove missing DocField in fetch_from (backport #34212)
2023-02-27 12:28:55 +05:30
Brian Pond
45645c1064 fix: Remove missing DocField in fetch_from
(cherry picked from commit 83f3e317e1)
2023-02-27 06:24:23 +00:00
mergify[bot]
d44da6c820 fix: german translations (#31732)
fix: german translations (#31732)

(cherry picked from commit 6b510546ae)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-02-27 11:50:12 +05:30
Sagar Sharma
95ea28f14d Merge pull request #34209 from frappe/mergify/bp/version-13-hotfix/pr-34206
fix: not able to repost gl entries (backport #34206)
2023-02-27 10:26:38 +05:30
ruthra kumar
7971c149ed fix(test): use standalone method to fetch work orders from SO
(cherry picked from commit a11d3327df)
2023-02-27 10:14:36 +05:30
ruthra kumar
3d7b2b1a6d fix: permission error while calling get_work_order_items
(cherry picked from commit b6bad728cd)
2023-02-27 10:14:31 +05:30
anandbaburajan
9942a9d40a chore: refactor long if conditions
(cherry picked from commit d56ca011fe)
2023-02-26 14:38:43 +00:00
anandbaburajan
9a607b9bd0 chore: should prepare schedule if not draft
(cherry picked from commit 75386e3653)
2023-02-26 14:38:42 +00:00
anandbaburajan
304e6bb996 fix: incorrect acc depr amount if multiple FBs with straight line or manual method
(cherry picked from commit dda6baea3e)
2023-02-26 14:38:42 +00:00
anandbaburajan
4a557b47d7 chore: handle change in opening_accumulated_depreciation properly
(cherry picked from commit b0d670a51d)
2023-02-26 14:38:42 +00:00
anandbaburajan
71767994a7 fix: manual depr schedule
(cherry picked from commit 971c0720e5)
2023-02-26 14:38:41 +00:00
Rohit Waghchaure
2039bd066d fix: not able to repost gl entries
(cherry picked from commit 7d10dd9ea8)
2023-02-24 15:41:22 +00:00
rohitwaghchaure
b599b93ae8 Merge pull request #34201 from frappe/mergify/bp/version-13-hotfix/pr-34199
fix: conversion factor not set (backport #34199)
2023-02-24 17:52:40 +05:30
Rohit Waghchaure
59d579764d fix: conversion factor not set
(cherry picked from commit 8e46aebc50)
2023-02-24 09:28:37 +00:00
rohitwaghchaure
0fbd29b16d Merge pull request #34197 from frappe/mergify/bp/version-13-hotfix/pr-34115
feat: provision to convert transaction based reposting to item wareho… (backport #34115)
2023-02-24 11:54:56 +05:30
Rucha Mahabal
806f7e5eef fix(patch): create only 80G custom fields instead of running the whole setup (#34183) 2023-02-24 11:32:46 +05:30
Rohit Waghchaure
59c6eb591b feat: provision to convert transaction based reposting to item warehouse based reposting
(cherry picked from commit f1383b5ef9)
2023-02-24 05:51:56 +00:00
rohitwaghchaure
0aeef34944 Merge pull request #34191 from frappe/mergify/bp/version-13-hotfix/pr-34189
fix: user shouldn't able to make item price for item template (backport #34189)
2023-02-24 09:23:41 +05:30
Rohit Waghchaure
69f1247fab fix: user shouldn't able to make item price for item template
(cherry picked from commit 6417ae0ee8)
2023-02-23 15:18:42 +00:00
rohitwaghchaure
2d01b72b04 Merge pull request #34178 from frappe/mergify/bp/version-13-hotfix/pr-34173
fix: incorrect color in the BOM Stock Report (backport #34173)
2023-02-23 20:47:07 +05:30
ruthra kumar
bb4c968d95 Merge pull request #34185 from frappe/mergify/bp/version-13-hotfix/pr-34022
perf: Gross Profit report will fetch SLE's on demand and memoize (backport #34022)
2023-02-23 12:54:47 +05:30
ruthra kumar
c40aa580c5 refactor: use docstatus from Delivery Note Item
(cherry picked from commit 88d888d9d0)
2023-02-23 06:26:15 +00:00
ruthra kumar
642692a040 perf: fetch SLE's on demand and memoize
(cherry picked from commit 3e5691072a)
2023-02-23 06:26:15 +00:00
rohitwaghchaure
fd24d52d86 Merge pull request #34182 from frappe/mergify/bp/version-13-hotfix/pr-34172
fix: zero division error while making LCV (backport #34172)
2023-02-23 11:25:24 +05:30
Rohit Waghchaure
91a95adcb6 fix: zero division error while making LCV
(cherry picked from commit 80e94a08cf)
2023-02-23 05:24:56 +00:00
ruthra kumar
fe04b5a2b9 Merge pull request #34179 from frappe/mergify/bp/version-13-hotfix/pr-34176
fix: ui freeze upon item selection in sales invoice (backport #34176)
2023-02-23 10:52:12 +05:30
ruthra kumar
d1b611d37f fix: ui freeze on item selection in sales invoice
(cherry picked from commit 6412583e98)
2023-02-23 05:06:50 +00:00
Rohit Waghchaure
e98b34617f fix: incorrect color in the BOM Stock Report
(cherry picked from commit a8f03ebf7f)
2023-02-23 04:25:45 +00:00
Rucha Mahabal
6391ccd56a Merge pull request #34175 from ruchamahabal/fix-leave-balances 2023-02-22 20:17:13 +05:30
Rucha Mahabal
b848b77815 test: leave details with expired cf leaves 2023-02-22 19:46:08 +05:30
Rucha Mahabal
d82ba4e86f fix: ignore remaining leaves calculation for cf leaves after expiry
- calculate correct cf expiry in the entire allocation period
2023-02-22 19:44:23 +05:30
Rucha Mahabal
aea9d82672 test: leaves allocated before and after cf leave expiry is same 2023-02-22 19:44:06 +05:30
Rucha Mahabal
a3a9cd5174 fix: incorrect leave balance after carry-forwarded leave expiry 2023-02-22 19:43:56 +05:30
ruthra kumar
c7093b6e96 Merge pull request #34165 from frappe/mergify/bp/version-13-hotfix/pr-34102
fix: check for duplicate pos invoices in closing entry (backport #34102)
2023-02-21 20:04:02 +05:30
ruthra kumar
92da1ed3c2 fix: check for duplicate in pos closing and pos merge log entry
(cherry picked from commit 47add0b751)
2023-02-21 13:16:32 +00:00
mergify[bot]
9826245d8a fix: Filters in item-wise sales history report (#34145)
fix: Filters in item-wise sales history report (#34145)

(cherry picked from commit c88444a6c4)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-21 15:06:21 +05:30
mergify[bot]
26ed460a4f fix: Use normal rounding for Tax Withholding Category (#34114)
fix: Use normal rounding for Tax Withholding Category (#34114)

(cherry picked from commit 35cdd996a9)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-21 14:23:16 +05:30
Anand Baburajan
7bed6cddc7 Merge pull request #34156 from frappe/mergify/bp/version-13-hotfix/pr-34153
fix: fiscal year error for existing assets in fixed asset register (backport #34153)
2023-02-21 14:19:45 +05:30
anandbaburajan
1fb3a28128 fix: fiscal year error for existing assets in fixed asset register
(cherry picked from commit 76861eb332)
2023-02-21 08:25:47 +00:00
Rucha Mahabal
c49c621e43 Merge pull request #34150 from ruchamahabal/consolidate-balance-entries 2023-02-21 13:01:32 +05:30
Rucha Mahabal
8add12d568 fix: add missing import 2023-02-21 12:33:47 +05:30
Rucha Mahabal
acdf7fd8df fix: don't get chart data if data is empty 2023-02-21 12:30:52 +05:30
Rucha Mahabal
ccd25684f9 feat(UX): Add option to disable consolidating leave types in balance reports 2023-02-21 12:30:24 +05:30
Sagar Sharma
e34f5c9cf7 Merge pull request #34147 from frappe/mergify/bp/version-13-hotfix/pr-34138
fix(ux): `ReferenceError: me is not defined` Delivery Note (backport #34138)
2023-02-21 10:31:27 +05:30
s-aga-r
bdefd700af chore: Linters
(cherry picked from commit 44ee9f0f19)
2023-02-21 04:57:40 +00:00
s-aga-r
495d1b2548 fix(ux): ReferenceError: me is not defined Delivery Note
(cherry picked from commit 1b010add26)
2023-02-21 04:57:40 +00:00
mergify[bot]
2408966090 fix: Amount for debit and credit notes with 0 qty line items (backport #33902) (#34123)
fix: Amount for debit and credit notes with 0 qty line items (#33902)

(cherry picked from commit 47c91324b1)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-19 11:37:44 +05:30
Anand Baburajan
58a006ff64 Merge pull request #34113 from frappe/mergify/bp/version-13-hotfix/pr-34112
fix: repair status after deletion, asset status after manual depr entry and other misc bugs [v14] (backport #34112)
2023-02-17 16:52:28 +05:30
anandbaburajan
3585b90ce5 chore: fixing conflict 2023-02-17 16:29:09 +05:30
anandbaburajan
922b30a566 fix: asset repair status after deletion and asset status after manual depr entry
(cherry picked from commit 03f07a20e7)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.py
2023-02-17 10:44:04 +00:00
Deepesh Garg
5fc68a3dfe Merge pull request #34017 from frappe/mergify/bp/version-13-hotfix/pr-33901
fix(ecommerce): throw invalid doctype error in shop by category (backport #33901)
2023-02-15 16:59:18 +05:30
Sagar Sharma
f6d8adc921 Merge pull request #34068 from frappe/mergify/bp/version-13-hotfix/pr-34002
fix: should never get cutomer price on purchase document (backport #34002)
2023-02-15 16:01:17 +05:30
Sagar Sharma
48f2bd9add Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34002 2023-02-15 15:22:02 +05:30
Anand Baburajan
fb3a411d1f Merge pull request #34073 from frappe/mergify/bp/version-13-hotfix/pr-34058
fix: manual depr entries in asset_depreciations_and_balances report and some misc bugs [v14] (backport #34058)
2023-02-15 13:43:36 +05:30
anandbaburajan
6227c16374 fix: asset_depreciation_and_balances report doesn't reflect manual depr entries
(cherry picked from commit 1535c3d856)
2023-02-15 07:04:18 +00:00
anandbaburajan
ff2e617c0c chore: break look if je processed
(cherry picked from commit a220dc0c9c)
2023-02-15 07:04:18 +00:00
anandbaburajan
4f10f48f7c fix: opening_accumulated_depreciation and precision in charts
(cherry picked from commit 47cc8ab6c6)
2023-02-15 07:04:17 +00:00
Anand Baburajan
612ceb59c7 Merge pull request #34063 from frappe/mergify/bp/version-13-hotfix/pr-34059
chore: add anand to asset's codeowner (backport #34059)
2023-02-15 11:44:41 +05:30
HENRY Florian
117dbe38c4 fix: should never get cutomer price on purchase document (#34002)
* fix: never get cutomer price on purchase document

chores: syntax

chore: typo in stock_entry get_uom_details (#33998)

fix: typo in stock_entry get_uom_details

chores: syntax

* feat: add test for get_item_detail price list oriented

* feat: add test for get_item_detail price price oriented

* feat: add test for get_item_detail price price oriented

* chore: clean test code

(cherry picked from commit 231fe4156f)
2023-02-15 02:38:50 +00:00
Anand Baburajan
1223e31e7d Update CODEOWNERS 2023-02-14 20:33:40 +05:30
anandbaburajan
bc59ea0d55 chore: add anand to asset's codeowner
(cherry picked from commit d003370f61)

# Conflicts:
#	CODEOWNERS
2023-02-14 14:22:03 +00:00
Sabu Siyad
6ae1cc020a resolve conflicts 2023-02-14 19:34:39 +05:30
Sabu Siyad
4278bfe7b3 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33901 2023-02-14 19:05:14 +05:30
Sagar Sharma
574791f2c9 Merge pull request #34056 from frappe/mergify/bp/version-13-hotfix/pr-34018
fix: update `reserved_qty` when `Sales Order` marked as `Hold` (backport #34018)
2023-02-14 17:40:40 +05:30
s-aga-r
2391c37238 fix: update reserved_qty when Sales Order marked as Hold
(cherry picked from commit d76759e066)
2023-02-14 11:23:16 +00:00
Saurabh
60d2bf939b Merge pull request #34041 from saurabh6790/fix-lwp-calculations
fix: LWP calculation
2023-02-14 15:26:01 +05:30
Saurabh
a8ea3efae2 fix: validate working day list against holidays 2023-02-14 13:14:58 +05:30
Saurabh
c1de4e4420 fix: LWP calculation 2023-02-14 10:52:10 +05:30
mergify[bot]
f04542eac9 feat: Setting to allow Sales Order creation against expired quotation (#33952)
* feat: Setting to allow Sales Order creation against expired quotation (#33952)

* feat: Setting to allow Sales Order creation against expired quotation

* chore: linting issues

(cherry picked from commit 148703bfc2)

# Conflicts:
#	erpnext/selling/doctype/selling_settings/selling_settings.json

* chore: Resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-13 11:39:30 +05:30
Sabu Siyad
de87786db4 fix(ecommerce): throw invalid doctype error in shop by category (#33901)
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 0df28c7174)

# Conflicts:
#	erpnext/www/shop-by-category/index.py
2023-02-12 06:58:27 +00:00
mergify[bot]
f6410393ce fix: currency formatting in item-wise sales history (#33903)
fix: currency formatting in item-wise sales history (#33903)

* fix(item-sales-history): currency formatting

* chore: linting issues

* fix: convert raw sql to qb

(cherry picked from commit 2cc7239dd5)

Co-authored-by: Dany Robert <danyrt@wahni.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-11 11:10:58 +05:30
mergify[bot]
5be4c6ffbc fix: Debit and Credit not equal while submitting PI containing asset item (#33092)
fix: Debit and Credit not equal while submitting PI containing asset item

(cherry picked from commit dc8d635120)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-11 09:02:06 +05:30
mergify[bot]
124d7dea1b fix(UX): make Item attachments public by default (backport #32196) (#33949)
* fix(UX): make Item attachments public by default (#32196)

(cherry picked from commit fffc245922)

# Conflicts:
#	erpnext/stock/doctype/item/item.json

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-02-10 21:39:33 +05:30
mergify[bot]
bbcdd1e2e2 chore: typo in stock_entry get_uom_details (backport #33998) (#34004)
chore: typo in stock_entry get_uom_details (#33998)

fix: typo in stock_entry get_uom_details
(cherry picked from commit 185c543b73)

Co-authored-by: Akshay <60477442+akshayitzme@users.noreply.github.com>
2023-02-10 20:55:52 +05:30
Anand Baburajan
b6bc29ac92 Merge pull request #33963 from frappe/mergify/bp/version-13-hotfix/pr-33946
fix: allow cancelling purchase invoice if linked asset is already cancelled (backport #33946)
2023-02-10 14:15:44 +05:30
Anand Baburajan
e9a453c430 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33946 2023-02-08 23:23:31 +05:30
rohitwaghchaure
7e1d5e3595 Merge pull request #33956 from frappe/mergify/bp/version-13-hotfix/pr-33936
fix: negative stock error (backport #33936)
2023-02-07 19:13:35 +05:30
rohitwaghchaure
a9f5be3f98 fix: conflicts 2023-02-07 13:46:40 +05:30
anandbaburajan
d6b0e622ea chore: use continue, not break
(cherry picked from commit 3380dc5dea)
2023-02-05 10:38:00 +00:00
anandbaburajan
fbeaabffc9 fix: allow PI cancel if linked asset is cancelled
(cherry picked from commit b961321de5)
2023-02-05 10:38:00 +00:00
Sagar Sharma
c7c611d929 Merge pull request #33959 from frappe/mergify/bp/version-13-hotfix/pr-33942
fix: stock entry from item dashboard (stock levels) (backport #33942)
2023-02-05 10:06:14 +05:30
s-aga-r
8106c64c91 fix: stock entry from item dashboard (stock levels)
(cherry picked from commit dc0ddf8d7e)
2023-02-05 04:17:35 +00:00
Rohit Waghchaure
bd1191783b test: test case
(cherry picked from commit 9ae7578b07)
2023-02-04 18:06:07 +00:00
Rohit Waghchaure
2f4ffe137e fix: negative stock error
(cherry picked from commit 6d513e2519)

# Conflicts:
#	erpnext/stock/stock_ledger.py
2023-02-04 18:06:07 +00:00
Sagar Sharma
6735b09dd9 Merge pull request #33951 from frappe/mergify/bp/version-13-hotfix/pr-33940
chore: report `Warehouse wise Item Balance Age and Value` (backport #33940)
2023-02-04 18:58:46 +05:30
s-aga-r
745bef8ebc chore: conflicts 2023-02-04 13:51:17 +05:30
s-aga-r
5a9673ae1f chore: add Item Name column in Warehouse wise Item Balance Age and Value report
(cherry picked from commit 56356ffbb9)
2023-02-04 07:59:04 +00:00
s-aga-r
8d0b45b835 chore: column width in Warehouse wise Item Balance Age and Value report
(cherry picked from commit d7a665cb84)

# Conflicts:
#	erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
2023-02-04 07:59:04 +00:00
rohitwaghchaure
7738ca1ce0 Merge pull request #33922 from frappe/mergify/bp/version-13-hotfix/pr-33918
fix: incorrect actual qty in Bin (backport #33918)
2023-02-01 22:20:31 +05:30
Rohit Waghchaure
8f42833fba fix: incorrect actual qty in Bin
(cherry picked from commit f8c852c54c)
2023-02-01 12:54:28 +00:00
mergify[bot]
b2a3e014e9 fix: german chart of accounts "SKR03" (#33909)
fix: german chart of accounts "SKR03" (#33909)

* fix: german chart of accounts "SKR03"

- Added some missing account types and tax rates
- Added some missing accounts

* style: convert indentation to tabs

* fix: space before percentage sign

* feat: add some expense accounts

* refactor: replace unicode characters with utf-8

for better readability

* revert: add back groups for Bank and Cash accounts

Removed in 7d0d9c6900

(cherry picked from commit 3c7b460fd8)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-02-01 14:17:59 +05:30
Sagar Sharma
64018c29f3 Merge pull request #33898 from frappe/mergify/bp/version-13-hotfix/pr-33869
fix: `amount` in `Material Request` (backport #33869)
2023-01-31 16:01:49 +05:30
s-aga-r
813e8bb664 fix: amount in Material Request
(cherry picked from commit 6b781d78e0)
2023-01-31 09:15:48 +00:00
Anand Baburajan
f5efb2057c fix: manual depr entry not updating asset value [v13] (#33890)
fix: asset value for manual depr entries
2023-01-31 11:00:06 +05:30
mergify[bot]
3425a3bef9 fix: Fetch commission rate from sales partner (#33851)
* fix: Fetch commission rate from sales partner (#33851)
2023-01-31 10:17:05 +05:30
Deepesh Garg
4bf3e310e1 perf: Timeout while doing payment reconciliation (v13) (#33818)
perf: Timeout while doing payment reconciliation
2023-01-31 09:37:45 +05:30
ruthra kumar
abb466e2fb Merge pull request #33876 from frappe/mergify/bp/version-13-hotfix/pr-33736
fix(gp): fetch buying amount from dn related to so (backport #33736)
2023-01-31 09:29:56 +05:30
HENRY Florian
54c1642e3b fix: enable customs in Selling Workpace by default (#33853)
* fix: enable customs in Selling Workpace by default

* fix: enable customs in Selling Workpace by default
2023-01-31 08:50:34 +05:30
mergify[bot]
b6839d8f51 ci: bump isort to 5.12.0 (backport #33875) (#33880)
ci: bump isort to 5.12.0 (#33875)

[skip ci]

(cherry picked from commit 2bad86d8d8)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-31 08:49:28 +05:30
Anand Baburajan
af3ad155e5 Merge pull request #33885 from AnandBaburajan/fix_disposal_was_made_on_original_schedule_date_v13
fix: disposal_was_made_on_original_schedule_date [v13]
2023-01-30 22:55:34 +05:30
anandbaburajan
939a3121b7 fix: disposal_was_made_on_original_schedule_date 2023-01-30 22:10:51 +05:30
Dany Robert
ac6186e16f chore: linting issues
(cherry picked from commit d69c839369)
2023-01-30 13:35:51 +00:00
Dany Robert
b72a35a622 feat(gp): test for inv and dn related via so
(cherry picked from commit 1f6ab86a65)
2023-01-30 13:35:50 +00:00
Dany Robert
0d8a4bf936 chore: linting issue
(cherry picked from commit ef90e24931)
2023-01-30 13:35:50 +00:00
Dany Robert
be5edd329f fix(gp): fetch buying amount from dn related to so
(cherry picked from commit e8e20da78e)
2023-01-30 13:35:50 +00:00
rohitwaghchaure
0902a5c440 Merge pull request #33847 from frappe/mergify/bp/version-13-hotfix/pr-33845
fix: item rate not fetching (backport #33845)
2023-01-28 22:41:06 +05:30
Rohit Waghchaure
bb5641535b fix: item rate not fetching
(cherry picked from commit 0d7f98b496)
2023-01-28 09:41:20 +00:00
Sagar Vora
fc7aac9d41 Merge pull request #33833 from frappe/mergify/bp/version-13-hotfix/pr-33831
perf: show update items dialog (backport #33831)
2023-01-27 04:19:30 +00:00
Devin Slauenwhite
0ff5099cbc perf: show update items dialog
(cherry picked from commit a835c1a418)
2023-01-27 04:18:50 +00:00
mergify[bot]
b38ad66012 fix: use correct filter name in item_query (backport #33814) (#33817)
fix: use correct filter name in `item_query` (#33814)

(cherry picked from commit da323cbb40)

Co-authored-by: Daizy Modi <modidaizy5217@gmail.com>
2023-01-25 17:38:03 +05:30
Deepesh Garg
1b11566485 fix: e-Invoicing for SEZ Customer(v13) (#33796) 2023-01-25 08:57:52 +05:30
mergify[bot]
28f5d28201 ci: documentation helper (backport #33757) (#33799)
ci: documentation helper (#33757)

refactor: documentation helper
(cherry picked from commit d155042edd)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-24 16:47:13 +05:30
Anand Baburajan
421814e9b3 Merge pull request #33773 from AnandBaburajan/asset_bug_fixes_13
fix: backport #32226 and fix some asset bugs related to finance books [v13]
2023-01-23 21:09:05 +05:30
Anand Baburajan
814333b0cc Merge branch 'version-13-hotfix' into asset_bug_fixes_13 2023-01-23 14:22:46 +05:30
rohitwaghchaure
0862f670ee Merge pull request #33787 from frappe/mergify/bp/version-13-hotfix/pr-33684
feat: [minor] date type based on filter in Work Order Summary report (backport #33684)
2023-01-23 14:16:43 +05:30
rohitwaghchaure
593d7f3dd6 fix: linter issue 2023-01-23 13:22:24 +05:30
Rohit Waghchaure
5ed6a74fc4 feat: provision to select date type based on filter
(cherry picked from commit 20c8873208)
2023-01-23 07:44:08 +00:00
Anand Baburajan
76b6833b61 Merge branch 'version-13-hotfix' into asset_bug_fixes_13 2023-01-22 13:57:31 +05:30
anandbaburajan
b7e9e4a7c5 fix: accumulated_depreciation in reverse_depreciation_entry_made_after_disposal 2023-01-22 13:56:56 +05:30
Sagar Sharma
54b2f78a99 Merge pull request #33780 from frappe/mergify/bp/version-13-hotfix/pr-33778
fix: missing constant definition (backport #33778)
2023-01-21 22:32:59 +05:30
barredterra
fc4be1b337 fix: missing constant definition
(cherry picked from commit 547d37b1db)
2023-01-21 16:59:37 +00:00
Anand Baburajan
b9b110674e Merge branch 'version-13-hotfix' into asset_bug_fixes_13 2023-01-21 20:04:20 +05:30
anandbaburajan
7959e41a81 chore: fix circular import issue and rename date_of_sale to date_of_disposal 2023-01-21 19:58:26 +05:30
anandbaburajan
d6913fffe6 fix: backport of #32226 2023-01-21 19:29:39 +05:30
anandbaburajan
7174a2cd93 fix: incorrect row order and accumulated_depreciation when schedule with multiple FBs is scrapped 2023-01-21 18:41:19 +05:30
mergify[bot]
47e500c2eb fix(minor): Label updates in Statement of Accounts (#33639)
fix(minor): Label updates in Statement of Accounts (#33639)
2023-01-21 15:44:27 +05:30
mergify[bot]
4511d41329 Removed an unnecessary check in code which always evaluates to true (#33710)
fix: removed an unnecessary check which always evaluates to true
2023-01-21 12:03:33 +05:30
rohitwaghchaure
7243f71d7d Merge pull request #33762 from frappe/mergify/bp/version-13-hotfix/pr-33759
fix: incorrect actual qty for the packed item (backport #33759)
2023-01-21 09:46:59 +05:30
mergify[bot]
3daaa021eb fix: Short closed order, receipt and delivery note status on cancellation (#33743)
fix: Short closed order, receipt, and delivery note status on cancellation (#33743)
2023-01-20 23:41:14 +05:30
Rohit Waghchaure
09e13d279c fix: incorrect actual qty for the packed item
(cherry picked from commit 02566a02a8)
2023-01-20 18:10:16 +00:00
mergify[bot]
d6504320b1 fix: calculate correct amount for qty == 0 (backport #33739) (#33752)
fix: calculate correct amount for qty == 0 (#33739)

(cherry picked from commit 327b6fdb32)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-20 23:38:37 +05:30
Raffael Meyer
af3a0e56f6 chore: bump python version for docs-checker (#33756) 2023-01-20 22:52:33 +05:30
mergify[bot]
2da543ebd4 fix(ecommerce): breadcrumb: fallback to /all-products (#33718)
fix(ecommerce): breadcrumb: fallback to `/all-products` (#33718)

* fix(ecommerce): breadcrumb: fallback to `/all-products`

* fix(item_group): use `==` instead of `is`

* test(ecommerce): breadcrumb

(cherry picked from commit a94aa7a79f)

Co-authored-by: Sabu Siyad <hello@ssiyad.com>
2023-01-20 19:26:05 +05:30
anandbaburajan
ae031cea63 fix: fb issue in asset chart 2023-01-20 15:39:01 +05:30
rohitwaghchaure
6135d2972e Merge pull request #33742 from frappe/mergify/bp/version-13-hotfix/pr-33695
fix: patch item_reposting_for_incorrect_sl_and_gl (backport #33695)
2023-01-20 14:35:10 +05:30
rohitwaghchaure
d717ca0325 fix: conflicts 2023-01-20 14:05:14 +05:30
Rohit Waghchaure
1c5c06716b fix: patch item_reposting_for_incorrect_sl_and_gl
(cherry picked from commit dbde3a3421)

# Conflicts:
#	erpnext/patches.txt
2023-01-20 06:14:02 +00:00
rohitwaghchaure
61d06dd702 Merge pull request #33732 from frappe/mergify/bp/version-13-hotfix/pr-33723
fix: don't add template item in sales/purchase transaction (backport #33723)
2023-01-20 08:30:41 +05:30
Sagar Sharma
b702a02f61 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33723 2023-01-19 22:04:05 +05:30
rohitwaghchaure
055f8536c3 fix: conflicts 2023-01-19 16:57:17 +05:30
Sagar Sharma
40ab5b034c Merge pull request #33734 from frappe/mergify/bp/version-13-hotfix/pr-33619
fix: rewrite logic for duplicate check in Item Attribute (backport #33619)
2023-01-19 15:29:17 +05:30
unknown
13906cba9a fix: linting
(cherry picked from commit 2ca4d3fb71)
2023-01-19 07:59:03 +00:00
unknown
4741ce13c6 fix: rewrite logic for duplicate check in Item Attribute
Previously, Item Attribute values were not checked for case-insensitive duplicates, and Item tttribute abbreviations were forced to be uppercase. This commit fixes both problems.

(cherry picked from commit 974e12c837)
2023-01-19 07:59:02 +00:00
Rohit Waghchaure
f81d4a79ea fix: don't add template item in sales/purchase transaction
(cherry picked from commit 2c83fff1a1)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/test_purchase_order.py
2023-01-19 07:13:29 +00:00
Anand Baburajan
f2d83b1b21 Merge pull request #33689 from AnandBaburajan/misc_asset_fixes_v13
fix: handle asset depr entries posting failure and fix asset repair link [v13]
2023-01-17 15:14:10 +05:30
Anand Baburajan
f1670e922f Merge branch 'version-13-hotfix' into misc_asset_fixes_v13 2023-01-17 11:21:29 +05:30
Ankush Menat
ec780ac263 chore: ignore b028 2023-01-17 10:59:03 +05:30
Sagar Sharma
847171bd14 Merge pull request #33693 from frappe/mergify/bp/version-13-hotfix/pr-33690
fix: Sales Order Connections Tabs do not show linked Material Request or "+" button  (intoduce by #33304) (backport #33690)
2023-01-17 10:08:17 +05:30
Florian HENRY
97488aee88 fix: Sales ORder Connections on Material Request
(cherry picked from commit e19161a8ee)
2023-01-17 04:37:12 +00:00
Anand Baburajan
2b3a0ba9c4 Merge branch 'version-13-hotfix' into misc_asset_fixes_v13 2023-01-17 00:44:05 +05:30
anandbaburajan
5f7dc8a5b9 fix: handle post depr entries fail and fix asset repair link 2023-01-17 00:39:35 +05:30
ruthra kumar
edc20ae8b8 Merge pull request #33672 from frappe/mergify/bp/version-13-hotfix/pr-33646
Revert "fix: Updating SO throws ordered_qty not allowed to change after submission" (backport #33646)
2023-01-16 15:28:33 +05:30
ruthra kumar
6ebc9c5c82 Merge pull request #33669 from frappe/mergify/bp/version-13-hotfix/pr-33662
revert: Reverting changes done on 33495 (backport #33662)
2023-01-16 14:25:55 +05:30
Sagar Sharma
5a4d92b1bc Merge pull request #33666 from frappe/mergify/bp/version-13-hotfix/pr-33664
chore: `Sales Order` link in `Pick List` (backport #33664)
2023-01-16 13:53:28 +05:30
Sagar Sharma
ff48c44496 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33664 2023-01-16 10:30:13 +05:30
mergify[bot]
2f81f15f02 fix: allow to create sales order from expired quotation (#33582)
fix: allow to create sales order from expired quotation (#33582)

(cherry picked from commit dceef0397a)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-16 10:02:41 +05:30
ruthra kumar
f1bb8933c1 Revert "fix: Updating SO throws ordered_qty not allowed to change after submission" (#33646)
(cherry picked from commit 333907b7a5)
2023-01-16 04:09:26 +00:00
ruthra kumar
0f0a2b100c revert: Reverting changes done on 33495 (#33662)
'ordered_qty' will not be fetched from `tabBin`

(cherry picked from commit be382054e5)
2023-01-16 04:03:32 +00:00
mergify[bot]
eef0f453d2 fix: Return against internal purchase invoice (#33635)
fix: Return against internal purchase invoice (#33635)

(cherry picked from commit 906ad10d16)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-16 08:48:52 +05:30
s-aga-r
e4af69bc93 chore: Sales Order link in Pick List
(cherry picked from commit b3759890d7)
2023-01-15 17:35:52 +00:00
mergify[bot]
42fe63da2c fix: asset value in fixed asset register (#33608)
fix: asset value in fixed asset register

(cherry picked from commit aa1f2a7297)

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-01-15 17:33:17 +05:30
ruthra kumar
e23d7aa968 Merge pull request #33629 from frappe/mergify/bp/version-13-hotfix/pr-33622
fix: Updating SO throws ordered_qty not allowed to change after submission (backport #33622)
2023-01-13 10:15:14 +05:30
ruthra kumar
a46aa808be fix: Updating SO throws ordered_qty not allowed to change after submission
(cherry picked from commit 391f42db04)
2023-01-13 08:22:50 +05:30
mergify[bot]
f3b6b4609e chore: reuse doc object in test_pick_list_grouping_before_print (backport #33636) (#33638)
chore: reuse doc object in test_pick_list_grouping_before_print (#33636)

(cherry picked from commit e22d56484d)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-01-13 01:33:46 +05:30
mergify[bot]
7dcf0f0866 fix: only group similar items in print format if group_same_items is checked in pick list (backport #33627) (#33631)
fix: only group similar items in print format if group_same_items is checked in pick list (#33627)

* fix: only group similar items if group same items is checked in pick list

* test: non grouping of locations if group_same_items is false

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit cfb0bb1eaa)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-01-12 20:32:37 +05:30
Sagar Sharma
29dcce53db Merge pull request #33615 from frappe/mergify/bp/version-13-hotfix/pr-33611
fix: better comparision of `difference_value` of Stock and Account (backport #33611)
2023-01-11 15:44:03 +05:30
Smit Vora
a450c8dce9 fix: better comparision of difference value between stock and account
(cherry picked from commit be05aea101)
2023-01-11 09:24:10 +00:00
Sagar Sharma
287411667a Merge pull request #33602 from frappe/mergify/bp/version-13-hotfix/pr-33597
fix: don't check other warehouse ledgers to calculate valuation rate (backport #33597)
2023-01-10 22:58:10 +05:30
Rohit Waghchaure
66bf1071bb fix: don't check other warehouse ledgers to calculate valuation rate
(cherry picked from commit ef2bf3c223)
2023-01-10 10:05:12 +00:00
Sagar Sharma
410e617834 Merge pull request #33587 from frappe/mergify/bp/version-13-hotfix/pr-33562
fix: better handling of duplicate bundle items (backport #33562)
2023-01-09 22:55:56 +05:30
ruthra kumar
0b952e8bba fix: better handling of duplicate bundle items
(cherry picked from commit c717e87c9e)
2023-01-09 16:54:55 +00:00
mergify[bot]
e9d85a3ee4 ci: bump node in release workflow (backport #33574) (#33576)
ci: bump node in release workflow (#33574)

[skip ci]

(cherry picked from commit 1ad1fc4c7d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-01-09 13:26:18 +05:30
Rucha Mahabal
c20d469f31 fix: remove hard-coded roles for populating leave balance reports (#249) (#33557) 2023-01-06 14:28:15 +05:30
Sagar Sharma
7d0a118eab Merge pull request #33546 from frappe/mergify/bp/version-13-hotfix/pr-33543
chore: enable `No Copy` attribute for `route` in Item Group (backport #33543)
2023-01-05 13:32:52 +05:30
s-aga-r
2394f64872 chore: enable No Copy attribute for route in Item Group
(cherry picked from commit 348dc32514)
2023-01-05 07:33:04 +00:00
Daizy Modi
a50ad1d292 fix: remove unnecessary permissions from Appointment and Appointment Booking Settings (#33468)
* fix: remove unnecessary permissions from Appointment and Appointment Booking Settings

* fix: remove line

* fix: use more intuitive import

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2023-01-04 21:44:44 +05:30
Deepesh Garg
be48b4a028 chore: resolve conflicts 2023-01-04 08:24:20 +05:30
Deepesh Garg
b6ed0698b4 chore: resolve conflicts 2023-01-03 22:56:58 +05:30
Deepesh Garg
208d541373 Merge branch 'version-13' into version-13-hotfix 2023-01-03 22:22:12 +05:30
mergify[bot]
865f233add fix: Missing opening entry in general ledger (backport #33519) (#33527)
fix: Missing opening entry in general ledger (#33519)

(cherry picked from commit c78399c618)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-03 22:13:44 +05:30
mergify[bot]
ea99ac9c29 fix: Deferred revenue date comparison (backport #33515) (#33517)
fix: Deferred revenue date comparison (#33515)

(cherry picked from commit a3ab8f973a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-03 18:41:40 +05:30
mergify[bot]
6516e8042b fix(ecommerce): remove query parameters from referrer (backport #33269) (#33513)
fix(ecommerce): remove query parameters from referer

inclusion of query parameters results in logic failure

example:
- logic check if referrer is `all-products`
- `http://shop.example/all-products` -> `all-products`, valid outcome
- `http://shop.example/all-products?start=1` -> `all-products?start=1`,
  invalid outcome

Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit b6bd408f19)

Co-authored-by: Sabu Siyad <hello@ssiyad.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-03 17:51:57 +05:30
Rucha Mahabal
3c83ec5613 Merge pull request #33510 from ruchamahabal/mark-attendance-period 2023-01-03 16:47:31 +05:30
Rucha Mahabal
e5a187e08c fix(test): monthly attendance sheet 2023-01-03 16:18:42 +05:30
Rucha Mahabal
8df11516be fix(test): holiday list dates in attendance test setup 2023-01-03 15:44:58 +05:30
Rucha Mahabal
03af48b50b chore(style): fix formatting 2023-01-03 14:36:36 +05:30
Samuel Danieli
a2bd8d22cb test: get_unmarked_days 2023-01-03 13:15:36 +05:30
Samuel Danieli
d2f86ead74 feat: explicit time period for mark attendance 2023-01-03 13:12:15 +05:30
Sagar Sharma
985c47fe3b Merge pull request #33501 from frappe/mergify/bp/version-13-hotfix/pr-33444
fix: consider child nodes while getting bin details (backport #33444)
2023-01-02 19:29:33 +05:30
s-aga-r
6c7815cd72 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33444 2023-01-02 19:12:19 +05:30
Sagar Sharma
9b1384f79c Merge pull request #33499 from frappe/mergify/bp/version-13-hotfix/pr-33495
fix(stock): missing ordered_qty in get_bin_details (backport #33495)
2023-01-02 18:53:59 +05:30
s-aga-r
299e02ae46 chore: linter 2023-01-02 18:23:50 +05:30
s-aga-r
4fb2d2c000 chore: use frappe.qb instead of frappe.db.get_value
(cherry picked from commit c3911a592a)
2023-01-02 06:25:22 +00:00
s-aga-r
c9bf062f63 fix: consider child nodes while getting bin details
(cherry picked from commit c716dcc01e)
2023-01-02 06:25:22 +00:00
Devin Slauenwhite
196ba6759e test: get_item_details contains bin details
(cherry picked from commit 239a5f8bf4)
2023-01-02 05:45:43 +00:00
Devin Slauenwhite
66ba098462 fix: add missing 'ordered_qty' to get_bin_details
(cherry picked from commit 8d62cdfd5f)
2023-01-02 05:45:42 +00:00
mergify[bot]
4ba2f1ec96 fix: Multi-currency issues in Bank Reconciliation Tool (backport #33488) (#33493)
fix: Multi-currency issues in Bank Recociliation Tool

(cherry picked from commit ad53ecf2b4)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-02 08:52:04 +05:30
Deepesh Garg
6ab91348fd Merge pull request #33478 from frappe/mergify/bp/version-13-hotfix/pr-32714
fix: Conversion factor error for invoices without item code (petty expenses) (backport #32714)
2022-12-31 13:06:11 +05:30
Deepesh Garg
3f9b8923a9 chore: resolve conflicts 2022-12-30 20:57:38 +05:30
Deepesh Garg
038fa4dbe2 chore: resolve conflicts 2022-12-30 20:56:50 +05:30
Frappe PR Bot
d97e673874 chore(release): Bumped to Version 13.42.7
## [13.42.7](https://github.com/frappe/erpnext/compare/v13.42.6...v13.42.7) (2022-12-30)

### Bug Fixes

* debit note not pulled on reconciliation tool ([e01ff0d](e01ff0df40))
2022-12-30 15:21:51 +00:00
Deepesh Garg
b16bfa541d Merge pull request #33491 from frappe/mergify/bp/version-13/pr-33483
fix: debit note not pulled on reconciliation tool (#33483)
2022-12-30 20:49:48 +05:30
rohitwaghchaure
8156cb4db0 Merge pull request #33490 from frappe/mergify/bp/version-13-hotfix/pr-33487
Revert "fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation" (backport #33487)
2022-12-30 16:13:20 +05:30
Deepesh Garg
65688684a7 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32714 2022-12-30 16:00:59 +05:30
ruthra kumar
e01ff0df40 fix: debit note not pulled on reconciliation tool
(cherry picked from commit cf133b2f1c)
2022-12-30 10:05:59 +00:00
rohitwaghchaure
f0475e9cc5 fix: linter 2022-12-30 15:32:38 +05:30
ruthra kumar
b2333d3b5f Merge pull request #33483 from ruthra-kumar/debit_note_not_pulled_in_reconciliation_tool
fix: debit note not pulled on reconciliation tool
2022-12-30 15:02:49 +05:30
rohitwaghchaure
8521e12753 fix: conflicts 2022-12-30 14:35:12 +05:30
rohitwaghchaure
1c7c591ee2 fix: conflicts 2022-12-30 14:30:35 +05:30
rohitwaghchaure
c18a451362 fix: conflicts 2022-12-30 14:28:18 +05:30
rohitwaghchaure
529fb411ab Revert "fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation"
(cherry picked from commit 728dc1acf4)

# Conflicts:
#	erpnext/hooks.py
#	erpnext/stock/doctype/stock_entry/stock_entry.py
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py
2022-12-30 08:51:54 +00:00
ruthra kumar
4acaa3eecf Merge pull request #33475 from frappe/mergify/bp/version-13-hotfix/pr-33457
fix: use base_net_amount in case of missing stock qty (backport #33457)
2022-12-30 13:39:54 +05:30
ruthra kumar
cf133b2f1c fix: debit note not pulled on reconciliation tool 2022-12-29 18:02:16 +05:30
ruthra kumar
92c895aa1c Merge pull request #33460 from frappe/mergify/bp/version-13-hotfix/pr-33380
fix: ERR journals should be reported in AR/AP (backport #33380)
2022-12-29 11:27:05 +05:30
Frappe PR Bot
8d99763bea chore(release): Bumped to Version 13.42.6
## [13.42.6](https://github.com/frappe/erpnext/compare/v13.42.5...v13.42.6) (2022-12-29)

### Bug Fixes

* reconciled credit notes being fetched again in Payment Reconciliation tool ([#33471](https://github.com/frappe/erpnext/issues/33471)) ([b4589d8](b4589d8b8f))
* reconciled credit notes being fetched again in Payment Reconciliation tool ([#33471](https://github.com/frappe/erpnext/issues/33471)) ([37ae2df](37ae2dfe7f))
2022-12-29 05:30:04 +00:00
Deepesh Garg
b4589d8b8f fix: reconciled credit notes being fetched again in Payment Reconciliation tool (#33471)
fix: reconciled credit notes being fetched again in Payment Reconciliation tool (#33471)
2022-12-29 10:58:09 +05:30
ruthra kumar
ec15965a6c test: err for party should be in AR/AP report
(cherry picked from commit 2ed86760d7)
2022-12-29 10:53:55 +05:30
ruthra kumar
c850635551 fix: ERR journals reported in AR/AP
Exchange Rate Revaluation on Receivable/Payable will included in AR/AP report

(cherry picked from commit b09eade3e4)
2022-12-29 10:53:07 +05:30
Deepesh Garg
acf8b464f3 fix: Conversion factor error for invoices without item code (petty expenses) (#32714)
* fix: Set default uom conversion factor to 1 for invoices

* chore: set default conversion_factor as 1

* chore: remove print statements

(cherry picked from commit 617518389a)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
2022-12-29 05:12:48 +00:00
ruthra kumar
37ae2dfe7f fix: reconciled credit notes being fetched again in Payment Reconciliation tool (#33471)
fix: reconciled cr note showing up as Payments
(cherry picked from commit 5ec11bad4f)
2022-12-29 05:01:57 +00:00
ruthra kumar
5ec11bad4f fix: reconciled credit notes being fetched again in Payment Reconciliation tool (#33471)
fix: reconciled cr note showing up as Payments
2022-12-29 10:31:06 +05:30
ruthra kumar
6e363a62db fix: use base_net_amount in case of missing stock qty (#33457)
(cherry picked from commit e3a0ce5d63)
2022-12-29 04:05:54 +00:00
Deepesh Garg
334219e36a fix: Tax withheld vouchers naming rule (#33467) 2022-12-28 18:05:24 +05:30
Frappe PR Bot
cbda28d739 chore: release v13 (#33453)
* fix: typerror on multi warehouse in Packed Items

DN(with bundled item with varying warehouses)-> Sales Invoice.

(cherry picked from commit e684eb32d0)

* test: type error on bundled products with different warehouses

(cherry picked from commit 5918bb03f7)

* fix: No permission to read doctype

(cherry picked from commit c0da948a4e)

* fix: `shipping_address` in PO

(cherry picked from commit 7e1b6b3c2a)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.json

* chore: conflicts

* chore: linter

* refactor: Customer and Supplier Ledger summary will have hidden fields for better handling of user permission (#33432)

* feat: provision to setup opening balances for earnings and deductions while creating SSA

* fix: use get_all instead of get_value as get_value api dont supports between condition

* fix: patch

* fix: provision to set tax_deducted_till_date after document is subnmmited

* fix: `shipping_address` for non-drop shipping item

(cherry picked from commit 67a7ccf3ce)

* chore: linter (#33455)

fix: linter

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh6790@gmail.com>
2022-12-27 17:49:51 +05:30
Saurabh
79643a5716 chore: linter (#33455)
fix: linter
2022-12-27 17:49:38 +05:30
Sagar Sharma
707eb9e8d5 Merge pull request #33446 from frappe/mergify/bp/version-13-hotfix/pr-33437
fix: `shipping_address` in PO for non-drop ship item (backport #33437)
2022-12-27 10:16:50 +05:30
s-aga-r
19feebbcb6 fix: shipping_address for non-drop shipping item
(cherry picked from commit 67a7ccf3ce)
2022-12-26 15:51:49 +00:00
Nabin Hait
0cf9702a21 Merge pull request #33412 from saurabh6790/provision-to-set-earnings-and-deductions-till-date
feat: provision to setup opening balances for earnings and deductions while creating SSA
2022-12-26 17:26:35 +05:30
Saurabh
64454e0d4e fix: provision to set tax_deducted_till_date after document is subnmmited 2022-12-26 12:48:37 +05:30
Saurabh
7b813d6045 fix: patch 2022-12-26 12:22:34 +05:30
Saurabh
bc04e05b46 fix: use get_all instead of get_value as get_value api dont supports between condition 2022-12-26 12:09:03 +05:30
Saurabh
c3b9059c1b feat: provision to setup opening balances for earnings and deductions while creating SSA 2022-12-26 12:09:03 +05:30
Sagar Sharma
7f1574478b Merge pull request #33436 from frappe/mergify/bp/version-13-hotfix/pr-33434
fix(ux): `shipping_address` in PO (backport #33434)
2022-12-26 11:19:01 +05:30
Sagar Sharma
b634e44fac Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33434 2022-12-26 10:49:48 +05:30
mergify[bot]
3aa335d36a refactor: Customer and Supplier Ledger summary will have hidden fields for better handling of user permission (#33432) 2022-12-26 10:12:35 +05:30
s-aga-r
820e82265b chore: linter 2022-12-25 21:46:58 +05:30
s-aga-r
91dad909ec chore: conflicts 2022-12-25 21:40:49 +05:30
s-aga-r
1068d0ec63 fix: shipping_address in PO
(cherry picked from commit 7e1b6b3c2a)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.json
2022-12-25 14:11:23 +00:00
ruthra kumar
ae3581c7d0 Merge pull request #33416 from frappe/mergify/bp/version-13-hotfix/pr-32219
fix: No permission to read doctype (backport #32219)
2022-12-24 07:34:39 +05:30
ruthra kumar
7a97cc4629 Merge pull request #33413 from frappe/mergify/bp/version-13-hotfix/pr-33410
fix: TypeError on GP Report due to multiple warehouse on bundled items (backport #33410)
2022-12-22 12:06:55 +05:30
Nabin Hait
8e1c0cd234 fix: No permission to read doctype
(cherry picked from commit c0da948a4e)
2022-12-22 04:12:14 +00:00
ruthra kumar
d58719a30a test: type error on bundled products with different warehouses
(cherry picked from commit 5918bb03f7)
2022-12-21 12:58:15 +00:00
ruthra kumar
6a394c5be7 fix: typerror on multi warehouse in Packed Items
DN(with bundled item with varying warehouses)-> Sales Invoice.

(cherry picked from commit e684eb32d0)
2022-12-21 12:58:13 +00:00
Frappe PR Bot
35c71f5923 chore(release): Bumped to Version 13.42.5
## [13.42.5](https://github.com/frappe/erpnext/compare/v13.42.4...v13.42.5) (2022-12-20)

### Bug Fixes

* conflict ([7ef0c6b](7ef0c6bb01))
* conflict in hooks file ([2a18067](2a18067aad))
* conflict in stock_entry ([4587bb3](4587bb3767))
* conflicts ([086e747](086e74791b))
* Consolidated financial report ([7825c56](7825c564eb))
* Cost center filter not working in cash flow report ([684a45f](684a45f234))
* daily scheduler to identify and fix stock transfer entries having incorrect valuation ([b82154c](b82154cb9e))
* disabled items showing in the report 'Itemwise Recommended Reorder Level ([c3fca3c](c3fca3cfcb))
* get_serial_nos not defined ([e5b3748](e5b3748b49))
* get_serial_nos_for_fg() missing 1 required positional argument: 'args' ([eddb7b4](eddb7b429e))
* linter issue ([ab2f250](ab2f250960))
* translation for warning on Overbilling/-receipt/-delivery ([b13ee4f](b13ee4fc8c))
* unsupported operand type(s) for +: 'int' and 'NoneType' ([a6241fc](a6241fc813))
* unsupported operand type(s) for +=: 'int' and 'NoneType' ([b573d97](b573d9739f))
2022-12-20 14:02:06 +00:00
Deepesh Garg
52d4e2acf8 Merge pull request #33403 from frappe/version-13-hotfix
chore: release v13
2022-12-20 19:30:24 +05:30
Deepesh Garg
3691eec66c Merge pull request #33401 from frappe/mergify/bp/version-13-hotfix/pr-33393
fix: Cost center filter not working in cash flow report (backport #33393)
2022-12-20 18:22:46 +05:30
rohitwaghchaure
e93af962a1 Merge pull request #33390 from frappe/mergify/bp/version-13-hotfix/pr-33387
fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation (backport #33387)
2022-12-20 16:59:58 +05:30
rohitwaghchaure
9692eeeb15 Merge pull request #33392 from frappe/mergify/bp/version-13-hotfix/pr-33382
fix: unsupported operand type(s) for +=: 'int' and 'NoneType' (backport #33382)
2022-12-20 16:59:40 +05:30
Deepesh Garg
7825c564eb fix: Consolidated financial report 2022-12-20 16:52:28 +05:30
Deepesh Garg
e5fd95bb21 chore: remove print statement
(cherry picked from commit 068df9f815)
2022-12-20 08:17:21 +00:00
Deepesh Garg
684a45f234 fix: Cost center filter not working in cash flow report
(cherry picked from commit d0dbfec052)
2022-12-20 08:17:20 +00:00
rohitwaghchaure
7ef0c6bb01 fix: conflict 2022-12-20 11:55:22 +05:30
rohitwaghchaure
4587bb3767 fix: conflict in stock_entry 2022-12-20 11:52:33 +05:30
rohitwaghchaure
2a18067aad fix: conflict in hooks file 2022-12-20 11:49:22 +05:30
Rohit Waghchaure
b573d9739f fix: unsupported operand type(s) for +=: 'int' and 'NoneType'
(cherry picked from commit 2b4eae5f84)
2022-12-20 04:19:14 +00:00
Rohit Waghchaure
4dbce87660 test: added test case to validate audit for incorrect entries
(cherry picked from commit f31612376a)

# Conflicts:
#	erpnext/hooks.py
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py
2022-12-20 04:18:19 +00:00
Rohit Waghchaure
b82154cb9e fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation
(cherry picked from commit b1721b79ce)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/stock_entry.py
2022-12-20 04:18:18 +00:00
Deepesh Garg
2105193594 Merge pull request #33367 from ruthra-kumar/using_subquery_for_fetching_dr_cr_notes
perf: using subquery in get_dr_or_cr_notes() to improve performance
2022-12-17 16:41:58 +05:30
Deepesh Garg
ef74c6689b Merge pull request #33360 from frappe/mergify/bp/version-13-hotfix/pr-33355
fix: disabled items showing in the report Itemwise Recommended Reorder Level (backport #33355)
2022-12-16 16:12:29 +05:30
ruthra kumar
799d7b254e refactor: using subquery in get_dr_or_cr_notes to improve performance 2022-12-16 14:06:05 +05:30
rohitwaghchaure
086e74791b fix: conflicts 2022-12-16 11:41:22 +05:30
Rohit Waghchaure
c3fca3cfcb fix: disabled items showing in the report 'Itemwise Recommended Reorder Level
'

(cherry picked from commit ae31ff1c48)

# Conflicts:
#	erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py
2022-12-15 12:39:14 +00:00
rohitwaghchaure
1634448864 Merge pull request #33357 from frappe/mergify/bp/version-13-hotfix/pr-33354
fix: unsupported operand type(s) for +: 'int' and 'NoneType' (backport #33354)
2022-12-15 18:08:33 +05:30
Rohit Waghchaure
a6241fc813 fix: unsupported operand type(s) for +: 'int' and 'NoneType'
(cherry picked from commit 0f28074e5a)
2022-12-15 11:44:56 +00:00
Deepesh Garg
896bac10bc Merge pull request #33343 from frappe/mergify/bp/version-13-hotfix/pr-33323
fix: translatability of warning on overbilling/-receipt/-delivery (backport #33323)
2022-12-15 09:17:19 +05:30
Raffael Meyer
0992ca40b0 chore: resolve merge conflict (2) 2022-12-15 00:13:13 +01:00
Raffael Meyer
10ac8d6e67 chore: resolve merge conflicts 2022-12-15 00:11:35 +01:00
rohitwaghchaure
c8a2f9f857 Merge pull request #33334 from frappe/mergify/bp/version-13-hotfix/pr-33332
fix: get_serial_nos_for_fg() missing 1 required positional argument: … (backport #33332)
2022-12-15 00:55:00 +05:30
barredterra
b13ee4fc8c fix: translation for warning on Overbilling/-receipt/-delivery
(cherry picked from commit 36997d9788)

# Conflicts:
#	erpnext/controllers/status_updater.py
#	erpnext/translations/de.csv
2022-12-14 17:55:29 +00:00
rohitwaghchaure
ab2f250960 fix: linter issue 2022-12-14 23:23:19 +05:30
rohitwaghchaure
e5b3748b49 fix: get_serial_nos not defined 2022-12-14 23:06:38 +05:30
Rohit Waghchaure
eddb7b429e fix: get_serial_nos_for_fg() missing 1 required positional argument: 'args'
(cherry picked from commit 410a58b3de)
2022-12-14 10:38:38 +00:00
Frappe PR Bot
b3a9c1eb2a chore(release): Bumped to Version 13.42.4
## [13.42.4](https://github.com/frappe/erpnext/compare/v13.42.3...v13.42.4) (2022-12-13)

### Bug Fixes

* `Enough Parts to Build` in `BOM Stock Report` ([50b2898](50b2898a2c))
* `Material Request` reference in internal `Sales Order` ([988a327](988a327b58))
* incorrect balance on parent company due to key mismatch ([b17ac52](b17ac522f5))
* order status in `Production Planning Report` ([2880469](2880469706))

### Performance Improvements

* add indexes on payment entry reference (backport [#33288](https://github.com/frappe/erpnext/issues/33288)) ([#33290](https://github.com/frappe/erpnext/issues/33290)) ([45f79ef](45f79ef644))
2022-12-13 12:31:01 +00:00
Ankush Menat
e44646054c Merge pull request #33317 from frappe/version-13-hotfix
chore: release v13
2022-12-13 17:59:05 +05:30
Sagar Sharma
12f11a6976 Merge pull request #33321 from frappe/mergify/bp/version-13-hotfix/pr-33314
fix: `Enough Parts to Build` in `BOM Stock Report` (backport #33314)
2022-12-13 15:58:15 +05:30
s-aga-r
50b2898a2c fix: Enough Parts to Build in BOM Stock Report
(cherry picked from commit 723c64ba73)
2022-12-13 09:50:30 +00:00
ruthra kumar
23830266f2 Merge pull request #33310 from frappe/mergify/bp/version-13-hotfix/pr-33303
fix: incorrect balance on parent company on consolidate Balance sheet due to key mismatch (backport #33303)
2022-12-13 13:56:31 +05:30
ruthra kumar
b17ac522f5 fix: incorrect balance on parent company due to key mismatch
(cherry picked from commit 7b3316dc31)
2022-12-13 03:36:32 +00:00
Sagar Sharma
1b22f53fde Merge pull request #33307 from frappe/mergify/bp/version-13-hotfix/pr-33304
fix: `Material Request` reference in internal `Sales Order` (backport #33304)
2022-12-13 00:01:25 +05:30
s-aga-r
988a327b58 fix: Material Request reference in internal Sales Order
(cherry picked from commit 78b438f6cf)
2022-12-12 18:19:15 +00:00
mergify[bot]
45f79ef644 perf: add indexes on payment entry reference (backport #33288) (#33290)
perf: add indexes on payment entry reference (#33288)

Adds index on:
1. reference doctype
2. reference name

*Why not composite index?*

There are three type of queries on this doctype

- filtering ref_doctype - doctype index helps here
- filtering ref_name - name index helps here
- filtering both - name index helps here too. Since it has sufficiently
  high cardinality. Composite index wont help in case where ref_doctype
  isn't specfied.

[skip ci]

(cherry picked from commit 593626f502)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-12-12 13:02:08 +05:30
Sagar Sharma
bce3506e90 Merge pull request #33257 from frappe/mergify/bp/version-13-hotfix/pr-33255
fix: order status in `Production Planning Report` (backport #33255)
2022-12-08 00:04:53 +05:30
s-aga-r
2880469706 fix: order status in Production Planning Report
(cherry picked from commit 632c08f7e0)
2022-12-07 18:07:23 +00:00
Frappe PR Bot
104967881d chore(release): Bumped to Version 13.42.3
## [13.42.3](https://github.com/frappe/erpnext/compare/v13.42.2...v13.42.3) (2022-12-06)

### Bug Fixes

* add company filter in RFQ Items ([a716f78](a716f780a8))
* key error on p/l and balance sheet reports on foreign currency ([0003e0c](0003e0cb5b))
* key error while filtering on date range and different currency ([84ef814](84ef814f45))
* non empty FG batch picked while completing work order ([635d80d](635d80dc2f))
* remove duplicate schema ([4ad9aa2](4ad9aa29ee))
* replace sql code with fields list in get_cached_value ([b3ccad8](b3ccad8cf4))
2022-12-06 14:37:49 +00:00
Deepesh Garg
b2ef5f7cd2 Merge pull request #33232 from frappe/version-13-hotfix
chore: release v13
2022-12-06 20:06:03 +05:30
Deepesh Garg
cd5b8aeb64 Merge pull request #33234 from frappe/mergify/bp/version-13-hotfix/pr-33191
fix: key error while filtering on date range and reporting on foreign currency (backport #33191)
2022-12-06 17:36:37 +05:30
ruthra kumar
0003e0cb5b fix: key error on p/l and balance sheet reports on foreign currency
(cherry picked from commit a6794c3606)
2022-12-06 16:52:26 +05:30
ruthra kumar
b3ccad8cf4 fix: replace sql code with fields list in get_cached_value
(cherry picked from commit 19db7e2989)
2022-12-06 16:52:22 +05:30
ruthra kumar
84ef814f45 fix: key error while filtering on date range and different currency
(cherry picked from commit 9b8d6fe411)
2022-12-06 10:13:40 +00:00
rohitwaghchaure
ac432ea52f Merge pull request #33226 from frappe/mergify/bp/version-13-hotfix/pr-33224
fix: non empty FG batch picked while completing work order (backport #33224)
2022-12-05 23:58:52 +05:30
Rohit Waghchaure
635d80dc2f fix: non empty FG batch picked while completing work order
(cherry picked from commit 713330cbf6)
2022-12-05 15:00:38 +00:00
Sagar Sharma
0c4de03baa Merge pull request #33176 from frappe/mergify/bp/version-13-hotfix/pr-33174
fix: add company filter in RFQ Items (backport #33174)
2022-11-30 12:25:15 +05:30
s-aga-r
a716f780a8 fix: add company filter in RFQ Items
(cherry picked from commit ca0485a503)
2022-11-30 05:07:27 +00:00
Deepesh Garg
6f6598878e Merge pull request #33173 from frappe/mergify/bp/version-13-hotfix/pr-33115
fix: remove product schema block from additional info section on item template (backport #33115)
2022-11-30 09:46:49 +05:30
ruthra kumar
4ad9aa29ee fix: remove duplicate schema
(cherry picked from commit 2c18a95115)
2022-11-30 03:49:36 +00:00
Frappe PR Bot
e54b23d71b chore(release): Bumped to Version 13.42.2
## [13.42.2](https://github.com/frappe/erpnext/compare/v13.42.1...v13.42.2) (2022-11-29)

### Bug Fixes

* `production_item` filter in `Job Card Summary Report` ([ce54198](ce5419888b))
* `Work Order` filter typo in `Job Card Summary Report` ([2de239c](2de239c73b))
* cannot update auth token until token expiry if credentials change ([2121714](2121714856))
* company name with `,` in `Job Card Summary Report` ([ffef0cb](ffef0cb771))
* company name with `,` in `Work Order Summary Report` ([11978fc](11978fca4e))
* create rounding gl entry for PCV during gle post processing ([7af4597](7af45972ae))
* disbursable amount on currrent security price ([eca2d96](eca2d96419))
* Dispatch address display ([10cfcb5](10cfcb5e8a))
* incorrect balance qty ([78e64fa](78e64fa486))
* linter ([b91860d](b91860ddf2))
* MR Item `description` and `item_name` gets reset on `qty` change ([b66976b](b66976bd36))
* Multicurrency invoice with exchange gain and loss showing up in AR/AP report ([d38a289](d38a2895b0))
* only consider draft pending asset repair docs ([6da7b38](6da7b38f6e))
* only show serial no batch selector only once ([0c6a7ce](0c6a7cef95))
* reset `voucher_type` and `voucher_no` if `based_on` is set to `Item and Warehouse` ([ff59483](ff594831b0))
* validate voucher type while checking journal entry against payroll entry ([07c25ac](07c25ace5c))
2022-11-29 13:19:11 +00:00
Deepesh Garg
ba9220f9d2 Merge pull request #33164 from frappe/version-13-hotfix
chore: release v13
2022-11-29 18:47:36 +05:30
Sagar Sharma
354f258543 Merge pull request #33160 from frappe/mergify/bp/version-13-hotfix/pr-33136
fix: reset `voucher_type` and `voucher_no` if `based_on` is set to `Transaction` (backport #33136)
2022-11-29 13:24:45 +05:30
s-aga-r
f7d3f136c5 chore: make posting_date and posting_time read-only if based_on is set to Transaction
(cherry picked from commit 4e10352b48)
2022-11-29 06:44:57 +00:00
s-aga-r
ff594831b0 fix: reset voucher_type and voucher_no if based_on is set to Item and Warehouse
(cherry picked from commit eeec008547)
2022-11-29 06:44:57 +00:00
rohitwaghchaure
b08d36cb7b Merge pull request #33150 from frappe/mergify/bp/version-13-hotfix/pr-33144
fix: incorrect balance qty (backport #33144)
2022-11-29 12:06:09 +05:30
Sagar Sharma
cdb6a4e3f7 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33144 2022-11-29 11:17:07 +05:30
Deepesh Garg
99188afa16 Merge pull request #33157 from frappe/mergify/bp/version-13-hotfix/pr-33116
fix: only show serial no batch selector only once (backport #33116)
2022-11-29 11:07:09 +05:30
Deepesh Garg
64fda0d4b7 Merge pull request #33028 from saurabh6790/small-fixes
chore: link payroll entry reference in accrual payroll journal entry
2022-11-29 10:53:42 +05:30
Shariq Ansari
0c6a7cef95 fix: only show serial no batch selector only once
(cherry picked from commit 0f87d329d6)
2022-11-29 04:51:41 +00:00
Rohit Waghchaure
c930d64e8d test: test case for serialized batched item
(cherry picked from commit b606a9684b)
2022-11-29 03:19:16 +00:00
Rohit Waghchaure
78e64fa486 fix: incorrect balance qty
(cherry picked from commit b2105a8be7)
2022-11-29 03:19:15 +00:00
Deepesh Garg
2a0d7acc2b Merge pull request #33122 from deepeshgarg007/receivable_payable_multi_currency
fix: Multicurrency invoice with exchange gain and loss showing up in AR/AP report
2022-11-28 22:49:06 +05:30
Sagar Sharma
24a3da55e6 Merge pull request #33124 from frappe/mergify/bp/version-13-hotfix/pr-33120
fix: `Work Order Summary` and `Job Card Summary` Report (backport #33120)
2022-11-27 23:23:06 +05:30
Sagar Sharma
c3289c265a Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33120 2022-11-27 22:11:06 +05:30
s-aga-r
b39f367dbd chore: conflicts 2022-11-27 22:10:10 +05:30
Deepesh Garg
d76e291927 Merge pull request #33114 from frappe/mergify/bp/version-13-hotfix/pr-33111
fix: Loan disbursable amount on current security price (backport #33111)
2022-11-27 20:50:19 +05:30
s-aga-r
ce5419888b fix: production_item filter in Job Card Summary Report
(cherry picked from commit ef7fd670fc)

# Conflicts:
#	erpnext/manufacturing/report/job_card_summary/job_card_summary.py
2022-11-26 16:25:16 +00:00
s-aga-r
ffef0cb771 fix: company name with , in Job Card Summary Report
(cherry picked from commit 481149814e)

# Conflicts:
#	erpnext/manufacturing/report/job_card_summary/job_card_summary.py
2022-11-26 16:25:15 +00:00
s-aga-r
2de239c73b fix: Work Order filter typo in Job Card Summary Report
(cherry picked from commit 2e4f3e9317)
2022-11-26 16:25:14 +00:00
s-aga-r
11978fca4e fix: company name with , in Work Order Summary Report
(cherry picked from commit 87b39f045c)
2022-11-26 16:25:14 +00:00
Deepesh Garg
d38a2895b0 fix: Multicurrency invoice with exchange gain and loss showing up in AR/AP report 2022-11-26 20:21:22 +05:30
Sagar Sharma
4492ee4771 Merge pull request #33109 from frappe/mergify/bp/version-13-hotfix/pr-33090
fix: MR Item `item_name` and `description` gets reset on `qty` change (backport #33090)
2022-11-26 10:07:37 +05:30
Abhinav Raut
eca2d96419 fix: disbursable amount on currrent security price
(cherry picked from commit fe87c27acd)
2022-11-25 09:49:03 +00:00
s-aga-r
b66976bd36 fix: MR Item description and item_name gets reset on qty change
(cherry picked from commit df0fee2312)
2022-11-25 05:50:10 +00:00
Deepesh Garg
776c8c6d6a Merge pull request #33093 from frappe/einv-reset-client-creds
fix: cannot update auth token until token expiry if credentials change
2022-11-24 21:25:46 +05:30
Deepesh Garg
452db7ed15 Merge pull request #33105 from frappe/mergify/bp/version-13-hotfix/pr-33100
fix: Dispatch address display (backport #33100)
2022-11-24 21:22:13 +05:30
Deepesh Garg
10cfcb5e8a fix: Dispatch address display
(cherry picked from commit 104fdcb9f9)
2022-11-24 12:31:40 +00:00
Saqib Ansari
b91860ddf2 fix: linter 2022-11-24 15:26:32 +05:30
Deepesh Garg
eda89a467c Merge pull request #33086 from AnandBaburajan/pending_asset_repair
fix: only consider draft pending asset repair docs
2022-11-24 14:37:36 +05:30
Saqib Ansari
2121714856 fix: cannot update auth token until token expiry if credentials change 2022-11-23 21:33:04 +05:30
Saurabh
8b46da39ea Merge branch 'version-13-hotfix' into small-fixes 2022-11-23 18:16:49 +05:30
anandbaburajan
6da7b38f6e fix: only consider draft pending asset repair docs 2022-11-23 13:05:52 +05:30
Deepesh Garg
7688239fc0 Merge pull request #33084 from frappe/mergify/bp/version-13-hotfix/pr-33062
fix: create rounding gl entry for PCV during gle post processing (backport #33062)
2022-11-23 11:50:14 +05:30
Saurabh
07c25ace5c fix: validate voucher type while checking journal entry against payroll entry 2022-11-23 11:45:50 +05:30
Saurabh
6ae21c92de chore: link payroll entry reference in accrual payroll journal entry 2022-11-23 11:45:50 +05:30
Nabin Hait
7af45972ae fix: create rounding gl entry for PCV during gle post processing
(cherry picked from commit 022d8d5d79)
2022-11-23 05:07:10 +00:00
Frappe PR Bot
f106b9e884 chore(release): Bumped to Version 13.42.1
## [13.42.1](https://github.com/frappe/erpnext/compare/v13.42.0...v13.42.1) (2022-11-22)

### Bug Fixes

* Accounting Dimension filtering for Sales and Purchase Report ([58f3f2b](58f3f2b6d9))
* cast POS query inputs to integers  (backport [#32975](https://github.com/frappe/erpnext/issues/32975)) ([#32978](https://github.com/frappe/erpnext/issues/32978)) ([3aba14f](3aba14f71a))
* GP incorrect buying amount if no upd on SI and Delivery Note ([40bb2cb](40bb2cba93))
* incorrect fix of conversion factor in PP ([726c3d3](726c3d32be))
* linter issue ([72f9308](72f9308df6))
* make `is_internal_supplier` read-only ([30b5d1c](30b5d1c400))
* Opening journal entry templates ([4ad3e28](4ad3e28147))
* **pos:** item selector image border radius ([ab31eb4](ab31eb4ee7))
* **realtime:** Restrict updates to only last modified or current user ([#33034](https://github.com/frappe/erpnext/issues/33034)) ([ecdd849](ecdd8493ea))
* use `list()` on self mutating iteration ([0070b5e](0070b5ef9a))
2022-11-22 16:00:21 +00:00
Deepesh Garg
b839c53572 Merge pull request #33075 from frappe/version-13-hotfix
chore: release v13
2022-11-22 21:28:29 +05:30
ruthra kumar
30b42b22ab Merge pull request #32942 from frappe/mergify/bp/version-13-hotfix/pr-32866
fix: incorrect buying amount on Gross Profit (backport #32866)
2022-11-22 15:59:28 +05:30
ruthra kumar
4834b78ed2 refactor: clean up code in test suite
Remove doctypes that are not in v13
2022-11-22 15:06:46 +05:30
ruthra kumar
72f9308df6 fix: linter issue 2022-11-22 15:06:27 +05:30
Deepesh Garg
dc9b81d216 Merge pull request #33041 from frappe/mergify/bp/version-13-hotfix/pr-33032
fix: Accounting Dimension filtering for Sales and Purchase Report (backport #33032)
2022-11-19 18:53:34 +05:30
Deepesh Garg
61b20c81c2 Merge pull request #33036 from frappe/mergify/bp/version-13-hotfix/pr-33034
fix(realtime): Restrict updates to only last modified or current user (backport #33034)
2022-11-19 18:22:17 +05:30
Deepesh Garg
58f3f2b6d9 fix: Accounting Dimension filtering for Sales and Purchase Report
(cherry picked from commit 8b394afaa9)
2022-11-19 12:50:19 +00:00
rohitwaghchaure
e3435369a0 Merge pull request #33037 from frappe/mergify/bp/version-13-hotfix/pr-32947
fix: incorrect fix of conversion factor in PP (backport #32947)
2022-11-19 11:50:05 +05:30
Rohit Waghchaure
726c3d32be fix: incorrect fix of conversion factor in PP
(cherry picked from commit 490b0e3cdf)
2022-11-18 14:39:27 +00:00
gavin
ecdd8493ea fix(realtime): Restrict updates to only last modified or current user (#33034)
(cherry picked from commit dd2493a541)
2022-11-18 11:49:11 +00:00
Deepesh Garg
431a94b961 Merge pull request #33016 from frappe/mergify/bp/version-13-hotfix/pr-33009
fix(pos): item selector image border radius (backport #33009)
2022-11-18 15:09:17 +05:30
Sagar Sharma
00f990e3f4 Merge pull request #33024 from frappe/mergify/bp/version-13-hotfix/pr-33019
fix: use `list()` on self mutating iteration (backport #33019)
2022-11-18 10:59:54 +05:30
Sabu Siyad
0070b5ef9a fix: use list() on self mutating iteration
https://github.com/frappe/erpnext/issues/30325

Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 546c809cbe)
2022-11-18 04:56:12 +00:00
Sabu Siyad
ab31eb4ee7 fix(pos): item selector image border radius
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 2f4940cc26)
2022-11-17 12:02:46 +00:00
mergify[bot]
357ae939d1 refactor: search queries (backport #33004) (#33008)
* refactor: search queries (#33004)

- guard clauses for readability
- use values or format

(cherry picked from commit 34e4903ed7)

# Conflicts:
#	erpnext/stock/doctype/material_request/material_request.py
#	erpnext/stock/doctype/quality_inspection/quality_inspection.py

* chore: conflicts

[skip ci]

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-17 14:24:45 +05:30
Sagar Sharma
b8aa63b5e2 Merge pull request #33011 from frappe/mergify/bp/version-13-hotfix/pr-33006
fix: make `is_internal_supplier` read-only in PO (backport #33006)
2022-11-17 14:23:28 +05:30
s-aga-r
9191c54b90 chore: conflicts 2022-11-17 14:19:01 +05:30
s-aga-r
30b5d1c400 fix: make is_internal_supplier read-only
(cherry picked from commit 5efbc2cbf8)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.json
2022-11-17 08:41:11 +00:00
Ankush Menat
9d5c4ffadf chore: hardcode doctype 2022-11-17 12:03:02 +05:30
Deepesh Garg
85d8540379 Merge pull request #32995 from frappe/mergify/bp/version-13-hotfix/pr-32983
fix: Opening journal entry templates (backport #32983)
2022-11-17 11:15:52 +05:30
Deepesh Garg
4ad3e28147 fix: Opening journal entry templates
(cherry picked from commit 33b61aef5a)
2022-11-16 15:12:34 +00:00
Deepesh Garg
ec6a01de4c Merge pull request #32991 from frappe/mergify/bp/version-13-hotfix/pr-32989
ci: fix flake8 URL (backport #32989)
2022-11-16 17:05:25 +05:30
Deepesh Garg
7831744064 ci: fix flake8 URL
(cherry picked from commit e81bec5fc9)
2022-11-16 10:56:43 +00:00
mergify[bot]
3aba14f71a fix: cast POS query inputs to integers (backport #32975) (#32978)
* fix: cast POS query inputs to integers  (#32975)

fix: cast POS query inputs to integers
(cherry picked from commit c013db6ea1)

# Conflicts:
#	erpnext/selling/page/point_of_sale/point_of_sale.py

* chore: conflicts

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-15 18:50:32 +05:30
Frappe PR Bot
f3f6d35a84 chore(release): Bumped to Version 13.42.0
# [13.42.0](https://github.com/frappe/erpnext/compare/v13.41.1...v13.42.0) (2022-11-15)

### Bug Fixes

* add Document Date in E-Invoice print format ([a16347f](a16347f325))
* ambiguous 'cost_center' on payment reconciliation ([e9e5ded](e9e5ded36b))
* check type for reference name ([ad648f3](ad648f313c))
* don't set WIP Warehouse if  is checked in WO ([4a17711](4a177113c6))
* Label for applicable dimension table ([cbc8b2d](cbc8b2da0a))
* Pricing rule item group consider UOM ([1ed0b6e](1ed0b6e89b)), closes [#32566](https://github.com/frappe/erpnext/issues/32566)
* query condition change ([88ce59a](88ce59a1ca))
* repayment schedule regeneration ([a19031c](a19031cf9a))
* set `WIP Warehouse` in Job Card ([f09e427](f09e4273d9))
* set stock UOM in args to ensure item price is fetched ([bd2242b](bd2242b285))
* wrong totals in hsn summary report ([79d508f](79d508f4ff))

### Features

* page break in SoA pdf ([e93ac3c](e93ac3c9a8))
2022-11-15 13:02:04 +00:00
Deepesh Garg
1cf5b23d9c Merge pull request #32973 from frappe/version-13-hotfix
chore: release v13
2022-11-15 18:17:49 +05:30
Deepesh Garg
de3453e477 Merge pull request #32934 from rtdany10/hsn-summary-report
fix: wrong hsn summary totals
2022-11-15 16:33:46 +05:30
Deepesh Garg
ee015273c9 Merge pull request #32953 from gavindsouza/rm-dead-validation-pe
chore(payment_entry): Remove dead validations
2022-11-15 13:56:38 +05:30
Deepesh Garg
db3f8d2768 Merge pull request #32961 from frappe/mergify/bp/version-13-hotfix/pr-32956
fix: Label for applicable dimension table (backport #32956)
2022-11-15 13:01:34 +05:30
Gavin D'souza
e1ecc9a819 chore(payment_entry): Remove dead validations 2022-11-15 10:43:47 +05:30
Deepesh Garg
9e340a8307 Merge branch 'version-13-hotfix' into hsn-summary-report 2022-11-15 09:26:00 +05:30
Deepesh Garg
cbc8b2da0a fix: Label for applicable dimension table
(cherry picked from commit 8c13f70fc5)
2022-11-15 03:56:00 +00:00
ruthra kumar
b7ff5fb426 Merge pull request #32930 from ruthra-kumar/ambiguous_cost_center_field
fix: ambiguous 'cost_center' while using payment reconciliation
2022-11-14 16:56:36 +05:30
Sagar Sharma
2b2a4f66ad Merge pull request #32949 from frappe/mergify/bp/version-13-hotfix/pr-32937
refactor: rewrite `job_card.py` queries in QB (backport #32937)
2022-11-14 12:22:59 +05:30
s-aga-r
78ca078474 refactor: rewrite job_card.py queries in QB
(cherry picked from commit 7df2921d38)
2022-11-14 05:57:03 +00:00
Deepesh Garg
65c9941aa4 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32866 2022-11-14 10:45:09 +05:30
Deepesh Garg
5e46567a0b Merge pull request #32940 from deepeshgarg007/psa_pdf_issue_v13
feat: page break in SoA pdf
2022-11-14 10:44:56 +05:30
Deepesh Garg
079cf6899e Merge pull request #32943 from frappe/mergify/bp/version-13-hotfix/pr-32938
chore: Remove raw SQL query (backport #32938)
2022-11-14 10:44:24 +05:30
Sagar Vora
ad648f313c fix: check type for reference name
(cherry picked from commit b06345af46)
2022-11-13 15:11:50 +00:00
Deepesh Garg
9c9c6607f8 chore: Remove qb doc reference
(cherry picked from commit 4b9921782b)
2022-11-13 15:11:49 +00:00
Deepesh Garg
d6901e51ad chore: Remove raw SQL query
(cherry picked from commit 42a59d5c17)
2022-11-13 15:11:48 +00:00
Deepesh Garg
8733ce5ca9 Merge branch 'version-13-hotfix' into psa_pdf_issue_v13 2022-11-13 20:41:38 +05:30
Deepesh Garg
1ee5c2ff87 chore: Resolve conflicts 2022-11-13 19:49:07 +05:30
ruthra kumar
09ef8eeaea test: buying amount of invoices
1. Invoice with unset `update_stock`, with and without Delivery Notes

(cherry picked from commit 2c8b0b17a7)
2022-11-13 13:46:48 +00:00
ruthra kumar
40bb2cba93 fix: GP incorrect buying amount if no upd on SI and Delivery Note
(cherry picked from commit e4d16c31da)

# Conflicts:
#	erpnext/accounts/report/gross_profit/gross_profit.py
2022-11-13 13:46:47 +00:00
Dany Robert
95f81d3563 chore: remove commented line 2022-11-13 18:53:10 +05:30
Dany Robert
88ce59a1ca fix: query condition change 2022-11-13 18:52:57 +05:30
Dany Robert
e93ac3c9a8 feat: page break in SoA pdf 2022-11-13 18:52:44 +05:30
Sagar Sharma
079fc2dc34 Merge pull request #32936 from frappe/mergify/bp/version-13-hotfix/pr-32913
fix: set stock UOM in args to ensure item price is fetched (backport #32913)
2022-11-12 12:46:54 +05:30
Sagar Vora
bd2242b285 fix: set stock UOM in args to ensure item price is fetched
(cherry picked from commit 57038c3969)
2022-11-12 04:39:52 +00:00
Dany Robert
79d508f4ff fix: wrong totals in hsn summary report 2022-11-12 05:22:31 +01:00
Deepesh Garg
a0cab4c5e7 Merge pull request #32931 from frappe/mergify/bp/version-13-hotfix/pr-32878
fix: repayment schedule regeneration (backport #32878)
2022-11-11 15:15:32 +05:30
Abhinav Raut
a19031cf9a fix: repayment schedule regeneration
(cherry picked from commit d6ab2b3b87)
2022-11-11 08:53:31 +00:00
ruthra kumar
e9e5ded36b fix: ambiguous 'cost_center' on payment reconciliation 2022-11-11 10:14:04 +05:30
Sagar Sharma
fcb6ee22ba Merge pull request #32920 from frappe/mergify/bp/version-13-hotfix/pr-32918
fix: WO Skip Material Transfer to WIP Warehouse (backport #32918)
2022-11-10 18:42:25 +05:30
Sagar Sharma
f09e4273d9 fix: set WIP Warehouse in Job Card
(cherry picked from commit e7fa2e08ad)
2022-11-10 11:43:23 +00:00
Sagar Sharma
4a177113c6 fix: don't set WIP Warehouse if is checked in WO
(cherry picked from commit 9730cd0aec)
2022-11-10 11:43:22 +00:00
Deepesh Garg
972893d00e Merge pull request #32908 from maharshivpatel/item-group-pricing-rule-backport
fix: Pricing rule item group consider UOM
2022-11-10 09:58:50 +05:30
Maharshi Patel
1ed0b6e89b fix: Pricing rule item group consider UOM
Pricing rule's apply_on_field == "item_group" didn't check for UOM. I have added the required checks.

Same as #32566
2022-11-09 17:17:35 +05:30
Deepesh Garg
dafb575500 Merge pull request #32894 from maharshivpatel/add-einvoice-document-date
fix: add Document Date in E-Invoice print format
2022-11-08 21:45:17 +05:30
Frappe PR Bot
9cf5e9e61e chore(release): Bumped to Version 13.41.1
## [13.41.1](https://github.com/frappe/erpnext/compare/v13.41.0...v13.41.1) (2022-11-08)

### Bug Fixes

* `Material Consumption` option in case of `Skip Transfer to WIP` in WO ([418c131](418c131331))
* Create POS Opening Entry POS Profile filter. ([76e4bb4](76e4bb44f1))
* Disable tax included prices for internal transfers ([#32794](https://github.com/frappe/erpnext/issues/32794)) ([84ee1b8](84ee1b86af))
* for asset's purchase_date, if bill_date is set, use that instead of posting_date ([1d23c9a](1d23c9a9fd))
* Reset advance paid amount on Oreder cancel and amend ([e32e0bc](e32e0bc8fa))
* use `flt` instead of `cint` in `get_batch_no` ([601b1e3](601b1e3821))
2022-11-08 12:14:53 +00:00
Deepesh Garg
af8b99a5e0 Merge pull request #32892 from frappe/version-13-hotfix
chore: release v13
2022-11-08 17:43:28 +05:30
Maharshi Patel
a16347f325 fix: add Document Date in E-Invoice print format 2022-11-08 16:35:34 +05:30
Deepesh Garg
19b9875ba8 Merge pull request #32781 from frappe/mergify/bp/version-13-hotfix/pr-32777
fix: Reset advance paid amount on Order cancel and amend (backport #32777)
2022-11-08 10:53:02 +05:30
Deepesh Garg
43aa670e90 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into mergify/bp/version-13-hotfix/pr-32777 2022-11-08 10:40:07 +05:30
Deepesh Garg
4f76ed1c68 chore: Resolve conflicts 2022-11-08 10:39:21 +05:30
Deepesh Garg
b93d13feef Merge pull request #32865 from frappe/mergify/bp/version-13-hotfix/pr-32846
fix: add german translations (backport #32846)
2022-11-07 18:42:38 +05:30
Raffael Meyer
e1a32cc620 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32846 2022-11-07 13:18:06 +01:00
barredterra
550f5f280c chore: resolve merge conflicts 2022-11-07 13:15:38 +01:00
Deepesh Garg
fbbfeb8563 Merge pull request #32873 from frappe/mergify/bp/version-13-hotfix/pr-32802
fix: `Material Consumption` option in case of `Skip Transfer to WIP` in WO (backport #32802)
2022-11-07 10:18:14 +05:30
Sagar Sharma
418c131331 fix: Material Consumption option in case of Skip Transfer to WIP in WO
(cherry picked from commit 8ea6983734)
2022-11-07 04:06:55 +00:00
Raffael Meyer
a8bf17e560 chore: add german translations (#32846)
Mostly for balance sheet

(cherry picked from commit d2b6490bca)

# Conflicts:
#	erpnext/translations/de.csv
2022-11-06 04:53:43 +00:00
Deepesh Garg
9961037f71 Merge pull request #32860 from frappe/mergify/bp/version-13-hotfix/pr-32794
fix: Disable tax included prices for internal transfers (backport #32794)
2022-11-05 21:17:09 +05:30
Deepesh Garg
84ee1b86af fix: Disable tax included prices for internal transfers (#32794)
* fix: Disable tax-included prices for internal transfers

(cherry picked from commit 8d30ebb12b)
2022-11-05 15:22:30 +00:00
Deepesh Garg
afe86d83aa Merge pull request #32857 from frappe/mergify/bp/version-13-hotfix/pr-32847
fix: Create POS Opening Entry POS Profile filter. (backport #32847)
2022-11-05 20:52:12 +05:30
Maharshi Patel
76e4bb44f1 fix: Create POS Opening Entry POS Profile filter.
pos_profile_query was variable instead of function.

(cherry picked from commit 1328a45f2a)
2022-11-05 11:15:58 +00:00
Deepesh Garg
c1bc1040b8 Merge pull request #32834 from frappe/mergify/bp/version-13-hotfix/pr-32773
fix: for asset's purchase_date, if bill_date is set, use that instead of posting_date (backport #32773)
2022-11-03 12:06:50 +05:30
anandbaburajan
1d23c9a9fd fix: for asset's purchase_date, if bill_date is set, use that instead of posting_date
(cherry picked from commit f322c608cf)
2022-11-03 06:28:37 +00:00
Sagar Sharma
5a211813d3 Merge pull request #32821 from frappe/mergify/bp/version-13-hotfix/pr-32788
fix: use `flt` instead of `cint` in `get_batch_no` (backport #32788)
2022-11-02 17:08:08 +05:30
Sagar Sharma
601b1e3821 fix: use flt instead of cint in get_batch_no
(cherry picked from commit 9fb3fb4c83)
2022-11-02 10:25:54 +00:00
Frappe PR Bot
6d1ae68d70 chore(release): Bumped to Version 13.41.0
# [13.41.0](https://github.com/frappe/erpnext/compare/v13.40.3...v13.41.0) (2022-11-01)

### Bug Fixes

* add `Sales Order` reference in Material Request Dashboard ([cb89dba](cb89dba5ab))
* Do not force eligibilgity of itc for reverse charge ([9dc0edf](9dc0edfb8a))
* filter return pos in reconciliation tool ([b877b0d](b877b0d3a2))
* group warehouse filter not working for Batch-wise Balance history report ([310e7c5](310e7c522c))
* Issues while cancel/amending Purchase Invoice with TDS enabled ([8888957](8888957952))
* Mode of payment for returns in POS Sales Invoice ([9b63a1a](9b63a1a2e9))

### Features

* Repayment schedule types for term loans ([c2817be](c2817bed0b))
2022-11-01 17:19:09 +00:00
Deepesh Garg
19ebebdc47 Merge pull request #32792 from frappe/version-13-hotfix
chore: release v13
2022-11-01 22:46:15 +05:30
Deepesh Garg
a91483899b Merge pull request #32806 from frappe/mergify/bp/version-13-hotfix/pr-32779
fix: Mode of payment for returns in POS Sales Invoice (backport #32779)
2022-11-01 22:11:50 +05:30
Deepesh Garg
2f6d55d8d2 Merge pull request #32803 from frappe/mergify/bp/version-13-hotfix/pr-32801
fix: Issues while cancel/amending Purchase Invoice with TDS enabled (backport #32801)
2022-11-01 22:11:26 +05:30
Deepesh Garg
4a10454d89 chore: Resolve conflicts 2022-11-01 21:30:36 +05:30
Deepesh Garg
12b15347bc chore: Update tests
(cherry picked from commit 5b74161195)
2022-11-01 15:59:54 +00:00
Deepesh Garg
9b63a1a2e9 fix: Mode of payment for returns in POS Sales Invoice
(cherry picked from commit 06e8e28531)
2022-11-01 15:59:53 +00:00
Deepesh Garg
8888957952 fix: Issues while cancel/amending Purchase Invoice with TDS enabled
(cherry picked from commit f7c9258770)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
2022-11-01 15:18:48 +00:00
ruthra kumar
a9660bf026 Merge pull request #32798 from ruthra-kumar/better_approach_to_list_item_removal
fix: filter return pos in reconciliation tool
2022-11-01 17:28:01 +05:30
ruthra kumar
b877b0d3a2 fix: filter return pos in reconciliation tool 2022-11-01 16:56:35 +05:30
Deepesh Garg
e4082093b8 Merge pull request #32796 from deepeshgarg007/itc_eligibility_reverse_charge
fix: Do not force eligibilgity of itc for reverse charge
2022-11-01 16:32:39 +05:30
Deepesh Garg
9dc0edfb8a fix: Do not force eligibilgity of itc for reverse charge 2022-11-01 16:03:32 +05:30
rohitwaghchaure
e13f05ce19 Merge pull request #32784 from rohitwaghchaure/fixed-warehouse-group-for-batch
fix: group warehouse filter not working for Batch-wise Balance history report
2022-10-31 23:34:00 +05:30
Rohit Waghchaure
310e7c522c fix: group warehouse filter not working for Batch-wise Balance history report 2022-10-31 23:21:29 +05:30
Deepesh Garg
e32e0bc8fa fix: Reset advance paid amount on Oreder cancel and amend
(cherry picked from commit 92f37ca111)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.js
2022-10-31 16:09:48 +00:00
Deepesh Garg
0c24ba0118 Merge pull request #32690 from frappe/mergify/bp/version-13-hotfix/pr-32424
feat: Repayment schedule types for term loans (backport #32424)
2022-10-31 11:57:57 +05:30
Deepesh Garg
60fa87751a chore: Update payroll loan tests 2022-10-31 11:28:32 +05:30
Deepesh Garg
50bc7785f7 chore: reload doctypes 2022-10-31 10:39:03 +05:30
Deepesh Garg
d2aea0cd2e chore: fix datetime value 2022-10-30 11:01:41 +05:30
Deepesh Garg
e9006582fb chore: Add removed field 2022-10-30 10:48:37 +05:30
Deepesh Garg
3483e0e2a5 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into mergify/bp/version-13-hotfix/pr-32424 2022-10-30 10:46:21 +05:30
Deepesh Garg
65b047c94c chore: Resync Loan Doc 2022-10-30 10:44:15 +05:30
Sagar Sharma
ada3ce21c0 Merge pull request #32757 from frappe/mergify/bp/version-13-hotfix/pr-32754
fix: add `Sales Order` reference in Material Request Dashboard (backport #32754)
2022-10-29 13:52:28 +05:30
Sagar Sharma
cb89dba5ab fix: add Sales Order reference in Material Request Dashboard
(cherry picked from commit 15ebf4a0cf)
2022-10-29 07:07:45 +00:00
Deepesh Garg
d73237e896 chore: Resolve conflicts 2022-10-29 11:06:53 +05:30
Sagar Sharma
8e0d393cd4 Merge pull request #32741 from frappe/mergify/bp/version-13-hotfix/pr-32738
fix: Added Material Request Reference in Purchase Recipt Dashboard for Tracking (backport #32738)
2022-10-28 16:06:35 +05:30
Vishal
292ff1bd6b chore: minor linting issue fixed
(cherry picked from commit e8c0157017)
2022-10-28 08:55:07 +00:00
Vishal
804cf40f69 chore: Added Material Request Reference in Purchase Recipt Dashboard for Tracking
(cherry picked from commit a04c44fe34)
2022-10-28 08:55:06 +00:00
Frappe PR Bot
1d31ab1ab7 chore(release): Bumped to Version 13.40.3
## [13.40.3](https://github.com/frappe/erpnext/compare/v13.40.2...v13.40.3) (2022-10-26)

### Bug Fixes

* allow to create Sales Order from expired Quotation ([#32641](https://github.com/frappe/erpnext/issues/32641)) ([ea03289](ea032893d3))
* Billing Address for inter-company purchase docs ([3a2f08f](3a2f08fbda))
* BOM cost update message ([98bcb72](98bcb7255d))
* conflicts ([447485a](447485ae90))
* incorrect qty in material request ([1741501](1741501ea8))
* overlap error not raised for job card in case of workstation with production capacity ([b5376ce](b5376ce5cb))
* unset contact details ([7afb19f](7afb19f965))
2022-10-26 05:09:20 +00:00
Deepesh Garg
dd493fb46f Merge pull request #32706 from frappe/version-13-hotfix
chore: release v13
2022-10-26 10:37:31 +05:30
Deepesh Garg
85f48dd6bd chore: Update tests
(cherry picked from commit e59b147a62)
2022-10-23 14:09:20 +00:00
Deepesh Garg
fa0a137a38 chore: Add repayment date on option
(cherry picked from commit ef0cb17faf)
2022-10-23 14:09:19 +00:00
Deepesh Garg
5fc8d20e96 chore: label post save
(cherry picked from commit bf7a51791a)
2022-10-23 14:09:18 +00:00
Deepesh Garg
7ddcfc00fc chore: Add patch to update repayment schedule type in loan documents
(cherry picked from commit 679b5ed551)

# Conflicts:
#	erpnext/patches.txt
2022-10-23 14:09:17 +00:00
Deepesh Garg
3f02059085 chore: Update labels as per repayment type
(cherry picked from commit 2ddee50f27)

# Conflicts:
#	erpnext/loan_management/doctype/loan/loan.json
2022-10-23 14:09:14 +00:00
Deepesh Garg
71b21086b1 chore: Remove print statements
(cherry picked from commit 3466461eb3)
2022-10-23 14:09:13 +00:00
Deepesh Garg
c2817bed0b feat: Repayment schedule types for term loans
(cherry picked from commit 76c6ccab5d)

# Conflicts:
#	erpnext/loan_management/doctype/loan/loan.json
#	erpnext/loan_management/doctype/loan/loan.py
2022-10-23 14:09:12 +00:00
Deepesh Garg
dc972718d5 Merge pull request #32687 from frappe/mergify/bp/version-13-hotfix/pr-32650
fix: unset contact details (backport #32650)
2022-10-23 18:32:15 +05:30
barredterra
7afb19f965 fix: unset contact details
(cherry picked from commit 23f0bb45b0)
2022-10-23 12:52:29 +00:00
Deepesh Garg
0ca137808b Merge pull request #32656 from frappe/mergify/bp/version-13-hotfix/pr-32641
fix: allow to create Sales Order from expired Quotation (backport #32641)
2022-10-20 17:34:31 +05:30
rohitwaghchaure
99e0106193 Merge pull request #32670 from frappe/mergify/bp/version-13-hotfix/pr-32667
fix: BOM cost update message (backport #32667)
2022-10-20 16:52:56 +05:30
rohitwaghchaure
447485ae90 fix: conflicts 2022-10-20 15:01:22 +05:30
Rohit Waghchaure
98bcb7255d fix: BOM cost update message
(cherry picked from commit 9cfe527492)

# Conflicts:
#	erpnext/manufacturing/doctype/bom/test_bom.py
2022-10-20 09:09:02 +00:00
Deepesh Garg
2df24ec459 Merge pull request #32664 from frappe/mergify/bp/version-13-hotfix/pr-32659
fix: Billing Address for inter-company purchase docs (backport #32659)
2022-10-20 12:42:38 +05:30
Deepesh Garg
3a2f08fbda fix: Billing Address for inter-company purchase docs
(cherry picked from commit 796f2d3c09)
2022-10-20 06:29:56 +00:00
rohitwaghchaure
7c9b535514 Merge pull request #32661 from frappe/mergify/bp/version-13-hotfix/pr-32654
fix: incorrect qty in material request created from PP (backport #32654)
2022-10-20 10:27:41 +05:30
Rohit Waghchaure
4f0c2909ab test: validate qty and purchase uom in material request which is created from PP
(cherry picked from commit 4d5ef721f7)
2022-10-20 04:30:29 +00:00
Rohit Waghchaure
1741501ea8 fix: incorrect qty in material request
(cherry picked from commit ad278b2007)
2022-10-20 04:30:28 +00:00
Raffael Meyer
ea032893d3 fix: allow to create Sales Order from expired Quotation (#32641)
(cherry picked from commit 4ad3002861)
2022-10-19 16:38:19 +00:00
rohitwaghchaure
7601a016b8 Merge pull request #32653 from frappe/mergify/bp/version-13-hotfix/pr-32645
fix: overlap error not raised for job card in case of workstation with production capacity (backport #32645)
2022-10-19 18:09:44 +05:30
Rohit Waghchaure
b5376ce5cb fix: overlap error not raised for job card in case of workstation with production capacity
(cherry picked from commit 8b2165e0d1)
2022-10-19 11:35:59 +00:00
Frappe PR Bot
7ba029b140 chore(release): Bumped to Version 13.40.2
## [13.40.2](https://github.com/frappe/erpnext/compare/v13.40.1...v13.40.2) (2022-10-19)

### Bug Fixes

* `Brand Defaults` filters ([b1c70af](b1c70af4db))
* don't try to update youtube data if disabled in settings (backport [#32588](https://github.com/frappe/erpnext/issues/32588)) ([#32590](https://github.com/frappe/erpnext/issues/32590)) ([7e7122b](7e7122b668))
* Ignore linked purchase invoice on cancel ([eec770a](eec770a4a8))
* Party account for multi-order invoices ([0ae2a4f](0ae2a4f1c4))
* pricing rule item code UOM apply & conversions (backport [#32566](https://github.com/frappe/erpnext/issues/32566)) ([#32636](https://github.com/frappe/erpnext/issues/32636)) ([b8d97b8](b8d97b82b8))
2022-10-19 03:57:46 +00:00
Deepesh Garg
cf74d24400 Merge pull request #32634 from frappe/version-13-hotfix
chore: release v13
2022-10-19 09:24:40 +05:30
mergify[bot]
b8d97b82b8 fix: pricing rule item code UOM apply & conversions (backport #32566) (#32636)
* fix: pricing rule for non stock UOM and conversions

* fix: pricing rule for non stock UOM and conversions

(cherry picked from commit 96b4211ea1)

# Conflicts:
#	erpnext/accounts/doctype/pricing_rule/pricing_rule.py

* chore: resolve conflicts

Co-authored-by: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-10-18 23:31:31 +05:30
Deepesh Garg
56c4c3186b Merge pull request #32624 from frappe/mergify/bp/version-13-hotfix/pr-32622
fix: Ignore linked purchase invoice on cancel (backport #32622)
2022-10-18 14:49:36 +05:30
Deepesh Garg
015a221d8d chore: Resolve conflicts 2022-10-18 09:11:58 +05:30
Deepesh Garg
eec770a4a8 fix: Ignore linked purchase invoice on cancel
(cherry picked from commit faadf78332)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
2022-10-17 14:09:12 +00:00
Deepesh Garg
44f5ccc9dc Merge pull request #32605 from frappe/mergify/bp/version-13-hotfix/pr-32594
fix: Party account for multi-order invoices (backport #32594)
2022-10-15 18:25:25 +05:30
Deepesh Garg
0ae2a4f1c4 fix: Party account for multi-order invoices
(cherry picked from commit fd49503ba2)
2022-10-15 11:29:21 +00:00
mergify[bot]
5fdaddad86 chore: drop dead code (backport #32595) (#32597)
chore: drop dead code (#32595)

[skip ci]

(cherry picked from commit 50e9698932)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-13 15:27:09 +05:30
Sagar Sharma
03ccddc1cc Merge pull request #32587 from frappe/mergify/bp/version-13-hotfix/pr-32576
fix: `Brand Defaults` filters (backport #32576)
2022-10-13 14:42:29 +05:30
Sagar Sharma
e00ebcd9e5 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32576 2022-10-13 14:38:26 +05:30
mergify[bot]
7e7122b668 fix: don't try to update youtube data if disabled in settings (backport #32588) (#32590)
* fix: don't try to update youtube data if disabled in settings (#32588)

fix: cast value from db

[skip ci]

(cherry picked from commit e543dca6a0)

* chore: qualified path

not imported 

[skip ci]

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-13 11:57:08 +05:30
Sagar Sharma
b1c70af4db fix: Brand Defaults filters
(cherry picked from commit 7da32c7db3)
2022-10-12 13:53:56 +00:00
Frappe PR Bot
1609129e1e chore(release): Bumped to Version 13.40.1
## [13.40.1](https://github.com/frappe/erpnext/compare/v13.40.0...v13.40.1) (2022-10-12)

### Bug Fixes

* conflct in test purchase receipt ([6ae2f90](6ae2f90683))
* conflict ([cb7aef5](cb7aef505d))
* consider outgoingrate while valuation rate calculate ([6f43133](6f43133c04))
* consider sales rate as incoming rate for transit warehouse in purchase flow ([f72602e](f72602ebf3))
* Hanlde rounding loss for internal transfer ([dd26ef9](dd26ef96e0))
* Incoming rate precision fixes for intra company transfer ([227ce5f](227ce5f8a2))
* incorrect import ([8238b89](8238b89907))
* linter issue ([aa0552d](aa0552d788))
* test case ([acd64ba](acd64ba7c1))
* value error on pos submit ([4383980](4383980bcc))
2022-10-12 12:34:41 +00:00
Deepesh Garg
9b02455c09 Merge pull request #32585 from frappe/version-13-hotfix
chore: version 13 release
2022-10-12 18:03:01 +05:30
Deepesh Garg
ff3bfb060a Merge pull request #32584 from frappe/mergify/bp/version-13-hotfix/pr-32557
fix: Value error on validation of POS invoices with Serial Nos (backport #32557)
2022-10-12 17:17:01 +05:30
rohitwaghchaure
63e087d31e Merge pull request #32580 from frappe/mergify/bp/version-13-hotfix/pr-32563
fix: consider sales rate as incoming rate for transit warehouse in purchase flow (backport #32563)
2022-10-12 17:08:33 +05:30
Deepesh Garg
b62a397397 Merge pull request #32581 from frappe/mergify/bp/version-13-hotfix/pr-32272
fix: Incoming rate precision fixes for intra company transfer (backport #32272)
2022-10-12 17:04:52 +05:30
ruthra kumar
48efcc82b6 test: value error on serial no validation on pos
(cherry picked from commit 9e2bd10d03)
2022-10-12 11:12:09 +00:00
ruthra kumar
4383980bcc fix: value error on pos submit
(cherry picked from commit 4b908ebcd6)
2022-10-12 11:12:08 +00:00
rohitwaghchaure
aa0552d788 fix: linter issue 2022-10-12 16:33:53 +05:30
Deepesh Garg
3b5889ef85 chore: resolve conflicts 2022-10-12 16:30:23 +05:30
rohitwaghchaure
8238b89907 fix: incorrect import 2022-10-12 16:28:31 +05:30
rohitwaghchaure
6ae2f90683 fix: conflct in test purchase receipt 2022-10-12 16:26:52 +05:30
rohitwaghchaure
cb7aef505d fix: conflict 2022-10-12 16:24:50 +05:30
Deepesh Garg
4a8c42d62b chore: check only for inter-company transfers
(cherry picked from commit 9aa5e20ef7)
2022-10-12 10:54:15 +00:00
Deepesh Garg
c67bdcf3c6 chore: fix precision condition
(cherry picked from commit 49601558c6)
2022-10-12 10:54:14 +00:00
Deepesh Garg
7a9e7b66ac chore: Use proper accounts
(cherry picked from commit 1c05c004cd)
2022-10-12 10:54:13 +00:00
Deepesh Garg
151b9d4d7b chore: Increase precision for other doc fields
(cherry picked from commit c8d2181498)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
#	erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
2022-10-12 10:54:13 +00:00
Deepesh Garg
b966f10711 chore: GL Entries for SLE diff
(cherry picked from commit df2a0e265b)
2022-10-12 10:54:11 +00:00
Deepesh Garg
0b48f13873 test: Internal tranfer precision loss test
(cherry picked from commit dc20b21fb5)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2022-10-12 10:54:10 +00:00
Deepesh Garg
b531a38efe chore: Increase incoming_rate field precision to 6
(cherry picked from commit b31c3bd35d)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
2022-10-12 10:54:08 +00:00
Deepesh Garg
dd26ef96e0 fix: Hanlde rounding loss for internal transfer
(cherry picked from commit 6e47fd54a0)
2022-10-12 10:54:07 +00:00
Deepesh Garg
227ce5f8a2 fix: Incoming rate precision fixes for intra company transfer
(cherry picked from commit 083309c056)
2022-10-12 10:54:06 +00:00
Rohit Waghchaure
acd64ba7c1 fix: test case
(cherry picked from commit 98bf8e1304)
2022-10-12 10:51:22 +00:00
Rohit Waghchaure
6f43133c04 fix: consider outgoingrate while valuation rate calculate
(cherry picked from commit 3266e54e33)
2022-10-12 10:51:22 +00:00
Rohit Waghchaure
f72602ebf3 fix: consider sales rate as incoming rate for transit warehouse in purchase flow
(cherry picked from commit 683a47f7a1)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
#	erpnext/stock/stock_ledger.py
2022-10-12 10:51:21 +00:00
Frappe PR Bot
49c9c68e14 chore(release): Bumped to Version 13.40.0
# [13.40.0](https://github.com/frappe/erpnext/compare/v13.39.5...v13.40.0) (2022-10-12)

### Bug Fixes

* Do not add tax withheld vouchers post tax withheding in one document ([e1c41b9](e1c41b9195))
* future attendance marking ([cb4fbd5](cb4fbd5432))
* make readings status mandatory in Quality Inspection ([257a2a3](257a2a3d71))
* mark attendance issue with joining date ([6f8d620](6f8d62088e))
* mark attendance issue with relieving date ([a9546dd](a9546dd01f))
* PO cancel post advance payment cancel against PO ([41599cf](41599cf29f))
* set Quality Inspection status based on readings status ([d67b44f](d67b44fcec))
* Tax withholding related fixes ([32a9575](32a9575f07))
* **test:** `test_rejected_qi_validation` ([2763d06](2763d06307))
* TooManyWritesError during reposting of stock ([476175b](476175b307))

### Features

* cst ux improvement ([552c595](552c5951bd))
* **JE:** trigger account field when fetched from template ([baa4fec](baa4fec611)), closes [#32409](https://github.com/frappe/erpnext/issues/32409)
2022-10-12 07:21:47 +00:00
Ankush Menat
9ce765b268 Merge pull request #32561 from frappe/version-13-hotfix
chore: release v13
2022-10-12 12:49:45 +05:30
Ankush Menat
002ae8ae13 ci: disable test orchestrator v13 (#32574) 2022-10-12 12:13:51 +05:30
Deepesh Garg
558dc57b94 Merge pull request #32539 from frappe/mergify/bp/version-13-hotfix/pr-32536
fix: PO cancel post advance payment cancel against PO (backport #32536)
2022-10-11 13:58:24 +05:30
Deepesh Garg
cd942d36a8 chore: resolve conflicts 2022-10-11 10:16:31 +05:30
Sagar Sharma
3257533ee3 Merge pull request #32544 from frappe/mergify/bp/version-13-hotfix/pr-32497
chore: set `Quality Inspection` status based on readings status (backport #32497)
2022-10-10 12:10:29 +05:30
Sagar Sharma
2763d06307 fix(test): test_rejected_qi_validation
(cherry picked from commit 4992e4a2b8)
2022-10-10 05:21:09 +00:00
Sagar Sharma
a0772ea8d7 test: add test cases for Quality Inspection status
(cherry picked from commit fcc1272d42)
2022-10-10 05:21:08 +00:00
Sagar Sharma
d67b44fcec fix: set Quality Inspection status based on readings status
(cherry picked from commit 2657ece2cd)
2022-10-10 05:21:08 +00:00
Sagar Sharma
257a2a3d71 fix: make readings status mandatory in Quality Inspection
(cherry picked from commit d7c3b7633a)
2022-10-10 05:21:07 +00:00
Sagar Sharma
e6abbd1c83 chore: add Manual Inspection field in Quality Inspection DocType
(cherry picked from commit 39707757a6)
2022-10-10 05:21:06 +00:00
Deepesh Garg
41599cf29f fix: PO cancel post advance payment cancel against PO
(cherry picked from commit d806e32030)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py
2022-10-09 13:05:46 +00:00
Frappe PR Bot
c66ebcdf9a chore(release): Bumped to Version 13.39.5
## [13.39.5](https://github.com/frappe/erpnext/compare/v13.39.4...v13.39.5) (2022-10-07)

### Bug Fixes

* Do not add tax withheld vouchers post tax withheding in one document ([be404b7](be404b77a1))
* Tax withholding related fixes ([6e9b52d](6e9b52d268))
2022-10-07 13:08:29 +00:00
Deepesh Garg
4623b986a3 Merge pull request #32526 from frappe/mergify/bp/version-13/pr-32523
fix: Tax withholding related fixes (backport #32522) (backport #32523)
2022-10-07 18:36:57 +05:30
Deepesh Garg
611dd5c073 chore: resolve conflicts
(cherry picked from commit 2bf76f64bd)
2022-10-07 12:39:14 +00:00
Deepesh Garg
be404b77a1 fix: Do not add tax withheld vouchers post tax withheding in one document
(cherry picked from commit 781d160c68)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
(cherry picked from commit e1c41b9195)
2022-10-07 12:39:13 +00:00
Deepesh Garg
6e9b52d268 fix: Tax withholding related fixes
(cherry picked from commit abf5b6be3e)
(cherry picked from commit 32a9575f07)
2022-10-07 12:39:13 +00:00
Deepesh Garg
997990c69f Merge pull request #32523 from frappe/mergify/bp/version-13-hotfix/pr-32522
fix: Tax withholding related fixes (backport #32522)
2022-10-07 18:08:31 +05:30
Deepesh Garg
2bf76f64bd chore: resolve conflicts 2022-10-07 17:33:03 +05:30
Deepesh Garg
e1c41b9195 fix: Do not add tax withheld vouchers post tax withheding in one document
(cherry picked from commit 781d160c68)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2022-10-07 11:03:16 +00:00
Deepesh Garg
32a9575f07 fix: Tax withholding related fixes
(cherry picked from commit abf5b6be3e)
2022-10-07 11:03:15 +00:00
Deepesh Garg
e031e095dd Merge pull request #32521 from FHenry/13_fr_translation
chore: fr translation (backport #32385)
2022-10-07 08:48:43 +05:30
Florian HENRY
39ce3756c8 chore: fr translation 2022-10-06 22:39:40 +02:00
Deepesh Garg
f2515d9c9c Merge pull request #32449 from rtdany10/cst-ux-improvement
feat(ux): improved course scheduling tool
2022-10-05 18:44:05 +05:30
Deepesh Garg
27fe9c9179 Merge pull request #32426 from AnandBaburajan/fix_mark_attendance_joining_date_and_future
fix: mark attendance issue with joining and relieving date, and fix future attendance marking
2022-10-05 18:34:31 +05:30
Deepesh Garg
503183cb0b Merge pull request #32502 from frappe/mergify/bp/version-13-hotfix/pr-32499
fix: TooManyWritesError during reposting of stock (backport #32499)
2022-10-05 17:29:25 +05:30
Deepesh Garg
f1ea5de022 Merge pull request #32504 from frappe/mergify/bp/version-13-hotfix/pr-32478
feat(JE): trigger account field when fetched from template (backport #32478)
2022-10-05 17:29:05 +05:30
Dany Robert
baa4fec611 feat(JE): trigger account field when fetched from template
Closes #32409

(cherry picked from commit c35adcf5a1)
2022-10-05 10:38:21 +00:00
Rohit Waghchaure
476175b307 fix: TooManyWritesError during reposting of stock
(cherry picked from commit aaabba9b1e)
2022-10-05 10:35:55 +00:00
Frappe PR Bot
de584535e9 chore(release): Bumped to Version 13.39.4
## [13.39.4](https://github.com/frappe/erpnext/compare/v13.39.3...v13.39.4) (2022-10-04)

### Bug Fixes

* asset requiring maintenance sold status ([14ab9d9](14ab9d9158))
* conflict ([0f8e34e](0f8e34e972))
* Disbursement Account in patch to update old loans ([b4a511c](b4a511cbb4))
* e-Way bill JSON for Intra-state internal transfers ([b7fbf75](b7fbf75e10))
* fetch swift_number in payment_request ([6074570](60745705a8))
* Incorrect TCS amount deducted in Sales Invoice ([32456bf](32456bff30))
* Item details fetching on making transaction from item dashboard ([1aed76f](1aed76f778))
* linter issue ([4757a65](4757a65863))
* not able to return sold expired batches ([2fd4485](2fd4485f2f))
* payment reconciliation tool consider cost_center for JV ([9f98891](9f988910b5))
* payment request make bank field Link instead of Read Only ([299175e](299175e6fe))
* pick list picked-qty for batch item ([96a6db0](96a6db0422))
* SEZ Without Payment of Tax don't add tax rows ([a13eecc](a13eecc961))
* show `Make Purchase Invoice` button based on permission ([7124328](7124328640))
* typo in sales_register's filter mode_of_payment (backport [#32371](https://github.com/frappe/erpnext/issues/32371)) ([#32447](https://github.com/frappe/erpnext/issues/32447)) ([cdc8297](cdc8297083))
* update with new Frappe color. fix [#32455](https://github.com/frappe/erpnext/issues/32455) ([#32456](https://github.com/frappe/erpnext/issues/32456)) ([ad43b18](ad43b18ace))

### Reverts

* Revert "fix: fetch swift_number in payment_request" ([8251b84](8251b843ec))
2022-10-04 12:14:27 +00:00
Deepesh Garg
d95d234aa4 Merge pull request #32494 from frappe/version-13-hotfix
chore: release v13
2022-10-04 17:41:06 +05:30
rohitwaghchaure
3648745e5e Merge pull request #32470 from frappe/mergify/bp/version-13-hotfix/pr-32466
fix: not able to return sold expired batches (backport #32466)
2022-10-04 07:35:10 +05:30
Deepesh Garg
8e1e6a194b Merge pull request #32467 from frappe/mergify/bp/version-13-hotfix/pr-32394
fix: fetch swift number in payment request from bank doctype (backport #32394)
2022-10-03 21:54:05 +05:30
Ankush Menat
663e9b403f chore: codeowners 2022-10-03 16:27:32 +05:30
Ankush Menat
3219b7c766 chore: codeowners 2022-10-03 16:27:13 +05:30
Sagar Sharma
3a6e4c8da7 Merge pull request #32474 from frappe/mergify/bp/version-13-hotfix/pr-32472
fix: pick list picked-qty for batch item (backport #32472)
2022-10-03 15:24:02 +05:30
Sagar Sharma
96a6db0422 fix: pick list picked-qty for batch item
(cherry picked from commit ba02209f1d)
2022-10-03 09:17:03 +00:00
rohitwaghchaure
4757a65863 fix: linter issue 2022-10-03 13:27:38 +05:30
rohitwaghchaure
0f8e34e972 fix: conflict 2022-10-03 13:18:58 +05:30
Rohit Waghchaure
2fd4485f2f fix: not able to return sold expired batches
(cherry picked from commit 0b1727cf79)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2022-10-03 07:46:13 +00:00
Maharshi Patel
299175e6fe fix: payment request make bank field Link instead of Read Only
(cherry picked from commit dc8d49260c)
2022-10-03 07:26:06 +00:00
Maharshi Patel
8251b843ec Revert "fix: fetch swift_number in payment_request"
This reverts commit f42a8e4e03.

(cherry picked from commit 9245d3b5cd)
2022-10-03 07:26:05 +00:00
Maharshi Patel
60745705a8 fix: fetch swift_number in payment_request
There isn't direct link between payment_request and bank so swift_number wasn't fetched using Fetch form. I fixed it by fetching swift_number on_change of bank_account.

(cherry picked from commit f42a8e4e03)
2022-10-03 07:26:04 +00:00
Deepesh Garg
caedc9f6ad Merge pull request #32462 from frappe/mergify/bp/version-13-hotfix/pr-32456
fix: update with new Frappe color. fix #32455 (backport #32456)
2022-10-03 09:15:21 +05:30
Deepesh Garg
fbeb86b9c0 Merge pull request #32453 from deepeshgarg007/intra_state_transfer_eway_bill_v13
fix: e-Way bill JSON for Intra-state internal transfers
2022-10-03 09:07:26 +05:30
Muvuk
ad43b18ace fix: update with new Frappe color. fix #32455 (#32456)
* Update with new Frappe color.

* refactor: use css variables

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit 73e5a7d671)
2022-10-02 17:02:25 +00:00
Frappe PR Bot
34284216cd chore(release): Bumped to Version 13.39.3
## [13.39.3](https://github.com/frappe/erpnext/compare/v13.39.2...v13.39.3) (2022-10-02)

### Bug Fixes

* asset requiring maintenance sold status ([a668d4e](a668d4e789))
2022-10-02 15:39:08 +00:00
Deepesh Garg
5c6c9812c0 Merge pull request #32458 from frappe/mergify/bp/version-13/pr-32413
fix: status of assets with maintenance_required changing back to 'Partially Depreciated' some time after being sold [v13] (backport #32413)
2022-10-02 21:07:00 +05:30
anandbaburajan
4afd2b7470 chore: refactor by just using a filter
(cherry picked from commit 6b21deedae)
2022-10-02 12:14:41 +00:00
anandbaburajan
bc21ce412b chore: refactor by creating is_sold
(cherry picked from commit 430a4c98a0)
2022-10-02 12:14:41 +00:00
anandbaburajan
a668d4e789 fix: asset requiring maintenance sold status
(cherry picked from commit 14ab9d9158)
2022-10-02 12:14:40 +00:00
Deepesh Garg
9f8d3e43ea Merge pull request #32413 from AnandBaburajan/fix_asset_sold_status_v13
fix: status of assets with maintenance_required changing back to 'Partially Depreciated' some time after being sold [v13]
2022-10-02 17:43:09 +05:30
Deepesh Garg
9dbb2bf512 Merge pull request #32369 from maharshivpatel/fix-taxes-sez-without-payment-of-tax
fix: SEZ Without Payment of Tax don't add tax rows
2022-10-01 16:13:11 +05:30
Deepesh Garg
8c52c71299 Merge pull request #32344 from maharshivpatel/fix-payment-reconciliation-jv-cost-center
fix: consider cost center for journal entry in payment reconciliation tool
2022-10-01 16:12:30 +05:30
Deepesh Garg
c4c52c1cd3 chore: Linting Issues 2022-10-01 16:06:31 +05:30
Deepesh Garg
b7fbf75e10 fix: e-Way bill JSON for Intra-state internal transfers 2022-10-01 15:58:31 +05:30
Dany Robert
6dabfbedf1 Merge branch 'version-13-hotfix' into cst-ux-improvement 2022-10-01 14:19:31 +05:30
Dany Robert
68c592377b chore: pre-commit 2022-09-30 23:41:01 -07:00
Deepesh Garg
d69d2217f6 Merge pull request #32431 from frappe/mergify/bp/version-13-hotfix/pr-32402
fix: Item details fetching on making transaction from item dashboard (backport #32402)
2022-10-01 12:05:26 +05:30
mergify[bot]
cdc8297083 fix: typo in sales_register's filter mode_of_payment (backport #32371) (#32447)
fix: typo in sales_register's filter mode_of_payment (#32371)
2022-10-01 12:04:40 +05:30
Dany Robert
f24f71f387 Merge branch 'version-13-hotfix' into cst-ux-improvement 2022-10-01 12:03:05 +05:30
Dany Robert
552c5951bd feat: cst ux improvement 2022-09-30 23:25:55 -07:00
Deepesh Garg
562025eb45 Merge branch 'version-13-hotfix' into fix-payment-reconciliation-jv-cost-center 2022-10-01 11:10:21 +05:30
Deepesh Garg
f0a37f545a chore: resolve conflicts 2022-10-01 11:02:40 +05:30
Deepesh Garg
001afb96ba Merge pull request #32435 from frappe/mergify/bp/version-13-hotfix/pr-32412
fix: Incorrect TCS amount deducted in Sales Invoice (backport #32412)
2022-10-01 11:01:05 +05:30
Deepesh Garg
61d3370527 chore: Remove print statements
(cherry picked from commit bff3cd9068)
2022-09-30 10:36:20 +00:00
Deepesh Garg
32456bff30 fix: Incorrect TCS amount deducted in Sales Invoice
(cherry picked from commit 08443c6421)
2022-09-30 10:36:20 +00:00
Deepesh Garg
1aed76f778 fix: Item details fetching on making transaction from item dashboard
(cherry picked from commit 0439e41a44)

# Conflicts:
#	erpnext/stock/doctype/item/item.js
2022-09-30 10:27:36 +00:00
anandbaburajan
308c400c6a chore: make linter happy 2022-09-30 15:33:34 +05:30
anandbaburajan
a9546dd01f fix: mark attendance issue with relieving date 2022-09-30 15:27:03 +05:30
anandbaburajan
cb4fbd5432 fix: future attendance marking 2022-09-30 14:48:30 +05:30
anandbaburajan
6f8d62088e fix: mark attendance issue with joining date 2022-09-30 14:46:57 +05:30
Anand Baburajan
5d66646fcd Merge branch 'version-13-hotfix' into fix_asset_sold_status_v13 2022-09-29 22:49:10 +05:30
Sagar Sharma
6a58d15497 Merge pull request #32419 from frappe/mergify/bp/version-13-hotfix/pr-32404
fix(ux): show `Make Purchase Invoice` button based on permission (backport #32404)
2022-09-29 17:16:15 +05:30
anandbaburajan
6b21deedae chore: refactor by just using a filter 2022-09-29 15:37:04 +05:30
Sagar Sharma
7124328640 fix: show Make Purchase Invoice button based on permission
(cherry picked from commit 80080a3d7b)
2022-09-29 09:27:03 +00:00
anandbaburajan
430a4c98a0 chore: refactor by creating is_sold 2022-09-29 08:59:49 +05:30
Anand Baburajan
c65fb64578 Merge branch 'version-13-hotfix' into fix_asset_sold_status_v13 2022-09-28 21:36:48 +05:30
anandbaburajan
14ab9d9158 fix: asset requiring maintenance sold status 2022-09-28 21:25:42 +05:30
Deepesh Garg
1095052479 Merge pull request #32410 from frappe/mergify/bp/version-13-hotfix/pr-32403
fix: Disbursement Account in patch to update old loans (backport #32403)
2022-09-28 20:13:45 +05:30
Deepesh Garg
b4a511cbb4 fix: Disbursement Account in patch to update old loans
(cherry picked from commit be623ce8e8)
2022-09-28 14:06:42 +00:00
Frappe PR Bot
a77388d520 chore(release): Bumped to Version 13.39.2
## [13.39.2](https://github.com/frappe/erpnext/compare/v13.39.1...v13.39.2) (2022-09-28)

### Bug Fixes

* `For Quantity` error msg in `Stock Entry` ([a194d28](a194d28b69))
* Add return against indexes for POS Invoice ([9e8e7aa](9e8e7aab70))
* Add return against indexes for POS Invoice ([6c528d4](6c528d469d))
* allow to return expired batches using purchase return ([02468a9](02468a902f))
* consider overproduction percentage for WO finish button ([ed4ac10](ed4ac100ba))
* difference amount calculation on payment reconciliation ([d68cdb4](d68cdb4f5e))
* don't count half day in absent days in Monthly Attendance Sheet summarized view ([#32399](https://github.com/frappe/erpnext/issues/32399)) ([255aa7a](255aa7a84a))
* **e-invoicing:** local variable 'res' referenced before assignment ([#32352](https://github.com/frappe/erpnext/issues/32352)) ([8f961ab](8f961abe8b))
* get amount in words for debit note ([0cd1cac](0cd1cacc29))
* GST Itemised Sales Register GSTIN filter ([#32367](https://github.com/frappe/erpnext/issues/32367)) ([988c5b9](988c5b95e6))
* item_code key error in production plan ([638d5e9](638d5e9dc3))
* Move subscription process to hourly long quque ([447c553](447c553954))
* opening entry causing discepancy between stock and trial balance ([70c68f0](70c68f011a))
* POS only validate QTY if is_stock_item ([ac8100f](ac8100f1e5))
* POS properly validate stock for bundle products ([96fa14b](96fa14be88))
* Reduce font size for Process Statement of accounts print/pdf ([1cfeb93](1cfeb9371c))
* remove no_copy for ignore_pricing_rule ([8abfdb6](8abfdb6598))
* total value in all keys ([80d046a](80d046a38c))
2022-09-28 10:10:58 +00:00
Deepesh Garg
eda6076a43 Merge pull request #32374 from frappe/version-13-hotfix
chore: release v13
2022-09-28 15:39:01 +05:30
Deepesh Garg
0b2405bbdf Merge pull request #32395 from frappe/mergify/bp/version-13-hotfix/pr-32379
fix: POS only validate QTY if is_stock_item (backport #32379)
2022-09-28 15:12:47 +05:30
Rucha Mahabal
255aa7a84a fix: don't count half day in absent days in Monthly Attendance Sheet summarized view (#32399) 2022-09-28 15:02:21 +05:30
Deepesh Garg
a604eed1b9 chore: Resolve conflicts 2022-09-28 14:49:25 +05:30
Maharshi Patel
96fa14be88 fix: POS properly validate stock for bundle products
Stock availability was not calculated properly for Product Bundle with non stock item so i have added logic to properly calculate that as well.

(cherry picked from commit e392ea1104)

# Conflicts:
#	erpnext/selling/page/point_of_sale/pos_item_details.js
2022-09-28 08:16:02 +00:00
Maharshi Patel
ac8100f1e5 fix: POS only validate QTY if is_stock_item
POS invoice raised " Item not available " validation error even though item is non_stock.

(cherry picked from commit e39e088f18)
2022-09-28 08:16:00 +00:00
Deepesh Garg
07cc05785e Merge pull request #32386 from frappe/mergify/bp/version-13-hotfix/pr-32382
fix: Move subscription process to hourly long queue (backport #32382)
2022-09-28 10:39:08 +05:30
Deepesh Garg
f03fbc0e6d chore: Resolve conflicts 2022-09-28 08:10:37 +05:30
Deepesh Garg
447c553954 fix: Move subscription process to hourly long quque
(cherry picked from commit 82a2f31ada)

# Conflicts:
#	erpnext/hooks.py
2022-09-27 18:09:32 +00:00
Deepesh Garg
b2e9dccc8c Merge pull request #32384 from frappe/mergify/bp/version-13-hotfix/pr-32378
fix: Add return against indexes for POS Invoice (backport #32378)
2022-09-27 23:34:50 +05:30
Deepesh Garg
9e8e7aab70 fix: Add return against indexes for POS Invoice
(cherry picked from commit cbfe28286a)
2022-09-27 16:52:59 +00:00
Deepesh Garg
6c528d469d fix: Add return against indexes for POS Invoice
(cherry picked from commit 1f6205e1ea)
2022-09-27 16:52:59 +00:00
Maharshi Patel
988c5b95e6 fix: GST Itemised Sales Register GSTIN filter (#32367)
fix: GST Itemised Sales Register GSTIN filte
2022-09-27 22:21:14 +05:30
Sagar Sharma
1f2887d601 Merge pull request #32381 from frappe/mergify/bp/version-13-hotfix/pr-32377
fix: consider overproduction percentage for WO finish button (backport #32377)
2022-09-27 18:51:37 +05:30
Sagar Sharma
ed4ac100ba fix: consider overproduction percentage for WO finish button
(cherry picked from commit 05392e0918)
2022-09-27 12:15:43 +00:00
Sagar Sharma
a194d28b69 fix: For Quantity error msg in Stock Entry
(cherry picked from commit 9049db41ae)
2022-09-27 12:15:42 +00:00
rohitwaghchaure
3217924242 Merge pull request #32373 from frappe/mergify/bp/version-13-hotfix/pr-32370
fix: Not allowing to return expired batches using purchase return (backport #32370)
2022-09-27 14:44:30 +05:30
Rohit Waghchaure
02468a902f fix: allow to return expired batches using purchase return
(cherry picked from commit a4a86ee23f)
2022-09-27 08:51:26 +00:00
Maharshi Patel
a13eecc961 fix: SEZ Without Payment of Tax don't add tax rows
taxes were added even when gst_category was SEZ and export_type was Without Payment of Tax
2022-09-27 13:40:04 +05:30
rohitwaghchaure
776ee53a25 Merge pull request #32358 from frappe/mergify/bp/version-13-hotfix/pr-32346
refactor: rewrite `Item Price Stock Report` queries in `QB` (backport #32346)
2022-09-27 10:44:05 +05:30
rohitwaghchaure
ddf5565c67 Merge pull request #32366 from frappe/mergify/bp/version-13-hotfix/pr-32339
fix: opening entry causing discrepancy between stock and trial balance (backport #32339)
2022-09-27 09:57:01 +05:30
Maharshi Patel
4152a9f026 Merge branch 'version-13-hotfix' into fix-payment-reconciliation-jv-cost-center 2022-09-26 23:03:39 +05:30
Saqib Ansari
8f961abe8b fix(e-invoicing): local variable 'res' referenced before assignment (#32352) 2022-09-26 22:42:07 +05:30
Rohit Waghchaure
70c68f011a fix: opening entry causing discepancy between stock and trial balance
(cherry picked from commit bc3ab45af2)
2022-09-26 15:03:48 +00:00
Sagar Sharma
9066009e89 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32346 2022-09-26 18:18:41 +05:30
Sagar Sharma
9332e7f96f Merge pull request #32360 from frappe/mergify/bp/version-13-hotfix/pr-32347
refactor: rewrite `Incorrect Stock Value Report` queries in `QB` (backport #32347)
2022-09-26 18:18:01 +05:30
Sagar Sharma
d6a335e59f refactor: rewrite Incorrect Stock Value Report queries in QB
(cherry picked from commit b93331e844)
2022-09-26 11:40:21 +00:00
Sagar Sharma
a66002f774 refactor: rewrite Item Price Stock Report queries in QB
(cherry picked from commit 22299d2382)
2022-09-26 11:39:24 +00:00
ruthra kumar
6eb3428f8e Merge pull request #32348 from frappe/mergify/bp/version-13-hotfix/pr-32303
fix: difference amount calculation and popup on payment reconciliation (backport #32303)
2022-09-26 14:18:09 +05:30
ruthra kumar
d158784472 Merge pull request #32350 from frappe/mergify/bp/version-13-hotfix/pr-32310
fix: total value in all keys (backport #32310)
2022-09-26 12:05:04 +05:30
nishibakabeer
80d046a38c fix: total value in all keys
Gross and net profit report showing wrong values in monthly quarterly and half yearly filters which is the total value
@ruthra-kumar added in develop branch as suggested ( https://github.com/frappe/erpnext/pull/32020)

(cherry picked from commit 6919f389aa)
2022-09-26 06:03:15 +00:00
ruthra kumar
d68cdb4f5e fix: difference amount calculation on payment reconciliation
(cherry picked from commit 122d5f2729)
2022-09-26 10:36:08 +05:30
Maharshi Patel
9f988910b5 fix: payment reconciliation tool consider cost_center for JV
We need to consider cost center in all four cases of get_conditions. I have removed check in if statement for get_invoices, get_payments, get_return_invoices as it is not required.
2022-09-25 23:24:59 +05:30
Deepesh Garg
09cd480c81 Merge pull request #32333 from frappe/mergify/bp/version-13-hotfix/pr-32117
fix: Reduce font size for Process Statement of accounts print/pdf (backport #32117)
2022-09-25 17:20:57 +05:30
Sagar Sharma
4777991a74 Merge pull request #32338 from frappe/mergify/bp/version-13-hotfix/pr-32324
refactor: rewrite `Production Planning Report` queries in `QB` (backport #32324)
2022-09-23 10:38:20 +05:30
Sagar Sharma
1301a6ff7f refactor: rewrite Production Planning Report queries in QB
(cherry picked from commit 8417b9b99c)
2022-09-23 04:20:42 +00:00
Sagar Sharma
a6a5f63af2 Merge pull request #32328 from s-aga-r/backport/v13-h/32309
fix: item_code key error in production plan (backport #32309)
2022-09-23 09:48:25 +05:30
Deepesh Garg
1cfeb9371c fix: Reduce font size for Process Statement of accounts print/pdf
(cherry picked from commit 6bfd193b0d)
2022-09-22 19:38:55 +00:00
Rohit Waghchaure
638d5e9dc3 fix: item_code key error in production plan 2022-09-22 18:09:12 +05:30
Sagar Sharma
b4ee72e15e Merge pull request #32316 from s-aga-r/backport/v13-h/32304
refactor: rewrite `Exponential Smoothing Forecasting` queries in `QB` (backport #32304)
2022-09-22 11:16:22 +05:30
Sagar Sharma
2a9b519773 Merge branch 'version-13-hotfix' into backport/v13-h/32304 2022-09-22 01:32:20 +05:30
Sagar Sharma
57136fa921 Merge pull request #32315 from s-aga-r/backport/v13-h/32153
refactor: rewrite Work Order Stock Report queries in QB (backport #32153)
2022-09-22 01:31:18 +05:30
Sagar Sharma
882542c2d5 Merge branch 'version-13-hotfix' into backport/v13-h/32153 2022-09-22 01:31:04 +05:30
Sagar Sharma
0a4025e7e0 Merge pull request #32314 from s-aga-r/backport/v13-h/32161
refactor: rewrite Process Loss Report queries in QB (backport #32161)
2022-09-22 01:30:40 +05:30
Sagar Sharma
54dfd50391 refactor: rewrite Exponential Smoothing Forecasting queries in QB 2022-09-21 21:27:04 +05:30
Sagar Sharma
45d02ceb4e refactor: rewrite Work Order Stock Report queries in QB 2022-09-21 21:20:03 +05:30
Sagar Sharma
f72bb18da7 refactor: rewrite Process Loss Report queries in QB 2022-09-21 21:13:10 +05:30
Deepesh Garg
f371008cd9 Merge pull request #32293 from frappe/mergify/bp/version-13-hotfix/pr-32284
fix: remove no_copy for ignore_pricing_rule (backport #32284)
2022-09-21 16:41:25 +05:30
Deepesh Garg
82e5a784cb Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32284 2022-09-21 13:08:41 +05:30
Deepesh Garg
d267372334 Merge pull request #32299 from frappe/mergify/bp/version-13-hotfix/pr-32296
fix: get amount in words for debit note (backport #32296)
2022-09-21 13:07:39 +05:30
Sagar Sharma
92c7d074dd Merge pull request #32307 from s-aga-r/backport/13/refactor/report/exponential-smoothing-forecasting
refactor: rewrite `BOM Variance Report` queries in `QB` (backport #32297)
2022-09-21 12:42:10 +05:30
Sagar Sharma
cedc8d28e4 refactor: rewrite BOM Variance Report queries in QB 2022-09-21 12:13:05 +05:30
Frappe PR Bot
be4fdca6c7 chore(release): Bumped to Version 13.39.1
## [13.39.1](https://github.com/frappe/erpnext/compare/v13.39.0...v13.39.1) (2022-09-20)

### Bug Fixes

* Add child table for tax withheld vouchers ([4165fee](4165fee6a7))
* Change Department fieldtype to Link in Leave Balance Report ([#32252](https://github.com/frappe/erpnext/issues/32252)) ([e2e69dc](e2e69dced7))
* dont show zero qty available items in stock ageing report ([37dbc70](37dbc7043a))
* fetch description only if empty on the payment schedule ([07a7fdb](07a7fdbe6c))
* Fetch vouchers to show in Invoice ([51d7c0b](51d7c0bfe4))
* incorrect gl if tax on multi currency payment entry ([d9d6a07](d9d6a07bbb))
* item wise sales register taxes and charges ([e65990e](e65990eb34))
* make `po_detail` or `sco_rm_detail` mandatory for SE `Send to Subcontractor` ([0329642](0329642116))
* Parent Level project linkning on creating PO from project ([3c3e3cf](3c3e3cfcf8))
* pending accrual entries ([ef86b43](ef86b437cb))
* production plan pending-qty ([2dcb35d](2dcb35da33))
* remove return pos from pos reconciliation tool ([e9bf74e](e9bf74e589))
* TDS deduction via journal entry ([ca0cce7](ca0cce7599))
* use default supplier currency if default supplier is enabled ([3c10e50](3c10e5066a))
* warehouse filter in `BOM Stock Calculated Report` ([96bf1e2](96bf1e2a0a))
2022-09-20 19:12:47 +00:00
Deepesh Garg
2694438163 Merge pull request #32291 from frappe/version-13-hotfix
chore: release v13
2022-09-21 00:41:03 +05:30
Deepesh Garg
d0bd78ddcd Merge pull request #32289 from frappe/mergify/bp/version-13-hotfix/pr-32204
fix(UX): More predictable tax withholding application in invoices (backport #32204)
2022-09-21 00:11:37 +05:30
Deepesh Garg
e2912caeae chore: Handle edge cases 2022-09-20 23:50:16 +05:30
Sagar Sharma
6f9c2e6c80 Merge pull request #32302 from frappe/mergify/bp/version-13-hotfix/pr-32295
refactor: rewrite `BOM Stock Report` queries in `QB` (backport #32295)
2022-09-20 23:10:19 +05:30
Sagar Sharma
96bf1e2a0a fix: warehouse filter in BOM Stock Calculated Report
(cherry picked from commit 390ce5719d)
2022-09-20 17:37:41 +00:00
Sagar Sharma
1f633b293d refactor: rewrite BOM Stock Report queries in QB
(cherry picked from commit 8fd7c04920)
2022-09-20 17:37:40 +00:00
ruthra kumar
0cd1cacc29 fix: get amount in words for debit note
(cherry picked from commit 70f6484d9d)
2022-09-20 12:43:45 +00:00
Deepesh Garg
21154c8bee chore: fix tests 2022-09-20 17:52:37 +05:30
ruthra kumar
9270e58969 Merge pull request #32277 from frappe/remove_return_pos_from_reconciliation_tool
fix: remove return pos from pos reconciliation tool
2022-09-20 17:20:25 +05:30
Deepesh Garg
de8f44bbff chore: Resolve conflicts 2022-09-20 16:42:30 +05:30
ruthra kumar
e9bf74e589 fix: remove return pos from pos reconciliation tool 2022-09-20 16:41:28 +05:30
Maharshi Patel
8abfdb6598 fix: remove no_copy for ignore_pricing_rule
(cherry picked from commit 8c5b420aea)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
#	erpnext/buying/doctype/purchase_order/purchase_order.json
#	erpnext/selling/doctype/quotation/quotation.json
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
2022-09-20 10:49:59 +00:00
Nabin Hait
305693b562 Merge pull request #32281 from maharshivpatel/fix-item-wise-sales-register-v13
fix: item wise sales register taxes and charges
2022-09-20 14:56:23 +05:30
Deepesh Garg
794eeebabc chore: resolve conflicts 2022-09-20 14:48:06 +05:30
Deepesh Garg
75768d780f Merge pull request #32282 from frappe/mergify/bp/version-13-hotfix/pr-32217
fix: incorrect gl if tax on multi currency payment entry (backport #32217)
2022-09-20 14:39:37 +05:30
Deepesh Garg
fe252b48f7 chore: fix tests
(cherry picked from commit 9aa1f84d45)
2022-09-20 09:07:06 +00:00
Deepesh Garg
ca0cce7599 fix: TDS deduction via journal entry
(cherry picked from commit 36d0906ea2)
2022-09-20 09:07:05 +00:00
Deepesh Garg
e07fd46a46 test: Add tests
(cherry picked from commit b6184ce471)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2022-09-20 09:07:04 +00:00
Deepesh Garg
51d7c0bfe4 fix: Fetch vouchers to show in Invoice
(cherry picked from commit 3fb1595a4e)
2022-09-20 09:07:03 +00:00
Deepesh Garg
4165fee6a7 fix: Add child table for tax withheld vouchers
(cherry picked from commit 246c1a9380)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2022-09-20 09:07:02 +00:00
Deepesh Garg
d251ef9ce5 Merge pull request #32279 from frappe/mergify/bp/version-13-hotfix/pr-32235
fix: fetch description only if empty on the payment schedule (backport #32235)
2022-09-20 14:35:35 +05:30
Sagar Sharma
afda4bdb17 Merge pull request #32286 from frappe/mergify/bp/version-13-hotfix/pr-32280
refactor: rewrite `Item Shortage Report` queries in QB (backport #32280)
2022-09-20 11:43:41 +05:30
Sagar Sharma
c4452360da test: add test cases for Item Shortage Report
(cherry picked from commit 3dc754cac2)
2022-09-20 05:45:29 +00:00
Sagar Sharma
13527d6154 refactor: rewrite Item Shortage Report queries in QB
(cherry picked from commit f0a78aa559)
2022-09-20 05:45:28 +00:00
ruthra kumar
5c0a46110e test: gl entries of payments with advance tax
(cherry picked from commit 5bd5dd7262)
2022-09-20 11:09:37 +05:30
ruthra kumar
d9d6a07bbb fix: incorrect gl if tax on multi currency payment entry
(cherry picked from commit f0ae77b23b)
2022-09-20 04:30:42 +00:00
Maharshi Patel
e65990eb34 fix: item wise sales register taxes and charges
I have added a separate column for other charges. Instead of adding all values to tax_total, it checks if account_type is tax, and then only it adds to total_tax otherwise it adds to the total_other_charges.
2022-09-20 09:47:47 +05:30
Maharshi Patel
07a7fdbe6c fix: fetch description only if empty on the payment schedule
added fetch_if_empty on description field of payment_schedule.

(cherry picked from commit f4b64686ae)
2022-09-20 03:44:50 +00:00
Sagar Sharma
2fca8b541e Merge pull request #32261 from frappe/mergify/bp/version-13-hotfix/pr-32250
fix: make `po_detail` or `sco_rm_detail` mandatory for SE Send to Subcontractor (backport #32250)
2022-09-19 19:53:57 +05:30
Sagar Sharma
7fc460bb32 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32250 2022-09-19 19:22:31 +05:30
Solufyin
e2e69dced7 fix: Change Department fieldtype to Link in Leave Balance Report (#32252)
Co-authored-by: Nihantra C. Patel <n.patel.serpentcs@gmail.com>
2022-09-19 15:42:05 +05:30
Deepesh Garg
5e49b6ea0f Merge pull request #32269 from frappe/mergify/bp/version-13-hotfix/pr-32251
fix: use default supplier currency if default supplier is enabled (backport #32251)
2022-09-19 15:20:44 +05:30
Ritwik Puri
2e3445fad9 chore: patch for removing stale values in Naming Series (#32271) 2022-09-19 13:35:08 +05:30
ruthra kumar
3c10e5066a fix: use default supplier currency if default supplier is enabled
(cherry picked from commit 77fdc37cb7)
2022-09-19 07:32:58 +00:00
Sagar Sharma
e8d2e49155 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32250 2022-09-18 20:30:21 +05:30
Deepesh Garg
5690e9771a Merge pull request #32256 from frappe/mergify/bp/version-13-hotfix/pr-32244
fix: Parent Level project linkning on creating PO from project (backport #32244)
2022-09-18 19:41:57 +05:30
Sagar Sharma
ec6cac8043 chore: conflicts 2022-09-18 16:38:09 +05:30
Sagar Sharma
0329642116 fix: make po_detail or sco_rm_detail mandatory for SE Send to Subcontractor
(cherry picked from commit b90875575c)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/stock_entry.py
2022-09-18 09:25:10 +00:00
Deepesh Garg
3c3e3cfcf8 fix: Parent Level project linkning on creating PO from project
(cherry picked from commit 93e134aab0)
2022-09-17 15:00:56 +00:00
Sagar Sharma
7c4f5fa5c5 Merge pull request #32241 from frappe/mergify/bp/version-13-hotfix/pr-32236
fix: production plan pending-qty (backport #32236)
2022-09-16 20:43:28 +05:30
Sagar Sharma
367e05f808 test: update test case for production plan pending-qty
(cherry picked from commit bd6af7c613)
2022-09-16 13:00:59 +00:00
Sagar Sharma
2dcb35da33 fix: production plan pending-qty
(cherry picked from commit 5be7d42dfd)
2022-09-16 13:00:58 +00:00
Sagar Sharma
94732479f5 Merge pull request #32237 from frappe/mergify/bp/version-13-hotfix/pr-32233
refactor: rewrite Production Plan queries in QB (backport #32233)
2022-09-16 17:35:38 +05:30
Sagar Sharma
b4dec4630d chore: conflicts 2022-09-16 17:08:35 +05:30
Sagar Sharma
c415a47d25 refactor: rewrite Production Plan queries in QB
(cherry picked from commit b8cf3b4c77)

# Conflicts:
#	erpnext/manufacturing/doctype/production_plan/production_plan.py
2022-09-16 09:30:11 +00:00
rohitwaghchaure
1e0cc65c61 Merge pull request #32220 from frappe/mergify/bp/version-13-hotfix/pr-31681
fix: dont show zero qty available items in stock ageing report (backport #31681)
2022-09-15 12:39:22 +05:30
Rohit Waghchaure
37dbc7043a fix: dont show zero qty available items in stock ageing report
(cherry picked from commit 5da7e01db2)
2022-09-15 06:01:10 +00:00
Deepesh Garg
0e88496607 Merge pull request #32209 from frappe/mergify/bp/version-13-hotfix/pr-32208
fix: Loans pending accrual entries (backport #32208)
2022-09-14 15:34:10 +05:30
Abhinav Raut
ef86b437cb fix: pending accrual entries
(cherry picked from commit f2209045f8)
2022-09-14 08:45:27 +00:00
Frappe PR Bot
47aa191004 chore(release): Bumped to Version 13.39.0
# [13.39.0](https://github.com/frappe/erpnext/compare/v13.38.0...v13.39.0) (2022-09-13)

### Bug Fixes

* add missing warehouse filter in BOM Stock Calculated report ([ab32c09](ab32c09ff9))
* calculate amount based on payment days for statistical components too ([3f99522](3f99522764))
* conflict ([6f2a567](6f2a567c95))
* linter ([e177f1e](e177f1e51b))
* Loan amount post write off ([e78a767](e78a7679a4))
* option to start reposting from repost item valuation ([a1826f2](a1826f215a))
* pick_list - picked qty getting set to 1 ([3256e2b](3256e2b8b7))
* Purchase Order creation from Sales Order ([d79aacd](d79aacd1cb))
* Rate for internal PI have non stock UOM items ([638d6b7](638d6b7177))
* reposting not working for internal transferred purchase receipt ([bb41d8b](bb41d8bc47))
* require barcode item barcode ([#32112](https://github.com/frappe/erpnext/issues/32112)) ([44c3a32](44c3a322d3)), closes [#31957](https://github.com/frappe/erpnext/issues/31957)
* required_qty in BOM Stock Calculated report ([f2e63bc](f2e63bc491))
* **Salary Slip:** set default amount to 0 if None ([#32184](https://github.com/frappe/erpnext/issues/32184)) ([d29a033](d29a033c09))

### Features

* Ability to manually update loan amount in Salary Slips ([ac320e4](ac320e4d55))
2022-09-13 11:15:15 +00:00
Deepesh Garg
5840913320 Merge pull request #32200 from frappe/version-13-hotfix
chore: release v13
2022-09-13 16:43:21 +05:30
Deepesh Garg
b7b0076743 Merge pull request #32194 from deepeshgarg007/loan_amount_post_write_off
fix: Loan amount post write off
2022-09-13 13:41:21 +05:30
Deepesh Garg
ef5dd1d693 Merge pull request #32165 from frappe/mergify/bp/version-13-hotfix/pr-32144
fix: Rate for internal PI have non stock UOM items (backport #32144)
2022-09-13 12:02:12 +05:30
Deepesh Garg
a53b40ba93 chore: Remove print 2022-09-13 12:00:06 +05:30
Deepesh Garg
e78a7679a4 fix: Loan amount post write off 2022-09-13 11:53:11 +05:30
Deepesh Garg
6a5beecb36 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32144 2022-09-13 09:39:37 +05:30
Rucha Mahabal
2b900e2f0e Merge pull request #32187 from ruchamahabal/stat-comp-pd
fix: calculate amount based on payment days for statistical components too
2022-09-13 02:09:39 +05:30
Rucha Mahabal
bc14dbbcad refactor(tests): add a test utility file for commonly used functions in tests 2022-09-13 01:42:27 +05:30
Rucha Mahabal
f4e53a5c91 test: statistical component based on payment days 2022-09-13 00:59:59 +05:30
Rucha Mahabal
3f99522764 fix: calculate amount based on payment days for statistical components too 2022-09-13 00:59:03 +05:30
Sagar Sharma
81dd9722fe Merge pull request #32179 from Havenir/fix-picklist-picked-qty
fix: pick_list - picked qty getting set to 1
2022-09-12 22:19:26 +05:30
Sagar Sharma
9c5d335360 Merge pull request #32186 from frappe/mergify/bp/version-13-hotfix/pr-32150
refactor: BOM Stock Calculated report, fix required-qty (backport #32150)
2022-09-12 19:48:38 +05:30
Sagar Sharma
c5c28615f5 test: add test cases for BOM Stock Calculated report
(cherry picked from commit e1a98c1ff7)
2022-09-12 13:52:31 +00:00
Sagar Sharma
ab32c09ff9 fix: add missing warehouse filter in BOM Stock Calculated report
(cherry picked from commit 7a968a5f0d)
2022-09-12 13:52:30 +00:00
Sagar Sharma
f2e63bc491 fix: required_qty in BOM Stock Calculated report
(cherry picked from commit 56192daabf)
2022-09-12 13:52:30 +00:00
Sagar Sharma
882aa96973 refactor: BOM Stock Calculated report
(cherry picked from commit 723fa9eebc)
2022-09-12 13:52:29 +00:00
Rucha Mahabal
d29a033c09 fix(Salary Slip): set default amount to 0 if None (#32184) 2022-09-12 19:21:58 +05:30
Deepesh Garg
b3125a56ed Merge pull request #32178 from deepeshgarg007/manual_update_loan_amount
feat: Ability to manually update loan amount in Salary Slips
2022-09-12 17:41:02 +05:30
rohitwaghchaure
adfc57487b Merge pull request #32167 from frappe/mergify/bp/version-13-hotfix/pr-32118
fix: option to start reposting from repost item valuation (backport #32118)
2022-09-12 16:16:26 +05:30
Deepesh Garg
ac320e4d55 feat: Ability to manually update loan amount in Salary Slips 2022-09-12 15:05:42 +05:30
Ahmad
3256e2b8b7 fix: pick_list - picked qty getting set to 1 2022-09-12 14:23:44 +05:00
mergify[bot]
b4ec4ccc56 chore: correct license text for GPLv3 (backport #32170) (#32172)
* chore: correct license text for GPLv3 (#32170)

[skip ci]



Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-09-12 14:00:14 +05:30
Rohit Waghchaure
a1826f215a fix: option to start reposting from repost item valuation
(cherry picked from commit f1c4aea7b5)
2022-09-12 06:44:59 +00:00
Deepesh Garg
181c0acf99 Merge pull request #32127 from SolufyPrivateLimited/Solufy-so-to-po-v13
fix: Purchase Order creation from Sales Order
2022-09-12 09:25:24 +05:30
Deepesh Garg
638d6b7177 fix: Rate for internal PI have non stock UOM items
(cherry picked from commit 0f655e4430)
2022-09-12 03:40:23 +00:00
rohitwaghchaure
f5132411eb Merge pull request #32152 from frappe/mergify/bp/version-13-hotfix/pr-32135
fix: reposting not working for internal transferred purchase receipt (backport #32135)
2022-09-10 23:29:56 +05:30
rohitwaghchaure
e177f1e51b fix: linter 2022-09-10 23:01:48 +05:30
rohitwaghchaure
6f2a567c95 fix: conflict 2022-09-10 16:41:39 +05:30
Rohit Waghchaure
bb41d8bc47 fix: reposting not working for internal transferred purchase receipt
(cherry picked from commit a03b4ce213)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
2022-09-09 17:13:21 +00:00
Nihantra C. Patel
d79aacd1cb fix: Purchase Order creation from Sales Order 2022-09-08 13:51:11 +05:30
Sagar Sharma
44c3a322d3 fix: require barcode item barcode (#32112)
fix: require barcode item barcode. (#31957)

* fix: require barcode item barcode.

* fix: make supplier mandatory in Item Supplier DocType

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2022-09-07 14:24:53 +05:30
Frappe PR Bot
2af489d69d chore(release): Bumped to Version 13.38.0
# [13.38.0](https://github.com/frappe/erpnext/compare/v13.37.0...v13.38.0) (2022-09-06)

### Bug Fixes

* consider Stock Entry purpose while getting total supplied qty ([8964612](8964612b8e))
* force delete old report docs (backport [#32026](https://github.com/frappe/erpnext/issues/32026)) ([#32028](https://github.com/frappe/erpnext/issues/32028)) ([0f1f67d](0f1f67dcae))
* incorrect import parameter for cancel PDA ([814dd36](814dd36a3e))
* key error on consolidated financial report ([20919c8](20919c8626))
* KSA VAT report multi currency amount issue ([56d8962](56d8962e40))
* Loan Interest accruals for 0 rated loans ([a369852](a3698524ca))
* lost quotation not to expired ([ea995de](ea995de4a3))
* Naming series in Journal Entry Template ([66cb3fd](66cb3fd63f))
* **pos:** error while consolidating pos invoices ([0527393](0527393b09))
* QR Code multi currency issue ([b10a2b8](b10a2b87b6))

### Features

* better Item Price list view ([#31954](https://github.com/frappe/erpnext/issues/31954)) ([25d2847](25d2847881))
2022-09-06 16:05:26 +00:00
Deepesh Garg
bb1c450c33 Merge pull request #32104 from frappe/version-13-hotfix
chore: release v13
2022-09-06 21:33:13 +05:30
Sagar Sharma
5707118d58 Merge pull request #32099 from s-aga-r/fix/stock-entry/send-to-subcontractor
fix: consider Stock Entry purpose while getting total supplied qty
2022-09-06 15:49:38 +05:30
Sagar Sharma
8964612b8e fix: consider Stock Entry purpose while getting total supplied qty 2022-09-06 13:04:03 +05:30
Deepesh Garg
514d280ee7 Merge pull request #32086 from Havenir/qr_code_multi_currency_issue
fix: QR Code multi currency issue
2022-09-05 12:42:43 +05:30
hamzaali15
b10a2b87b6 fix: QR Code multi currency issue
When try to scan qr code on app it is showing correct values for multi currencies because it is not getting base amount
2022-09-05 11:15:43 +05:00
Deepesh Garg
3664a12bb9 Merge pull request #32078 from frappe/mergify/bp/version-13-hotfix/pr-31954
feat: better Item Price list view (backport #31954)
2022-09-04 18:15:13 +05:30
Deepesh Garg
0605cbf26b Merge pull request #32076 from frappe/mergify/bp/version-13-hotfix/pr-32045
fix: Naming series in Journal Entry Template (backport #32045)
2022-09-04 18:14:40 +05:30
HENRY Florian
25d2847881 feat: better Item Price list view (#31954)
* feat: better Item Price list view

(cherry picked from commit 86395c6adb)
2022-09-04 12:38:43 +00:00
Solufyin
66cb3fd63f fix: Naming series in Journal Entry Template
(cherry picked from commit 2085626390)
2022-09-04 11:04:44 +00:00
Deepesh Garg
d22104ad40 Merge pull request #32072 from frappe/mergify/bp/version-13-hotfix/pr-31822
fix(pos): error while consolidating pos invoices (backport #31822)
2022-09-04 15:57:37 +05:30
Saqib Ansari
0527393b09 fix(pos): error while consolidating pos invoices
(cherry picked from commit 33762dbbac)
2022-09-04 07:56:06 +00:00
Deepesh Garg
741d6fcb9a Merge pull request #32053 from Havenir/version-13-hotfix
fix: KSA VAT report multi currency amount issue
2022-09-04 13:12:21 +05:30
ruthra kumar
1870dbf9a8 Merge pull request #32059 from frappe/mergify/bp/version-13-hotfix/pr-32054
fix: type error on cancellation of Process Deferred Accounting (backport #32054)
2022-09-02 17:10:01 +05:30
ruthra kumar
69a9724422 test: pda document submission and cancellation
(cherry picked from commit 1c385541fa)
2022-09-02 11:15:13 +00:00
ruthra kumar
814dd36a3e fix: incorrect import parameter for cancel PDA
(cherry picked from commit 08f2e4edc3)
2022-09-02 11:15:12 +00:00
ruthra kumar
17ad96998e Merge pull request #32057 from frappe/mergify/bp/version-13-hotfix/pr-32052
fix: key error on consolidated financial report (backport #32052)
2022-09-02 16:41:56 +05:30
ruthra kumar
20919c8626 fix: key error on consolidated financial report
accounts with same name but different account number will throw key
error on consolidated report

(cherry picked from commit 6e8395cccd)
2022-09-02 10:46:23 +00:00
hamzaali15
56d8962e40 fix: KSA VAT report multi currency amount issue
In KSA VAT report amount is not showing correctly for multi currencies because net_amount field is fetched instead of base_net_amount
2022-09-01 15:02:21 +05:00
Deepesh Garg
0a3ac82232 Merge pull request #32031 from frappe/mergify/bp/version-13-hotfix/pr-32030
fix: Loan Interest accruals for 0 rated loans (backport #32030)
2022-08-31 21:04:27 +05:30
Deepesh Garg
b736df3f0b Merge pull request #32036 from niyazrazak/patch-5
fix: lost quotation not to expired
2022-08-31 21:03:31 +05:30
MOHAMMED NIYAS
ea995de4a3 fix: lost quotation not to expired
code is merged in version-14 and conflict in version 13
2022-08-31 15:31:07 +05:30
Deepesh Garg
b7c94e38a6 chore: Add check for principal amount
(cherry picked from commit a76d3827ec)
2022-08-30 15:46:39 +00:00
Deepesh Garg
a3698524ca fix: Loan Interest accruals for 0 rated loans
(cherry picked from commit eefc9b7172)
2022-08-30 15:46:38 +00:00
mergify[bot]
0f1f67dcae fix: force delete old report docs (backport #32026) (#32028)
fix: force delete old report docs (#32026)

(cherry picked from commit ffa3071d36)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-30 15:45:47 +05:30
Frappe PR Bot
11b04acf8b chore(release): Bumped to Version 13.37.0
# [13.37.0](https://github.com/frappe/erpnext/compare/v13.36.5...v13.37.0) (2022-08-30)

### Bug Fixes

* Add docstatus filter for voucher_no in Repost Item Valuation ([2cf2885](2cf2885470))
* Cash and non trade discount calculation ([20e9599](20e9599fc1))
* do not clear promotion/transfer details if doc is amended ([#32000](https://github.com/frappe/erpnext/issues/32000)) ([074d484](074d484d3c))
* filter leave types and render leave application dashboard w/o from date ([#32001](https://github.com/frappe/erpnext/issues/32001)) ([7686c9e](7686c9e450))
* Loan Write-off for term loans ([e64e812](e64e812679))
* **minor:** don't print tax rate if its '0' ([#31838](https://github.com/frappe/erpnext/issues/31838)) ([a46dca5](a46dca57cb))
* permissions for Task Type ([#32016](https://github.com/frappe/erpnext/issues/32016)) ([1157bf8](1157bf887f))
* **pos:** edge case while closing pos (backport [#31748](https://github.com/frappe/erpnext/issues/31748)) ([#31893](https://github.com/frappe/erpnext/issues/31893)) ([261405c](261405cec1))
* Purposes not set ([edfaf99](edfaf99388))
* Route condition set for stock ledger (backport [#31935](https://github.com/frappe/erpnext/issues/31935)) ([#31946](https://github.com/frappe/erpnext/issues/31946)) ([34537c9](34537c9dc2))
* Set the condition to create a purchase receipt ([b4c992d](b4c992dd4d))
* Test cases ([7c85b48](7c85b487cd))

### Features

* In BOM,  Operation time can be fix (backport [#27063](https://github.com/frappe/erpnext/issues/27063)) ([#31923](https://github.com/frappe/erpnext/issues/31923)) ([c2b8d1b](c2b8d1bd9a))
2022-08-30 08:05:05 +00:00
Deepesh Garg
4c1156a816 Merge pull request #32023 from frappe/version-13-hotfix
chore: weekly version 13 release
2022-08-30 13:32:35 +05:30
Deepesh Garg
570729b73e Merge pull request #32024 from frappe/mergify/bp/version-13-hotfix/pr-31838
fix(minor): don't print tax rate if its '0' (backport #31838)
2022-08-30 13:32:16 +05:30
ruthra kumar
a46dca57cb fix(minor): don't print tax rate if its '0' (#31838)
(cherry picked from commit 3b4c0a3fc0)
2022-08-30 07:34:26 +00:00
Deepesh Garg
821c1cddfc Merge pull request #32011 from deepeshgarg007/loan_write_off_salary_slip
fix: Loan Write-off for term loans
2022-08-30 11:36:09 +05:30
Deepesh Garg
8217c6dd9f chore: Linting issues and test case fixes 2022-08-30 10:24:31 +05:30
Deepesh Garg
fc030a7de9 Merge pull request #32018 from frappe/mergify/bp/version-13-hotfix/pr-32016
fix: permissions for Task Type (backport #32016)
2022-08-30 08:38:25 +05:30
Raffael Meyer
1157bf887f fix: permissions for Task Type (#32016)
(cherry picked from commit 73f4d5931d)
2022-08-29 16:27:24 +00:00
Deepesh Garg
e64e812679 fix: Loan Write-off for term loans 2022-08-29 18:33:40 +05:30
Deepesh Garg
6025df97ef Merge pull request #31931 from frappe/mergify/bp/version-13-hotfix/pr-31910
fix: Cash and non trade discount calculation (backport #31910)
2022-08-29 15:06:00 +05:30
Deepesh Garg
4793adfefd chore: rounded total for cash and non trade discounts 2022-08-29 14:02:18 +05:30
Rucha Mahabal
7686c9e450 fix: filter leave types and render leave application dashboard w/o from date (#32001) 2022-08-29 12:26:05 +05:30
Rucha Mahabal
074d484d3c fix: do not clear promotion/transfer details if doc is amended (#32000) 2022-08-29 12:10:15 +05:30
Deepesh Garg
332e86af7e Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31910 2022-08-28 17:32:41 +05:30
Deepesh Garg
8eded437d2 Merge pull request #31971 from frappe/mergify/bp/version-13-hotfix/pr-31955
chore: update french translation (backport #31955)
2022-08-28 11:32:34 +05:30
Deepesh Garg
bef7f6114d Merge pull request #31989 from frappe/mergify/bp/version-13-hotfix/pr-31988
chore: remove precision on discount_percentage of Sales Invoice Item (backport #31988)
2022-08-28 11:32:14 +05:30
Deepesh Garg
4095a3dae2 chore: Resolve conflicts 2022-08-26 18:10:09 +05:30
ruthra kumar
0b40117bfd chore: remove precision on discount_percentage of Sales Invoice Item
(cherry picked from commit c42fef541a)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
2022-08-26 10:34:31 +00:00
ruthra kumar
09de1cba92 Merge pull request #31972 from frappe/mergify/bp/version-13-hotfix/pr-31934
refactor: disable discount accounting on Buying module(PI) (backport #31934)
2022-08-25 17:14:44 +05:30
ruthra kumar
51a40ad2fc test: remove discount accounting tests
(cherry picked from commit 277ef04b60)
2022-08-25 16:05:01 +05:30
mergify[bot]
261405cec1 fix(pos): edge case while closing pos (backport #31748) (#31893) 2022-08-25 14:50:24 +05:30
ruthra kumar
1ac9d7f43e refactor: disable discount accounting on Buying module(PI)
(cherry picked from commit a956e20f29)
2022-08-25 14:44:54 +05:30
Florian HENRY
69b3145be4 chore: update fr translation
(cherry picked from commit 299da5d596)
2022-08-25 07:37:26 +00:00
Florian HENRY
5e1d367d7a chore: update fr translation
(cherry picked from commit 1f6f2747d4)
2022-08-25 07:37:25 +00:00
Florian HENRY
10f0baf6ad chore: update french translation
(cherry picked from commit 264f98af14)
2022-08-25 07:37:25 +00:00
Deepesh Garg
20694eb509 Merge pull request #31965 from frappe/mergify/bp/version-13-hotfix/pr-31909
fix: Add docstatus filter for voucher_no in Repost Item Valuation (backport #31909)
2022-08-25 11:25:14 +05:30
HENRY Florian
c2b8d1bd9a feat: In BOM, Operation time can be fix (backport #27063) (#31923)
* feat: In BOM Operation time can be fix (backport #27063)

* chore: only changes necessary for feature

* chore: add test

* chore: linter

* chore: linter

* chore: linter

* chore: fix date in json

* chore: fix test order

* chore: revert test from version-13 not develop

* chore: make test ok
2022-08-25 11:14:35 +05:30
rohitwaghchaure
49bf05c1c2 Merge pull request #31962 from frappe/mergify/bp/version-13-hotfix/pr-31951
fix: Purposes not set in Maintenance Visit (backport #31951)
2022-08-25 10:51:12 +05:30
Sagar Sharma
2cf2885470 fix: Add docstatus filter for voucher_no in Repost Item Valuation
(cherry picked from commit 520306dc87)
2022-08-25 05:20:46 +00:00
Rohit Waghchaure
edfaf99388 fix: Purposes not set
(cherry picked from commit f9a7b31b5b)
2022-08-25 05:19:36 +00:00
Deepesh Garg
3a7a53ab72 Merge pull request #31919 from SolufyPrivateLimited/Solufy-pur_inv_docstatus
fix: Set the condition to create a purchase receipt
2022-08-25 10:35:14 +05:30
mergify[bot]
34537c9dc2 fix: Route condition set for stock ledger (backport #31935) (#31946)
fix: Route condition set for stock ledger (#31935)

(cherry picked from commit 0e26df331c)

Co-authored-by: Solufyin <34390782+Solufyin@users.noreply.github.com>
2022-08-24 13:30:49 +05:30
Frappe PR Bot
f6248d0259 chore(release): Bumped to Version 13.36.5
## [13.36.5](https://github.com/frappe/erpnext/compare/v13.36.4...v13.36.5) (2022-08-23)

### Bug Fixes

* added employee name to call log ([476ded2](476ded2972))
* added field to show called group, user_id ([66578a5](66578a58cf))
* added tests ([aa8a063](aa8a063103))
* added type of call select field, additional status for agent rejecting call ([b65bce8](b65bce8f98))
* call status fix ([ffb1196](ffb1196516))
* call type doctype, fixes ([b94154f](b94154f00a))
* Handle exception where no employee is returned ([baab96d](baab96d02c))
* incorrect buying amount in Gross Profit rpt ([6405a93](6405a9378d))
* incorrect tax amt due to different exchange rate in PR and PI ([ba5ee1c](ba5ee1ca96))
* interview rescheduling not working ([a482840](a4828407d0))
* limit pos recent order page result ([9751f10](9751f1060e))
* linter, sider fixes ([b529627](b52962751c))
* **minor:** save the employee doc on promotion/transfer update ([36130c6](36130c6292))
* process loan interest accrual ([acbed43](acbed434c2))
* Replace walrus operator ([23a4412](23a441252b))
* sider fixes ([90ed14a](90ed14a055))
* TDS calculation for advance payment ([a452143](a452143782))
* term loan interest calculation ([8dea238](8dea238d12))
* Update received_by if "to" is changed ([9263d5f](9263d5ff4d))
* used get_employees_with_number, strip_number methods ([3f46b2a](3f46b2a0ce))
2022-08-23 13:37:34 +00:00
Deepesh Garg
4e6ef5d6fa Merge pull request #31939 from frappe/version-13-hotfix
chore: Weekly version 13 release
2022-08-23 19:05:53 +05:30
mergify[bot]
154adcbb58 chore: add Work Order test dependencies (backport #31936) (#31938)
chore: add Work Order test dependencies (#31936)

(cherry picked from commit fe73d55f70)

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
2022-08-23 16:10:27 +05:30
Deepesh Garg
6a9d13ff28 chore: Linting issues
(cherry picked from commit 1cb7ae16ab)
2022-08-23 04:50:19 +00:00
Deepesh Garg
7c85b487cd fix: Test cases
(cherry picked from commit ae3dce0cbd)
2022-08-23 04:50:18 +00:00
Deepesh Garg
20e9599fc1 fix: Cash and non trade discount calculation
(cherry picked from commit 3b15966cc9)
2022-08-23 04:50:17 +00:00
Solufyin
b4c992dd4d fix: Set the condition to create a purchase receipt 2022-08-22 12:00:21 +05:30
Suraj Shetty
d46ce05dcd Merge pull request #31903 from frappe/exotel_fixes_v13 2022-08-22 10:52:18 +05:30
Deepesh Garg
6bc6681f92 Merge pull request #31825 from frappe/mergify/bp/version-13-hotfix/pr-31817
fix: limit pos recent order page result (backport #31817)
2022-08-22 10:32:30 +05:30
Deepesh Garg
75d57c1f77 Merge pull request #31889 from frappe/mergify/bp/version-13-hotfix/pr-31871
fix: incorrect buying amount in Gross Profit rpt (backport #31871)
2022-08-22 10:29:47 +05:30
Deepesh Garg
fc7285cc85 Merge pull request #31826 from frappe/mergify/bp/version-13-hotfix/pr-31799
fix: process loan interest accrual (backport #31799)
2022-08-22 10:28:04 +05:30
Suraj Shetty
23a441252b fix: Replace walrus operator 2022-08-22 09:49:15 +05:30
Deepesh Garg
474f34c04c Merge pull request #31868 from frappe/mergify/bp/version-13-hotfix/pr-31856
fix: incorrect tax amt due to different exchange rate in PR and PI (backport #31856)
2022-08-22 09:09:53 +05:30
Deepesh Garg
6606028062 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31799 2022-08-22 09:00:14 +05:30
Deepesh Garg
f58427bffe Merge pull request #31894 from maharshivpatel/fix-tax-withholding-advance-vouchers
fix: TDS calculation for advance payment
2022-08-22 08:58:59 +05:30
Suraj Shetty
89f889068e style: Fix formatting 2022-08-20 14:19:15 +05:30
Suraj Shetty
9263d5ff4d fix: Update received_by if "to" is changed 2022-08-20 14:15:54 +05:30
Suraj Shetty
4df197a282 test: Do not overwrite frappe.form_dict to retain proxy reference
Set frappe.local.form_dict instead
2022-08-20 14:14:16 +05:30
Suraj Shetty
b495969eb8 test: Clean up form_dict
To avoid failures like
https://github.com/frappe/erpnext/runs/5887687369?check_suite_focus=true#step:12:783
2022-08-20 14:14:10 +05:30
Suraj Shetty
5f4760985c test: Fix used frappe._dict to avoid AttributeError down the line
ref: https://github.com/frappe/erpnext/runs/5816574721?check_suite_focus=true#step:12:880
2022-08-20 14:14:03 +05:30
Suraj Shetty
4a61840e39 test: Use FrappeAPITestCase to track coverage 2022-08-20 14:13:56 +05:30
Suraj Shetty
ca48b9de54 test: Fix erroneous code 2022-08-20 14:13:50 +05:30
Suraj Shetty
baab96d02c fix: Handle exception where no employee is returned 2022-08-20 14:13:40 +05:30
Suraj Shetty
f5b967a947 chore: Remove unused code
- and simplify get_call_log
2022-08-20 14:13:24 +05:30
Suraj Shetty
06b1bcbf59 test: Refactor exotel test setup
- Remove unnecessary code
- Move test data to separate file
- Make proper test assertions
2022-08-20 14:12:17 +05:30
Subin Tom
aa8a063103 fix: added tests 2022-08-20 14:11:48 +05:30
Subin Tom
3f46b2a0ce fix: used get_employees_with_number, strip_number methods 2022-08-20 14:10:18 +05:30
Subin Tom
b52962751c fix: linter, sider fixes 2022-08-20 14:07:17 +05:30
Subin Tom
b94154f00a fix: call type doctype, fixes 2022-08-20 14:06:52 +05:30
Subin Tom
90ed14a055 fix: sider fixes 2022-08-20 14:05:49 +05:30
Subin Tom
b65bce8f98 fix: added type of call select field, additional status for agent rejecting call 2022-08-20 14:05:27 +05:30
Subin Tom
66578a58cf fix: added field to show called group, user_id 2022-08-20 14:04:01 +05:30
Subin Tom
476ded2972 fix: added employee name to call log 2022-08-20 14:03:40 +05:30
Subin Tom
ffb1196516 fix: call status fix 2022-08-20 14:03:14 +05:30
Maharshi Patel
a452143782 fix: TDS calculation for advance payment
"against_voucher": ["is", "not set"] was used in query due to which if TDS was added on "advance" payment vouchers and then reconciled against purchase invoice. it will not find those vouchers and consider this as first-time threshold due to which it will calculate Tax for all transactions.
2022-08-19 12:30:47 +05:30
ruthra kumar
6405a9378d fix: incorrect buying amount in Gross Profit rpt
(cherry picked from commit 967dd398e7)
2022-08-18 13:28:45 +00:00
Rucha Mahabal
2471ca58ee Merge pull request #31884 from ruchamahabal/fix-promotion 2022-08-18 12:29:31 +05:30
Rucha Mahabal
a4828407d0 fix: interview rescheduling not working 2022-08-18 12:02:32 +05:30
Frappe PR Bot
bafa3ce150 chore(release): Bumped to Version 13.36.4
## [13.36.4](https://github.com/frappe/erpnext/compare/v13.36.3...v13.36.4) (2022-08-18)

### Bug Fixes

* check item_code in all rows of po_items (backport [#31741](https://github.com/frappe/erpnext/issues/31741)) ([#31843](https://github.com/frappe/erpnext/issues/31843)) ([ba8dc89](ba8dc8925f))
* conflicts ([41b8563](41b8563b7a))
* contact search in request for quotation (backport [#31828](https://github.com/frappe/erpnext/issues/31828)) ([#31841](https://github.com/frappe/erpnext/issues/31841)) ([2a615af](2a615af00a))
* incorrect produced-qty in production-plan-item (backport [#31706](https://github.com/frappe/erpnext/issues/31706)) ([#31862](https://github.com/frappe/erpnext/issues/31862)) ([7ddb332](7ddb332f47))
* incorrect rate in BOM exploded items (backport [#31513](https://github.com/frappe/erpnext/issues/31513)) ([#31865](https://github.com/frappe/erpnext/issues/31865)) ([3274e76](3274e7681d))
* Make expense account editable in Purchase Receipt Item (backport [#31730](https://github.com/frappe/erpnext/issues/31730)) ([#31879](https://github.com/frappe/erpnext/issues/31879)) ([4775c42](4775c42593))
* not able to issue expired batches ([7ee75ff](7ee75ff762))
* set `billing_address` for purchases in `get_party_details` ([a7d66fa](a7d66fa352))
* set `company_address` for purchases in `party.js` ([d1de4b0](d1de4b027c))
* Transit filter for Default Target Warehouse in SE (backport [#31839](https://github.com/frappe/erpnext/issues/31839)) ([#31874](https://github.com/frappe/erpnext/issues/31874)) ([b0917aa](b0917aaf8a))
* use old style for `_dict.update` ([15654aa](15654aae8b))
2022-08-18 06:15:23 +00:00
Deepesh Garg
cff140db3d Merge pull request #31880 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-08-18 11:43:42 +05:30
Rucha Mahabal
36130c6292 fix(minor): save the employee doc on promotion/transfer update 2022-08-18 11:42:29 +05:30
mergify[bot]
4775c42593 fix: Make expense account editable in Purchase Receipt Item (backport #31730) (#31879)
* fix: Make expense account editable in Purchase Receipt Item (#31730)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit 1a6508972e)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json

* chore: conflicts

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-18 11:15:26 +05:30
mergify[bot]
b0917aaf8a fix: Transit filter for Default Target Warehouse in SE (backport #31839) (#31874)
fix: Transit filter for Default Target Warehouse in SE (#31839)

(cherry picked from commit f1a612245c)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 17:25:31 +05:30
rohitwaghchaure
d349a337e1 Merge pull request #31866 from frappe/mergify/bp/version-13-hotfix/pr-31863
fix: not able to issue expired batches (backport #31863)
2022-08-17 15:43:22 +05:30
ruthra kumar
ba5ee1ca96 fix: incorrect tax amt due to different exchange rate in PR and PI
(cherry picked from commit 5fd0770372)
2022-08-17 09:40:36 +00:00
rohitwaghchaure
41b8563b7a fix: conflicts 2022-08-17 14:47:47 +05:30
Rohit Waghchaure
7ee75ff762 fix: not able to issue expired batches
(cherry picked from commit 795c94384a)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py
2022-08-17 09:16:37 +00:00
mergify[bot]
3274e7681d fix: incorrect rate in BOM exploded items (backport #31513) (#31865)
* fix: incorrect rate in BOM exploded items (#31513)

(cherry picked from commit 313625c349)

# Conflicts:
#	erpnext/manufacturing/doctype/bom_item/bom_item.json

* chore: conflicts

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 14:39:15 +05:30
mergify[bot]
7ddb332f47 fix: incorrect produced-qty in production-plan-item (backport #31706) (#31862)
fix: incorrect produced-qty in production-plan-item (#31706)

(cherry picked from commit 538cd6fdcf)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 13:49:51 +05:30
mergify[bot]
2a615af00a fix: contact search in request for quotation (backport #31828) (#31841)
* fix: contact search in request for quotation (#31828)

(cherry picked from commit e5e88bb9f1)

# Conflicts:
#	erpnext/buying/doctype/request_for_quotation/request_for_quotation.py

* chore: conflicts

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 11:23:24 +05:30
mergify[bot]
ba8dc8925f fix: check item_code in all rows of po_items (backport #31741) (#31843)
fix: check item_code in all rows of po_items (#31741)

fix: check item-code in each row of po-items
(cherry picked from commit 0047e18a9b)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 11:21:47 +05:30
Sagar Vora
14891ccf18 Merge pull request #31792 from frappe/mergify/bp/version-13-hotfix/pr-31733
fix: set `billing_address` for purchases in `get_party_details` (backport #31733)
2022-08-16 05:48:48 +00:00
Sagar Vora
15654aae8b fix: use old style for _dict.update 2022-08-13 08:00:27 +00:00
Sagar Vora
d1de4b027c fix: set company_address for purchases in party.js
(cherry picked from commit d05082987f)
2022-08-13 08:00:27 +00:00
Sagar Vora
a7d66fa352 fix: set billing_address for purchases in get_party_details
(cherry picked from commit a3625b3817)
2022-08-13 08:00:27 +00:00
Abhinav Raut
8dea238d12 fix: term loan interest calculation
(cherry picked from commit 534d7ce64b)
2022-08-11 10:18:04 +00:00
Abhinav Raut
acbed434c2 fix: process loan interest accrual
(cherry picked from commit 9ef8d5c5c3)
2022-08-11 10:18:04 +00:00
ruthra kumar
9751f1060e fix: limit pos recent order page result
(cherry picked from commit bb40e38451)
2022-08-11 08:40:05 +00:00
Frappe PR Bot
c15cff05b0 chore(release): Bumped to Version 13.36.3
## [13.36.3](https://github.com/frappe/erpnext/compare/v13.36.2...v13.36.3) (2022-08-09)

### Bug Fixes

* (india) HSN wise report ([08c69c7](08c69c7a76))
* add asset repair to accounting dimension list ([809d5ca](809d5caf80))
* consider precision while validating advance amount against sanctioned amount ([63cd434](63cd4349a6))
* **ecommerce:** remove query to non-existing field (backport [#31771](https://github.com/frappe/erpnext/issues/31771)) ([#31774](https://github.com/frappe/erpnext/issues/31774)) ([0e46b33](0e46b33ee3))
* f-string and where clause ([42b3959](42b395916d))
* getting error to show sales invoice group or print rep… (backport [#31756](https://github.com/frappe/erpnext/issues/31756)) ([#31768](https://github.com/frappe/erpnext/issues/31768)) ([473a43b](473a43b6b1))
* incorrect incoming rate set for inter transfer purchase receipt ([4e8b39a](4e8b39ab3f))
* incorrect tax calculation in case of reduced payment days ([80981d0](80981d025f))
* intercompany SO throws exception ([a17acfd](a17acfdaa2))
* minor changed link ([e9e53a7](e9e53a74c9))
* Payment Entry button is visible even when claim is fully paid ([d820757](d820757359))
* pending principal- amount ([16c94d2](16c94d292c))
* **pos:** validate product bundles while submitting pos invoice (backport [#31615](https://github.com/frappe/erpnext/issues/31615)) ([#31657](https://github.com/frappe/erpnext/issues/31657)) ([b145fe3](b145fe3b3e))
* specify allowed doctype in queries ([#31765](https://github.com/frappe/erpnext/issues/31765)) ([0dbfb15](0dbfb1589e))
* statistical component showing up in salary slip ([#31746](https://github.com/frappe/erpnext/issues/31746)) ([26aef4f](26aef4fb1c))
* sum stock_value and group by warehouse ([18d93f8](18d93f8398))
* taxable_value and gst_account_heads ([6c574fb](6c574fbf33))
* update To Date in Employee Work History ([#31811](https://github.com/frappe/erpnext/issues/31811)) ([0057c10](0057c10a7d))
2022-08-09 14:09:11 +00:00
Deepesh Garg
b80526f226 Merge pull request #31812 from frappe/version-13-hotfix
chore: weekly version 13 release
2022-08-09 19:37:13 +05:30
Deepesh Garg
0569f8a857 Merge pull request #31736 from maharshivpatel/fix-india-hsn-report
fix: (india) HSN wise report
2022-08-09 18:58:25 +05:30
Rucha Mahabal
63715bf229 Merge pull request #31813 from ruchamahabal/fix-claim 2022-08-09 18:52:22 +05:30
Rucha Mahabal
63cd4349a6 fix: consider precision while validating advance amount against sanctioned amount 2022-08-09 18:28:19 +05:30
Maharshi Patel
42b395916d fix: f-string and where clause
Used f-string formatting and added conditions to WHERE clause
2022-08-09 18:22:05 +05:30
Rucha Mahabal
0057c10a7d fix: update To Date in Employee Work History (#31811) 2022-08-09 18:19:09 +05:30
Deepesh Garg
3c8c5d01fb Merge pull request #31797 from frappe/mergify/bp/version-13-hotfix/pr-31779
Bug add accouting dimension in asset repair (backport #31779)
2022-08-09 18:18:42 +05:30
Rucha Mahabal
d820757359 fix: Payment Entry button is visible even when claim is fully paid 2022-08-09 18:15:41 +05:30
mergify[bot]
14e59c86aa Tds report (backport #31801) (#31808)
* fix: TDS Computation Summary Report not loading, too many values to unpack
2022-08-09 18:11:13 +05:30
Deepesh Garg
9e16f4e412 chore: resolve conflicts 2022-08-09 17:55:02 +05:30
rohitwaghchaure
6d269a4d89 Merge pull request #31805 from frappe/mergify/bp/version-13-hotfix/pr-31804
fix: incorrect incoming rate set for inter transfer purchase receipt (backport #31804)
2022-08-09 16:26:34 +05:30
Rohit Waghchaure
4e8b39ab3f fix: incorrect incoming rate set for inter transfer purchase receipt
(cherry picked from commit ddd24ea8c8)
2022-08-09 10:31:14 +00:00
Rucha Mahabal
9925eb9982 Merge pull request #31802 from ruchamahabal/fix-salary-slip-tds-v13 2022-08-09 15:33:54 +05:30
Rucha Mahabal
301d199ece test: default amount in slip 2022-08-09 14:57:10 +05:30
Maharshi Patel
6c574fbf33 fix: taxable_value and gst_account_heads
used taxable_value instead of base_net_amount and only appended required GST accounts
2022-08-09 14:39:13 +05:30
Rucha Mahabal
80981d025f fix: incorrect tax calculation in case of reduced payment days 2022-08-09 12:40:06 +05:30
ruthra kumar
a420d0242c chore: patch for creating existing dimensions in asset repair
(cherry picked from commit 80f508c4b1)

# Conflicts:
#	erpnext/patches.txt
2022-08-08 11:09:55 +00:00
ruthra kumar
809d5caf80 fix: add asset repair to accounting dimension list
(cherry picked from commit 452584c4bd)
2022-08-08 11:09:53 +00:00
Deepesh Garg
6f442d14cf Merge pull request #31795 from frappe/mergify/bp/version-13-hotfix/pr-31777
fix: intercompany SO created from Purchase Order throws exception (backport #31777)
2022-08-08 16:37:39 +05:30
ruthra kumar
a17acfdaa2 fix: intercompany SO throws exception
(cherry picked from commit af0a353b79)
2022-08-08 10:37:25 +00:00
Deepesh Garg
3673dea03b Merge pull request #31783 from frappe/mergify/bp/version-13-hotfix/pr-31780
Fix: Loan pending principal amount  (backport #31780)
2022-08-08 14:48:06 +05:30
Deepesh Garg
fb3725752f chore: resolve conflicts 2022-08-08 11:53:49 +05:30
Abhinav Raut
16c94d292c fix: pending principal- amount
(cherry picked from commit a272d73dd9)

# Conflicts:
#	erpnext/loan_management/doctype/loan_repayment/loan_repayment.json
2022-08-05 10:35:05 +00:00
mergify[bot]
0e46b33ee3 fix(ecommerce): remove query to non-existing field (backport #31771) (#31774)
fix(ecommerce): remove query to non-existing field (#31771)

(cherry picked from commit 17b9bfd249)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-03 17:08:46 +05:30
mergify[bot]
df716fbd0c ci: fix automated release regex (backport #31770) (#31772)
ci: fix automated release regex (#31770)

[skip ci]

(cherry picked from commit 2defb89962)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-03 16:37:39 +05:30
mergify[bot]
0dbfb1589e fix: specify allowed doctype in queries (#31765)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2022-08-03 12:03:53 +05:30
mergify[bot]
473a43b6b1 fix: getting error to show sales invoice group or print rep… (backport #31756) (#31768)
fix: getting error to show sales invoice group or print rep… (#31756)

fix: formatter getting error to show sales invoice group or print report.

1 - When I view the Gross Profit report in Sales Invoice mode, the table is all broken.
Error on browser console:
TypeError: Cannot read properties of undefined (reading 'indent')

2 - When I try to print, no matter the Group (Sales Invoice, Item Code, Item Group...) nothing happens. in browser log console I have the following error:
TypeError: Cannot read properties of undefined (reading 'content')

i fixed both errors and all working perfectly.

(cherry picked from commit ea88451875)

Co-authored-by: HarryPaulo <paulo_fabris@hotmail.com>
2022-08-03 11:23:10 +05:30
rohitwaghchaure
1a3b3b96c2 Merge pull request #31751 from frappe/mergify/bp/version-13-hotfix/pr-31750
fix: minor URL link (backport #31750)
2022-08-01 14:34:12 +05:30
Rohit Waghchaure
e9e53a74c9 fix: minor changed link
(cherry picked from commit 0e7c4314b4)
2022-08-01 09:02:07 +00:00
Rucha Mahabal
26aef4fb1c fix: statistical component showing up in salary slip (#31746)
* fix: statistical component showing up in salary slip

* fix(test): payment days effect on timesheet salary slio
2022-08-01 12:54:25 +05:30
mergify[bot]
b145fe3b3e fix(pos): validate product bundles while submitting pos invoice (backport #31615) (#31657) 2022-07-31 19:12:14 +05:30
Marica
d83c869d73 Merge pull request #31717 from frappe/mergify/bp/version-13-hotfix/pr-31601
perf: reduce db calls for warehouse wise stock value chart (backport #31601)
2022-07-31 18:26:27 +05:30
Maharshi Patel
08c69c7a76 fix: (india) HSN wise report
Problem:
The previous approach for calculating tax_rate was incorrect.
```
['tax_rate'] * ['number of unique rows']
```
Joining `tabSales Taxes and Charges` was adding unnecessary rows & complexity.

Solution:
Instead of trying to get tax_rate from the main query itself, I used the get_tax_accounts's data to calculate the correct tax_rate.

Todo:
Union Territory
2022-07-29 14:22:31 +05:30
Frappe PR Bot
84e6cead56 chore(release): Bumped to Version 13.36.2
## [13.36.2](https://github.com/frappe/erpnext/compare/v13.36.1...v13.36.2) (2022-07-28)

### Bug Fixes

* (india) (e-invoice) margin & internal company transfer ([b97d30a](b97d30aad0))
* (india) add overseas in HSN wise report ([1d69ce1](1d69ce1932))
* Allow allocating advance amount against Expense Claim taxes ([42f3592](42f3592e95))
* assign duplicate_items_msg outside conditional ([#31639](https://github.com/frappe/erpnext/issues/31639)) ([8e23c6a](8e23c6ad69))
* correct Brazilian portuguese translations (backport [#31498](https://github.com/frappe/erpnext/issues/31498)) ([#31660](https://github.com/frappe/erpnext/issues/31660)) ([794fd08](794fd0819f))
* discount and test added ([a843e78](a843e784e6))
* display customer name on picking list ([dbf245c](dbf245c687))
* do not update component amount for timesheet components ([#31696](https://github.com/frappe/erpnext/issues/31696)) ([bc7cfe6](bc7cfe6919))
* enable tax withholding checkbox in PI with supplier_tds ([bc74942](bc7494278d))
* ensure defaults removed in bad frappe patch get set again (backport [#31659](https://github.com/frappe/erpnext/issues/31659)) ([#31661](https://github.com/frappe/erpnext/issues/31661)) ([763787b](763787b0a5))
* hero image not loading in portal homepage ([#31699](https://github.com/frappe/erpnext/issues/31699)) ([8a6432e](8a6432ec3f))
* **india:** e-way bill json for unregistered gst category ([01d6df4](01d6df45d0))
* make customer_name field read only. ([2381b81](2381b81aac))
* manually generated salary slips overwritten by structure amount ([#31711](https://github.com/frappe/erpnext/issues/31711)) ([32c1bb6](32c1bb61de))
* Map `Item` image to `Website Item` website_image only if published via UI (v13) ([9b1544a](9b1544aa14))
* payment entry to student ([#31708](https://github.com/frappe/erpnext/issues/31708)) ([4f02375](4f023757de))
* Reload loan Table in Salary Slip when change Employee ([#31525](https://github.com/frappe/erpnext/issues/31525)) ([a95c011](a95c011a93))
* rounding errors while closing pos (backport [#31654](https://github.com/frappe/erpnext/issues/31654)) ([#31658](https://github.com/frappe/erpnext/issues/31658)) ([529a47b](529a47bc88))
* Route condition set with proper filter ([#31556](https://github.com/frappe/erpnext/issues/31556)) ([5cdc267](5cdc267aee))
* The Fee details are not fetched in Program Enrollment ([#31153](https://github.com/frappe/erpnext/issues/31153)) ([0602848](0602848caa))
* update fr translations ([#31687](https://github.com/frappe/erpnext/issues/31687)) ([89348c1](89348c1bb4))
* update fr translations (backport [#31526](https://github.com/frappe/erpnext/issues/31526)) ([#31666](https://github.com/frappe/erpnext/issues/31666)) ([95e1021](95e1021caf))
* update SO's percentage billed on credit note ([2f2d3de](2f2d3de306))
* use current pos profile on sales return ([c442b4a](c442b4aef1))
2022-07-28 12:13:57 +00:00
Deepesh Garg
590e48fa1d Merge pull request #31725 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-07-28 17:42:15 +05:30
Deepesh Garg
25da4d28ff Merge pull request #31727 from frappe/mergify/bp/version-13-hotfix/pr-31656
fix: use current pos profile on sales return (backport #31656)
2022-07-28 16:32:36 +05:30
Deepesh Garg
f57d2fadbc Merge pull request #31728 from frappe/mergify/bp/version-13-hotfix/pr-31676
fix: enable tax withholding checkbox in PI with supplier_tds (backport #31676)
2022-07-28 16:32:17 +05:30
Deepesh Garg
9e7edd677a Merge pull request #31726 from frappe/mergify/bp/version-13-hotfix/pr-31576
fix: credite note for returned delivery note updates SO's billed percentage (backport #31576)
2022-07-28 16:32:05 +05:30
ruthra kumar
bc7494278d fix: enable tax withholding checkbox in PI with supplier_tds
(cherry picked from commit b461724416)
2022-07-28 10:42:58 +00:00
ruthra kumar
c442b4aef1 fix: use current pos profile on sales return
(cherry picked from commit 5b85af5f1a)
2022-07-28 10:36:23 +00:00
ruthra kumar
ef9b25cf08 test: SO percentage billed when cr_note made against delivery return
(cherry picked from commit 243f66fcd3)
2022-07-28 10:21:19 +00:00
ruthra kumar
2f2d3de306 fix: update SO's percentage billed on credit note
Credit Note created from Sales Return will update precentage billed in
Sales Order accordingly

(cherry picked from commit 04c1019242)
2022-07-28 10:21:18 +00:00
Rucha Mahabal
13639682ce Merge pull request #31724 from ruchamahabal/expense-claim-adv 2022-07-28 14:51:15 +05:30
Rucha Mahabal
c01adae8a5 test: advance amount allocation against expense claim with taxes 2022-07-28 14:27:09 +05:30
Deepesh Garg
8ae691d9dc Merge branch 'version-13' into version-13-hotfix 2022-07-28 13:59:25 +05:30
Alaa Alsalehi
a95c011a93 fix: Reload loan Table in Salary Slip when change Employee (#31525)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
Co-authored-by: bahaaabed <bahaa.9999.sh@gmail.com>
Co-authored-by: newhr1 <104132586+newhr1@users.noreply.github.com>
2022-07-28 13:22:07 +05:30
Rucha Mahabal
42f3592e95 fix: Allow allocating advance amount against Expense Claim taxes 2022-07-28 13:21:29 +05:30
Syed Mujeer Hashmi
0602848caa fix: The Fee details are not fetched in Program Enrollment (#31153) 2022-07-28 12:30:39 +05:30
Rucha Mahabal
9985d28571 chore: Add HR & Payroll deprecation warning (#31720) 2022-07-28 11:43:49 +05:30
Marica
31824c2280 Merge pull request #31716 from frappe/mergify/bp/version-13-hotfix/pr-31687
fix: update fr translations (backport #31687)
2022-07-27 18:01:30 +05:30
Devin Slauenwhite
18d93f8398 fix: sum stock_value and group by warehouse
(cherry picked from commit 1e20358c28)
2022-07-27 12:18:39 +00:00
Devin Slauenwhite
c9443123f9 chore: remove unused import
(cherry picked from commit bc3023318e)
2022-07-27 12:18:38 +00:00
Devin Slauenwhite
0fdec8fac8 pref: reduce count of db calls from n to 2
(cherry picked from commit 73ade04dcf)
2022-07-27 12:18:38 +00:00
marination
6fbb06a878 chore: Merge Conflict 2022-07-27 17:30:46 +05:30
HENRY Florian
89348c1bb4 fix: update fr translations (#31687)
* fix: update fr translations

* fix: update fr translation

* fix: update fr translation

* chore: Replace apostrophe encoding by symbol

Co-authored-by: marination <maricadsouza221197@gmail.com>
(cherry picked from commit cc1f837685)

# Conflicts:
#	erpnext/translations/fr.csv
2022-07-27 11:52:03 +00:00
Marica
598dbc93ac Merge pull request #31669 from frappe/mergify/bp/version-13-hotfix/pr-31579
fix: display customer name on picking list (backport #31579)
2022-07-27 16:45:07 +05:30
Marica
51a4ef3069 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31579 2022-07-27 16:23:22 +05:30
Marica
49fb177f86 chore: Merge Conflicts 2022-07-27 16:22:17 +05:30
Marica
b0aae8a297 Merge pull request #31713 from frappe/mergify/bp/version-13-hotfix/pr-31469
chore: Make `image` field obsolete in Website Item (redundant) (backport #31469)
2022-07-27 16:12:32 +05:30
Marica
e310347ca4 chore: Merge Conflicts 2022-07-27 15:51:01 +05:30
marination
9b1544aa14 fix: Map Item image to Website Item website_image only if published via UI (v13)
- For v12 Items, `website_image` should be mapped from `Item` to `Website Item`

(cherry picked from commit af38baeb3b)

# Conflicts:
#	erpnext/e_commerce/doctype/website_item/website_item.py
2022-07-27 10:14:20 +00:00
marination
a8da5f4566 chore: Remove image use in website item list
(cherry picked from commit 7a6ee8cf2d)
2022-07-27 10:14:18 +00:00
marination
0e469f6d95 chore: Remove image from ProductQuery fields
(cherry picked from commit eec07833f4)
2022-07-27 10:14:18 +00:00
marination
b393c230bd chore: Make image field obsolete in Website Item (redundant)
- Delete Image field and set `website_image` as form's image field for uploads
- Remove instances of `image` field access via Website Item
- Item -> Web Item via Desk: Map Item's `image` to Web Item's `website_image`
- Item -> Web Item via patch: `website_image` will be mapped with thumbnail
- Remove magic that auto-sets `website_image` from `image` in Website Item

(cherry picked from commit 9541354ec7)

# Conflicts:
#	erpnext/e_commerce/doctype/website_item/website_item.py
2022-07-27 10:14:16 +00:00
Rucha Mahabal
32c1bb61de fix: manually generated salary slips overwritten by structure amount (#31711) 2022-07-27 12:44:26 +05:30
MohsinAli
4f023757de fix: payment entry to student (#31708)
Payment entry to student via Payment References(From Journal Entry)
2022-07-27 11:50:15 +05:30
Deepesh Garg
d2d25e17bb Merge pull request #31698 from maharshivpatel/fix-einvoice-margin-internal-transfer
fix: (india) (e-invoice) margin & internal company transfer
2022-07-26 21:59:44 +05:30
Maharshi Patel
a843e784e6 fix: discount and test added
only report net rate if discount is less than 0 and added test.
2022-07-26 17:40:59 +05:30
Rucha Mahabal
8a6432ec3f fix: hero image not loading in portal homepage (#31699) 2022-07-26 13:43:36 +05:30
Maharshi Patel
b97d30aad0 fix: (india) (e-invoice) margin & internal company transfer
When the item price is more than the price list rate ( margin added ) discount value becomes negative. The previous attempt to solve this was to convert discount to absolute value. However, that gives incorrect unit price and discount value. To solve this, I have made changes to report net rates in cases where the margin is added or is an internal company transfer.
2022-07-26 12:57:47 +05:30
Rucha Mahabal
bc7cfe6919 fix: do not update component amount for timesheet components (#31696)
* fix: do not update component amount for timesheet components

* fix: warn the user about overwriting timesheet component amount
2022-07-26 12:35:50 +05:30
Deepesh Garg
85802b0f97 Merge pull request #31602 from rtdany10/patch-19
fix(india): e-way bill json for unregistered gst category
2022-07-22 13:11:19 +05:30
Deepesh Garg
dc67d39ce6 Merge pull request #31665 from maharshivpatel/fix-add-overseas-hsn-report
fix: (india) add entries from overseas invoices in HSN wise report
2022-07-22 13:06:30 +05:30
mergify[bot]
529a47bc88 fix: rounding errors while closing pos (backport #31654) (#31658) 2022-07-22 11:17:59 +05:30
Devin Slauenwhite
2381b81aac fix: make customer_name field read only.
(cherry picked from commit 7083b3148b)

# Conflicts:
#	erpnext/stock/doctype/pick_list/pick_list.json
2022-07-21 13:08:41 +00:00
Devin Slauenwhite
dbf245c687 fix: display customer name on picking list
(cherry picked from commit 0a633a212d)

# Conflicts:
#	erpnext/stock/doctype/pick_list/pick_list.json
2022-07-21 13:08:40 +00:00
Nihantra C. Patel
5cdc267aee fix: Route condition set with proper filter (#31556)
* fix: Redirect to report with proper filter

* Update member.js

* fix: Route condition set with proper filter

* fix: Route condition set with proper filter

* fix: Route condition set with proper filter

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-07-21 18:29:06 +05:30
mergify[bot]
95e1021caf fix: update fr translations (backport #31526) (#31666)
fix: update fr translations (#31526)

* fix: update fr translations

* fix: update fr translations

* fix: update fr translations

* fix: update fr translations

* chore: Update french translation

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit 3ba0d6cc5c)

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
2022-07-21 18:11:32 +05:30
mergify[bot]
7d50f8798a Update de.csv (backport #31596) (#31667)
Update de.csv (#31596)

IN,IM to IN,EIN

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit 8629d01dd5)

Co-authored-by: billy995 <48571007+billy995@users.noreply.github.com>
2022-07-21 18:10:46 +05:30
Marica
dd751c6e92 Merge pull request #31664 from frappe/mergify/bp/version-13-hotfix/pr-31544
FIX: quality inspection quick creation from purchase receipt: pre-fill sample size if available (backport #31544)
2022-07-21 14:13:48 +05:30
Frappe PR Bot
69087b8790 chore(release): Bumped to Version 13.36.1
## [13.36.1](https://github.com/frappe/erpnext/compare/v13.36.0...v13.36.1) (2022-07-21)

### Bug Fixes

* ensure defaults removed in bad frappe patch get set again (backport [#31659](https://github.com/frappe/erpnext/issues/31659)) ([2ae3bd9](2ae3bd9fed))
2022-07-21 08:26:20 +00:00
mergify[bot]
763787b0a5 fix: ensure defaults removed in bad frappe patch get set again (backport #31659) (#31661)
fix: ensure defaults removed in bad frappe patch get set again (#31659)

(cherry picked from commit bf2833b8ee)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2022-07-21 13:54:55 +05:30
mergify[bot]
2ae3bd9fed fix: ensure defaults removed in bad frappe patch get set again (backport #31659)
fix: ensure defaults removed in bad frappe patch get set again (#31659)

(cherry picked from commit bf2833b8ee)
(cherry picked from commit 9071018e4e)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2022-07-21 13:54:40 +05:30
Marc de Lima Lucio
1998223ee3 FIX: quality inspection quick creation from purchase receipt: pre-fill sample size if available (#31544)
FIX: quality inspection quick creation from transaction documents: pre-fill sample size if available

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit 048c037842)
2022-07-21 08:17:48 +00:00
mergify[bot]
794fd0819f fix: correct Brazilian portuguese translations (backport #31498) (#31660)
fix: correct Brazilian portuguese translations (#31498)

* fix brazilian portuguese translations

* minor adjustments

* fix minor adjustments

* fix: remove legacy pt_br.csv

* chore: Fix translation quotation marks

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit d30f8387d9)

Co-authored-by: Marco Fonseca <62901164+treasuryesc@users.noreply.github.com>
2022-07-21 13:47:18 +05:30
Maharshi Patel
1d69ce1932 fix: (india) add overseas in HSN wise report
SQL query had WHERE `tabSales Taxes and Charges`.parent = `tabSales Invoice`.name. However, In overseas, there is no `tabSales Taxes and Charges` so I changed the query to use a combination of INNER JOIN and LEFT JOIN to fetch all entries.
2022-07-21 13:27:30 +05:30
Maharshi Patel
8e23c6ad69 fix: assign duplicate_items_msg outside conditional (#31639)
duplicate_items_msg was defined inside if the statement  of stock_item so when duplicate was found in non_stock_item it raised referenced before assignment
2022-07-20 21:25:36 +05:30
Dany Robert
01d6df45d0 fix(india): e-way bill json for unregistered gst category 2022-07-15 11:17:41 +05:30
419 changed files with 23110 additions and 13188 deletions

View File

@@ -66,7 +66,8 @@ ignore =
F841,
E713,
E712,
B023
B023,
B028
max-line-length = 200

View File

@@ -3,52 +3,71 @@ from urllib.parse import urlparse
import requests
docs_repos = [
"frappe_docs",
"erpnext_documentation",
WEBSITE_REPOS = [
"erpnext_com",
"frappe_io",
]
DOCUMENTATION_DOMAINS = [
"docs.erpnext.com",
"frappeframework.com",
]
def uri_validator(x):
result = urlparse(x)
return all([result.scheme, result.netloc, result.path])
def docs_link_exists(body):
for line in body.splitlines():
for word in line.split():
if word.startswith('http') and uri_validator(word):
parsed_url = urlparse(word)
if parsed_url.netloc == "github.com":
parts = parsed_url.path.split('/')
if len(parts) == 5 and parts[1] == "frappe" and parts[2] in docs_repos:
return True
elif parsed_url.netloc == "docs.erpnext.com":
return True
def is_valid_url(url: str) -> bool:
parts = urlparse(url)
return all((parts.scheme, parts.netloc, parts.path))
def is_documentation_link(word: str) -> bool:
if not word.startswith("http") or not is_valid_url(word):
return False
parsed_url = urlparse(word)
if parsed_url.netloc in DOCUMENTATION_DOMAINS:
return True
if parsed_url.netloc == "github.com":
parts = parsed_url.path.split("/")
if len(parts) == 5 and parts[1] == "frappe" and parts[2] in WEBSITE_REPOS:
return True
return False
def contains_documentation_link(body: str) -> bool:
return any(
is_documentation_link(word)
for line in body.splitlines()
for word in line.split()
)
def check_pull_request(number: str) -> "tuple[int, str]":
response = requests.get(f"https://api.github.com/repos/frappe/erpnext/pulls/{number}")
if not response.ok:
return 1, "Pull Request Not Found! ⚠️"
payload = response.json()
title = (payload.get("title") or "").lower().strip()
head_sha = (payload.get("head") or {}).get("sha")
body = (payload.get("body") or "").lower()
if (
not title.startswith("feat")
or not head_sha
or "no-docs" in body
or "backport" in body
):
return 0, "Skipping documentation checks... 🏃"
if contains_documentation_link(body):
return 0, "Documentation Link Found. You're Awesome! 🎉"
return 1, "Documentation Link Not Found! ⚠️"
if __name__ == "__main__":
pr = sys.argv[1]
response = requests.get("https://api.github.com/repos/frappe/erpnext/pulls/{}".format(pr))
if response.ok:
payload = response.json()
title = (payload.get("title") or "").lower().strip()
head_sha = (payload.get("head") or {}).get("sha")
body = (payload.get("body") or "").lower()
if (title.startswith("feat")
and head_sha
and "no-docs" not in body
and "backport" not in body
):
if docs_link_exists(body):
print("Documentation Link Found. You're Awesome! 🎉")
else:
print("Documentation Link Not Found! ⚠️")
sys.exit(1)
else:
print("Skipping documentation checks... 🏃")
exit_code, message = check_pull_request(sys.argv[1])
print(message)
sys.exit(exit_code)

View File

@@ -12,7 +12,7 @@ jobs:
- name: 'Setup Environment'
uses: actions/setup-python@v2
with:
python-version: 3.6
python-version: '3.10'
- name: 'Clone repo'
uses: actions/checkout@v2

View File

@@ -14,7 +14,7 @@ concurrency:
jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
timeout-minutes: 60
name: Patch Test

View File

@@ -13,10 +13,10 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js v14
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 18
- name: Setup dependencies
run: |
npm install @semantic-release/git @semantic-release/exec --no-save
@@ -28,4 +28,4 @@ jobs:
GIT_AUTHOR_EMAIL: "developers@frappe.io"
GIT_COMMITTER_NAME: "Frappe PR Bot"
GIT_COMMITTER_EMAIL: "developers@frappe.io"
run: npx semantic-release
run: npx semantic-release

View File

@@ -18,7 +18,7 @@ concurrency:
jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
timeout-minutes: 60
strategy:
@@ -93,7 +93,7 @@ jobs:
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
- name: Run Tests
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator
run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --total-builds 2 --build-number ${{ matrix.container }}'
env:
TYPE: server
CI_BUILD_ID: ${{ github.run_id }}

View File

@@ -8,7 +8,7 @@ on:
jobs:
check_translation:
name: Translation Syntax Check
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup python3

View File

@@ -16,8 +16,8 @@ repos:
- id: check-merge-conflict
- id: check-ast
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [
@@ -32,8 +32,8 @@ repos:
- id: black
additional_dependencies: ['click==8.0.4']
- repo: https://github.com/timothycrosley/isort
rev: 5.9.1
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
exclude: ".*setup.py$"

View File

@@ -10,7 +10,7 @@
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec", {
"prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" erpnext/__init__.py'
"prepareCmd": 'sed -ir -E "s/\"[0-9]+\.[0-9]+\.[0-9]+\"/\"${nextRelease.version}\"/" erpnext/__init__.py'
}
],
[

View File

@@ -4,7 +4,7 @@
# the repo. Unless a later match takes precedence,
erpnext/accounts/ @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/assets/ @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/assets/ @anandbaburajan @deepeshgarg007
erpnext/erpnext_integrations/ @nextchamp-saqib
erpnext/loan_management/ @nextchamp-saqib @deepeshgarg007
erpnext/regional @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
@@ -12,17 +12,13 @@ erpnext/selling @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/support/ @nextchamp-saqib @deepeshgarg007
pos* @nextchamp-saqib
erpnext/buying/ @marination @rohitwaghchaure @s-aga-r
erpnext/e_commerce/ @marination
erpnext/maintenance/ @marination @rohitwaghchaure @s-aga-r
erpnext/manufacturing/ @marination @rohitwaghchaure @s-aga-r
erpnext/portal/ @marination
erpnext/quality_management/ @marination @rohitwaghchaure @s-aga-r
erpnext/shopping_cart/ @marination
erpnext/stock/ @marination @rohitwaghchaure @s-aga-r
erpnext/buying/ @rohitwaghchaure @s-aga-r
erpnext/maintenance/ @rohitwaghchaure @s-aga-r
erpnext/manufacturing/ @rohitwaghchaure @s-aga-r
erpnext/quality_management/ @rohitwaghchaure @s-aga-r
erpnext/stock/ @rohitwaghchaure @s-aga-r
erpnext/crm/ @NagariaHussain
erpnext/education/ @rutwikhdev
erpnext/healthcare/ @chillaranand
erpnext/hr/ @ruchamahabal
erpnext/non_profit/ @ruchamahabal
@@ -30,7 +26,7 @@ erpnext/payroll @ruchamahabal
erpnext/projects/ @ruchamahabal
erpnext/controllers @deepeshgarg007 @nextchamp-saqib @rohitwaghchaure @marination
erpnext/patches/ @deepeshgarg007 @nextchamp-saqib @marination rohitwaghchaure
erpnext/patches/ @deepeshgarg007 @nextchamp-saqib @rohitwaghchaure
erpnext/public/ @nextchamp-saqib @marination
.github/ @ankush

View File

@@ -65,6 +65,8 @@ GNU/General Public License (see [license.txt](license.txt))
The ERPNext code is licensed as GNU General Public License (v3) and the Documentation is licensed as Creative Commons (CC-BY-SA-3.0) and the copyright is owned by Frappe Technologies Pvt Ltd (Frappe) and Contributors.
By contributing to ERPNext, you agree that your contributions will be licensed under its GNU General Public License (v3).
---
## Contributing

View File

@@ -4,7 +4,7 @@ import frappe
from erpnext.hooks import regional_overrides
__version__ = "13.36.0"
__version__ = "13.42.7"
def get_default_company(user=None):

View File

@@ -378,7 +378,7 @@ def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
return
# check if books nor frozen till endate:
if accounts_frozen_upto and (end_date) <= getdate(accounts_frozen_upto):
if accounts_frozen_upto and getdate(end_date) <= getdate(accounts_frozen_upto):
end_date = get_last_day(add_days(accounts_frozen_upto, 1))
if via_journal_entry:

View File

@@ -1,38 +1,38 @@
{
"country_code": "de",
"name": "SKR03 mit Kontonummern",
"tree": {
"Aktiva": {
"is_group": 1,
"country_code": "de",
"name": "SKR03 mit Kontonummern",
"tree": {
"Aktiva": {
"is_group": 1,
"root_type": "Asset",
"A - Anlagevermögen": {
"is_group": 1,
"EDV-Software": {
"account_number": "0027",
"account_type": "Fixed Asset"
},
"Gesch\u00e4ftsausstattung": {
"account_number": "0410",
"account_type": "Fixed Asset"
},
"B\u00fcroeinrichtung": {
"account_number": "0420",
"account_type": "Fixed Asset"
},
"Darlehen": {
"account_number": "0565"
},
"Maschinen": {
"account_number": "0210",
"account_type": "Fixed Asset"
},
"Betriebsausstattung": {
"account_number": "0400",
"account_type": "Fixed Asset"
},
"Ladeneinrichtung": {
"account_number": "0430",
"account_type": "Fixed Asset"
"A - Anlagevermögen": {
"is_group": 1,
"EDV-Software": {
"account_number": "0027",
"account_type": "Fixed Asset"
},
"Geschäftsausstattung": {
"account_number": "0410",
"account_type": "Fixed Asset"
},
"Büroeinrichtung": {
"account_number": "0420",
"account_type": "Fixed Asset"
},
"Darlehen": {
"account_number": "0565"
},
"Maschinen": {
"account_number": "0210",
"account_type": "Fixed Asset"
},
"Betriebsausstattung": {
"account_number": "0400",
"account_type": "Fixed Asset"
},
"Ladeneinrichtung": {
"account_number": "0430",
"account_type": "Fixed Asset"
},
"Accumulated Depreciation": {
"account_type": "Accumulated Depreciation"
@@ -60,36 +60,46 @@
"Durchlaufende Posten": {
"account_number": "1590"
},
"Gewinnermittlung \u00a74/3 nicht Ergebniswirksam": {
"Verrechnungskonto Gewinnermittlung § 4 Abs. 3 EStG, nicht ergebniswirksam": {
"account_number": "1371"
},
"Abziehbare Vorsteuer": {
"account_type": "Tax",
"is_group": 1,
"Abziehbare Vorsteuer 7%": {
"account_number": "1571"
"Abziehbare Vorsteuer 7 %": {
"account_number": "1571",
"account_type": "Tax",
"tax_rate": 7.0
},
"Abziehbare Vorsteuer 19%": {
"account_number": "1576"
"Abziehbare Vorsteuer 19 %": {
"account_number": "1576",
"account_type": "Tax",
"tax_rate": 19.0
},
"Abziehbare Vorsteuer nach \u00a713b UStG 19%": {
"account_number": "1577"
},
"Leistungen \u00a713b UStG 19% Vorsteuer, 19% Umsatzsteuer": {
"account_number": "3120"
"Abziehbare Vorsteuer nach § 13b UStG 19 %": {
"account_number": "1577",
"account_type": "Tax",
"tax_rate": 19.0
}
}
},
"III. Wertpapiere": {
"is_group": 1
"is_group": 1,
"Anteile an verbundenen Unternehmen (Umlaufvermögen)": {
"account_number": "1340"
},
"Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft": {
"account_number": "1344"
},
"Sonstige Wertpapiere": {
"account_number": "1348"
}
},
"IV. Kassenbestand, Bundesbankguthaben, Guthaben bei Kreditinstituten und Schecks.": {
"is_group": 1,
"Kasse": {
"account_type": "Cash",
"is_group": 1,
"account_type": "Cash",
"Kasse": {
"is_group": 1,
"account_number": "1000",
"account_type": "Cash"
}
@@ -111,21 +121,21 @@
"C - Rechnungsabgrenzungsposten": {
"is_group": 1,
"Aktive Rechnungsabgrenzung": {
"account_number": "0980"
"account_number": "0980"
}
},
"D - Aktive latente Steuern": {
"is_group": 1,
"Aktive latente Steuern": {
"account_number": "0983"
"account_number": "0983"
}
},
"E - Aktiver Unterschiedsbetrag aus der Vermögensverrechnung": {
"is_group": 1
}
},
"Passiva": {
"is_group": 1,
},
"Passiva": {
"is_group": 1,
"root_type": "Liability",
"A. Eigenkapital": {
"is_group": 1,
@@ -200,26 +210,32 @@
},
"Umsatzsteuer": {
"is_group": 1,
"account_type": "Tax",
"Umsatzsteuer 7%": {
"account_number": "1771"
"Umsatzsteuer 7 %": {
"account_number": "1771",
"account_type": "Tax",
"tax_rate": 7.0
},
"Umsatzsteuer 19%": {
"account_number": "1776"
"Umsatzsteuer 19 %": {
"account_number": "1776",
"account_type": "Tax",
"tax_rate": 19.0
},
"Umsatzsteuer-Vorauszahlung": {
"account_number": "1780"
"account_number": "1780",
"account_type": "Tax"
},
"Umsatzsteuer-Vorauszahlung 1/11": {
"account_number": "1781"
},
"Umsatzsteuer \u00a7 13b UStG 19%": {
"account_number": "1787"
"Umsatzsteuer nach § 13b UStG 19 %": {
"account_number": "1787",
"account_type": "Tax",
"tax_rate": 19.0
},
"Umsatzsteuer Vorjahr": {
"account_number": "1790"
},
"Umsatzsteuer fr\u00fchere Jahre": {
"Umsatzsteuer frühere Jahre": {
"account_number": "1791"
}
}
@@ -234,44 +250,56 @@
"E. Passive latente Steuern": {
"is_group": 1
}
},
"Erl\u00f6se u. Ertr\u00e4ge 2/8": {
"is_group": 1,
"root_type": "Income",
"Erl\u00f6skonten 8": {
},
"Erlöse u. Erträge 2/8": {
"is_group": 1,
"root_type": "Income",
"Erlöskonten 8": {
"is_group": 1,
"Erl\u00f6se": {
"account_number": "8200",
"account_type": "Income Account"
},
"Erl\u00f6se USt. 19%": {
"account_number": "8400",
"account_type": "Income Account"
},
"Erl\u00f6se USt. 7%": {
"account_number": "8300",
"account_type": "Income Account"
}
},
"Ertragskonten 2": {
"is_group": 1,
"sonstige Zinsen und \u00e4hnliche Ertr\u00e4ge": {
"account_number": "2650",
"account_type": "Income Account"
},
"Au\u00dferordentliche Ertr\u00e4ge": {
"account_number": "2500",
"account_type": "Income Account"
},
"Sonstige Ertr\u00e4ge": {
"account_number": "2700",
"account_type": "Income Account"
}
}
},
"Aufwendungen 2/4": {
"is_group": 1,
"Erlöse": {
"account_number": "8200",
"account_type": "Income Account"
},
"Erlöse USt. 19 %": {
"account_number": "8400",
"account_type": "Income Account"
},
"Erlöse USt. 7 %": {
"account_number": "8300",
"account_type": "Income Account"
}
},
"Ertragskonten 2": {
"is_group": 1,
"sonstige Zinsen und ähnliche Erträge": {
"account_number": "2650",
"account_type": "Income Account"
},
"Außerordentliche Erträge": {
"account_number": "2500",
"account_type": "Income Account"
},
"Sonstige Erträge": {
"account_number": "2700",
"account_type": "Income Account"
}
}
},
"Aufwendungen 2/4": {
"is_group": 1,
"root_type": "Expense",
"Fremdleistungen": {
"account_number": "3100",
"account_type": "Expense Account"
},
"Fremdleistungen ohne Vorsteuer": {
"account_number": "3109",
"account_type": "Expense Account"
},
"Bauleistungen eines im Inland ansässigen Unternehmers 19 % Vorsteuer und 19 % Umsatzsteuer": {
"account_number": "3120",
"account_type": "Expense Account"
},
"Wareneingang": {
"account_number": "3200"
},
@@ -298,234 +326,234 @@
"Gegenkonto 4996-4998": {
"account_number": "4999"
},
"Abschreibungen": {
"is_group": 1,
"Abschreibungen": {
"is_group": 1,
"Abschreibungen auf Sachanlagen (ohne AfA auf Kfz und Gebäude)": {
"account_number": "4830",
"account_type": "Accumulated Depreciation"
"account_number": "4830",
"account_type": "Accumulated Depreciation"
},
"Abschreibungen auf Gebäude": {
"account_number": "4831",
"account_type": "Depreciation"
"account_number": "4831",
"account_type": "Depreciation"
},
"Abschreibungen auf Kfz": {
"account_number": "4832",
"account_type": "Depreciation"
"account_number": "4832",
"account_type": "Depreciation"
},
"Sofortabschreibung GWG": {
"account_number": "4855",
"account_type": "Expense Account"
"account_number": "4855",
"account_type": "Expense Account"
}
},
"Kfz-Kosten": {
"is_group": 1,
"Kfz-Steuer": {
"account_number": "4510",
"account_type": "Expense Account"
},
"Kfz-Versicherungen": {
"account_number": "4520",
"account_type": "Expense Account"
},
"laufende Kfz-Betriebskosten": {
"account_number": "4530",
"account_type": "Expense Account"
},
"Kfz-Reparaturen": {
"account_number": "4540",
"account_type": "Expense Account"
},
"Fremdfahrzeuge": {
"account_number": "4570",
"account_type": "Expense Account"
},
"sonstige Kfz-Kosten": {
"account_number": "4580",
"account_type": "Expense Account"
}
},
"Personalkosten": {
"is_group": 1,
"Geh\u00e4lter": {
"account_number": "4120",
"account_type": "Expense Account"
},
"gesetzliche soziale Aufwendungen": {
"account_number": "4130",
"account_type": "Expense Account"
},
"Aufwendungen f\u00fcr Altersvorsorge": {
"account_number": "4165",
"account_type": "Expense Account"
},
"Verm\u00f6genswirksame Leistungen": {
"account_number": "4170",
"account_type": "Expense Account"
},
"Aushilfsl\u00f6hne": {
"account_number": "4190",
"account_type": "Expense Account"
}
},
"Raumkosten": {
"is_group": 1,
"Miete und Nebenkosten": {
"account_number": "4210",
"account_type": "Expense Account"
},
"Gas, Wasser, Strom (Verwaltung, Vertrieb)": {
"account_number": "4240",
"account_type": "Expense Account"
},
"Reinigung": {
"account_number": "4250",
"account_type": "Expense Account"
}
},
"Reparatur/Instandhaltung": {
"is_group": 1,
"Reparatur u. Instandh. von Anlagen/Maschinen u. Betriebs- u. Gesch\u00e4ftsausst.": {
"account_number": "4805",
"account_type": "Expense Account"
}
},
"Versicherungsbeitr\u00e4ge": {
"is_group": 1,
"Versicherungen": {
"account_number": "4360",
"account_type": "Expense Account"
},
"Beitr\u00e4ge": {
"account_number": "4380",
"account_type": "Expense Account"
},
"sonstige Ausgaben": {
"account_number": "4390",
"account_type": "Expense Account"
},
"steuerlich abzugsf\u00e4hige Versp\u00e4tungszuschl\u00e4ge und Zwangsgelder": {
"account_number": "4396",
"account_type": "Expense Account"
}
},
"Werbe-/Reisekosten": {
"is_group": 1,
"Werbekosten": {
"account_number": "4610",
"account_type": "Expense Account"
},
"Aufmerksamkeiten": {
"account_number": "4653",
"account_type": "Expense Account"
},
"nicht abzugsf\u00e4hige Betriebsausg. aus Werbe-, Repr\u00e4s.- u. Reisekosten": {
"account_number": "4665",
"account_type": "Expense Account"
},
"Reisekosten Unternehmer": {
"account_number": "4670",
"account_type": "Expense Account"
}
},
"verschiedene Kosten": {
"is_group": 1,
"Porto": {
"account_number": "4910",
"account_type": "Expense Account"
},
"Telekom": {
"account_number": "4920",
"account_type": "Expense Account"
},
"Mobilfunk D2": {
"account_number": "4921",
"account_type": "Expense Account"
},
"Internet": {
"account_number": "4922",
"account_type": "Expense Account"
},
"B\u00fcrobedarf": {
"account_number": "4930",
"account_type": "Expense Account"
},
"Zeitschriften, B\u00fccher": {
"account_number": "4940",
"account_type": "Expense Account"
},
"Fortbildungskosten": {
"account_number": "4945",
"account_type": "Expense Account"
},
"Buchf\u00fchrungskosten": {
"account_number": "4955",
"account_type": "Expense Account"
},
"Abschlu\u00df- u. Pr\u00fcfungskosten": {
"account_number": "4957",
"account_type": "Expense Account"
},
"Nebenkosten des Geldverkehrs": {
"account_number": "4970",
"account_type": "Expense Account"
},
"Werkzeuge und Kleinger\u00e4te": {
"account_number": "4985",
"account_type": "Expense Account"
}
},
"Zinsaufwendungen": {
"is_group": 1,
"Zinsaufwendungen f\u00fcr kurzfristige Verbindlichkeiten": {
"account_number": "2110",
"account_type": "Expense Account"
},
"Zinsaufwendungen f\u00fcr KFZ Finanzierung": {
"account_number": "2121",
"account_type": "Expense Account"
}
}
},
"Anfangsbestand 9": {
"is_group": 1,
"root_type": "Equity",
"Saldenvortragskonten": {
"is_group": 1,
"Saldenvortrag Sachkonten": {
"account_number": "9000"
},
"Saldenvortr\u00e4ge Debitoren": {
"account_number": "9008"
},
"Saldenvortr\u00e4ge Kreditoren": {
"account_number": "9009"
}
}
},
"Privatkonten 1": {
"is_group": 1,
"root_type": "Equity",
"Privatentnahmen/-einlagen": {
"is_group": 1,
"Privatentnahme allgemein": {
"account_number": "1800"
},
"Privatsteuern": {
"account_number": "1810"
},
"Sonderausgaben beschr\u00e4nkt abzugsf\u00e4hig": {
"account_number": "1820"
},
"Sonderausgaben unbeschr\u00e4nkt abzugsf\u00e4hig": {
"account_number": "1830"
},
"Au\u00dfergew\u00f6hnliche Belastungen": {
"account_number": "1850"
},
"Privateinlagen": {
"account_number": "1890"
}
}
}
}
},
"Kfz-Kosten": {
"is_group": 1,
"Kfz-Steuer": {
"account_number": "4510",
"account_type": "Expense Account"
},
"Kfz-Versicherungen": {
"account_number": "4520",
"account_type": "Expense Account"
},
"laufende Kfz-Betriebskosten": {
"account_number": "4530",
"account_type": "Expense Account"
},
"Kfz-Reparaturen": {
"account_number": "4540",
"account_type": "Expense Account"
},
"Fremdfahrzeuge": {
"account_number": "4570",
"account_type": "Expense Account"
},
"sonstige Kfz-Kosten": {
"account_number": "4580",
"account_type": "Expense Account"
}
},
"Personalkosten": {
"is_group": 1,
"Gehälter": {
"account_number": "4120",
"account_type": "Expense Account"
},
"gesetzliche soziale Aufwendungen": {
"account_number": "4130",
"account_type": "Expense Account"
},
"Aufwendungen für Altersvorsorge": {
"account_number": "4165",
"account_type": "Expense Account"
},
"Vermögenswirksame Leistungen": {
"account_number": "4170",
"account_type": "Expense Account"
},
"Aushilfslöhne": {
"account_number": "4190",
"account_type": "Expense Account"
}
},
"Raumkosten": {
"is_group": 1,
"Miete und Nebenkosten": {
"account_number": "4210",
"account_type": "Expense Account"
},
"Gas, Wasser, Strom (Verwaltung, Vertrieb)": {
"account_number": "4240",
"account_type": "Expense Account"
},
"Reinigung": {
"account_number": "4250",
"account_type": "Expense Account"
}
},
"Reparatur/Instandhaltung": {
"is_group": 1,
"Reparaturen und Instandhaltungen von anderen Anlagen und Betriebs- und Geschäftsausstattung": {
"account_number": "4805",
"account_type": "Expense Account"
}
},
"Versicherungsbeiträge": {
"is_group": 1,
"Versicherungen": {
"account_number": "4360",
"account_type": "Expense Account"
},
"Beiträge": {
"account_number": "4380",
"account_type": "Expense Account"
},
"sonstige Ausgaben": {
"account_number": "4390",
"account_type": "Expense Account"
},
"steuerlich abzugsfähige Verspätungszuschläge und Zwangsgelder": {
"account_number": "4396",
"account_type": "Expense Account"
}
},
"Werbe-/Reisekosten": {
"is_group": 1,
"Werbekosten": {
"account_number": "4610",
"account_type": "Expense Account"
},
"Aufmerksamkeiten": {
"account_number": "4653",
"account_type": "Expense Account"
},
"nicht abzugsfähige Betriebsausg. aus Werbe-, Repräs.- u. Reisekosten": {
"account_number": "4665",
"account_type": "Expense Account"
},
"Reisekosten Unternehmer": {
"account_number": "4670",
"account_type": "Expense Account"
}
},
"verschiedene Kosten": {
"is_group": 1,
"Porto": {
"account_number": "4910",
"account_type": "Expense Account"
},
"Telekom": {
"account_number": "4920",
"account_type": "Expense Account"
},
"Mobilfunk D2": {
"account_number": "4921",
"account_type": "Expense Account"
},
"Internet": {
"account_number": "4922",
"account_type": "Expense Account"
},
"Bürobedarf": {
"account_number": "4930",
"account_type": "Expense Account"
},
"Zeitschriften, Bücher": {
"account_number": "4940",
"account_type": "Expense Account"
},
"Fortbildungskosten": {
"account_number": "4945",
"account_type": "Expense Account"
},
"Buchführungskosten": {
"account_number": "4955",
"account_type": "Expense Account"
},
"Abschluß- u. Prüfungskosten": {
"account_number": "4957",
"account_type": "Expense Account"
},
"Nebenkosten des Geldverkehrs": {
"account_number": "4970",
"account_type": "Expense Account"
},
"Werkzeuge und Kleingeräte": {
"account_number": "4985",
"account_type": "Expense Account"
}
},
"Zinsaufwendungen": {
"is_group": 1,
"Zinsaufwendungen für kurzfristige Verbindlichkeiten": {
"account_number": "2110",
"account_type": "Expense Account"
},
"Zinsaufwendungen für KFZ Finanzierung": {
"account_number": "2121",
"account_type": "Expense Account"
}
}
},
"Anfangsbestand 9": {
"is_group": 1,
"root_type": "Equity",
"Saldenvortragskonten": {
"is_group": 1,
"Saldenvortrag Sachkonten": {
"account_number": "9000"
},
"Saldenvorträge Debitoren": {
"account_number": "9008"
},
"Saldenvorträge Kreditoren": {
"account_number": "9009"
}
}
},
"Privatkonten 1": {
"is_group": 1,
"root_type": "Equity",
"Privatentnahmen/-einlagen": {
"is_group": 1,
"Privatentnahme allgemein": {
"account_number": "1800"
},
"Privatsteuern": {
"account_number": "1810"
},
"Sonderausgaben beschränkt abzugsfähig": {
"account_number": "1820"
},
"Sonderausgaben unbeschränkt abzugsfähig": {
"account_number": "1830"
},
"Außergewöhnliche Belastungen": {
"account_number": "1850"
},
"Privateinlagen": {
"account_number": "1890"
}
}
}
}
}

View File

@@ -3,10 +3,6 @@
frappe.ui.form.on('Accounting Dimension Filter', {
refresh: function(frm, cdt, cdn) {
if (frm.doc.accounting_dimension) {
frm.set_df_property('dimensions', 'label', frm.doc.accounting_dimension, cdn, 'dimension_value');
}
let help_content =
`<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
<tr><td>
@@ -68,6 +64,7 @@ frappe.ui.form.on('Accounting Dimension Filter', {
frm.clear_table("dimensions");
let row = frm.add_child("dimensions");
row.accounting_dimension = frm.doc.accounting_dimension;
frm.fields_dict["dimensions"].grid.update_docfield_property("dimension_value", "label", frm.doc.accounting_dimension);
frm.refresh_field("dimensions");
frm.trigger('setup_filters');
},

View File

@@ -26,6 +26,7 @@
"determine_address_tax_category_from",
"column_break_19",
"add_taxes_from_item_tax_template",
"book_tax_discount_loss",
"period_closing_settings_section",
"acc_frozen_upto",
"frozen_accounts_modifier",
@@ -284,6 +285,13 @@
"fieldname": "allow_multi_currency_invoices_against_single_party_account",
"fieldtype": "Check",
"label": "Allow multi-currency invoices against single party account"
},
{
"default": "0",
"description": "Split Early Payment Discount Loss into Income and Tax Loss",
"fieldname": "book_tax_discount_loss",
"fieldtype": "Check",
"label": "Book Tax Loss on Early Payment Discount"
}
],
"icon": "icon-cog",
@@ -291,7 +299,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2022-07-11 13:37:50.605141",
"modified": "2023-03-28 09:50:20.375233",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -43,20 +43,13 @@ frappe.ui.form.on('Bank Guarantee', {
reference_docname: function(frm) {
if (frm.doc.reference_docname && frm.doc.reference_doctype) {
let fields_to_fetch = ["grand_total"];
let party_field = frm.doc.reference_doctype == "Sales Order" ? "customer" : "supplier";
if (frm.doc.reference_doctype == "Sales Order") {
fields_to_fetch.push("project");
}
fields_to_fetch.push(party_field);
frappe.call({
method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_vouchar_detials",
method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_voucher_details",
args: {
"column_list": fields_to_fetch,
"doctype": frm.doc.reference_doctype,
"docname": frm.doc.reference_docname
"bank_guarantee_type": frm.doc.bg_type,
"reference_name": frm.doc.reference_docname
},
callback: function(r) {
if (r.message) {

View File

@@ -2,11 +2,8 @@
# For license information, please see license.txt
import json
import frappe
from frappe import _
from frappe.desk.search import sanitize_searchfield
from frappe.model.document import Document
@@ -25,14 +22,18 @@ class BankGuarantee(Document):
@frappe.whitelist()
def get_vouchar_detials(column_list, doctype, docname):
column_list = json.loads(column_list)
for col in column_list:
sanitize_searchfield(col)
return frappe.db.sql(
""" select {columns} from `tab{doctype}` where name=%s""".format(
columns=", ".join(column_list), doctype=doctype
),
docname,
as_dict=1,
)[0]
def get_voucher_details(bank_guarantee_type: str, reference_name: str):
if not isinstance(reference_name, str):
raise TypeError("reference_name must be a string")
fields_to_fetch = ["grand_total"]
if bank_guarantee_type == "Receiving":
doctype = "Sales Order"
fields_to_fetch.append("customer")
fields_to_fetch.append("project")
else:
doctype = "Purchase Order"
fields_to_fetch.append("supplier")
return frappe.db.get_value(doctype, reference_name, fields_to_fetch, as_dict=True)

View File

@@ -299,7 +299,7 @@ def reconcile_vouchers(bank_transaction_name, vouchers):
dict(
account=account, voucher_type=voucher["payment_doctype"], voucher_no=voucher["payment_name"]
),
["credit", "debit"],
["credit_in_account_currency as credit", "debit_in_account_currency as debit"],
as_dict=1,
)
gl_amount, transaction_amount = (

View File

@@ -138,7 +138,7 @@ def get_paid_amount(payment_entry, currency, bank_account):
)
elif doc.payment_type == "Pay":
paid_amount_field = (
"paid_amount" if doc.paid_to_account_currency == currency else "base_paid_amount"
"paid_amount" if doc.paid_from_account_currency == currency else "base_paid_amount"
)
return frappe.db.get_value(

View File

@@ -169,5 +169,6 @@ def auto_create_fiscal_year():
def get_from_and_to_date(fiscal_year):
fields = ["year_start_date as from_date", "year_end_date as to_date"]
return frappe.db.get_value("Fiscal Year", fiscal_year, fields, as_dict=1)
fields = ["year_start_date", "year_end_date"]
cached_results = frappe.get_cached_value("Fiscal Year", fiscal_year, fields, as_dict=1)
return dict(from_date=cached_results.year_start_date, to_date=cached_results.year_end_date)

View File

@@ -358,7 +358,7 @@ def update_outstanding_amt(
if against_voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"]:
ref_doc = frappe.get_doc(against_voucher_type, against_voucher)
# Didn't use db_set for optimisation purpose
# Didn't use db_set for optimization purpose
ref_doc.outstanding_amount = bal
frappe.db.set_value(against_voucher_type, against_voucher, "outstanding_amount", bal)

View File

@@ -173,8 +173,8 @@ frappe.ui.form.on("Journal Entry", {
var update_jv_details = function(doc, r) {
$.each(r, function(i, d) {
var row = frappe.model.add_child(doc, "Journal Entry Account", "accounts");
row.account = d.account;
row.balance = d.balance;
frappe.model.set_value(row.doctype, row.name, "account", d.account)
frappe.model.set_value(row.doctype, row.name, "balance", d.balance)
});
refresh_field("accounts");
}

View File

@@ -87,6 +87,7 @@ class JournalEntry(AccountsController):
self.check_credit_limit()
self.make_gl_entries()
self.update_advance_paid()
self.update_asset_value()
self.update_expense_claim()
self.update_inter_company_jv()
self.update_invoice_discounting()
@@ -194,7 +195,9 @@ class JournalEntry(AccountsController):
}
)
tax_withholding_details = get_party_tax_withholding_details(inv, self.tax_withholding_category)
tax_withholding_details, advance_taxes, voucher_wise_amount = get_party_tax_withholding_details(
inv, self.tax_withholding_category
)
if not tax_withholding_details:
return
@@ -233,6 +236,29 @@ class JournalEntry(AccountsController):
for d in to_remove:
self.remove(d)
def update_asset_value(self):
if self.voucher_type != "Depreciation Entry":
return
processed_assets = []
for d in self.get("accounts"):
if (
d.reference_type == "Asset" and d.reference_name and d.reference_name not in processed_assets
):
processed_assets.append(d.reference_name)
asset = frappe.get_doc("Asset", d.reference_name)
if asset.calculate_depreciation:
continue
depr_value = d.debit or d.credit
asset.db_set("value_after_depreciation", asset.value_after_depreciation - depr_value)
asset.set_status()
def update_inter_company_jv(self):
if (
self.voucher_type == "Inter Company Journal Entry"
@@ -291,19 +317,38 @@ class JournalEntry(AccountsController):
d.db_update()
def unlink_asset_reference(self):
if self.voucher_type != "Depreciation Entry":
return
processed_assets = []
for d in self.get("accounts"):
if d.reference_type == "Asset" and d.reference_name:
if (
d.reference_type == "Asset" and d.reference_name and d.reference_name not in processed_assets
):
processed_assets.append(d.reference_name)
asset = frappe.get_doc("Asset", d.reference_name)
for s in asset.get("schedules"):
if s.journal_entry == self.name:
s.db_set("journal_entry", None)
idx = cint(s.finance_book_id) or 1
finance_books = asset.get("finance_books")[idx - 1]
finance_books.value_after_depreciation += s.depreciation_amount
finance_books.db_update()
if asset.calculate_depreciation:
for s in asset.get("schedules"):
if s.journal_entry == self.name:
s.db_set("journal_entry", None)
asset.set_status()
idx = cint(s.finance_book_id) or 1
finance_books = asset.get("finance_books")[idx - 1]
finance_books.value_after_depreciation += s.depreciation_amount
finance_books.db_update()
asset.set_status()
break
else:
depr_value = d.debit or d.credit
asset.db_set("value_after_depreciation", asset.value_after_depreciation + depr_value)
asset.set_status()
def unlink_inter_company_jv(self):
if (

View File

@@ -2,7 +2,7 @@
// For license information, please see license.txt
frappe.ui.form.on("Journal Entry Template", {
setup: function(frm) {
refresh: function(frm) {
frappe.model.set_default_values(frm.doc);
frm.set_query("account" ,"accounts", function(){
@@ -45,21 +45,6 @@ frappe.ui.form.on("Journal Entry Template", {
frm.trigger("clear_child");
switch(frm.doc.voucher_type){
case "Opening Entry":
frm.set_value("is_opening", "Yes");
frappe.call({
type:"GET",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_opening_accounts",
args: {
"company": frm.doc.company
},
callback: function(r) {
if(r.message) {
add_accounts(frm.doc, r.message);
}
}
});
break;
case "Bank Entry":
case "Cash Entry":
frappe.call({

View File

@@ -20,7 +20,6 @@ frappe.ui.form.on('Opening Invoice Creation Tool', {
frm.dashboard.reset();
frm.doc.import_in_progress = true;
}
if (data.user != frappe.session.user) return;
if (data.count == data.total) {
setTimeout((title) => {
frm.doc.import_in_progress = false;

View File

@@ -271,10 +271,10 @@ def publish(index, total, doctype):
dict(
title=_("Opening Invoice Creation In Progress"),
message=_("Creating {} out of {} {}").format(index + 1, total, doctype),
user=frappe.session.user,
count=index + 1,
total=total,
),
user=frappe.session.user,
)

View File

@@ -256,8 +256,6 @@ frappe.ui.form.on('Payment Entry', {
frm.set_currency_labels(["total_amount", "outstanding_amount", "allocated_amount"],
party_account_currency, "references");
frm.set_currency_labels(["amount"], company_currency, "deductions");
cur_frm.set_df_property("source_exchange_rate", "description",
("1 " + frm.doc.paid_from_account_currency + " = [?] " + company_currency));
@@ -1111,7 +1109,7 @@ frappe.ui.form.on('Payment Entry', {
$.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0; });
frm.doc.paid_amount_after_tax = frm.doc.paid_amount;
frm.doc.paid_amount_after_tax = frm.doc.base_paid_amount;
});
},
@@ -1202,7 +1200,7 @@ frappe.ui.form.on('Payment Entry', {
}
cumulated_tax_fraction += tax.tax_fraction_for_current_item;
frm.doc.paid_amount_after_tax = flt(frm.doc.paid_amount/(1+cumulated_tax_fraction))
frm.doc.paid_amount_after_tax = flt(frm.doc.base_paid_amount/(1+cumulated_tax_fraction))
});
},
@@ -1234,6 +1232,7 @@ frappe.ui.form.on('Payment Entry', {
frm.doc.total_taxes_and_charges = 0.0;
frm.doc.base_total_taxes_and_charges = 0.0;
let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
let actual_tax_dict = {};
// maintain actual tax rate based on idx
@@ -1254,8 +1253,8 @@ frappe.ui.form.on('Payment Entry', {
}
}
tax.tax_amount = current_tax_amount;
tax.base_tax_amount = tax.tax_amount * frm.doc.source_exchange_rate;
// tax accounts are only in company currency
tax.base_tax_amount = current_tax_amount;
current_tax_amount *= (tax.add_deduct_tax == "Deduct") ? -1.0 : 1.0;
if(i==0) {
@@ -1264,9 +1263,29 @@ frappe.ui.form.on('Payment Entry', {
tax.total = flt(frm.doc["taxes"][i-1].total + current_tax_amount, precision("total", tax));
}
tax.base_total = tax.total * frm.doc.source_exchange_rate;
frm.doc.total_taxes_and_charges += current_tax_amount;
frm.doc.base_total_taxes_and_charges += current_tax_amount * frm.doc.source_exchange_rate;
// tac accounts are only in company currency
tax.base_total = tax.total
// calculate total taxes and base total taxes
if(frm.doc.payment_type == "Pay") {
// tax accounts only have company currency
if(tax.currency != frm.doc.paid_to_account_currency) {
//total_taxes_and_charges has the target currency. so using target conversion rate
frm.doc.total_taxes_and_charges += flt(current_tax_amount / frm.doc.target_exchange_rate);
} else {
frm.doc.total_taxes_and_charges += current_tax_amount;
}
} else if(frm.doc.payment_type == "Receive") {
if(tax.currency != frm.doc.paid_from_account_currency) {
//total_taxes_and_charges has the target currency. so using source conversion rate
frm.doc.total_taxes_and_charges += flt(current_tax_amount / frm.doc.source_exchange_rate);
} else {
frm.doc.total_taxes_and_charges += current_tax_amount;
}
}
frm.doc.base_total_taxes_and_charges += tax.base_tax_amount;
frm.refresh_field('taxes');
frm.refresh_field('total_taxes_and_charges');

View File

@@ -7,7 +7,7 @@ from functools import reduce
import frappe
from frappe import ValidationError, _, scrub, throw
from frappe.utils import cint, comma_or, flt, getdate, nowdate
from frappe.utils import cint, comma_or, flt, get_link_to_form, getdate, nowdate
from six import iteritems, string_types
import erpnext
@@ -67,7 +67,6 @@ class PaymentEntry(AccountsController):
self.set_missing_values()
self.validate_payment_type()
self.validate_party_details()
self.validate_bank_accounts()
self.set_exchange_rate()
self.validate_mandatory()
self.validate_reference_documents()
@@ -169,8 +168,31 @@ class PaymentEntry(AccountsController):
for reference in self.references:
if reference.reference_doctype in ("Sales Invoice", "Purchase Invoice"):
doc = frappe.get_doc(reference.reference_doctype, reference.reference_name)
repost_required = False
for adv_reference in doc.get("advances"):
if adv_reference.exchange_gain_loss != 0:
repost_required = True
break
if repost_required:
for item in doc.get("items"):
if item.get("enable_deferred_revenue") or item.get("enable_deferred_expense"):
frappe.msgprint(
_(
"Linked Invoice {0} has Exchange Gain/Loss GL entries due to this Payment. Submit a Journal manually to reverse its effects."
).format(get_link_to_form(doc.doctype, doc.name))
)
repost_required = False
doc.delink_advance_entries(self.name)
if repost_required:
doc.reload()
doc.docstatus = 2
doc.make_gl_entries()
doc.docstatus = 1
doc.make_gl_entries()
def set_missing_values(self):
if self.payment_type == "Internal Transfer":
for field in (
@@ -250,23 +272,6 @@ class PaymentEntry(AccountsController):
if not frappe.db.exists(self.party_type, self.party):
frappe.throw(_("Invalid {0}: {1}").format(self.party_type, self.party))
if self.party_account and self.party_type in ("Customer", "Supplier"):
self.validate_account_type(
self.party_account, [erpnext.get_party_account_type(self.party_type)]
)
def validate_bank_accounts(self):
if self.payment_type in ("Pay", "Internal Transfer"):
self.validate_account_type(self.paid_from, ["Bank", "Cash"])
if self.payment_type in ("Receive", "Internal Transfer"):
self.validate_account_type(self.paid_to, ["Bank", "Cash"])
def validate_account_type(self, account, account_types):
account_type = frappe.db.get_value("Account", account, "account_type")
# if account_type not in account_types:
# frappe.throw(_("Account Type for {0} must be {1}").format(account, comma_or(account_types)))
def set_exchange_rate(self, ref_doc=None):
self.set_source_exchange_rate(ref_doc)
self.set_target_exchange_rate(ref_doc)
@@ -305,7 +310,7 @@ class PaymentEntry(AccountsController):
def validate_reference_documents(self):
if self.party_type == "Student":
valid_reference_doctypes = "Fees"
valid_reference_doctypes = ("Fees", "Journal Entry")
elif self.party_type == "Customer":
valid_reference_doctypes = ("Sales Order", "Sales Invoice", "Journal Entry", "Dunning")
elif self.party_type == "Supplier":
@@ -435,7 +440,7 @@ class PaymentEntry(AccountsController):
for ref in self.get("references"):
if ref.payment_term and ref.reference_name:
key = (ref.payment_term, ref.reference_name)
key = (ref.payment_term, ref.reference_name, ref.reference_doctype)
invoice_payment_amount_map.setdefault(key, 0.0)
invoice_payment_amount_map[key] += ref.allocated_amount
@@ -443,20 +448,37 @@ class PaymentEntry(AccountsController):
payment_schedule = frappe.get_all(
"Payment Schedule",
filters={"parent": ref.reference_name},
fields=["paid_amount", "payment_amount", "payment_term", "discount", "outstanding"],
fields=[
"paid_amount",
"payment_amount",
"payment_term",
"discount",
"outstanding",
"discount_type",
],
)
for term in payment_schedule:
invoice_key = (term.payment_term, ref.reference_name)
invoice_key = (term.payment_term, ref.reference_name, ref.reference_doctype)
invoice_paid_amount_map.setdefault(invoice_key, {})
invoice_paid_amount_map[invoice_key]["outstanding"] = term.outstanding
invoice_paid_amount_map[invoice_key]["discounted_amt"] = ref.total_amount * (
term.discount / 100
)
if not (term.discount_type and term.discount):
continue
if term.discount_type == "Percentage":
invoice_paid_amount_map[invoice_key]["discounted_amt"] = ref.total_amount * (
term.discount / 100
)
else:
invoice_paid_amount_map[invoice_key]["discounted_amt"] = term.discount
for idx, (key, allocated_amount) in enumerate(iteritems(invoice_payment_amount_map), 1):
if not invoice_paid_amount_map.get(key):
frappe.throw(_("Payment term {0} not used in {1}").format(key[0], key[1]))
allocated_amount = self.get_allocated_amount_in_transaction_currency(
allocated_amount, key[2], key[1]
)
outstanding = flt(invoice_paid_amount_map.get(key, {}).get("outstanding"))
discounted_amt = flt(invoice_paid_amount_map.get(key, {}).get("discounted_amt"))
@@ -491,6 +513,33 @@ class PaymentEntry(AccountsController):
(allocated_amount - discounted_amt, discounted_amt, allocated_amount, key[1], key[0]),
)
def get_allocated_amount_in_transaction_currency(
self, allocated_amount, reference_doctype, reference_docname
):
"""
Payment Entry could be in base currency while reference's payment schedule
is always in transaction currency.
E.g.
* SI with base=INR and currency=USD
* SI with payment schedule in USD
* PE in INR (accounting done in base currency)
"""
ref_currency, ref_exchange_rate = frappe.db.get_value(
reference_doctype, reference_docname, ["currency", "conversion_rate"]
)
is_single_currency = self.paid_from_account_currency == self.paid_to_account_currency
# PE in different currency
reference_is_multi_currency = self.paid_from_account_currency != ref_currency
if not (is_single_currency and reference_is_multi_currency):
return allocated_amount
allocated_amount = flt(
allocated_amount / ref_exchange_rate, self.precision("total_allocated_amount")
)
return allocated_amount
def set_status(self):
if self.docstatus == 2:
self.status = "Cancelled"
@@ -944,6 +993,13 @@ class PaymentEntry(AccountsController):
)
if not d.included_in_paid_amount:
if get_account_currency(payment_account) != self.company_currency:
if self.payment_type == "Receive":
exchange_rate = self.target_exchange_rate
elif self.payment_type in ["Pay", "Internal Transfer"]:
exchange_rate = self.source_exchange_rate
base_tax_amount = flt((tax_amount / exchange_rate), self.precision("paid_amount"))
gl_entries.append(
self.get_gl_dict(
{
@@ -1059,7 +1115,7 @@ class PaymentEntry(AccountsController):
for fieldname in tax_fields:
tax.set(fieldname, 0.0)
self.paid_amount_after_tax = self.paid_amount
self.paid_amount_after_tax = self.base_paid_amount
def determine_exclusive_rate(self):
if not any((cint(tax.included_in_paid_amount) for tax in self.get("taxes"))):
@@ -1078,7 +1134,7 @@ class PaymentEntry(AccountsController):
cumulated_tax_fraction += tax.tax_fraction_for_current_item
self.paid_amount_after_tax = flt(self.paid_amount / (1 + cumulated_tax_fraction))
self.paid_amount_after_tax = flt(self.base_paid_amount / (1 + cumulated_tax_fraction))
def calculate_taxes(self):
self.total_taxes_and_charges = 0.0
@@ -1101,7 +1157,7 @@ class PaymentEntry(AccountsController):
current_tax_amount += actual_tax_dict[tax.idx]
tax.tax_amount = current_tax_amount
tax.base_tax_amount = tax.tax_amount * self.source_exchange_rate
tax.base_tax_amount = current_tax_amount
if tax.add_deduct_tax == "Deduct":
current_tax_amount *= -1.0
@@ -1115,14 +1171,20 @@ class PaymentEntry(AccountsController):
self.get("taxes")[i - 1].total + current_tax_amount, self.precision("total", tax)
)
tax.base_total = tax.total * self.source_exchange_rate
tax.base_total = tax.total
if self.payment_type == "Pay":
self.base_total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
self.total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
else:
self.base_total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
self.total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
if tax.currency != self.paid_to_account_currency:
self.total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
else:
self.total_taxes_and_charges += current_tax_amount
elif self.payment_type == "Receive":
if tax.currency != self.paid_from_account_currency:
self.total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
else:
self.total_taxes_and_charges += current_tax_amount
self.base_total_taxes_and_charges += tax.base_tax_amount
if self.get("taxes"):
self.paid_amount_after_tax = self.get("taxes")[-1].base_total
@@ -1260,6 +1322,7 @@ def get_outstanding_reference_documents(args):
args.get("party_type"),
args.get("party"),
args.get("party_account"),
args.get("company"),
filters=args,
condition=condition,
)
@@ -1782,7 +1845,14 @@ def get_bill_no_and_update_amounts(
@frappe.whitelist()
def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=None):
def get_payment_entry(
dt,
dn,
party_amount=None,
bank_account=None,
bank_amount=None,
reference_date=None,
):
reference_doc = None
doc = frappe.get_doc(dt, dn)
if dt in ("Sales Order", "Purchase Order") and flt(doc.per_billed, 2) > 0:
@@ -1803,8 +1873,9 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
dt, party_account_currency, bank, outstanding_amount, payment_type, bank_amount, doc
)
paid_amount, received_amount, discount_amount = apply_early_payment_discount(
paid_amount, received_amount, doc
reference_date = getdate(reference_date)
paid_amount, received_amount, discount_amount, valid_discounts = apply_early_payment_discount(
paid_amount, received_amount, doc, party_account_currency, reference_date
)
pe = frappe.new_doc("Payment Entry")
@@ -1812,6 +1883,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
pe.company = doc.company
pe.cost_center = doc.get("cost_center")
pe.posting_date = nowdate()
pe.reference_date = reference_date
pe.mode_of_payment = doc.get("mode_of_payment")
pe.party_type = party_type
pe.party = doc.get(scrub(party_type))
@@ -1852,7 +1924,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
):
for reference in get_reference_as_per_payment_terms(
doc.payment_schedule, dt, dn, doc, grand_total, outstanding_amount
doc.payment_schedule, dt, dn, doc, grand_total, outstanding_amount, party_account_currency
):
pe.append("references", reference)
else:
@@ -1903,16 +1975,17 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
reference_doc = doc
pe.set_exchange_rate(ref_doc=reference_doc)
pe.set_amounts()
if discount_amount:
pe.set_gain_or_loss(
account_details={
"account": frappe.get_cached_value("Company", pe.company, "default_discount_account"),
"cost_center": pe.cost_center
or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": discount_amount * (-1 if payment_type == "Pay" else 1),
}
base_total_discount_loss = 0
if frappe.db.get_single_value("Accounts Settings", "book_tax_discount_loss"):
base_total_discount_loss = split_early_payment_discount_loss(pe, doc, valid_discounts)
set_pending_discount_loss(
pe, doc, discount_amount, base_total_discount_loss, party_account_currency
)
pe.set_difference_amount()
pe.set_difference_amount()
return pe
@@ -2048,20 +2121,30 @@ def set_paid_amount_and_received_amount(
return paid_amount, received_amount
def apply_early_payment_discount(paid_amount, received_amount, doc):
def apply_early_payment_discount(
paid_amount, received_amount, doc, party_account_currency, reference_date
):
total_discount = 0
valid_discounts = []
eligible_for_payments = ["Sales Order", "Sales Invoice", "Purchase Order", "Purchase Invoice"]
has_payment_schedule = hasattr(doc, "payment_schedule") and doc.payment_schedule
if doc.doctype in eligible_for_payments and has_payment_schedule:
# Non eligible documents may not have `company_currency` field
is_multi_currency = party_account_currency != doc.company_currency
for term in doc.payment_schedule:
if not term.discounted_amount and term.discount and getdate(nowdate()) <= term.discount_date:
if not term.discounted_amount and term.discount and reference_date <= term.discount_date:
if term.discount_type == "Percentage":
discount_amount = flt(doc.get("grand_total")) * (term.discount / 100)
grand_total = doc.get("grand_total") if is_multi_currency else doc.get("base_grand_total")
discount_amount = flt(grand_total) * (term.discount / 100)
else:
discount_amount = term.discount
discount_amount_in_foreign_currency = discount_amount * doc.get("conversion_rate", 1)
# if accounting is done in the same currency, paid_amount = received_amount
conversion_rate = doc.get("conversion_rate", 1) if is_multi_currency else 1
discount_amount_in_foreign_currency = discount_amount * conversion_rate
if doc.doctype == "Sales Invoice":
paid_amount -= discount_amount
@@ -2070,23 +2153,151 @@ def apply_early_payment_discount(paid_amount, received_amount, doc):
received_amount -= discount_amount
paid_amount -= discount_amount_in_foreign_currency
valid_discounts.append({"type": term.discount_type, "discount": term.discount})
total_discount += discount_amount
if total_discount:
money = frappe.utils.fmt_money(total_discount, currency=doc.get("currency"))
currency = doc.get("currency") if is_multi_currency else doc.company_currency
money = frappe.utils.fmt_money(total_discount, currency=currency)
frappe.msgprint(_("Discount of {} applied as per Payment Term").format(money), alert=1)
return paid_amount, received_amount, total_discount
return paid_amount, received_amount, total_discount, valid_discounts
def set_pending_discount_loss(
pe, doc, discount_amount, base_total_discount_loss, party_account_currency
):
# If multi-currency, get base discount amount to adjust with base currency deductions/losses
if party_account_currency != doc.company_currency:
discount_amount = discount_amount * doc.get("conversion_rate", 1)
# Avoid considering miniscule losses
discount_amount = flt(discount_amount - base_total_discount_loss, doc.precision("grand_total"))
# Set base discount amount (discount loss/pending rounding loss) in deductions
if discount_amount > 0.0:
positive_negative = -1 if pe.payment_type == "Pay" else 1
# If tax loss booking is enabled, pending loss will be rounding loss.
# Otherwise it will be the total discount loss.
book_tax_loss = frappe.db.get_single_value("Accounts Settings", "book_tax_discount_loss")
account_type = "round_off_account" if book_tax_loss else "default_discount_account"
pe.set_gain_or_loss(
account_details={
"account": frappe.get_cached_value("Company", pe.company, account_type),
"cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": discount_amount * positive_negative,
}
)
def split_early_payment_discount_loss(pe, doc, valid_discounts) -> float:
"""Split early payment discount into Income Loss & Tax Loss."""
total_discount_percent = get_total_discount_percent(doc, valid_discounts)
if not total_discount_percent:
return 0.0
base_loss_on_income = add_income_discount_loss(pe, doc, total_discount_percent)
base_loss_on_taxes = add_tax_discount_loss(pe, doc, total_discount_percent)
# Round off total loss rather than individual losses to reduce rounding error
return flt(base_loss_on_income + base_loss_on_taxes, doc.precision("grand_total"))
def get_total_discount_percent(doc, valid_discounts) -> float:
"""Get total percentage and amount discount applied as a percentage."""
total_discount_percent = (
sum(
discount.get("discount") for discount in valid_discounts if discount.get("type") == "Percentage"
)
or 0.0
)
# Operate in percentages only as it makes the income & tax split easier
total_discount_amount = (
sum(discount.get("discount") for discount in valid_discounts if discount.get("type") == "Amount")
or 0.0
)
if total_discount_amount:
discount_percentage = (total_discount_amount / doc.get("grand_total")) * 100
total_discount_percent += discount_percentage
return total_discount_percent
return total_discount_percent
def add_income_discount_loss(pe, doc, total_discount_percent) -> float:
"""Add loss on income discount in base currency."""
precision = doc.precision("total")
base_loss_on_income = doc.get("base_total") * (total_discount_percent / 100)
pe.append(
"deductions",
{
"account": frappe.get_cached_value("Company", pe.company, "default_discount_account"),
"cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": flt(base_loss_on_income, precision),
},
)
return base_loss_on_income # Return loss without rounding
def add_tax_discount_loss(pe, doc, total_discount_percentage) -> float:
"""Add loss on tax discount in base currency."""
tax_discount_loss = {}
base_total_tax_loss = 0
precision = doc.precision("tax_amount_after_discount_amount", "taxes")
# The same account head could be used more than once
for tax in doc.get("taxes", []):
base_tax_loss = tax.get("base_tax_amount_after_discount_amount") * (
total_discount_percentage / 100
)
account = tax.get("account_head")
if not tax_discount_loss.get(account):
tax_discount_loss[account] = base_tax_loss
else:
tax_discount_loss[account] += base_tax_loss
for account, loss in tax_discount_loss.items():
base_total_tax_loss += loss
if loss == 0.0:
continue
pe.append(
"deductions",
{
"account": account,
"cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": flt(loss, precision),
},
)
return base_total_tax_loss # Return loss without rounding
def get_reference_as_per_payment_terms(
payment_schedule, dt, dn, doc, grand_total, outstanding_amount
payment_schedule, dt, dn, doc, grand_total, outstanding_amount, party_account_currency
):
references = []
is_multi_currency_acc = (doc.currency != doc.company_currency) and (
party_account_currency != doc.company_currency
)
for payment_term in payment_schedule:
payment_term_outstanding = flt(
payment_term.payment_amount - payment_term.paid_amount, payment_term.precision("payment_amount")
)
if not is_multi_currency_acc:
# If accounting is done in company currency for multi-currency transaction
payment_term_outstanding = flt(
payment_term_outstanding * doc.get("conversion_rate"), payment_term.precision("payment_amount")
)
if payment_term_outstanding:
references.append(

View File

@@ -4,6 +4,8 @@
import unittest
import frappe
from frappe import qb
from frappe.tests.utils import change_settings
from frappe.utils import flt, nowdate
from erpnext.accounts.doctype.payment_entry.payment_entry import (
@@ -251,10 +253,25 @@ class TestPaymentEntry(unittest.TestCase):
},
)
si.save()
si.submit()
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 1)
pe_with_tax_loss = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe_with_tax_loss.references[0].payment_term, "30 Credit Days with 10% Discount")
self.assertEqual(pe_with_tax_loss.references[0].allocated_amount, 236.0)
self.assertEqual(pe_with_tax_loss.paid_amount, 212.4)
self.assertEqual(pe_with_tax_loss.deductions[0].amount, 20.0) # Loss on Income
self.assertEqual(pe_with_tax_loss.deductions[1].amount, 3.6) # Loss on Tax
self.assertEqual(pe_with_tax_loss.deductions[1].account, "_Test Account Service Tax - _TC")
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 0)
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe.references[0].allocated_amount, 236.0)
self.assertEqual(pe.paid_amount, 212.4)
self.assertEqual(pe.deductions[0].amount, 23.6)
pe.submit()
si.load_from_db()
@@ -264,6 +281,190 @@ class TestPaymentEntry(unittest.TestCase):
self.assertEqual(si.payment_schedule[0].outstanding, 0)
self.assertEqual(si.payment_schedule[0].discounted_amount, 23.6)
def test_payment_entry_against_payment_terms_with_discount_amount(self):
si = create_sales_invoice(do_not_save=1, qty=1, rate=200)
si.payment_terms_template = "Test Discount Amount Template"
create_payment_terms_template_with_discount(
name="30 Credit Days with Rs.50 Discount",
discount_type="Amount",
discount=50,
template_name="Test Discount Amount Template",
)
frappe.db.set_value("Company", si.company, "default_discount_account", "Write Off - _TC")
si.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account Service Tax - _TC",
"cost_center": "_Test Cost Center - _TC",
"description": "Service Tax",
"rate": 18,
},
)
si.save()
si.submit()
# Set reference date past discount cut off date
pe_1 = get_payment_entry(
"Sales Invoice",
si.name,
bank_account="_Test Cash - _TC",
reference_date=frappe.utils.add_days(si.posting_date, 2),
)
self.assertEqual(pe_1.paid_amount, 236.0) # discount not applied
# Test if tax loss is booked on enabling configuration
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 1)
pe_with_tax_loss = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe_with_tax_loss.deductions[0].amount, 42.37) # Loss on Income
self.assertEqual(pe_with_tax_loss.deductions[1].amount, 7.63) # Loss on Tax
self.assertEqual(pe_with_tax_loss.deductions[1].account, "_Test Account Service Tax - _TC")
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 0)
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe.references[0].allocated_amount, 236.0)
self.assertEqual(pe.paid_amount, 186)
self.assertEqual(pe.deductions[0].amount, 50.0)
pe.submit()
si.load_from_db()
self.assertEqual(si.payment_schedule[0].payment_amount, 236.0)
self.assertEqual(si.payment_schedule[0].paid_amount, 186)
self.assertEqual(si.payment_schedule[0].outstanding, 0)
self.assertEqual(si.payment_schedule[0].discounted_amount, 50)
@change_settings(
"Accounts Settings",
{
"allow_multi_currency_invoices_against_single_party_account": 1,
"book_tax_discount_loss": 1,
},
)
def test_payment_entry_multicurrency_si_with_base_currency_accounting_early_payment_discount(
self,
):
"""
1. Multi-currency SI with single currency accounting (company currency)
2. PE with early payment discount
3. Test if Paid Amount is calculated in company currency
4. Test if deductions are calculated in company currency
SI is in USD to document agreed amounts that are in USD, but the accounting is in base currency.
"""
si = create_sales_invoice(
customer="_Test Customer",
currency="USD",
conversion_rate=50,
do_not_save=1,
)
create_payment_terms_template_with_discount()
si.payment_terms_template = "Test Discount Template"
frappe.db.set_value("Company", si.company, "default_discount_account", "Write Off - _TC")
si.save()
si.submit()
pe = get_payment_entry(
"Sales Invoice",
si.name,
bank_account="_Test Bank - _TC",
)
pe.reference_no = si.name
pe.reference_date = nowdate()
# Early payment discount loss on income
self.assertEqual(pe.paid_amount, 4500.0) # Amount in company currency
self.assertEqual(pe.received_amount, 4500.0)
self.assertEqual(pe.deductions[0].amount, 500.0)
self.assertEqual(pe.deductions[0].account, "Write Off - _TC")
self.assertEqual(pe.difference_amount, 0.0)
pe.insert()
pe.submit()
expected_gle = dict(
(d[0], d)
for d in [
["Debtors - _TC", 0, 5000, si.name],
["_Test Bank - _TC", 4500, 0, None],
["Write Off - _TC", 500.0, 0, None],
]
)
self.validate_gl_entries(pe.name, expected_gle)
outstanding_amount = flt(frappe.db.get_value("Sales Invoice", si.name, "outstanding_amount"))
self.assertEqual(outstanding_amount, 0)
def test_payment_entry_multicurrency_accounting_si_with_early_payment_discount(self):
"""
1. Multi-currency SI with multi-currency accounting
2. PE with early payment discount and also exchange loss
3. Test if Paid Amount is calculated in transaction currency
4. Test if deductions are calculated in base/company currency
5. Test if exchange loss is reflected in difference
"""
si = create_sales_invoice(
customer="_Test Customer USD",
debit_to="_Test Receivable USD - _TC",
currency="USD",
conversion_rate=50,
do_not_save=1,
)
create_payment_terms_template_with_discount()
si.payment_terms_template = "Test Discount Template"
frappe.db.set_value("Company", si.company, "default_discount_account", "Write Off - _TC")
si.save()
si.submit()
pe = get_payment_entry(
"Sales Invoice", si.name, bank_account="_Test Bank - _TC", bank_amount=4700
)
pe.reference_no = si.name
pe.reference_date = nowdate()
# Early payment discount loss on income
self.assertEqual(pe.paid_amount, 90.0)
self.assertEqual(pe.received_amount, 4200.0) # 5000 - 500 (discount) - 300 (exchange loss)
self.assertEqual(pe.deductions[0].amount, 500.0)
self.assertEqual(pe.deductions[0].account, "Write Off - _TC")
# Exchange loss
self.assertEqual(pe.difference_amount, 300.0)
pe.append(
"deductions",
{
"account": "_Test Exchange Gain/Loss - _TC",
"cost_center": "_Test Cost Center - _TC",
"amount": 300.0,
},
)
pe.insert()
pe.submit()
self.assertEqual(pe.difference_amount, 0.0)
expected_gle = dict(
(d[0], d)
for d in [
["_Test Receivable USD - _TC", 0, 5000, si.name],
["_Test Bank - _TC", 4200, 0, None],
["Write Off - _TC", 500.0, 0, None],
["_Test Exchange Gain/Loss - _TC", 300.0, 0, None],
]
)
self.validate_gl_entries(pe.name, expected_gle)
outstanding_amount = flt(frappe.db.get_value("Sales Invoice", si.name, "outstanding_amount"))
self.assertEqual(outstanding_amount, 0)
def test_payment_against_purchase_invoice_to_check_status(self):
pi = make_purchase_invoice(
supplier="_Test Supplier USD",
@@ -743,6 +944,46 @@ class TestPaymentEntry(unittest.TestCase):
flt(payment_entry.total_taxes_and_charges, 2), flt(10 / payment_entry.target_exchange_rate, 2)
)
def test_gl_of_multi_currency_payment_with_taxes(self):
payment_entry = create_payment_entry(
party="_Test Supplier USD", paid_to="_Test Payable USD - _TC", save=True
)
payment_entry.append(
"taxes",
{
"account_head": "_Test Account Service Tax - _TC",
"charge_type": "Actual",
"tax_amount": 100,
"add_deduct_tax": "Add",
"description": "Test",
},
)
payment_entry.target_exchange_rate = 80
payment_entry.received_amount = 12.5
payment_entry = payment_entry.submit()
gle = qb.DocType("GL Entry")
gl_entries = (
qb.from_(gle)
.select(
gle.account,
gle.debit,
gle.credit,
gle.debit_in_account_currency,
gle.credit_in_account_currency,
)
.orderby(gle.account)
.where(gle.voucher_no == payment_entry.name)
.run()
)
expected_gl_entries = (
("_Test Account Service Tax - _TC", 100.0, 0.0, 100.0, 0.0),
("_Test Bank - _TC", 0.0, 1100.0, 0.0, 1100.0),
("_Test Payable USD - _TC", 1000.0, 0.0, 12.5, 0),
)
self.assertEqual(gl_entries, expected_gl_entries)
def test_payment_entry_against_onhold_purchase_invoice(self):
pi = make_purchase_invoice()
@@ -815,24 +1056,27 @@ def create_payment_terms_template():
).insert()
def create_payment_terms_template_with_discount():
def create_payment_terms_template_with_discount(
name=None, discount_type=None, discount=None, template_name=None
):
create_payment_term(name or "30 Credit Days with 10% Discount")
template_name = template_name or "Test Discount Template"
create_payment_term("30 Credit Days with 10% Discount")
if not frappe.db.exists("Payment Terms Template", "Test Discount Template"):
payment_term_template = frappe.get_doc(
if not frappe.db.exists("Payment Terms Template", template_name):
frappe.get_doc(
{
"doctype": "Payment Terms Template",
"template_name": "Test Discount Template",
"template_name": template_name,
"allocate_payment_based_on_payment_terms": 1,
"terms": [
{
"doctype": "Payment Terms Template Detail",
"payment_term": "30 Credit Days with 10% Discount",
"payment_term": name or "30 Credit Days with 10% Discount",
"invoice_portion": 100,
"credit_days_based_on": "Day(s) after invoice date",
"credit_days": 2,
"discount": 10,
"discount_type": discount_type or "Percentage",
"discount": discount or 10,
"discount_validity_based_on": "Day(s) after invoice date",
"discount_validity": 1,
}

View File

@@ -3,6 +3,7 @@
"creation": "2016-06-15 15:56:30.815503",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"account",
"cost_center",
@@ -17,9 +18,7 @@
"in_list_view": 1,
"label": "Account",
"options": "Account",
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"reqd": 1
},
{
"fieldname": "cost_center",
@@ -28,37 +27,30 @@
"label": "Cost Center",
"options": "Cost Center",
"print_hide": 1,
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"reqd": 1
},
{
"fieldname": "amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Amount",
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"label": "Amount (Company Currency)",
"options": "Company:company:default_currency",
"reqd": 1
},
{
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"show_days": 1,
"show_seconds": 1
"fieldtype": "Column Break"
},
{
"fieldname": "description",
"fieldtype": "Small Text",
"label": "Description",
"show_days": 1,
"show_seconds": 1
"label": "Description"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2020-09-12 20:38:08.110674",
"modified": "2023-03-06 07:11:57.739619",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Deduction",
@@ -66,5 +58,6 @@
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -25,7 +25,8 @@
"in_list_view": 1,
"label": "Type",
"options": "DocType",
"reqd": 1
"reqd": 1,
"search_index": 1
},
{
"columns": 2,
@@ -35,7 +36,8 @@
"in_list_view": 1,
"label": "Name",
"options": "reference_doctype",
"reqd": 1
"reqd": 1,
"search_index": 1
},
{
"fieldname": "due_date",
@@ -104,7 +106,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-09-26 17:06:55.597389",
"modified": "2022-12-12 12:31:44.919895",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Reference",
@@ -113,5 +115,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -3,12 +3,18 @@
import frappe
from frappe import _, msgprint
from frappe import _, msgprint, qb
from frappe.model.document import Document
from frappe.query_builder import Criterion
from frappe.query_builder.functions import Sum
from frappe.utils import flt, getdate, nowdate, today
import erpnext
from erpnext.accounts.utils import get_outstanding_invoices, reconcile_against_document
from erpnext.accounts.utils import (
get_outstanding_invoices,
reconcile_against_document,
update_reference_in_payment_entry,
)
from erpnext.controllers.accounts_controller import get_advance_payment_entries
@@ -43,6 +49,10 @@ class PaymentReconciliation(Document):
def get_payment_entries(self):
order_doctype = "Sales Order" if self.party_type == "Customer" else "Purchase Order"
condition = self.get_conditions(get_payments=True)
if self.get("cost_center"):
condition += " and cost_center = '{0}' ".format(self.cost_center)
payment_entries = get_advance_payment_entries(
self.party_type,
self.party,
@@ -57,6 +67,10 @@ class PaymentReconciliation(Document):
def get_jv_entries(self):
condition = self.get_conditions()
if self.get("cost_center"):
condition += " and t2.cost_center = '{0}' ".format(self.cost_center)
dr_or_cr = (
"credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
@@ -108,54 +122,79 @@ class PaymentReconciliation(Document):
return list(journal_entries)
def get_dr_or_cr_notes(self):
condition = self.get_conditions(get_return_invoices=True)
gl = qb.DocType("GL Entry")
voucher_type = "Sales Invoice" if self.party_type == "Customer" else "Purchase Invoice"
doc = qb.DocType(voucher_type)
# build conditions
sub_query_conditions = []
conditions = []
sub_query_conditions.append(doc.company == self.company)
if self.get("from_payment_date"):
sub_query_conditions.append(doc.posting_date.gte(self.from_payment_date))
if self.get("to_payment_date"):
sub_query_conditions.append(doc.posting_date.lte(self.to_payment_date))
if self.get("cost_center"):
sub_query_conditions.append(doc.cost_center == self.cost_center)
dr_or_cr = (
"credit_in_account_currency"
gl["credit_in_account_currency"]
if erpnext.get_party_account_type(self.party_type) == "Receivable"
else "debit_in_account_currency"
else gl["debit_in_account_currency"]
)
reconciled_dr_or_cr = (
"debit_in_account_currency"
if dr_or_cr == "credit_in_account_currency"
else "credit_in_account_currency"
gl["debit_in_account_currency"]
if dr_or_cr.name == "credit_in_account_currency"
else gl["credit_in_account_currency"]
)
voucher_type = "Sales Invoice" if self.party_type == "Customer" else "Purchase Invoice"
having_clause = qb.Field("amount") > 0
return frappe.db.sql(
""" SELECT doc.name as reference_name, %(voucher_type)s as reference_type,
(sum(gl.{dr_or_cr}) - sum(gl.{reconciled_dr_or_cr})) as amount, doc.posting_date,
account_currency as currency
FROM `tab{doc}` doc, `tabGL Entry` gl
WHERE
(doc.name = gl.against_voucher or doc.name = gl.voucher_no)
and doc.{party_type_field} = %(party)s
and doc.is_return = 1 and ifnull(doc.return_against, "") = ""
and gl.against_voucher_type = %(voucher_type)s
and doc.docstatus = 1 and gl.party = %(party)s
and gl.party_type = %(party_type)s and gl.account = %(account)s
and gl.is_cancelled = 0 {condition}
GROUP BY doc.name
Having
amount > 0
ORDER BY doc.posting_date
""".format(
doc=voucher_type,
dr_or_cr=dr_or_cr,
reconciled_dr_or_cr=reconciled_dr_or_cr,
party_type_field=frappe.scrub(self.party_type),
condition=condition or "",
),
{
"party": self.party,
"party_type": self.party_type,
"voucher_type": voucher_type,
"account": self.receivable_payable_account,
},
as_dict=1,
if self.minimum_payment_amount:
having_clause = qb.Field("amount") >= self.minimum_payment_amount
if self.maximum_payment_amount:
having_clause = having_clause & qb.Field("amount") <= self.maximum_payment_amount
sub_query = (
qb.from_(doc)
.select(doc.name)
.where(Criterion.all(sub_query_conditions))
.where(
(doc.docstatus == 1)
& (doc.is_return == 1)
& ((doc.return_against == "") | (doc.return_against.isnull()))
)
)
query = (
qb.from_(gl)
.select(
gl.against_voucher_type.as_("reference_type"),
gl.against_voucher.as_("reference_name"),
(Sum(dr_or_cr) - Sum(reconciled_dr_or_cr)).as_("amount"),
gl.posting_date,
gl.account_currency.as_("currency"),
)
.where(
(gl.against_voucher.isin(sub_query))
& (gl.against_voucher_type == voucher_type)
& (gl.is_cancelled == 0)
& (gl.account == self.receivable_payable_account)
& (gl.party_type == self.party_type)
& (gl.party == self.party)
)
.where(Criterion.all(conditions))
.groupby(gl.against_voucher)
.having(having_clause)
)
dr_cr_notes = query.run(as_dict=True)
return dr_cr_notes
def add_payment_entries(self, non_reconciled_payments):
self.set("payments", [])
@@ -168,8 +207,11 @@ class PaymentReconciliation(Document):
condition = self.get_conditions(get_invoices=True)
if self.get("cost_center"):
condition += " and cost_center = '{0}' ".format(self.cost_center)
non_reconciled_invoices = get_outstanding_invoices(
self.party_type, self.party, self.receivable_payable_account, condition=condition
self.party_type, self.party, self.receivable_payable_account, self.company, condition=condition
)
if self.invoice_limit:
@@ -190,6 +232,23 @@ class PaymentReconciliation(Document):
inv.currency = entry.get("currency")
inv.outstanding_amount = flt(entry.get("outstanding_amount"))
def get_difference_amount(self, allocated_entry):
if allocated_entry.get("reference_type") != "Payment Entry":
return
dr_or_cr = (
"credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
else "debit_in_account_currency"
)
row = self.get_payment_details(allocated_entry, dr_or_cr)
doc = frappe.get_doc(allocated_entry.reference_type, allocated_entry.reference_name)
update_reference_in_payment_entry(row, doc, do_not_save=True)
return doc.difference_amount
@frappe.whitelist()
def allocate_entries(self, args):
self.validate_entries()
@@ -205,12 +264,16 @@ class PaymentReconciliation(Document):
res = self.get_allocated_entry(pay, inv, pay["amount"])
inv["outstanding_amount"] = flt(inv.get("outstanding_amount")) - flt(pay.get("amount"))
pay["amount"] = 0
res.difference_amount = self.get_difference_amount(res)
if pay.get("amount") == 0:
entries.append(res)
break
elif inv.get("outstanding_amount") == 0:
entries.append(res)
continue
else:
break
@@ -329,12 +392,9 @@ class PaymentReconciliation(Document):
if not invoices_to_reconcile:
frappe.throw(_("No records found in Allocation table"))
def get_conditions(self, get_invoices=False, get_payments=False, get_return_invoices=False):
def get_conditions(self, get_invoices=False, get_payments=False):
condition = " and company = '{0}' ".format(self.company)
if self.get("cost_center") and (get_invoices or get_payments or get_return_invoices):
condition = " and cost_center = '{0}' ".format(self.cost_center)
if get_invoices:
condition += (
" and posting_date >= {0}".format(frappe.db.escape(self.from_invoice_date))
@@ -360,35 +420,7 @@ class PaymentReconciliation(Document):
condition += " and {dr_or_cr} <= {amount}".format(
dr_or_cr=dr_or_cr, amount=flt(self.maximum_invoice_amount)
)
elif get_return_invoices:
condition = " and doc.company = '{0}' ".format(self.company)
condition += (
" and doc.posting_date >= {0}".format(frappe.db.escape(self.from_payment_date))
if self.from_payment_date
else ""
)
condition += (
" and doc.posting_date <= {0}".format(frappe.db.escape(self.to_payment_date))
if self.to_payment_date
else ""
)
dr_or_cr = (
"debit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
else "credit_in_account_currency"
)
if self.minimum_invoice_amount:
condition += " and gl.{dr_or_cr} >= {amount}".format(
dr_or_cr=dr_or_cr, amount=flt(self.minimum_payment_amount)
)
if self.maximum_invoice_amount:
condition += " and gl.{dr_or_cr} <= {amount}".format(
dr_or_cr=dr_or_cr, amount=flt(self.maximum_payment_amount)
)
else:
elif get_payments:
condition += (
" and posting_date >= {0}".format(frappe.db.escape(self.from_payment_date))
if self.from_payment_date

View File

@@ -186,8 +186,10 @@
{
"fetch_from": "bank_account.bank",
"fieldname": "bank",
"fieldtype": "Read Only",
"label": "Bank"
"fieldtype": "Link",
"label": "Bank",
"options": "Bank",
"read_only": 1
},
{
"fetch_from": "bank_account.bank_account_no",
@@ -366,10 +368,11 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2020-09-18 12:24:14.178853",
"modified": "2022-09-30 16:19:43.680025",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -401,5 +404,6 @@
}
],
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -39,6 +39,7 @@
{
"columns": 2,
"fetch_from": "payment_term.description",
"fetch_if_empty": 1,
"fieldname": "description",
"fieldtype": "Small Text",
"in_list_view": 1,
@@ -159,7 +160,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-04-28 05:41:35.084233",
"modified": "2022-09-16 13:57:06.382859",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",
@@ -168,5 +169,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -25,7 +25,7 @@ frappe.ui.form.on('POS Closing Entry', {
frappe.realtime.on('closing_process_complete', async function(data) {
await frm.reload_doc();
if (frm.doc.status == 'Failed' && frm.doc.error_message && data.user == frappe.session.user) {
if (frm.doc.status == 'Failed' && frm.doc.error_message) {
frappe.msgprint({
title: __('POS Closing Failed'),
message: frm.doc.error_message,
@@ -36,6 +36,15 @@ frappe.ui.form.on('POS Closing Entry', {
});
set_html_data(frm);
if (frm.doc.docstatus == 1) {
if (!frm.doc.posting_date) {
frm.set_value("posting_date", frappe.datetime.nowdate());
}
if (!frm.doc.posting_time) {
frm.set_value("posting_time", frappe.datetime.now_time());
}
}
},
refresh: function(frm) {

View File

@@ -11,6 +11,7 @@
"period_end_date",
"column_break_3",
"posting_date",
"posting_time",
"pos_opening_entry",
"status",
"section_break_5",
@@ -51,7 +52,6 @@
"fieldtype": "Datetime",
"in_list_view": 1,
"label": "Period End Date",
"read_only": 1,
"reqd": 1
},
{
@@ -219,6 +219,13 @@
"fieldtype": "Small Text",
"label": "Error",
"read_only": 1
},
{
"fieldname": "posting_time",
"fieldtype": "Time",
"label": "Posting Time",
"no_copy": 1,
"reqd": 1
}
],
"is_submittable": 1,
@@ -228,10 +235,11 @@
"link_fieldname": "pos_closing_entry"
}
],
"modified": "2021-10-20 16:19:25.340565",
"modified": "2022-08-01 11:37:14.991228",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Closing Entry",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
@@ -278,5 +286,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -15,11 +15,30 @@ from erpnext.controllers.status_updater import StatusUpdater
class POSClosingEntry(StatusUpdater):
def validate(self):
self.posting_date = self.posting_date or frappe.utils.nowdate()
self.posting_time = self.posting_time or frappe.utils.nowtime()
if frappe.db.get_value("POS Opening Entry", self.pos_opening_entry, "status") != "Open":
frappe.throw(_("Selected POS Opening Entry should be open."), title=_("Invalid Opening Entry"))
self.validate_duplicate_pos_invoices()
self.validate_pos_invoices()
def validate_duplicate_pos_invoices(self):
pos_occurences = {}
for idx, inv in enumerate(self.pos_transactions, 1):
pos_occurences.setdefault(inv.pos_invoice, []).append(idx)
error_list = []
for key, value in pos_occurences.items():
if len(value) > 1:
error_list.append(
_("{} is added multiple times on rows: {}".format(frappe.bold(key), frappe.bold(value)))
)
if error_list:
frappe.throw(error_list, title=_("Duplicate POS Invoices found"), as_list=True)
def validate_pos_invoices(self):
invalid_rows = []
for d in self.pos_transactions:

View File

@@ -1572,7 +1572,7 @@
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2022-03-22 13:00:24.166684",
"modified": "2022-09-27 13:00:24.166684",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@@ -161,7 +161,7 @@ class POSInvoice(SalesInvoice):
bold_item_name = frappe.bold(item.item_name)
bold_extra_batch_qty_needed = frappe.bold(
abs(available_batch_qty - reserved_batch_qty - item.qty)
abs(available_batch_qty - reserved_batch_qty - item.stock_qty)
)
bold_invalid_batch_no = frappe.bold(item.batch_no)
@@ -172,7 +172,7 @@ class POSInvoice(SalesInvoice):
).format(item.idx, bold_invalid_batch_no, bold_item_name),
title=_("Item Unavailable"),
)
elif (available_batch_qty - reserved_batch_qty - item.qty) < 0:
elif (available_batch_qty - reserved_batch_qty - item.stock_qty) < 0:
frappe.throw(
_(
"Row #{}: Batch No. {} of item {} has less than required stock available, {} more required"
@@ -222,9 +222,6 @@ class POSInvoice(SalesInvoice):
allow_negative_stock = frappe.db.get_single_value("Stock Settings", "allow_negative_stock")
for d in self.get("items"):
is_service_item = not (frappe.db.get_value("Item", d.get("item_code"), "is_stock_item"))
if is_service_item:
return
if d.serial_no:
self.validate_pos_reserved_serial_nos(d)
self.validate_delivered_serial_nos(d)
@@ -242,14 +239,14 @@ class POSInvoice(SalesInvoice):
frappe.bold(d.warehouse),
frappe.bold(d.qty),
)
if flt(available_stock) <= 0:
if is_stock_item and flt(available_stock) <= 0:
frappe.throw(
_("Row #{}: Item Code: {} is not available under warehouse {}.").format(
d.idx, item_code, warehouse
),
title=_("Item Unavailable"),
)
elif flt(available_stock) < flt(d.qty):
elif is_stock_item and flt(available_stock) < flt(d.stock_qty):
frappe.throw(
_(
"Row #{}: Stock quantity not enough for Item Code: {} under warehouse {}. Available quantity {}."
@@ -637,11 +634,12 @@ def get_stock_availability(item_code, warehouse):
pos_sales_qty = get_pos_reserved_qty(item_code, warehouse)
return bin_qty - pos_sales_qty, is_stock_item
else:
is_stock_item = False
is_stock_item = True
if frappe.db.exists("Product Bundle", item_code):
return get_bundle_availability(item_code, warehouse), is_stock_item
else:
# Is a service item
is_stock_item = False
# Is a service item or non_stock item
return 0, is_stock_item
@@ -654,8 +652,10 @@ def get_bundle_availability(bundle_item_code, warehouse):
item_pos_reserved_qty = get_pos_reserved_qty(item.item_code, warehouse)
available_qty = item_bin_qty - item_pos_reserved_qty
max_available_bundles = available_qty / item.qty
if bundle_bin_qty > max_available_bundles:
max_available_bundles = available_qty / item.stock_qty
if bundle_bin_qty > max_available_bundles and frappe.get_value(
"Item", item.item_code, "is_stock_item"
):
bundle_bin_qty = max_available_bundles
pos_sales_qty = get_pos_reserved_qty(bundle_item_code, warehouse)
@@ -747,3 +747,7 @@ def add_return_modes(doc, pos_profile):
]:
payment_mode = get_mode_of_payment_info(mode_of_payment, doc.company)
append_payment(payment_mode[0])
def on_doctype_update():
frappe.db.add_index("POS Invoice", ["return_against"])

View File

@@ -495,6 +495,67 @@ class TestPOSInvoice(unittest.TestCase):
self.assertRaises(frappe.ValidationError, pos.submit)
def test_value_error_on_serial_no_validation(self):
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
se = make_serialized_item(
company="_Test Company",
target_warehouse="Stores - _TC",
cost_center="Main - _TC",
expense_account="Cost of Goods Sold - _TC",
)
serial_nos = se.get("items")[0].serial_no
# make a pos invoice
pos = create_pos_invoice(
company="_Test Company",
debit_to="Debtors - _TC",
account_for_change_amount="Cash - _TC",
warehouse="Stores - _TC",
income_account="Sales - _TC",
expense_account="Cost of Goods Sold - _TC",
cost_center="Main - _TC",
item=se.get("items")[0].item_code,
rate=1000,
qty=1,
do_not_save=1,
)
pos.get("items")[0].has_serial_no = 1
pos.get("items")[0].serial_no = serial_nos.split("\n")[0]
pos.set("payments", [])
pos.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1000, "default": 1}
)
pos = pos.save().submit()
# make a return
pos_return = make_sales_return(pos.name)
pos_return.paid_amount = pos_return.grand_total
pos_return.save()
pos_return.submit()
# set docstatus to 2 for pos to trigger this issue
frappe.db.set_value("POS Invoice", pos.name, "docstatus", 2)
pos2 = create_pos_invoice(
company="_Test Company",
debit_to="Debtors - _TC",
account_for_change_amount="Cash - _TC",
warehouse="Stores - _TC",
income_account="Sales - _TC",
expense_account="Cost of Goods Sold - _TC",
cost_center="Main - _TC",
item=se.get("items")[0].item_code,
rate=1000,
qty=1,
do_not_save=1,
)
pos2.get("items")[0].has_serial_no = 1
pos2.get("items")[0].serial_no = serial_nos.split("\n")[0]
# Value error should not be triggered on validation
pos2.save()
def test_loyalty_points(self):
from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
get_loyalty_program_details_with_points,

View File

@@ -6,6 +6,7 @@
"engine": "InnoDB",
"field_order": [
"posting_date",
"posting_time",
"merge_invoices_based_on",
"column_break_3",
"pos_closing_entry",
@@ -105,12 +106,19 @@
"label": "Customer Group",
"mandatory_depends_on": "eval:doc.merge_invoices_based_on == 'Customer Group'",
"options": "Customer Group"
},
{
"fieldname": "posting_time",
"fieldtype": "Time",
"label": "Posting Time",
"no_copy": 1,
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-09-14 11:17:19.001142",
"modified": "2022-08-01 11:36:42.456429",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice Merge Log",
@@ -173,5 +181,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -9,7 +9,7 @@ from frappe import _
from frappe.core.page.background_jobs.background_jobs import get_info
from frappe.model.document import Document
from frappe.model.mapper import map_child_doc, map_doc
from frappe.utils import flt, getdate, nowdate
from frappe.utils import cint, flt, get_time, getdate, nowdate, nowtime
from frappe.utils.background_jobs import enqueue
from frappe.utils.scheduler import is_scheduler_inactive
@@ -18,6 +18,22 @@ class POSInvoiceMergeLog(Document):
def validate(self):
self.validate_customer()
self.validate_pos_invoice_status()
self.validate_duplicate_pos_invoices()
def validate_duplicate_pos_invoices(self):
pos_occurences = {}
for idx, inv in enumerate(self.pos_invoices, 1):
pos_occurences.setdefault(inv.pos_invoice, []).append(idx)
error_list = []
for key, value in pos_occurences.items():
if len(value) > 1:
error_list.append(
_("{} is added multiple times on rows: {}".format(frappe.bold(key), frappe.bold(value)))
)
if error_list:
frappe.throw(error_list, title=_("Duplicate POS Invoices found"), as_list=True)
def validate_customer(self):
if self.merge_invoices_based_on == "Customer Group":
@@ -79,6 +95,7 @@ class POSInvoiceMergeLog(Document):
if sales:
sales_invoice = self.process_merging_into_sales_invoice(sales)
self.flags.ignore_validate_update_after_submit = True
self.save() # save consolidated_sales_invoice & consolidated_credit_note ref in merge log
self.update_pos_invoices(pos_invoice_docs, sales_invoice, credit_note)
@@ -99,6 +116,7 @@ class POSInvoiceMergeLog(Document):
sales_invoice.is_consolidated = 1
sales_invoice.set_posting_time = 1
sales_invoice.posting_date = getdate(self.posting_date)
sales_invoice.posting_time = get_time(self.posting_time)
sales_invoice.save()
sales_invoice.submit()
@@ -115,6 +133,7 @@ class POSInvoiceMergeLog(Document):
credit_note.is_consolidated = 1
credit_note.set_posting_time = 1
credit_note.posting_date = getdate(self.posting_date)
credit_note.posting_time = get_time(self.posting_time)
# TODO: return could be against multiple sales invoice which could also have been consolidated?
# credit_note.return_against = self.consolidated_invoice
credit_note.save()
@@ -219,6 +238,9 @@ class POSInvoiceMergeLog(Document):
invoice.taxes_and_charges = None
invoice.ignore_pricing_rule = 1
invoice.customer = self.customer
invoice.disable_rounded_total = cint(
frappe.db.get_value("POS Profile", invoice.pos_profile, "disable_rounded_total")
)
if self.merge_invoices_based_on == "Customer Group":
invoice.flags.ignore_pos_profile = True
@@ -399,6 +421,9 @@ def create_merge_logs(invoice_by_customer, closing_entry=None):
merge_log.posting_date = (
getdate(closing_entry.get("posting_date")) if closing_entry else nowdate()
)
merge_log.posting_time = (
get_time(closing_entry.get("posting_time")) if closing_entry else nowtime()
)
merge_log.customer = customer
merge_log.pos_closing_entry = closing_entry.get("name") if closing_entry else None
@@ -418,12 +443,14 @@ def create_merge_logs(invoice_by_customer, closing_entry=None):
if closing_entry:
closing_entry.set_status(update=True, status="Failed")
if type(error_message) == list:
error_message = frappe.json.dumps(error_message)
closing_entry.db_set("error_message", error_message)
raise
finally:
frappe.db.commit()
frappe.publish_realtime("closing_process_complete", {"user": frappe.session.user})
frappe.publish_realtime("closing_process_complete", user=frappe.session.user)
def cancel_merge_logs(merge_logs, closing_entry=None):
@@ -450,7 +477,7 @@ def cancel_merge_logs(merge_logs, closing_entry=None):
finally:
frappe.db.commit()
frappe.publish_realtime("closing_process_complete", {"user": frappe.session.user})
frappe.publish_realtime("closing_process_complete", user=frappe.session.user)
def enqueue_job(job, **kwargs):

View File

@@ -43,7 +43,9 @@
"currency",
"write_off_account",
"write_off_cost_center",
"write_off_limit",
"account_for_change_amount",
"disable_rounded_total",
"column_break_23",
"income_account",
"expense_account",
@@ -358,6 +360,21 @@
"fieldname": "validate_stock_on_save",
"fieldtype": "Check",
"label": "Validate Stock on Save"
},
{
"default": "1",
"description": "Auto write off precision loss while consolidation",
"fieldname": "write_off_limit",
"fieldtype": "Currency",
"label": "Write Off Limit",
"reqd": 1
},
{
"default": "0",
"description": "If enabled, the consolidated invoices will have rounded total disabled",
"fieldname": "disable_rounded_total",
"fieldtype": "Check",
"label": "Disable Rounded Total"
}
],
"icon": "icon-cog",
@@ -385,7 +402,7 @@
"link_fieldname": "pos_profile"
}
],
"modified": "2022-03-21 13:29:28.480533",
"modified": "2022-08-10 12:57:06.241439",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",

View File

@@ -269,6 +269,18 @@ def get_serial_no_for_item(args):
return item_details
def update_pricing_rule_uom(pricing_rule, args):
child_doc = {"Item Code": "items", "Item Group": "item_groups", "Brand": "brands"}.get(
pricing_rule.apply_on
)
apply_on_field = frappe.scrub(pricing_rule.apply_on)
for row in pricing_rule.get(child_doc):
if row.get(apply_on_field) == args.get(apply_on_field):
pricing_rule.uom = row.uom
def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=False):
from erpnext.accounts.doctype.pricing_rule.utils import (
get_applied_pricing_rules,
@@ -325,7 +337,8 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
if isinstance(pricing_rule, string_types):
pricing_rule = frappe.get_cached_doc("Pricing Rule", pricing_rule)
pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule)
update_pricing_rule_uom(pricing_rule, args)
pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule) or []
if pricing_rule.get("suggestion"):
continue
@@ -439,12 +452,15 @@ def apply_price_discount_rule(pricing_rule, item_details, args):
if pricing_rule.currency == args.currency:
pricing_rule_rate = pricing_rule.rate
# TODO https://github.com/frappe/erpnext/pull/23636 solve this in some other way.
if pricing_rule_rate:
is_blank_uom = pricing_rule.get("uom") != args.get("uom")
# Override already set price list rate (from item price)
# if pricing_rule_rate > 0
item_details.update(
{
"price_list_rate": pricing_rule_rate * args.get("conversion_factor", 1),
"price_list_rate": pricing_rule_rate
* (args.get("conversion_factor", 1) if is_blank_uom else 1),
}
)
item_details.update({"discount_percentage": 0.0})

View File

@@ -597,6 +597,255 @@ class TestPricingRule(unittest.TestCase):
frappe.get_doc("Item Price", {"item_code": "Water Flask"}).delete()
item.delete()
def test_item_price_with_blank_uom_pricing_rule(self):
properties = {
"item_code": "Item Blank UOM",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item Blank UOM", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item Blank UOM Rule",
"apply_on": "Item Code",
"items": [
{
"item_code": "Item Blank UOM",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True, item_code="Item Blank UOM", uom="Box", conversion_factor=10
)
si.selling_price_list = "_Test Price List"
si.save()
# If UOM is blank consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Box that have conversion_factor of 10 so 101 * 10 = 1010
self.assertEqual(si.items[0].price_list_rate, 1010)
self.assertEqual(si.items[0].rate, 1010)
si.delete()
si = create_sales_invoice(do_not_save=True, item_code="Item Blank UOM", uom="Nos")
si.selling_price_list = "_Test Price List"
si.save()
# UOM is blank so consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Nos that have conversion_factor of 1 so 101 * 1 = 101
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item Blank UOM"}).delete()
item.delete()
def test_item_price_with_selling_uom_pricing_rule(self):
properties = {
"item_code": "Item UOM other than Stock",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item UOM other than Stock", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item UOM other than Stock Rule",
"apply_on": "Item Code",
"items": [
{
"item_code": "Item UOM other than Stock",
"uom": "Box",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True, item_code="Item UOM other than Stock", uom="Box", conversion_factor=10
)
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so apply pricing_rule only on Box UOM.
# Selling UOM is Box and as both UOM are same no need to multiply by conversion_factor.
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
si = create_sales_invoice(do_not_save=True, item_code="Item UOM other than Stock", uom="Nos")
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so pricing_rule won't apply as selling_uom is Nos.
# As Pricing Rule is not applied price of 100 will be fetched from Item Price List.
self.assertEqual(si.items[0].price_list_rate, 100)
self.assertEqual(si.items[0].rate, 100)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item UOM other than Stock"}).delete()
item.delete()
def test_item_group_price_with_blank_uom_pricing_rule(self):
group = frappe.get_doc(
doctype="Item Group",
item_group_name="_Test Pricing Rule Item Group",
parent_item_group="All Item Groups",
)
group.save()
properties = {
"item_code": "Item with Group Blank UOM",
"item_group": "_Test Pricing Rule Item Group",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item with Group Blank UOM", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item with Group Blank UOM Rule",
"apply_on": "Item Group",
"item_groups": [
{
"item_group": "_Test Pricing Rule Item Group",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True, item_code="Item with Group Blank UOM", uom="Box", conversion_factor=10
)
si.selling_price_list = "_Test Price List"
si.save()
# If UOM is blank consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Box that have conversion_factor of 10 so 101 * 10 = 1010
self.assertEqual(si.items[0].price_list_rate, 1010)
self.assertEqual(si.items[0].rate, 1010)
si.delete()
si = create_sales_invoice(do_not_save=True, item_code="Item with Group Blank UOM", uom="Nos")
si.selling_price_list = "_Test Price List"
si.save()
# UOM is blank so consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Nos that have conversion_factor of 1 so 101 * 1 = 101
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item with Group Blank UOM"}).delete()
item.delete()
group.delete()
def test_item_group_price_with_selling_uom_pricing_rule(self):
group = frappe.get_doc(
doctype="Item Group",
item_group_name="_Test Pricing Rule Item Group UOM",
parent_item_group="All Item Groups",
)
group.save()
properties = {
"item_code": "Item with Group UOM other than Stock",
"item_group": "_Test Pricing Rule Item Group UOM",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item with Group UOM other than Stock", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item with Group UOM other than Stock Rule",
"apply_on": "Item Group",
"item_groups": [
{
"item_group": "_Test Pricing Rule Item Group UOM",
"uom": "Box",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True,
item_code="Item with Group UOM other than Stock",
uom="Box",
conversion_factor=10,
)
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so apply pricing_rule only on Box UOM.
# Selling UOM is Box and as both UOM are same no need to multiply by conversion_factor.
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
si = create_sales_invoice(
do_not_save=True, item_code="Item with Group UOM other than Stock", uom="Nos"
)
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so pricing_rule won't apply as selling_uom is Nos.
# As Pricing Rule is not applied price of 100 will be fetched from Item Price List.
self.assertEqual(si.items[0].price_list_rate, 100)
self.assertEqual(si.items[0].rate, 100)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item with Group UOM other than Stock"}).delete()
item.delete()
group.delete()
def test_pricing_rule_for_different_currency(self):
make_item("Test Sanitizer Item")

View File

@@ -111,6 +111,12 @@ def _get_pricing_rules(apply_on, args, values):
)
if apply_on_field == "item_code":
if args.get("uom", None):
item_conditions += (
" and ({child_doc}.uom='{item_uom}' or IFNULL({child_doc}.uom, '')='')".format(
child_doc=child_doc, item_uom=args.get("uom")
)
)
if "variant_of" not in args:
args.variant_of = frappe.get_cached_value("Item", args.item_code, "variant_of")
@@ -121,7 +127,12 @@ def _get_pricing_rules(apply_on, args, values):
values["variant_of"] = args.variant_of
elif apply_on_field == "item_group":
item_conditions = _get_tree_conditions(args, "Item Group", child_doc, False)
if args.get("uom", None):
item_conditions += (
" and ({child_doc}.uom='{item_uom}' or IFNULL({child_doc}.uom, '')='')".format(
child_doc=child_doc, item_uom=args.get("uom")
)
)
conditions += get_other_conditions(conditions, values, args)
warehouse_conditions = _get_tree_conditions(args, "Warehouse", "`tabPricing Rule`")
if warehouse_conditions:

View File

@@ -34,4 +34,4 @@ class ProcessDeferredAccounting(Document):
filters={"against_voucher_type": self.doctype, "against_voucher": self.name},
)
make_gl_entries(gl_entries=gl_entries, cancel=1)
make_gl_entries(gl_map=gl_entries, cancel=1)

View File

@@ -57,3 +57,16 @@ class TestProcessDeferredAccounting(unittest.TestCase):
]
check_gl_entries(self, si.name, expected_gle, "2019-01-10")
def test_pda_submission_and_cancellation(self):
pda = frappe.get_doc(
dict(
doctype="Process Deferred Accounting",
posting_date="2019-01-01",
start_date="2019-01-01",
end_date="2019-01-31",
type="Income",
)
)
pda.submit()
pda.cancel()

View File

@@ -15,7 +15,7 @@
</div>
<h2 class="text-center">{{ _("STATEMENTS OF ACCOUNTS") }}</h2>
<div>
<h5 style="float: left;">{{ _("Customer: ") }} <b>{{filters.party[0] }}</b></h5>
<h5 style="float: left;">{{ _("Customer: ") }} <b>{{filters.party_name[0] }}</b></h5>
<h5 style="float: right;">
{{ _("Date: ") }}
<b>{{ frappe.format(filters.from_date, 'Date')}}
@@ -25,7 +25,7 @@
</div>
<br>
<table class="table table-bordered">
<table class="table table-bordered" style="font-size: 10px">
<thead>
<tr>
<th style="width: 12%">{{ _("Date") }}</th>
@@ -49,7 +49,6 @@
<br>
{% endif %}
{{ _("Against") }}: {{ row.against }}
<br>{{ _("Remarks") }}: {{ row.remarks }}
{% if row.bill_no %}
<br>{{ _("Supplier Invoice No") }}: {{ row.bill_no }}

View File

@@ -8,7 +8,8 @@ frappe.ui.form.on('Process Statement Of Accounts', {
},
refresh: function(frm){
if(!frm.doc.__islocal) {
frm.add_custom_button('Send Emails',function(){
frm.add_custom_button(__('Send Emails'), function(){
if (frm.is_dirty()) frappe.throw(__("Please save before proceeding."))
frappe.call({
method: "erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.send_emails",
args: {
@@ -24,8 +25,9 @@ frappe.ui.form.on('Process Statement Of Accounts', {
}
});
});
frm.add_custom_button('Download',function(){
var url = frappe.urllib.get_full_url(
frm.add_custom_button(__('Download'), function(){
if (frm.is_dirty()) frappe.throw(__("Please save before proceeding."))
let url = frappe.urllib.get_full_url(
'/api/method/erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.download_statements?'
+ 'document_name='+encodeURIComponent(frm.doc.name))
$.ajax({

View File

@@ -27,6 +27,7 @@
"customers",
"preferences",
"orientation",
"include_break",
"include_ageing",
"ageing_based_on",
"section_break_14",
@@ -284,10 +285,16 @@
"fieldtype": "Link",
"label": "Terms and Conditions",
"options": "Terms and Conditions"
},
{
"default": "1",
"fieldname": "include_break",
"fieldtype": "Check",
"label": "Page Break After Each SoA"
}
],
"links": [],
"modified": "2021-09-06 21:00:45.732505",
"modified": "2022-10-17 17:47:08.662475",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts",
@@ -320,5 +327,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -6,6 +6,7 @@ import copy
import frappe
from frappe import _
from frappe.desk.reportview import get_match_cond
from frappe.model.document import Document
from frappe.utils import add_days, add_months, format_date, getdate, today
from frappe.utils.jinja import validate_template
@@ -23,7 +24,7 @@ from erpnext.accounts.report.general_ledger.general_ledger import execute as get
class ProcessStatementOfAccounts(Document):
def validate(self):
if not self.subject:
self.subject = "Statement Of Accounts for {{ customer.name }}"
self.subject = "Statement Of Accounts for {{ customer.customer_name }}"
if not self.body:
self.body = "Hello {{ customer.name }},<br>PFA your Statement Of Accounts from {{ doc.from_date }} to {{ doc.to_date }}."
@@ -86,6 +87,7 @@ def get_report_pdf(doc, consolidated=True):
"account": [doc.account] if doc.account else None,
"party_type": "Customer",
"party": [entry.customer],
"party_name": [entry.customer_name] if entry.customer_name else None,
"presentation_currency": presentation_currency,
"group_by": doc.group_by,
"currency": doc.currency,
@@ -128,7 +130,8 @@ def get_report_pdf(doc, consolidated=True):
if not bool(statement_dict):
return False
elif consolidated:
result = "".join(list(statement_dict.values()))
delimiter = '<div style="page-break-before: always;"></div>' if doc.include_break else ""
result = delimiter.join(list(statement_dict.values()))
return get_pdf(result, {"orientation": doc.orientation})
else:
for customer, statement_html in statement_dict.items():
@@ -153,7 +156,7 @@ def get_customers_based_on_territory_or_customer_group(customer_collection, coll
]
return frappe.get_list(
"Customer",
fields=["name", "email_id"],
fields=["name", "customer_name", "email_id"],
filters=[[fields_dict[customer_collection], "IN", selected]],
)
@@ -176,7 +179,7 @@ def get_customers_based_on_sales_person(sales_person):
if sales_person_records.get("Customer"):
return frappe.get_list(
"Customer",
fields=["name", "email_id"],
fields=["name", "customer_name", "email_id"],
filters=[["name", "in", list(sales_person_records["Customer"])]],
)
else:
@@ -225,7 +228,7 @@ def fetch_customers(customer_collection, collection_name, primary_mandatory):
if customer_collection == "Sales Partner":
customers = frappe.get_list(
"Customer",
fields=["name", "email_id"],
fields=["name", "customer_name", "email_id"],
filters=[["default_sales_partner", "=", collection_name]],
)
else:
@@ -240,11 +243,14 @@ def fetch_customers(customer_collection, collection_name, primary_mandatory):
if int(primary_mandatory):
if primary_email == "":
continue
elif (billing_email == "") and (primary_email == ""):
continue
customer_list.append(
{"name": customer.name, "primary_email": primary_email, "billing_email": billing_email}
{
"name": customer.name,
"customer_name": customer.customer_name,
"primary_email": primary_email,
"billing_email": billing_email,
}
)
return customer_list
@@ -273,8 +279,12 @@ def get_customer_emails(customer_name, primary_mandatory, billing_and_primary=Tr
link.link_doctype='Customer'
and link.link_name=%s
and contact.is_billing_contact=1
{mcond}
ORDER BY
contact.creation desc""",
contact.creation desc
""".format(
mcond=get_match_cond("Contact")
),
customer_name,
)
@@ -313,6 +323,8 @@ def send_emails(document_name, from_scheduler=False):
attachments = [{"fname": customer + ".pdf", "fcontent": report_pdf}]
recipients, cc = get_recipients_and_cc(customer, doc)
if not recipients:
continue
context = get_context(customer, doc)
subject = frappe.render_template(doc.subject, context)
message = frappe.render_template(doc.body, context)

View File

@@ -1,12 +1,12 @@
{
"actions": [],
"allow_workflow": 1,
"creation": "2020-08-03 16:35:21.852178",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"customer",
"customer_name",
"billing_email",
"primary_email"
],
@@ -30,11 +30,18 @@
"fieldtype": "Read Only",
"in_list_view": 1,
"label": "Billing Email"
},
{
"fetch_from": "customer.customer_name",
"fieldname": "customer_name",
"fieldtype": "Data",
"label": "Customer Name",
"read_only": 1
}
],
"istable": 1,
"links": [],
"modified": "2020-08-03 22:55:38.875601",
"modified": "2023-03-13 00:12:34.508086",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts Customer",
@@ -43,5 +50,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -31,7 +31,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
this._super();
// Ignore linked advances
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry'];
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry', 'Purchase Invoice'];
if(!this.frm.doc.__islocal) {
// show credit_to in print format
@@ -81,8 +81,12 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
}
if(doc.docstatus == 1 && doc.outstanding_amount != 0
&& !(doc.is_return && doc.return_against)) {
this.frm.add_custom_button(__('Payment'), this.make_payment_entry, __('Create'));
&& !(doc.is_return && doc.return_against) && !doc.on_hold) {
this.frm.add_custom_button(
__('Payment'),
() => this.make_payment_entry(),
__('Create')
);
cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
}
@@ -539,7 +543,7 @@ frappe.ui.form.on("Purchase Invoice", {
},
add_custom_buttons: function(frm) {
if (frm.doc.per_received < 100) {
if (frm.doc.docstatus == 1 && frm.doc.per_received < 100) {
frm.add_custom_button(__('Purchase Receipt'), () => {
frm.events.make_purchase_receipt(frm);
}, __('Create'));
@@ -569,6 +573,10 @@ frappe.ui.form.on("Purchase Invoice", {
erpnext.queries.setup_queries(frm, "Warehouse", function() {
return erpnext.queries.warehouse(frm.doc);
});
if (frm.is_new()) {
frm.clear_table("tax_withheld_vouchers");
}
},
is_subcontracted: function(frm) {

View File

@@ -83,6 +83,8 @@
"section_break_51",
"taxes_and_charges",
"taxes",
"tax_withheld_vouchers_section",
"tax_withheld_vouchers",
"sec_tax_breakup",
"other_charges_calculation",
"totals",
@@ -511,7 +513,6 @@
"fieldname": "ignore_pricing_rule",
"fieldtype": "Check",
"label": "Ignore Pricing Rule",
"no_copy": 1,
"permlevel": 1,
"print_hide": 1
},
@@ -1417,13 +1418,26 @@
"label": "Advance Tax",
"options": "Advance Tax",
"read_only": 1
},
{
"fieldname": "tax_withheld_vouchers_section",
"fieldtype": "Section Break",
"label": "Tax Withheld Vouchers"
},
{
"fieldname": "tax_withheld_vouchers",
"fieldtype": "Table",
"label": "Tax Withheld Vouchers",
"no_copy": 1,
"options": "Tax Withheld Vouchers",
"read_only": 1
}
],
"icon": "fa fa-file-text",
"idx": 204,
"is_submittable": 1,
"links": [],
"modified": "2021-11-25 13:31:02.716727",
"modified": "2022-10-07 14:19:14.214157",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
@@ -1483,7 +1497,8 @@
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"timeline_field": "supplier",
"title_field": "title",
"track_changes": 1
}
}

View File

@@ -67,6 +67,9 @@ class PurchaseInvoice(BuyingController):
supplier_tds = frappe.db.get_value("Supplier", self.supplier, "tax_withholding_category")
self.set_onload("supplier_tds", supplier_tds)
if self.is_new():
self.set("tax_withheld_vouchers", [])
def before_save(self):
if not self.on_hold:
self.release_date = ""
@@ -158,6 +161,7 @@ class PurchaseInvoice(BuyingController):
if tds_category and not for_validate:
self.apply_tds = 1
self.tax_withholding_category = tds_category
self.set_onload("supplier_tds", tds_category)
super(PurchaseInvoice, self).set_missing_values(for_validate)
@@ -566,7 +570,6 @@ class PurchaseInvoice(BuyingController):
self.make_supplier_gl_entry(gl_entries)
self.make_item_gl_entries(gl_entries)
self.make_discount_gl_entries(gl_entries)
if self.check_asset_cwip_enabled():
self.get_asset_gl_entry(gl_entries)
@@ -595,7 +598,7 @@ class PurchaseInvoice(BuyingController):
def make_supplier_gl_entry(self, gl_entries):
# Checked both rounding_adjustment and rounded_total
# because rounded_total had value even before introcution of posting GLE based on rounded total
# because rounded_total had value even before introduction of posting GLE based on rounded total
grand_total = (
self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total
)
@@ -695,6 +698,10 @@ class PurchaseInvoice(BuyingController):
)
)
credit_amount = item.base_net_amount
if self.is_internal_supplier and item.valuation_rate:
credit_amount = flt(item.valuation_rate * item.stock_qty)
# Intentionally passed negative debit amount to avoid incorrect GL Entry validation
gl_entries.append(
self.get_gl_dict(
@@ -704,7 +711,7 @@ class PurchaseInvoice(BuyingController):
"cost_center": item.cost_center,
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": -1 * flt(item.base_net_amount, item.precision("base_net_amount")),
"debit": -1 * flt(credit_amount, item.precision("base_net_amount")),
},
warehouse_account[item.from_warehouse]["account_currency"],
item=item,
@@ -792,10 +799,7 @@ class PurchaseInvoice(BuyingController):
else item.deferred_expense_account
)
if not item.is_fixed_asset:
dummy, amount = self.get_amount_and_base_amount(item, self.enable_discount_accounting)
else:
amount = flt(item.base_net_amount + item.item_tax_amount, item.precision("base_net_amount"))
dummy, amount = self.get_amount_and_base_amount(item, None)
if provisional_accounting_for_non_stock_items:
if item.purchase_receipt:
@@ -1109,7 +1113,7 @@ class PurchaseInvoice(BuyingController):
valuation_tax = {}
for tax in self.get("taxes"):
amount, base_amount = self.get_tax_amounts(tax, self.enable_discount_accounting)
amount, base_amount = self.get_tax_amounts(tax, None)
if tax.category in ("Total", "Valuation and Total") and flt(base_amount):
account_currency = get_account_currency(tax.account_head)
@@ -1364,7 +1368,14 @@ class PurchaseInvoice(BuyingController):
frappe.db.set(self, "status", "Cancelled")
unlink_inter_company_doc(self.doctype, self.name, self.inter_company_invoice_reference)
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Repost Item Valuation")
self.ignore_linked_doctypes = (
"GL Entry",
"Stock Ledger Entry",
"Repost Item Valuation",
"Tax Withheld Vouchers",
)
self.update_advance_tax_references(cancel=1)
def update_project(self):
@@ -1457,7 +1468,7 @@ class PurchaseInvoice(BuyingController):
if not self.tax_withholding_category:
return
tax_withholding_details, advance_taxes = get_party_tax_withholding_details(
tax_withholding_details, advance_taxes, voucher_wise_amount = get_party_tax_withholding_details(
self, self.tax_withholding_category
)
@@ -1486,6 +1497,19 @@ class PurchaseInvoice(BuyingController):
for d in to_remove:
self.remove(d)
## Add pending vouchers on which tax was withheld
self.set("tax_withheld_vouchers", [])
for voucher_no, voucher_details in voucher_wise_amount.items():
self.append(
"tax_withheld_vouchers",
{
"voucher_name": voucher_no,
"voucher_type": voucher_details.get("voucher_type"),
"taxable_amount": voucher_details.get("amount"),
},
)
# calculate totals again after applying TDS
self.calculate_taxes_and_totals()
@@ -1688,4 +1712,6 @@ def make_purchase_receipt(source_name, target_doc=None):
target_doc,
)
doc.set_onload("ignore_price_list", True)
return doc

View File

@@ -304,59 +304,6 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
self.assertEqual(expected_values[gle.account][1], gle.debit)
self.assertEqual(expected_values[gle.account][2], gle.credit)
def test_purchase_invoice_with_discount_accounting_enabled(self):
enable_discount_accounting()
discount_account = create_account(
account_name="Discount Account",
parent_account="Indirect Expenses - _TC",
company="_Test Company",
)
pi = make_purchase_invoice(discount_account=discount_account, rate=45)
expected_gle = [
["_Test Account Cost for Goods Sold - _TC", 250.0, 0.0, nowdate()],
["Creditors - _TC", 0.0, 225.0, nowdate()],
["Discount Account - _TC", 0.0, 25.0, nowdate()],
]
check_gl_entries(self, pi.name, expected_gle, nowdate())
enable_discount_accounting(enable=0)
def test_additional_discount_for_purchase_invoice_with_discount_accounting_enabled(self):
enable_discount_accounting()
additional_discount_account = create_account(
account_name="Discount Account",
parent_account="Indirect Expenses - _TC",
company="_Test Company",
)
pi = make_purchase_invoice(do_not_save=1, parent_cost_center="Main - _TC")
pi.apply_discount_on = "Grand Total"
pi.additional_discount_account = additional_discount_account
pi.additional_discount_percentage = 10
pi.disable_rounded_total = 1
pi.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account VAT - _TC",
"cost_center": "Main - _TC",
"description": "Test",
"rate": 10,
},
)
pi.submit()
expected_gle = [
["_Test Account Cost for Goods Sold - _TC", 250.0, 0.0, nowdate()],
["_Test Account VAT - _TC", 25.0, 0.0, nowdate()],
["Creditors - _TC", 0.0, 247.5, nowdate()],
["Discount Account - _TC", 0.0, 27.5, nowdate()],
]
check_gl_entries(self, pi.name, expected_gle, nowdate())
def test_purchase_invoice_change_naming_series(self):
pi = frappe.copy_doc(test_records[1])
pi.insert()
@@ -1602,6 +1549,37 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
pi.save()
self.assertEqual(pi.items[0].conversion_factor, 1000)
def test_batch_expiry_for_purchase_invoice(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
item = self.make_item(
"_Test Batch Item For Return Check",
{
"is_purchase_item": 1,
"is_stock_item": 1,
"has_batch_no": 1,
"create_new_batch": 1,
"batch_number_series": "TBIRC.#####",
},
)
pi = make_purchase_invoice(
qty=1,
item_code=item.name,
update_stock=True,
)
pi.load_from_db()
batch_no = pi.items[0].batch_no
self.assertTrue(batch_no)
frappe.db.set_value("Batch", batch_no, "expiry_date", add_days(nowdate(), -1))
return_pi = make_return_doc(pi.doctype, pi.name)
return_pi.save().submit()
self.assertTrue(return_pi.docstatus == 1)
def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
gl_entries = frappe.db.sql(

View File

@@ -706,6 +706,7 @@
"label": "Valuation Rate",
"no_copy": 1,
"options": "Company:company:default_currency",
"precision": "6",
"print_hide": 1,
"read_only": 1
},
@@ -871,7 +872,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2021-11-15 17:04:07.191013",
"modified": "2022-10-12 03:37:29.032732",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -75,9 +75,12 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
if (doc.docstatus == 1 && doc.outstanding_amount!=0
&& !(cint(doc.is_return) && doc.return_against)) {
cur_frm.add_custom_button(__('Payment'),
this.make_payment_entry, __('Create'));
cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
this.frm.add_custom_button(
__('Payment'),
() => this.make_payment_entry(),
__('Create')
);
this.frm.page.set_inner_btn_group_as_primary(__('Create'));
}
if(doc.docstatus==1 && !doc.is_return) {
@@ -480,9 +483,13 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
is_cash_or_non_trade_discount() {
this.frm.set_df_property("additional_discount_account", "hidden", 1 - this.frm.doc.is_cash_or_non_trade_discount);
this.frm.set_df_property("additional_discount_account", "reqd", this.frm.doc.is_cash_or_non_trade_discount);
if (!this.frm.doc.is_cash_or_non_trade_discount) {
this.frm.set_value("additional_discount_account", "");
}
this.calculate_taxes_and_totals();
}
});
@@ -1074,7 +1081,7 @@ var select_loyalty_program = function(frm, loyalty_programs) {
]
});
dialog.set_primary_action(__("Set"), function() {
dialog.set_primary_action(__("Set Loyalty Program"), function() {
dialog.hide();
return frappe.call({
method: "frappe.client.set_value",

View File

@@ -414,7 +414,7 @@
},
{
"default": "0",
"depends_on": "eval: doc.is_return && doc.return_against",
"depends_on": "eval: doc.is_return",
"fieldname": "update_billed_amount_in_sales_order",
"fieldtype": "Check",
"hide_days": 1,
@@ -651,7 +651,6 @@
"hide_days": 1,
"hide_seconds": 1,
"label": "Ignore Pricing Rule",
"no_copy": 1,
"print_hide": 1
},
{
@@ -1791,6 +1790,8 @@
"width": "50%"
},
{
"fetch_from": "sales_partner.commission_rate",
"fetch_if_empty": 1,
"fieldname": "commission_rate",
"fieldtype": "Float",
"hide_days": 1,
@@ -2046,7 +2047,7 @@
"link_fieldname": "consolidated_invoice"
}
],
"modified": "2022-06-16 16:22:44.870575",
"modified": "2023-01-28 19:45:47.538163",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
@@ -2102,4 +2103,4 @@
"title_field": "title",
"track_changes": 1,
"track_seen": 1
}
}

View File

@@ -7,17 +7,7 @@ from frappe import _, msgprint, throw
from frappe.contacts.doctype.address.address import get_address_display
from frappe.model.mapper import get_mapped_doc
from frappe.model.utils import get_fetch_values
from frappe.utils import (
add_days,
add_months,
cint,
cstr,
flt,
formatdate,
get_link_to_form,
getdate,
nowdate,
)
from frappe.utils import add_days, cint, cstr, flt, formatdate, get_link_to_form, getdate, nowdate
from six import iteritems
import erpnext
@@ -33,10 +23,12 @@ from erpnext.accounts.general_ledger import get_round_off_account_and_cost_cente
from erpnext.accounts.party import get_due_date, get_party_account, get_party_details
from erpnext.accounts.utils import get_account_currency
from erpnext.assets.doctype.asset.depreciation import (
depreciate_asset,
get_disposal_account_and_cost_center,
get_gl_entries_on_asset_disposal,
get_gl_entries_on_asset_regain,
make_depreciation_entry,
reset_depreciation_schedule,
reverse_depreciation_entry_made_after_disposal,
)
from erpnext.controllers.accounts_controller import validate_account_head
from erpnext.controllers.selling_controller import SellingController
@@ -1065,22 +1057,6 @@ class SalesInvoice(SellingController):
)
)
if self.apply_discount_on == "Grand Total" and self.get("is_cash_or_discount_account"):
gl_entries.append(
self.get_gl_dict(
{
"account": self.additional_discount_account,
"against": self.debit_to,
"debit": self.base_discount_amount,
"debit_in_account_currency": self.discount_amount,
"cost_center": self.cost_center,
"project": self.project,
},
self.currency,
item=self,
)
)
def make_tax_gl_entries(self, gl_entries):
for tax in self.get("taxes"):
amount, base_amount = self.get_tax_amounts(tax, self.enable_discount_accounting)
@@ -1130,18 +1106,20 @@ class SalesInvoice(SellingController):
asset = self.get_asset(item)
if self.is_return:
if asset.calculate_depreciation:
self.reverse_depreciation_entry_made_after_sale(asset)
self.reset_depreciation_schedule(asset)
fixed_asset_gl_entries = get_gl_entries_on_asset_regain(
asset, item.base_net_amount, item.finance_book
)
asset.db_set("disposal_date", None)
if asset.calculate_depreciation:
posting_date = frappe.db.get_value("Sales Invoice", self.return_against, "posting_date")
reverse_depreciation_entry_made_after_disposal(asset, posting_date)
reset_depreciation_schedule(asset, self.posting_date)
else:
if asset.calculate_depreciation:
self.depreciate_asset(asset)
depreciate_asset(asset, self.posting_date)
asset.reload()
fixed_asset_gl_entries = get_gl_entries_on_asset_disposal(
asset, item.base_net_amount, item.finance_book
@@ -1209,95 +1187,6 @@ class SalesInvoice(SellingController):
_("Select finance book for the item {0} at row {1}").format(item.item_code, item.idx)
)
def depreciate_asset(self, asset):
asset.flags.ignore_validate_update_after_submit = True
asset.prepare_depreciation_data(date_of_sale=self.posting_date)
asset.save()
make_depreciation_entry(asset.name, self.posting_date)
asset.load_from_db()
def reset_depreciation_schedule(self, asset):
asset.flags.ignore_validate_update_after_submit = True
# recreate original depreciation schedule of the asset
asset.prepare_depreciation_data(date_of_return=self.posting_date)
self.modify_depreciation_schedule_for_asset_repairs(asset)
asset.save()
asset.load_from_db()
def modify_depreciation_schedule_for_asset_repairs(self, asset):
asset_repairs = frappe.get_all(
"Asset Repair", filters={"asset": asset.name}, fields=["name", "increase_in_asset_life"]
)
for repair in asset_repairs:
if repair.increase_in_asset_life:
asset_repair = frappe.get_doc("Asset Repair", repair.name)
asset_repair.modify_depreciation_schedule()
asset.prepare_depreciation_data()
def reverse_depreciation_entry_made_after_sale(self, asset):
from erpnext.accounts.doctype.journal_entry.journal_entry import make_reverse_journal_entry
posting_date_of_original_invoice = self.get_posting_date_of_sales_invoice()
row = -1
finance_book = asset.get("schedules")[0].get("finance_book")
for schedule in asset.get("schedules"):
if schedule.finance_book != finance_book:
row = 0
finance_book = schedule.finance_book
else:
row += 1
if schedule.schedule_date == posting_date_of_original_invoice:
if not self.sale_was_made_on_original_schedule_date(
asset, schedule, row, posting_date_of_original_invoice
) or self.sale_happens_in_the_future(posting_date_of_original_invoice):
reverse_journal_entry = make_reverse_journal_entry(schedule.journal_entry)
reverse_journal_entry.posting_date = nowdate()
frappe.flags.is_reverse_depr_entry = True
reverse_journal_entry.submit()
frappe.flags.is_reverse_depr_entry = False
asset.flags.ignore_validate_update_after_submit = True
schedule.journal_entry = None
depreciation_amount = self.get_depreciation_amount_in_je(reverse_journal_entry)
asset.finance_books[0].value_after_depreciation += depreciation_amount
asset.save()
def get_posting_date_of_sales_invoice(self):
return frappe.db.get_value("Sales Invoice", self.return_against, "posting_date")
# if the invoice had been posted on the date the depreciation was initially supposed to happen, the depreciation shouldn't be undone
def sale_was_made_on_original_schedule_date(
self, asset, schedule, row, posting_date_of_original_invoice
):
for finance_book in asset.get("finance_books"):
if schedule.finance_book == finance_book.finance_book:
orginal_schedule_date = add_months(
finance_book.depreciation_start_date, row * cint(finance_book.frequency_of_depreciation)
)
if orginal_schedule_date == posting_date_of_original_invoice:
return True
return False
def sale_happens_in_the_future(self, posting_date_of_original_invoice):
if posting_date_of_original_invoice > getdate():
return True
return False
def get_depreciation_amount_in_je(self, journal_entry):
if journal_entry.accounts[0].debit_in_account_currency:
return journal_entry.accounts[0].debit_in_account_currency
else:
return journal_entry.accounts[0].credit_in_account_currency
@property
def enable_discount_accounting(self):
if not hasattr(self, "_enable_discount_accounting"):
@@ -2173,13 +2062,13 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
target_detail_field = "sales_invoice_item" if doctype == "Sales Invoice" else "sales_order_item"
source_document_warehouse_field = "target_warehouse"
target_document_warehouse_field = "from_warehouse"
received_items = get_received_items(source_name, target_doctype, target_detail_field)
else:
source_doc = frappe.get_doc(doctype, source_name)
target_doctype = "Sales Invoice" if doctype == "Purchase Invoice" else "Sales Order"
source_document_warehouse_field = "from_warehouse"
target_document_warehouse_field = "target_warehouse"
received_items = get_received_items(source_name, target_doctype, target_detail_field)
received_items = {}
validate_inter_company_transaction(source_doc, doctype)
details = get_inter_company_details(source_doc, doctype)
@@ -2203,6 +2092,9 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
update_address(
target_doc, "shipping_address", "shipping_address_display", source_doc.customer_address
)
update_address(
target_doc, "billing_address", "billing_address_display", source_doc.customer_address
)
if currency:
target_doc.currency = currency

View File

@@ -7,7 +7,7 @@ import unittest
import frappe
from frappe.model.dynamic_links import get_dynamic_link_map
from frappe.model.naming import make_autoname
from frappe.utils import add_days, flt, getdate, nowdate
from frappe.utils import add_days, flt, getdate, nowdate, today
from six import iteritems
from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account
@@ -31,10 +31,20 @@ from erpnext.stock.doctype.stock_entry.test_stock_entry import (
get_qty_after_transaction,
make_stock_entry,
)
from erpnext.stock.utils import get_incoming_rate
from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import (
create_stock_reconciliation,
)
from erpnext.stock.utils import get_incoming_rate, get_stock_balance
class TestSalesInvoice(unittest.TestCase):
def setUp(self):
from erpnext.stock.doctype.stock_ledger_entry.test_stock_ledger_entry import create_items
create_items(["_Test Internal Transfer Item"], uoms=[{"uom": "Box", "conversion_factor": 10}])
create_internal_parties()
setup_accounts()
def make(self):
w = frappe.copy_doc(test_records[0])
w.is_pos = 0
@@ -906,7 +916,8 @@ class TestSalesInvoice(unittest.TestCase):
pos_return.insert()
pos_return.submit()
self.assertEqual(pos_return.get("payments")[0].amount, -1000)
self.assertEqual(pos_return.get("payments")[0].amount, -500)
self.assertEqual(pos_return.get("payments")[1].amount, -500)
def test_pos_change_amount(self):
make_pos_profile(
@@ -1106,6 +1117,46 @@ class TestSalesInvoice(unittest.TestCase):
frappe.db.sql("delete from `tabPOS Profile`")
def test_bin_details_of_packed_item(self):
from erpnext.selling.doctype.product_bundle.test_product_bundle import make_product_bundle
from erpnext.stock.doctype.item.test_item import make_item
# test Update Items with product bundle
if not frappe.db.exists("Item", "_Test Product Bundle Item New"):
bundle_item = make_item("_Test Product Bundle Item New", {"is_stock_item": 0})
bundle_item.append(
"item_defaults", {"company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC"}
)
bundle_item.save(ignore_permissions=True)
make_item("_Packed Item New 1", {"is_stock_item": 1})
make_product_bundle("_Test Product Bundle Item New", ["_Packed Item New 1"], 2)
si = create_sales_invoice(
item_code="_Test Product Bundle Item New",
update_stock=1,
warehouse="_Test Warehouse - _TC",
transaction_date=add_days(nowdate(), -1),
do_not_submit=1,
)
make_stock_entry(item="_Packed Item New 1", target="_Test Warehouse - _TC", qty=120, rate=100)
bin_details = frappe.db.get_value(
"Bin",
{"item_code": "_Packed Item New 1", "warehouse": "_Test Warehouse - _TC"},
["actual_qty", "projected_qty", "ordered_qty"],
as_dict=1,
)
si.transaction_date = nowdate()
si.save()
packed_item = si.packed_items[0]
self.assertEqual(flt(bin_details.actual_qty), flt(packed_item.actual_qty))
self.assertEqual(flt(bin_details.projected_qty), flt(packed_item.projected_qty))
self.assertEqual(flt(bin_details.ordered_qty), flt(packed_item.ordered_qty))
def test_pos_si_without_payment(self):
make_pos_profile()
@@ -1687,7 +1738,7 @@ class TestSalesInvoice(unittest.TestCase):
si.save()
self.assertEqual(si.get("items")[0].rate, flt((price_list_rate * 25) / 100 + price_list_rate))
def test_outstanding_amount_after_advance_jv_cancelation(self):
def test_outstanding_amount_after_advance_jv_cancellation(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import (
test_records as jv_test_records,
)
@@ -1731,7 +1782,7 @@ class TestSalesInvoice(unittest.TestCase):
flt(si.rounded_total + si.total_advance, si.precision("outstanding_amount")),
)
def test_outstanding_amount_after_advance_payment_entry_cancelation(self):
def test_outstanding_amount_after_advance_payment_entry_cancellation(self):
pe = frappe.get_doc(
{
"doctype": "Payment Entry",
@@ -2369,29 +2420,6 @@ class TestSalesInvoice(unittest.TestCase):
acc_settings.save()
def test_inter_company_transaction(self):
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
create_internal_customer(
customer_name="_Test Internal Customer",
represents_company="_Test Company 1",
allowed_to_interact_with="Wind Power LLC",
)
if not frappe.db.exists("Supplier", "_Test Internal Supplier"):
supplier = frappe.get_doc(
{
"supplier_group": "_Test Supplier Group",
"supplier_name": "_Test Internal Supplier",
"doctype": "Supplier",
"is_internal_supplier": 1,
"represents_company": "Wind Power LLC",
}
)
supplier.append("companies", {"company": "_Test Company 1"})
supplier.insert()
si = create_sales_invoice(
company="Wind Power LLC",
customer="_Test Internal Customer",
@@ -2451,34 +2479,9 @@ class TestSalesInvoice(unittest.TestCase):
se.cancel()
def test_internal_transfer_gl_entry(self):
## Create internal transfer account
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
account = create_account(
account_name="Unrealized Profit",
parent_account="Current Liabilities - TCP1",
company="_Test Company with perpetual inventory",
)
frappe.db.set_value(
"Company", "_Test Company with perpetual inventory", "unrealized_profit_loss_account", account
)
customer = create_internal_customer(
"_Test Internal Customer 2",
"_Test Company with perpetual inventory",
"_Test Company with perpetual inventory",
)
create_internal_supplier(
"_Test Internal Supplier 2",
"_Test Company with perpetual inventory",
"_Test Company with perpetual inventory",
)
si = create_sales_invoice(
company="_Test Company with perpetual inventory",
customer=customer,
customer="_Test Internal Customer 2",
debit_to="Debtors - TCP1",
warehouse="Stores - TCP1",
income_account="Sales - TCP1",
@@ -2492,7 +2495,7 @@ class TestSalesInvoice(unittest.TestCase):
si.update_stock = 1
si.items[0].target_warehouse = "Work In Progress - TCP1"
# Add stock to stores for succesful stock transfer
# Add stock to stores for successful stock transfer
make_stock_entry(
target="Stores - TCP1", company="_Test Company with perpetual inventory", qty=1, basic_rate=100
)
@@ -2712,6 +2715,19 @@ class TestSalesInvoice(unittest.TestCase):
self.assertEqual(einvoice["ItemList"][2]["UnitPrice"], 20)
self.assertEqual(einvoice["ItemList"][3]["UnitPrice"], 10)
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = ""
si.items[1].price_list_rate = 15
si.items[1].discount_amount = -5
si.items[1].rate = 20
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 20)
def test_einvoice_without_discounts(self):
from erpnext.regional.india.e_invoice.utils import make_einvoice, validate_totals
@@ -2804,6 +2820,90 @@ class TestSalesInvoice(unittest.TestCase):
self.assertEqual(einvoice["ItemList"][2]["UnitPrice"], 18)
self.assertEqual(einvoice["ItemList"][3]["UnitPrice"], 5)
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = ""
si.items[1].price_list_rate = 15
si.items[1].discount_amount = -5
si.items[1].rate = 20
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 20)
def test_internal_transfer_gl_precision_issues(self):
# Make a stock queue of an item with two valuations
# Remove all existing stock for this
if get_stock_balance("_Test Internal Transfer Item", "Stores - TCP1", "2022-04-10"):
create_stock_reconciliation(
item_code="_Test Internal Transfer Item",
warehouse="Stores - TCP1",
qty=0,
rate=0,
company="_Test Company with perpetual inventory",
expense_account="Stock Adjustment - TCP1"
if frappe.get_all("Stock Ledger Entry")
else "Temporary Opening - TCP1",
posting_date="2020-04-10",
posting_time="14:00",
)
make_stock_entry(
item_code="_Test Internal Transfer Item",
target="Stores - TCP1",
qty=9000000,
basic_rate=52.0,
posting_date="2020-04-10",
posting_time="14:00",
)
make_stock_entry(
item_code="_Test Internal Transfer Item",
target="Stores - TCP1",
qty=60000000,
basic_rate=52.349777,
posting_date="2020-04-10",
posting_time="14:00",
)
# Make an internal transfer Sales Invoice Stock in non stock uom to check
# for rounding errors while converting to stock uom
si = create_sales_invoice(
company="_Test Company with perpetual inventory",
customer="_Test Internal Customer 2",
item_code="_Test Internal Transfer Item",
qty=5000000,
uom="Box",
debit_to="Debtors - TCP1",
warehouse="Stores - TCP1",
income_account="Sales - TCP1",
expense_account="Cost of Goods Sold - TCP1",
cost_center="Main - TCP1",
currency="INR",
do_not_save=1,
)
# Check GL Entries with precision
si.update_stock = 1
si.items[0].target_warehouse = "Work In Progress - TCP1"
si.items[0].conversion_factor = 10
si.save()
si.submit()
# Check if adjustment entry is created
self.assertTrue(
frappe.db.exists(
"GL Entry",
{
"voucher_type": "Sales Invoice",
"voucher_no": si.name,
"remarks": "Rounding gain/loss Entry for Stock Transfer",
},
)
)
def test_item_tax_net_range(self):
item = create_item("T Shirt")
@@ -3252,7 +3352,7 @@ class TestSalesInvoice(unittest.TestCase):
[deferred_account, 2022.47, 0.0, "2019-03-15"],
]
gl_entries = gl_entries = frappe.db.sql(
gl_entries = frappe.db.sql(
"""select account, debit, credit, posting_date
from `tabGL Entry`
where voucher_type='Journal Entry' and voucher_detail_no=%s and posting_date <= %s
@@ -3370,6 +3470,109 @@ class TestSalesInvoice(unittest.TestCase):
"Accounts Settings", "Accounts Settings", "unlink_payment_on_cancel_of_invoice", unlink_enabled
)
def test_gain_loss_on_advance_cancellation(self):
unlink_enabled = frappe.db.get_single_value(
"Accounts Settings", "unlink_payment_on_cancellation_of_invoice"
)
frappe.db.set_single_value("Accounts Settings", "unlink_payment_on_cancellation_of_invoice", 1)
pe = frappe.get_doc(
{
"doctype": "Payment Entry",
"payment_type": "Receive",
"party_type": "Customer",
"party": "_Test Customer USD",
"company": "_Test Company",
"paid_from_account_currency": "USD",
"paid_to_account_currency": "INR",
"source_exchange_rate": 70,
"target_exchange_rate": 1,
"reference_no": "1",
"reference_date": nowdate(),
"received_amount": 70,
"paid_amount": 1,
"paid_from": "_Test Receivable USD - _TC",
"paid_to": "_Test Cash - _TC",
}
)
pe.insert()
pe.submit()
si = create_sales_invoice(
customer="_Test Customer USD",
debit_to="_Test Receivable USD - _TC",
currency="USD",
conversion_rate=75,
do_not_save=1,
rate=1,
)
si = si.save()
si.append(
"advances",
{
"reference_type": "Payment Entry",
"reference_name": pe.name,
"advance_amount": 1,
"allocated_amount": 1,
"ref_exchange_rate": 70,
},
)
si.save()
si.submit()
expected_gle = [
["_Test Receivable USD - _TC", 75.0, 5.0],
["Exchange Gain/Loss - _TC", 5.0, 0.0],
["Sales - _TC", 0.0, 75.0],
]
check_gl_entries(self, si.name, expected_gle, nowdate())
# cancel advance payment
pe.reload()
pe.cancel()
expected_gle_after = [
["_Test Receivable USD - _TC", 75.0, 0.0],
["Sales - _TC", 0.0, 75.0],
]
check_gl_entries(self, si.name, expected_gle_after, nowdate())
frappe.db.set_single_value(
"Accounts Settings", "unlink_payment_on_cancellation_of_invoice", unlink_enabled
)
def test_batch_expiry_for_sales_invoice_return(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
from erpnext.stock.doctype.item.test_item import make_item
item = make_item(
"_Test Batch Item For Return Check",
{
"is_purchase_item": 1,
"is_stock_item": 1,
"has_batch_no": 1,
"create_new_batch": 1,
"batch_number_series": "TBIRC.#####",
},
)
pr = make_purchase_receipt(qty=1, item_code=item.name)
batch_no = pr.items[0].batch_no
si = create_sales_invoice(qty=1, item_code=item.name, update_stock=1, batch_no=batch_no)
si.load_from_db()
batch_no = si.items[0].batch_no
self.assertTrue(batch_no)
frappe.db.set_value("Batch", batch_no, "expiry_date", add_days(today(), -1))
return_si = make_return_doc(si.doctype, si.name)
return_si.save().submit()
self.assertTrue(return_si.docstatus == 1)
def get_sales_invoice_for_e_invoice():
si = make_sales_invoice_for_ewaybill()
@@ -3626,6 +3829,7 @@ def create_sales_invoice(**args):
"description": args.description or "_Test Item",
"gst_hsn_code": "999800",
"warehouse": args.warehouse or "_Test Warehouse - _TC",
"target_warehouse": args.target_warehouse,
"qty": args.qty or 1,
"uom": args.uom or "Nos",
"stock_uom": args.uom or "Nos",
@@ -3638,8 +3842,9 @@ def create_sales_invoice(**args):
"discount_amount": args.discount_amount or 0,
"cost_center": args.cost_center or "_Test Cost Center - _TC",
"serial_no": args.serial_no,
"conversion_factor": 1,
"conversion_factor": args.get("conversion_factor", 1),
"incoming_rate": args.incoming_rate or 0,
"batch_no": args.batch_no or None,
},
)
@@ -3751,6 +3956,34 @@ def get_taxes_and_charges():
]
def create_internal_parties():
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
create_internal_customer(
customer_name="_Test Internal Customer",
represents_company="_Test Company 1",
allowed_to_interact_with="Wind Power LLC",
)
create_internal_customer(
customer_name="_Test Internal Customer 2",
represents_company="_Test Company with perpetual inventory",
allowed_to_interact_with="_Test Company with perpetual inventory",
)
create_internal_supplier(
supplier_name="_Test Internal Supplier",
represents_company="Wind Power LLC",
allowed_to_interact_with="_Test Company 1",
)
create_internal_supplier(
supplier_name="_Test Internal Supplier 2",
represents_company="_Test Company with perpetual inventory",
allowed_to_interact_with="_Test Company with perpetual inventory",
)
def create_internal_supplier(supplier_name, represents_company, allowed_to_interact_with):
if not frappe.db.exists("Supplier", supplier_name):
supplier = frappe.get_doc(
@@ -3773,6 +4006,19 @@ def create_internal_supplier(supplier_name, represents_company, allowed_to_inter
return supplier_name
def setup_accounts():
## Create internal transfer account
account = create_account(
account_name="Unrealized Profit",
parent_account="Current Liabilities - TCP1",
company="_Test Company with perpetual inventory",
)
frappe.db.set_value(
"Company", "_Test Company with perpetual inventory", "unrealized_profit_loss_account", account
)
def add_taxes(doc):
doc.append(
"taxes",

View File

@@ -279,7 +279,6 @@
"label": "Discount (%) on Price List Rate with Margin",
"oldfieldname": "adj_rate",
"oldfieldtype": "Float",
"precision": "2",
"print_hide": 1
},
{
@@ -813,6 +812,8 @@
"fieldtype": "Currency",
"label": "Incoming Rate (Costing)",
"no_copy": 1,
"options": "Company:company:default_currency",
"precision": "6",
"print_hide": 1
},
{
@@ -842,7 +843,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2022-02-24 14:41:36.392560",
"modified": "2022-12-28 16:17:33.484531",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -0,0 +1,49 @@
{
"actions": [],
"autoname": "autoincrement",
"creation": "2022-09-13 16:18:59.404842",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"voucher_type",
"voucher_name",
"taxable_amount"
],
"fields": [
{
"fieldname": "voucher_type",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Voucher Type",
"options": "DocType"
},
{
"fieldname": "voucher_name",
"fieldtype": "Dynamic Link",
"in_list_view": 1,
"label": "Voucher Name",
"options": "voucher_type"
},
{
"fieldname": "taxable_amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Taxable Amount",
"options": "Company:company:default_currency"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2022-12-28 23:40:41.479208",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Withheld Vouchers",
"naming_rule": "Random",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class TaxWithheldVouchers(Document):
pass

View File

@@ -100,7 +100,7 @@ def get_party_tax_withholding_details(inv, tax_withholding_category=None):
).format(tax_withholding_category, inv.company, party)
)
tax_amount, tax_deducted, tax_deducted_on_advances = get_tax_amount(
tax_amount, tax_deducted, tax_deducted_on_advances, voucher_wise_amount = get_tax_amount(
party_type, parties, inv, tax_details, posting_date, pan_no
)
@@ -110,7 +110,7 @@ def get_party_tax_withholding_details(inv, tax_withholding_category=None):
tax_row = get_tax_row_for_tcs(inv, tax_details, tax_amount, tax_deducted)
if inv.doctype == "Purchase Invoice":
return tax_row, tax_deducted_on_advances
return tax_row, tax_deducted_on_advances, voucher_wise_amount
else:
return tax_row
@@ -208,7 +208,9 @@ def get_lower_deduction_certificate(tax_details, pan_no):
def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=None):
vouchers = get_invoice_vouchers(parties, tax_details, inv.company, party_type=party_type)
vouchers, voucher_wise_amount = get_invoice_vouchers(
parties, tax_details, inv.company, party_type=party_type
)
advance_vouchers = get_advance_vouchers(
parties,
company=inv.company,
@@ -227,6 +229,7 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
tax_deducted = get_deducted_tax(taxable_vouchers, tax_details)
tax_amount = 0
if party_type == "Supplier":
ldc = get_lower_deduction_certificate(tax_details, pan_no)
if tax_deducted:
@@ -237,6 +240,9 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
)
else:
tax_amount = net_total * tax_details.rate / 100 if net_total > 0 else 0
# once tds is deducted, not need to add vouchers in the invoice
voucher_wise_amount = {}
else:
tax_amount = get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers)
@@ -250,14 +256,15 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
tax_amount = get_tcs_amount(parties, inv, tax_details, vouchers, advance_vouchers)
if cint(tax_details.round_off_tax_amount):
tax_amount = round(tax_amount)
tax_amount = normal_round(tax_amount)
return tax_amount, tax_deducted, tax_deducted_on_advances
return tax_amount, tax_deducted, tax_deducted_on_advances, voucher_wise_amount
def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
dr_or_cr = "credit" if party_type == "Supplier" else "debit"
doctype = "Purchase Invoice" if party_type == "Supplier" else "Sales Invoice"
voucher_wise_amount = {}
vouchers = []
filters = {
"company": company,
@@ -272,29 +279,40 @@ def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
{"apply_tds": 1, "tax_withholding_category": tax_details.get("tax_withholding_category")}
)
invoices = frappe.get_all(doctype, filters=filters, pluck="name") or [""]
invoices_details = frappe.get_all(doctype, filters=filters, fields=["name", "base_net_total"])
journal_entries = frappe.db.sql(
for d in invoices_details:
vouchers.append(d.name)
voucher_wise_amount.update({d.name: {"amount": d.base_net_total, "voucher_type": doctype}})
journal_entries_details = frappe.db.sql(
"""
SELECT j.name
SELECT j.name, ja.credit - ja.debit AS amount
FROM `tabJournal Entry` j, `tabJournal Entry Account` ja
WHERE
j.docstatus = 1
j.name = ja.parent
AND j.docstatus = 1
AND j.is_opening = 'No'
AND j.posting_date between %s and %s
AND ja.{dr_or_cr} > 0
AND ja.party in %s
""".format(
dr_or_cr=dr_or_cr
AND j.apply_tds = 1
AND j.tax_withholding_category = %s
""",
(
tax_details.from_date,
tax_details.to_date,
tuple(parties),
tax_details.get("tax_withholding_category"),
),
(tax_details.from_date, tax_details.to_date, tuple(parties)),
as_list=1,
as_dict=1,
)
if journal_entries:
journal_entries = journal_entries[0]
if journal_entries_details:
for d in journal_entries_details:
vouchers.append(d.name)
voucher_wise_amount.update({d.name: {"amount": d.amount, "voucher_type": "Journal Entry"}})
return invoices + journal_entries
return vouchers, voucher_wise_amount
def get_advance_vouchers(
@@ -309,9 +327,11 @@ def get_advance_vouchers(
"is_cancelled": 0,
"party_type": party_type,
"party": ["in", parties],
"against_voucher": ["is", "not set"],
}
if party_type == "Customer":
filters.update({"against_voucher": ["is", "not set"]})
if company:
filters["company"] = company
if from_date and to_date:
@@ -321,23 +341,25 @@ def get_advance_vouchers(
def get_taxes_deducted_on_advances_allocated(inv, tax_details):
advances = [d.reference_name for d in inv.get("advances")]
tax_info = []
if advances:
pe = frappe.qb.DocType("Payment Entry").as_("pe")
at = frappe.qb.DocType("Advance Taxes and Charges").as_("at")
if inv.get("advances"):
advances = [d.reference_name for d in inv.get("advances")]
tax_info = (
frappe.qb.from_(at)
.inner_join(pe)
.on(pe.name == at.parent)
.select(at.parent, at.name, at.tax_amount, at.allocated_amount)
.where(pe.tax_withholding_category == tax_details.get("tax_withholding_category"))
.where(at.parent.isin(advances))
.where(at.account_head == tax_details.account_head)
.run(as_dict=True)
)
if advances:
pe = frappe.qb.DocType("Payment Entry").as_("pe")
at = frappe.qb.DocType("Advance Taxes and Charges").as_("at")
tax_info = (
frappe.qb.from_(at)
.inner_join(pe)
.on(pe.name == at.parent)
.select(at.parent, at.name, at.tax_amount, at.allocated_amount)
.where(pe.tax_withholding_category == tax_details.get("tax_withholding_category"))
.where(at.parent.isin(advances))
.where(at.account_head == tax_details.account_head)
.run(as_dict=True)
)
return tax_info
@@ -359,6 +381,9 @@ def get_deducted_tax(taxable_vouchers, tax_details):
def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
tds_amount = 0
supp_credit_amt = 0.0
supp_jv_credit_amt = 0.0
invoice_filters = {"name": ("in", vouchers), "docstatus": 1, "apply_tds": 1}
field = "sum(net_total)"
@@ -367,30 +392,25 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
invoice_filters.pop("apply_tds", None)
field = "sum(grand_total)"
supp_credit_amt = frappe.db.get_value("Purchase Invoice", invoice_filters, field) or 0.0
if vouchers:
supp_credit_amt = frappe.db.get_value("Purchase Invoice", invoice_filters, field) or 0.0
supp_jv_credit_amt = (
frappe.db.get_value(
"Journal Entry Account",
{
"parent": ("in", vouchers),
"docstatus": 1,
"party": ("in", parties),
"reference_type": ("!=", "Purchase Invoice"),
},
"sum(credit_in_account_currency)",
)
or 0.0
)
supp_jv_credit_amt = (
frappe.db.get_value(
"Journal Entry Account",
{
"parent": ("in", vouchers),
"docstatus": 1,
"party": ("in", parties),
"reference_type": ("!=", "Purchase Invoice"),
},
"sum(credit_in_account_currency)",
)
) or 0.0
supp_credit_amt += supp_jv_credit_amt
supp_credit_amt += inv.net_total
debit_note_amount = get_debit_note_amount(
parties, tax_details.from_date, tax_details.to_date, inv.company
)
supp_credit_amt -= debit_note_amount
threshold = tax_details.get("threshold", 0)
cumulative_threshold = tax_details.get("cumulative_threshold", 0)
@@ -402,7 +422,10 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
):
# Get net total again as TDS is calculated on net total
# Grand is used to just check for threshold breach
net_total = frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(net_total)") or 0.0
net_total = 0
if vouchers:
net_total = frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(net_total)")
net_total += inv.net_total
supp_credit_amt = net_total - cumulative_threshold
@@ -423,36 +446,40 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
tcs_amount = 0
invoiced_amt = 0
advance_amt = 0
# sum of debit entries made from sales invoices
invoiced_amt = (
frappe.db.get_value(
"GL Entry",
{
"is_cancelled": 0,
"party": ["in", parties],
"company": inv.company,
"voucher_no": ["in", vouchers],
},
"sum(debit)",
if vouchers:
invoiced_amt = (
frappe.db.get_value(
"GL Entry",
{
"is_cancelled": 0,
"party": ["in", parties],
"company": inv.company,
"voucher_no": ["in", vouchers],
},
"sum(debit)",
)
or 0.0
)
or 0.0
)
# sum of credit entries made from PE / JV with unset 'against voucher'
advance_amt = (
frappe.db.get_value(
"GL Entry",
{
"is_cancelled": 0,
"party": ["in", parties],
"company": inv.company,
"voucher_no": ["in", adv_vouchers],
},
"sum(credit)",
if advance_amt:
advance_amt = (
frappe.db.get_value(
"GL Entry",
{
"is_cancelled": 0,
"party": ["in", parties],
"company": inv.company,
"voucher_no": ["in", adv_vouchers],
},
"sum(credit)",
)
or 0.0
)
or 0.0
)
# sum of credit entries made from sales invoice
credit_note_amt = sum(
@@ -507,22 +534,6 @@ def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net
return tds_amount
def get_debit_note_amount(suppliers, from_date, to_date, company=None):
filters = {
"supplier": ["in", suppliers],
"is_return": 1,
"docstatus": 1,
"posting_date": ["between", (from_date, to_date)],
}
fields = ["abs(sum(net_total)) as net_total"]
if company:
filters["company"] = company
return frappe.get_all("Purchase Invoice", filters, fields)[0].get("net_total") or 0.0
def get_ltds_amount(current_amount, deducted_amount, certificate_limit, rate, tax_details):
if current_amount < (certificate_limit - deducted_amount):
return current_amount * rate / 100
@@ -544,3 +555,20 @@ def is_valid_certificate(
valid = True
return valid
def normal_round(number):
"""
Rounds a number to the nearest integer.
:param number: The number to round.
"""
decimal_part = number - int(number)
if decimal_part >= 0.5:
decimal_part = 1
else:
decimal_part = 0
number = int(number) + decimal_part
return number

View File

@@ -52,7 +52,7 @@ class TestTaxWithholdingCategory(unittest.TestCase):
invoices.append(pi)
# delete invoices to avoid clashing
for d in invoices:
for d in reversed(invoices):
d.cancel()
def test_single_threshold_tds(self):
@@ -88,7 +88,7 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(pi.taxes_and_charges_deducted, 1000)
# delete invoices to avoid clashing
for d in invoices:
for d in reversed(invoices):
d.cancel()
def test_tax_withholding_category_checks(self):
@@ -114,7 +114,7 @@ class TestTaxWithholdingCategory(unittest.TestCase):
# TDS should be applied only on 1000
self.assertEqual(pi1.taxes[0].tax_amount, 1000)
for d in invoices:
for d in reversed(invoices):
d.cancel()
def test_cumulative_threshold_tcs(self):
@@ -148,8 +148,8 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(tcs_charged, 500)
invoices.append(si)
# delete invoices to avoid clashing
for d in invoices:
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
def test_tds_calculation_on_net_total(self):
@@ -182,8 +182,8 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(pi1.taxes[0].tax_amount, 4000)
# delete invoices to avoid clashing
for d in invoices:
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
def test_multi_category_single_supplier(self):
@@ -207,8 +207,50 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(pi1.taxes[0].tax_amount, 250)
# delete invoices to avoid clashing
for d in invoices:
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
def test_tax_withholding_category_voucher_display(self):
frappe.db.set_value(
"Supplier", "Test TDS Supplier6", "tax_withholding_category", "Test Multi Invoice Category"
)
invoices = []
pi = create_purchase_invoice(supplier="Test TDS Supplier6", rate=4000, do_not_save=True)
pi.apply_tds = 1
pi.tax_withholding_category = "Test Multi Invoice Category"
pi.save()
pi.submit()
invoices.append(pi)
pi1 = create_purchase_invoice(supplier="Test TDS Supplier6", rate=2000, do_not_save=True)
pi1.apply_tds = 1
pi1.is_return = 1
pi1.items[0].qty = -1
pi1.tax_withholding_category = "Test Multi Invoice Category"
pi1.save()
pi1.submit()
invoices.append(pi1)
pi2 = create_purchase_invoice(supplier="Test TDS Supplier6", rate=9000, do_not_save=True)
pi2.apply_tds = 1
pi2.tax_withholding_category = "Test Multi Invoice Category"
pi2.save()
pi2.submit()
invoices.append(pi2)
pi2.load_from_db()
self.assertTrue(pi2.taxes[0].tax_amount, 1100)
self.assertTrue(pi2.tax_withheld_vouchers[0].voucher_name == pi1.name)
self.assertTrue(pi2.tax_withheld_vouchers[0].taxable_amount == pi1.net_total)
self.assertTrue(pi2.tax_withheld_vouchers[1].voucher_name == pi.name)
self.assertTrue(pi2.tax_withheld_vouchers[1].taxable_amount == pi.net_total)
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
@@ -308,6 +350,7 @@ def create_records():
"Test TDS Supplier3",
"Test TDS Supplier4",
"Test TDS Supplier5",
"Test TDS Supplier6",
]:
if frappe.db.exists("Supplier", name):
continue
@@ -498,3 +541,22 @@ def create_tax_with_holding_category():
"accounts": [{"company": "_Test Company", "account": "TDS - _TC"}],
}
).insert()
if not frappe.db.exists("Tax Withholding Category", "Test Multi Invoice Category"):
frappe.get_doc(
{
"doctype": "Tax Withholding Category",
"name": "Test Multi Invoice Category",
"category_name": "Test Multi Invoice Category",
"rates": [
{
"from_date": fiscal_year[1],
"to_date": fiscal_year[2],
"tax_withholding_rate": 10,
"single_threshold": 5000,
"cumulative_threshold": 10000,
}
],
"accounts": [{"company": "_Test Company", "account": "TDS - _TC"}],
}
).insert()

View File

@@ -298,20 +298,22 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
round_off_account, round_off_cost_center = get_round_off_account_and_cost_center(
gl_map[0].company, gl_map[0].voucher_type, gl_map[0].voucher_no
)
round_off_account_exists = False
round_off_gle = frappe._dict()
for d in gl_map:
if d.account == round_off_account:
round_off_gle = d
if d.debit:
debit_credit_diff -= flt(d.debit)
else:
debit_credit_diff += flt(d.credit)
round_off_account_exists = True
round_off_account_exists = False
if round_off_account_exists and abs(debit_credit_diff) < (1.0 / (10**precision)):
gl_map.remove(round_off_gle)
return
if gl_map[0].voucher_type != "Period Closing Voucher":
for d in gl_map:
if d.account == round_off_account:
round_off_gle = d
if d.debit:
debit_credit_diff -= flt(d.debit) - flt(d.credit)
else:
debit_credit_diff += flt(d.credit)
round_off_account_exists = True
if round_off_account_exists and abs(debit_credit_diff) < (1.0 / (10**precision)):
gl_map.remove(round_off_gle)
return
if not round_off_gle:
for k in ["voucher_type", "voucher_no", "company", "posting_date", "remarks"]:
@@ -334,7 +336,6 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
)
update_accounting_dimensions(round_off_gle)
if not round_off_account_exists:
gl_map.append(round_off_gle)

View File

@@ -208,7 +208,7 @@ def set_address_details(
)
if company_address:
party_details.update({"company_address": company_address})
party_details.company_address = company_address
else:
party_details.update(get_company_address(company))
@@ -220,12 +220,37 @@ def set_address_details(
get_regional_address_details(party_details, doctype, company)
elif doctype and doctype in ["Purchase Invoice", "Purchase Order", "Purchase Receipt"]:
if party_details.company_address:
party_details["shipping_address"] = shipping_address or party_details["company_address"]
party_details.shipping_address_display = get_address_display(party_details["shipping_address"])
if shipping_address:
party_details.update(
get_fetch_values(doctype, "shipping_address", party_details.shipping_address)
{
"shipping_address": shipping_address,
"shipping_address_display": get_address_display(shipping_address),
**get_fetch_values(doctype, "shipping_address", shipping_address),
}
)
if party_details.company_address:
# billing address
party_details.update(
{
"billing_address": party_details.company_address,
"billing_address_display": (
party_details.company_address_display or get_address_display(party_details.company_address)
),
**get_fetch_values(doctype, "billing_address", party_details.company_address),
}
)
# shipping address - if not already set
if not party_details.shipping_address:
party_details.update(
{
"shipping_address": party_details.billing_address,
"shipping_address_display": party_details.billing_address_display,
**get_fetch_values(doctype, "shipping_address", party_details.billing_address),
}
)
get_regional_address_details(party_details, doctype, company)
return party_details.get(billing_address_field), party_details.shipping_address_name

View File

@@ -50,6 +50,10 @@
<div class="col-xs-4"><label>Document No</label></div>
<div class="col-xs-8 value">{{ einvoice.DocDtls.No }}</div>
</div>
<div class="row data-field">
<div class="col-xs-4"><label>Document Date</label></div>
<div class="col-xs-8 value">{{ einvoice.DocDtls.Dt }}</div>
</div>
</div>
<div class="col-xs-4 column-break">
<img src="{{ doc.qrcode_image }}" width="175px" style="float: right;">

View File

@@ -5,7 +5,7 @@
from collections import OrderedDict
import frappe
from frappe import _, scrub
from frappe import _, qb, scrub
from frappe.utils import cint, cstr, flt, getdate, nowdate
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -95,6 +95,9 @@ class ReceivablePayableReport(object):
# Get return entries
self.get_return_entries()
# Get Exchange Rate Revaluations
self.get_exchange_rate_revaluations()
self.data = []
for gle in self.gl_entries:
self.update_voucher_balance(gle)
@@ -258,7 +261,8 @@ class ReceivablePayableReport(object):
row.invoice_grand_total = row.invoiced
if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) and (
abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision
(abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision)
or (row.voucher_no in self.err_journals)
):
# non-zero oustanding, we must consider this row
@@ -685,10 +689,10 @@ class ReceivablePayableReport(object):
if self.filters.get(scrub(self.party_type)):
select_fields = "debit_in_account_currency as debit, credit_in_account_currency as credit"
doc_currency_fields = "debit as debit_in_account_currency, credit as credit_in_account_currency"
else:
select_fields = "debit, credit"
doc_currency_fields = "debit_in_account_currency, credit_in_account_currency"
doc_currency_fields = "debit_in_account_currency, credit_in_account_currency"
remarks = ", remarks" if self.filters.get("show_remarks") else ""
@@ -1033,3 +1037,17 @@ class ReceivablePayableReport(object):
"data": {"labels": self.ageing_column_labels, "datasets": rows},
"type": "percentage",
}
def get_exchange_rate_revaluations(self):
je = qb.DocType("Journal Entry")
results = (
qb.from_(je)
.select(je.name)
.where(
(je.company == self.filters.company)
& (je.posting_date.lte(self.filters.report_date))
& (je.voucher_type == "Exchange Rate Revaluation")
)
.run()
)
self.err_journals = [x[0] for x in results] if results else []

View File

@@ -1,18 +1,51 @@
import unittest
import frappe
from frappe.utils import add_days, getdate, today
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, flt, getdate, today
from erpnext import get_default_cost_center
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.report.accounts_receivable.accounts_receivable import execute
class TestAccountsReceivable(unittest.TestCase):
def test_accounts_receivable(self):
def setUp(self):
frappe.db.sql("delete from `tabSales Invoice` where company='_Test Company 2'")
frappe.db.sql("delete from `tabGL Entry` where company='_Test Company 2'")
frappe.db.sql("delete from `tabJournal Entry` where company='_Test Company 2'")
frappe.db.sql("delete from `tabExchange Rate Revaluation` where company='_Test Company 2'")
self.create_usd_account()
def tearDown(self):
frappe.db.rollback()
def create_usd_account(self):
name = "Debtors USD"
exists = frappe.db.get_list(
"Account", filters={"company": "_Test Company 2", "account_name": "Debtors USD"}
)
if exists:
self.debtors_usd = exists[0].name
else:
debtors = frappe.get_doc(
"Account",
frappe.db.get_list(
"Account", filters={"company": "_Test Company 2", "account_name": "Debtors"}
)[0].name,
)
debtors_usd = frappe.new_doc("Account")
debtors_usd.company = debtors.company
debtors_usd.account_name = "Debtors USD"
debtors_usd.account_currency = "USD"
debtors_usd.parent_account = debtors.parent_account
debtors_usd.account_type = debtors.account_type
self.debtors_usd = debtors_usd.save().name
def test_accounts_receivable(self):
filters = {
"company": "_Test Company 2",
"based_on_payment_terms": 1,
@@ -24,7 +57,7 @@ class TestAccountsReceivable(unittest.TestCase):
}
# check invoice grand total and invoiced column's value for 3 payment terms
name = make_sales_invoice()
name = make_sales_invoice().name
report = execute(filters)
expected_data = [[100, 30], [100, 50], [100, 20]]
@@ -65,8 +98,74 @@ class TestAccountsReceivable(unittest.TestCase):
],
)
@change_settings(
"Accounts Settings", {"allow_multi_currency_invoices_against_single_party_account": 1}
)
def test_exchange_revaluation_for_party(self):
"""
Exchange Revaluation for party on Receivable/Payable shoule be included
"""
def make_sales_invoice():
company = "_Test Company 2"
customer = "_Test Customer 2"
# Using Exchange Gain/Loss account for unrealized as well.
company_doc = frappe.get_doc("Company", company)
company_doc.unrealized_exchange_gain_loss_account = company_doc.exchange_gain_loss_account
company_doc.save()
si = make_sales_invoice(no_payment_schedule=True, do_not_submit=True)
si.currency = "USD"
si.conversion_rate = 0.90
si.debit_to = self.debtors_usd
si = si.save().submit()
# Exchange Revaluation
err = frappe.new_doc("Exchange Rate Revaluation")
err.company = company
err.posting_date = today()
accounts = err.get_accounts_data()
err.extend("accounts", accounts)
err.accounts[0].new_exchange_rate = 0.95
row = err.accounts[0]
row.new_balance_in_base_currency = flt(
row.new_exchange_rate * flt(row.balance_in_account_currency)
)
row.gain_loss = row.new_balance_in_base_currency - flt(row.balance_in_base_currency)
err.set_total_gain_loss()
err = err.save().submit()
# Submit JV for ERR
jv = frappe.get_doc(err.make_jv_entry())
jv = jv.save()
for x in jv.accounts:
x.cost_center = get_default_cost_center(jv.company)
jv.submit()
filters = {
"company": company,
"report_date": today(),
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
}
report = execute(filters)
expected_data_for_err = [0, -5, 0, 5]
row = [x for x in report[1] if x.voucher_type == jv.doctype and x.voucher_no == jv.name][0]
self.assertEqual(
expected_data_for_err,
[
row.invoiced,
row.paid,
row.credit_note,
row.outstanding,
],
)
def make_sales_invoice(no_payment_schedule=False, do_not_submit=False):
frappe.set_user("Administrator")
si = create_sales_invoice(
@@ -81,22 +180,26 @@ def make_sales_invoice():
do_not_save=1,
)
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 30)), invoice_portion=30.00, payment_amount=30),
)
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 60)), invoice_portion=50.00, payment_amount=50),
)
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 90)), invoice_portion=20.00, payment_amount=20),
)
if not no_payment_schedule:
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 30)), invoice_portion=30.00, payment_amount=30),
)
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 60)), invoice_portion=50.00, payment_amount=50),
)
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 90)), invoice_portion=20.00, payment_amount=20),
)
si.submit()
si = si.save()
return si.name
if not do_not_submit:
si = si.submit()
return si
def make_payment(docname):

View File

@@ -25,6 +25,7 @@ def get_data(filters):
["posting_date", "<=", filters.get("to_date")],
["against_voucher_type", "=", "Asset"],
["account", "in", depreciation_accounts],
["is_cancelled", "=", 0],
]
if filters.get("asset"):

View File

@@ -135,6 +135,34 @@ def get_assets(filters):
where a.docstatus=1 and a.company=%(company)s and a.purchase_date <= %(to_date)s and a.name = ds.parent and ifnull(ds.journal_entry, '') != ''
group by a.asset_category
union
SELECT a.asset_category,
ifnull(sum(case when gle.posting_date < %(from_date)s and (ifnull(a.disposal_date, 0) = 0 or a.disposal_date >= %(from_date)s) then
gle.debit
else
0
end), 0) as accumulated_depreciation_as_on_from_date,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0 and a.disposal_date >= %(from_date)s
and a.disposal_date <= %(to_date)s and gle.posting_date <= a.disposal_date then
gle.debit
else
0
end), 0) as depreciation_eliminated_during_the_period,
ifnull(sum(case when gle.posting_date >= %(from_date)s and gle.posting_date <= %(to_date)s
and (ifnull(a.disposal_date, 0) = 0 or gle.posting_date <= a.disposal_date) then
gle.debit
else
0
end), 0) as depreciation_amount_during_the_period
from `tabGL Entry` gle
join `tabAsset` a on
gle.against_voucher = a.name
join `tabAsset Category Account` aca on
aca.parent = a.asset_category and aca.company_name = %(company)s
join `tabCompany` company on
company.name = %(company)s
where a.docstatus=1 and a.company=%(company)s and a.calculate_depreciation=0 and a.purchase_date <= %(to_date)s and gle.debit != 0 and gle.is_cancelled = 0 and gle.account = ifnull(aca.depreciation_expense_account, company.depreciation_expense_account)
group by a.asset_category
union
SELECT a.asset_category,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0 and (a.disposal_date < %(from_date)s or a.disposal_date > %(to_date)s) then
0

View File

@@ -22,8 +22,7 @@ def get_columns():
{
"label": _("Payment Document Type"),
"fieldname": "payment_document_type",
"fieldtype": "Link",
"options": "Doctype",
"fieldtype": "Data",
"width": 130,
},
{
@@ -33,15 +32,15 @@ def get_columns():
"options": "payment_document_type",
"width": 140,
},
{"label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", "width": 100},
{"label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", "width": 120},
{"label": _("Cheque/Reference No"), "fieldname": "cheque_no", "width": 120},
{"label": _("Clearance Date"), "fieldname": "clearance_date", "fieldtype": "Date", "width": 100},
{"label": _("Clearance Date"), "fieldname": "clearance_date", "fieldtype": "Date", "width": 120},
{
"label": _("Against Account"),
"fieldname": "against",
"fieldtype": "Link",
"options": "Account",
"width": 170,
"width": 200,
},
{"label": _("Amount"), "fieldname": "amount", "fieldtype": "Currency", "width": 120},
]

View File

@@ -9,6 +9,7 @@ from six import iteritems
from erpnext.accounts.report.financial_statements import (
get_columns,
get_cost_centers_with_children,
get_data,
get_filtered_list_for_consolidated_report,
get_period_list,
@@ -161,10 +162,11 @@ def get_account_type_based_data(company, account_type, period_list, accumulated_
total = 0
for period in period_list:
start_date = get_start_date(period, accumulated_values, company)
filters.start_date = start_date
filters.end_date = period["to_date"]
filters.account_type = account_type
amount = get_account_type_based_gl_data(
company, start_date, period["to_date"], account_type, filters
)
amount = get_account_type_based_gl_data(company, filters)
if amount and account_type == "Depreciation":
amount *= -1
@@ -176,7 +178,7 @@ def get_account_type_based_data(company, account_type, period_list, accumulated_
return data
def get_account_type_based_gl_data(company, start_date, end_date, account_type, filters=None):
def get_account_type_based_gl_data(company, filters=None):
cond = ""
filters = frappe._dict(filters or {})
@@ -192,17 +194,21 @@ def get_account_type_based_gl_data(company, start_date, end_date, account_type,
frappe.db.escape(cstr(filters.finance_book))
)
if filters.get("cost_center"):
filters.cost_center = get_cost_centers_with_children(filters.cost_center)
cond += " and cost_center in %(cost_center)s"
gl_sum = frappe.db.sql_list(
"""
select sum(credit) - sum(debit)
from `tabGL Entry`
where company=%s and posting_date >= %s and posting_date <= %s
where company=%(company)s and posting_date >= %(start_date)s and posting_date <= %(end_date)s
and voucher_type != 'Period Closing Voucher'
and account in ( SELECT name FROM tabAccount WHERE account_type = %s) {cond}
and account in ( SELECT name FROM tabAccount WHERE account_type = %(account_type)s) {cond}
""".format(
cond=cond
),
(company, start_date, end_date, account_type),
filters,
)
return gl_sum[0] if gl_sum and gl_sum[0] else 0

View File

@@ -138,7 +138,8 @@ def prepare_companywise_opening_balance(asset_data, liability_data, equity_data,
for data in [asset_data, liability_data, equity_data]:
if data:
account_name = get_root_account_name(data[0].root_type, company)
opening_value += get_opening_balance(account_name, data, company) or 0.0
if account_name:
opening_value += get_opening_balance(account_name, data, company) or 0.0
opening_balance[company] = opening_value
@@ -155,7 +156,7 @@ def get_opening_balance(account_name, data, company):
def get_root_account_name(root_type, company):
return frappe.get_all(
root_account = frappe.get_all(
"Account",
fields=["account_name"],
filters={
@@ -165,7 +166,10 @@ def get_root_account_name(root_type, company):
"parent_account": ("is", "not set"),
},
as_list=1,
)[0][0]
)
if root_account:
return root_account[0][0]
def get_profit_loss_data(fiscal_year, companies, columns, filters):
@@ -268,10 +272,12 @@ def get_cash_flow_data(fiscal_year, companies, filters):
def get_account_type_based_data(account_type, companies, fiscal_year, filters):
data = {}
total = 0
filters.account_type = account_type
filters.start_date = fiscal_year.year_start_date
filters.end_date = fiscal_year.year_end_date
for company in companies:
amount = get_account_type_based_gl_data(
company, fiscal_year.year_start_date, fiscal_year.year_end_date, account_type, filters
)
amount = get_account_type_based_gl_data(company, filters)
if amount and account_type == "Depreciation":
amount *= -1
@@ -533,9 +539,14 @@ def get_accounts(root_type, companies):
],
filters={"company": company, "root_type": root_type},
):
if account.account_name not in added_accounts:
if account.account_number:
account_key = account.account_number + "-" + account.account_name
else:
account_key = account.account_name
if account_key not in added_accounts:
accounts.append(account)
added_accounts.append(account.account_name)
added_accounts.append(account_key)
return accounts

View File

@@ -27,6 +27,7 @@ class PartyLedgerSummaryReport(object):
)
self.get_gl_entries()
self.get_additional_columns()
self.get_return_invoices()
self.get_party_adjustment_amounts()
@@ -34,6 +35,42 @@ class PartyLedgerSummaryReport(object):
data = self.get_data()
return columns, data
def get_additional_columns(self):
"""
Additional Columns for 'User Permission' based access control
"""
from frappe import qb
if self.filters.party_type == "Customer":
self.territories = frappe._dict({})
self.customer_group = frappe._dict({})
customer = qb.DocType("Customer")
result = (
frappe.qb.from_(customer)
.select(
customer.name, customer.territory, customer.customer_group, customer.default_sales_partner
)
.where((customer.disabled == 0))
.run(as_dict=True)
)
for x in result:
self.territories[x.name] = x.territory
self.customer_group[x.name] = x.customer_group
else:
self.supplier_group = frappe._dict({})
supplier = qb.DocType("Supplier")
result = (
frappe.qb.from_(supplier)
.select(supplier.name, supplier.supplier_group)
.where((supplier.disabled == 0))
.run(as_dict=True)
)
for x in result:
self.supplier_group[x.name] = x.supplier_group
def get_columns(self):
columns = [
{
@@ -117,6 +154,35 @@ class PartyLedgerSummaryReport(object):
},
]
# Hidden columns for handling 'User Permissions'
if self.filters.party_type == "Customer":
columns += [
{
"label": _("Territory"),
"fieldname": "territory",
"fieldtype": "Link",
"options": "Territory",
"hidden": 1,
},
{
"label": _("Customer Group"),
"fieldname": "customer_group",
"fieldtype": "Link",
"options": "Customer Group",
"hidden": 1,
},
]
else:
columns += [
{
"label": _("Supplier Group"),
"fieldname": "supplier_group",
"fieldtype": "Link",
"options": "Supplier Group",
"hidden": 1,
}
]
return columns
def get_data(self):
@@ -144,6 +210,12 @@ class PartyLedgerSummaryReport(object):
),
)
if self.filters.party_type == "Customer":
self.party_data[gle.party].update({"territory": self.territories.get(gle.party)})
self.party_data[gle.party].update({"customer_group": self.customer_group.get(gle.party)})
else:
self.party_data[gle.party].update({"supplier_group": self.supplier_group.get(gle.party)})
amount = gle.get(invoice_dr_or_cr) - gle.get(reverse_dr_or_cr)
self.party_data[gle.party].closing_balance += amount

View File

@@ -378,15 +378,14 @@ class Deferred_Revenue_and_Expense_Report(object):
ret += [{}]
# add total row
if ret is not []:
if self.filters.type == "Revenue":
total_row = frappe._dict({"name": "Total Deferred Income"})
elif self.filters.type == "Expense":
total_row = frappe._dict({"name": "Total Deferred Expense"})
if self.filters.type == "Revenue":
total_row = frappe._dict({"name": "Total Deferred Income"})
elif self.filters.type == "Expense":
total_row = frappe._dict({"name": "Total Deferred Expense"})
for idx, period in enumerate(self.period_list, 0):
total_row[period.key] = self.period_total[idx].total
ret.append(total_row)
for idx, period in enumerate(self.period_list, 0):
total_row[period.key] = self.period_total[idx].total
ret.append(total_row)
return ret

View File

@@ -25,8 +25,8 @@
<thead>
<tr>
<th style="width: 12%">{%= __("Date") %}</th>
<th style="width: 15%">{%= __("Ref") %}</th>
<th style="width: 25%">{%= __("Party") %}</th>
<th style="width: 15%">{%= __("Reference") %}</th>
<th style="width: 25%">{%= __("Remarks") %}</th>
<th style="width: 15%">{%= __("Debit") %}</th>
<th style="width: 15%">{%= __("Credit") %}</th>
<th style="width: 18%">{%= __("Balance (Dr - Cr)") %}</th>
@@ -38,23 +38,28 @@
{% if(data[i].posting_date) { %}
<td>{%= frappe.datetime.str_to_user(data[i].posting_date) %}</td>
<td>{%= data[i].voucher_type %}
<br>{%= data[i].voucher_no %}</td>
<td>
<br>{%= data[i].voucher_no %}
</td>
{% var longest_word = cstr(data[i].remarks).split(" ").reduce((longest, word) => word.length > longest.length ? word : longest, ""); %}
<td {% if longest_word.length > 45 %} class="overflow-wrap-anywhere" {% endif %}>
<span>
{% if(!(filters.party || filters.account)) { %}
{%= data[i].party || data[i].account %}
<br>
{% } %}
{{ __("Against") }}: {%= data[i].against %}
<br>{%= __("Remarks") %}: {%= data[i].remarks %}
{% if(data[i].bill_no) { %}
<br>{%= __("Supplier Invoice No") %}: {%= data[i].bill_no %}
{% } %}
</td>
<td style="text-align: right">
{%= format_currency(data[i].debit, filters.presentation_currency) %}</td>
<td style="text-align: right">
{%= format_currency(data[i].credit, filters.presentation_currency) %}</td>
</span>
</td>
<td style="text-align: right">
{%= format_currency(data[i].debit, filters.presentation_currency) %}
</td>
<td style="text-align: right">
{%= format_currency(data[i].credit, filters.presentation_currency) %}
</td>
{% } else { %}
<td></td>
<td></td>

View File

@@ -58,9 +58,8 @@ frappe.query_reports["General Ledger"] = {
{
"fieldname":"party_type",
"label": __("Party Type"),
"fieldtype": "Link",
"options": "Party Type",
"default": "",
"fieldtype": "Autocomplete",
options: Object.keys(frappe.boot.party_account_types),
on_change: function() {
frappe.query_report.set_filter_value('party', "");
}

View File

@@ -280,7 +280,7 @@ def get_conditions(filters):
or filters.get("party")
or filters.get("group_by") in ["Group by Account", "Group by Party"]
):
conditions.append("posting_date >=%(from_date)s")
conditions.append("(posting_date >=%(from_date)s or is_opening = 'Yes')")
conditions.append("(posting_date <=%(to_date)s or is_opening = 'Yes')")

View File

@@ -155,7 +155,6 @@ def adjust_account(data, period_list, consolidated=False):
for d in data:
for period in period_list:
key = period if consolidated else period.key
d[key] = totals[d["account"]]
d["total"] = totals[d["account"]]
return data

View File

@@ -44,14 +44,14 @@ frappe.query_reports["Gross Profit"] = {
"parent_field": "parent_invoice",
"initial_depth": 3,
"formatter": function(value, row, column, data, default_formatter) {
if (column.fieldname == "sales_invoice" && column.options == "Item" && data.indent == 0) {
if (column.fieldname == "sales_invoice" && column.options == "Item" && data && data.indent == 0) {
column._options = "Sales Invoice";
} else {
column._options = "Item";
}
value = default_formatter(value, row, column, data);
if (data && (data.indent == 0.0 || row[1].content == "Total")) {
if (data && (data.indent == 0.0 || (row[1] && row[1].content == "Total"))) {
value = $(`<span>${value}</span>`);
var $value = $(value).css("font-weight", "bold");
value = $value.wrap("<p></p>").parent().html();

View File

@@ -3,10 +3,12 @@
import frappe
from frappe import _, scrub
from frappe import _, qb, scrub
from frappe.query_builder import Order
from frappe.utils import cint, flt
from erpnext.controllers.queries import get_match_cond
from erpnext.stock.report.stock_ledger.stock_ledger import get_item_group_condition
from erpnext.stock.utils import get_incoming_rate
@@ -363,15 +365,16 @@ def get_column_names():
class GrossProfitGenerator(object):
def __init__(self, filters=None):
self.sle = {}
self.data = []
self.average_buying_rate = {}
self.filters = frappe._dict(filters)
self.load_invoice_items()
self.get_delivery_notes()
if filters.group_by == "Invoice":
self.group_items_by_invoice()
self.load_stock_ledger_entries()
self.load_product_bundle()
self.load_non_stock_items()
self.get_returned_invoice_items()
@@ -463,7 +466,14 @@ class GrossProfitGenerator(object):
):
returned_item_rows = self.returned_invoices[row.parent][row.item_code]
for returned_item_row in returned_item_rows:
row.qty += flt(returned_item_row.qty)
# returned_items 'qty' should be stateful
if returned_item_row.qty != 0:
if row.qty >= abs(returned_item_row.qty):
row.qty += returned_item_row.qty
returned_item_row.qty = 0
else:
row.qty = 0
returned_item_row.qty += row.qty
row.base_amount += flt(returned_item_row.base_amount, self.currency_precision)
row.buying_amount = flt(flt(row.qty) * flt(row.buying_rate), self.currency_precision)
if flt(row.qty) or row.base_amount:
@@ -535,6 +545,22 @@ class GrossProfitGenerator(object):
return flt(buying_amount, self.currency_precision)
def calculate_buying_amount_from_sle(self, row, my_sle, parenttype, parent, item_row, item_code):
for i, sle in enumerate(my_sle):
# find the stock valution rate from stock ledger entry
if (
sle.voucher_type == parenttype
and parent == sle.voucher_no
and sle.voucher_detail_no == item_row
):
previous_stock_value = len(my_sle) > i + 1 and flt(my_sle[i + 1].stock_value) or 0.0
if previous_stock_value:
return abs(previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty))
else:
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
return 0.0
def get_buying_amount(self, row, item_code):
# IMP NOTE
# stock_ledger_entries should already be filtered by item_code and warehouse and
@@ -545,29 +571,54 @@ class GrossProfitGenerator(object):
return flt(row.qty) * item_rate
else:
my_sle = self.sle.get((item_code, row.warehouse))
my_sle = self.get_stock_ledger_entries(item_code, row.warehouse)
if (row.update_stock or row.dn_detail) and my_sle:
parenttype, parent = row.parenttype, row.parent
if row.dn_detail:
parenttype, parent = "Delivery Note", row.delivery_note
for i, sle in enumerate(my_sle):
# find the stock valution rate from stock ledger entry
if (
sle.voucher_type == parenttype
and parent == sle.voucher_no
and sle.voucher_detail_no == row.item_row
):
previous_stock_value = len(my_sle) > i + 1 and flt(my_sle[i + 1].stock_value) or 0.0
if previous_stock_value:
return (previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty))
else:
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
return self.calculate_buying_amount_from_sle(
row, my_sle, parenttype, parent, row.item_row, item_code
)
elif self.delivery_notes.get((row.parent, row.item_code), None):
# check if Invoice has delivery notes
dn = self.delivery_notes.get((row.parent, row.item_code))
parenttype, parent, item_row, warehouse = (
"Delivery Note",
dn["delivery_note"],
dn["item_row"],
dn["warehouse"],
)
my_sle = self.get_stock_ledger_entries(item_code, row.warehouse)
return self.calculate_buying_amount_from_sle(
row, my_sle, parenttype, parent, item_row, item_code
)
elif row.sales_order and row.so_detail:
incoming_amount = self.get_buying_amount_from_so_dn(row.sales_order, row.so_detail, item_code)
if incoming_amount:
return incoming_amount
else:
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
return 0.0
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
def get_buying_amount_from_so_dn(self, sales_order, so_detail, item_code):
from frappe.query_builder.functions import Sum
delivery_note_item = frappe.qb.DocType("Delivery Note Item")
query = (
frappe.qb.from_(delivery_note_item)
.select(Sum(delivery_note_item.incoming_rate * delivery_note_item.stock_qty))
.where(delivery_note_item.docstatus == 1)
.where(delivery_note_item.item_code == item_code)
.where(delivery_note_item.against_sales_order == sales_order)
.where(delivery_note_item.so_detail == so_detail)
.groupby(delivery_note_item.item_code)
)
incoming_amount = query.run()
return flt(incoming_amount[0][0]) if incoming_amount else 0
def get_average_buying_rate(self, row, item_code):
args = row
@@ -621,6 +672,19 @@ class GrossProfitGenerator(object):
if self.filters.to_date:
conditions += " and posting_date <= %(to_date)s"
conditions += " and (is_return = 0 or (is_return=1 and return_against is null))"
if self.filters.item_group:
conditions += " and {0}".format(get_item_group_condition(self.filters.item_group))
if self.filters.sales_person:
conditions += """
and exists(select 1
from `tabSales Team` st
where st.parent = `tabSales Invoice`.name
and st.sales_person = %(sales_person)s)
"""
if self.filters.group_by == "Sales Person":
sales_person_cols = ", sales.sales_person, sales.allocated_amount, sales.incentives"
sales_team_table = "left join `tabSales Team` sales on sales.parent = `tabSales Invoice`.name"
@@ -644,7 +708,8 @@ class GrossProfitGenerator(object):
`tabSales Invoice`.territory, `tabSales Invoice Item`.item_code,
`tabSales Invoice Item`.item_name, `tabSales Invoice Item`.description,
`tabSales Invoice Item`.warehouse, `tabSales Invoice Item`.item_group,
`tabSales Invoice Item`.brand, `tabSales Invoice Item`.dn_detail,
`tabSales Invoice Item`.brand, `tabSales Invoice Item`.so_detail,
`tabSales Invoice Item`.sales_order, `tabSales Invoice Item`.dn_detail,
`tabSales Invoice Item`.delivery_note, `tabSales Invoice Item`.stock_qty as qty,
`tabSales Invoice Item`.base_net_rate, `tabSales Invoice Item`.base_net_amount,
`tabSales Invoice Item`.name as "item_row", `tabSales Invoice`.is_return,
@@ -667,6 +732,29 @@ class GrossProfitGenerator(object):
as_dict=1,
)
def get_delivery_notes(self):
self.delivery_notes = frappe._dict({})
if self.si_list:
invoices = [x.parent for x in self.si_list]
dni = qb.DocType("Delivery Note Item")
delivery_notes = (
qb.from_(dni)
.select(
dni.against_sales_invoice.as_("sales_invoice"),
dni.item_code,
dni.warehouse,
dni.parent.as_("delivery_note"),
dni.name.as_("item_row"),
)
.where((dni.docstatus == 1) & (dni.against_sales_invoice.isin(invoices)))
.groupby(dni.against_sales_invoice, dni.item_code)
.orderby(dni.creation, order=Order.desc)
.run(as_dict=True)
)
for entry in delivery_notes:
self.delivery_notes[(entry.sales_invoice, entry.item_code)] = entry
def group_items_by_invoice(self):
"""
Turns list of Sales Invoice Items to a tree of Sales Invoices with their Items as children.
@@ -770,24 +858,36 @@ class GrossProfitGenerator(object):
"Item", item_code, ["item_name", "description", "item_group", "brand"]
)
def load_stock_ledger_entries(self):
res = frappe.db.sql(
"""select item_code, voucher_type, voucher_no,
voucher_detail_no, stock_value, warehouse, actual_qty as qty
from `tabStock Ledger Entry`
where company=%(company)s and is_cancelled = 0
order by
item_code desc, warehouse desc, posting_date desc,
posting_time desc, creation desc""",
self.filters,
as_dict=True,
)
self.sle = {}
for r in res:
if (r.item_code, r.warehouse) not in self.sle:
self.sle[(r.item_code, r.warehouse)] = []
def get_stock_ledger_entries(self, item_code, warehouse):
if item_code and warehouse:
if (item_code, warehouse) not in self.sle:
sle = qb.DocType("Stock Ledger Entry")
res = (
qb.from_(sle)
.select(
sle.item_code,
sle.voucher_type,
sle.voucher_no,
sle.voucher_detail_no,
sle.stock_value,
sle.warehouse,
sle.actual_qty.as_("qty"),
)
.where(
(sle.company == self.filters.company)
& (sle.item_code == item_code)
& (sle.warehouse == warehouse)
& (sle.is_cancelled == 0)
)
.orderby(sle.item_code)
.orderby(sle.warehouse, sle.posting_date, sle.posting_time, sle.creation, order=Order.desc)
.run(as_dict=True)
)
self.sle[(r.item_code, r.warehouse)].append(r)
self.sle[(item_code, warehouse)] = res
return self.sle[(item_code, warehouse)]
return []
def load_product_bundle(self):
self.product_bundles = {}

View File

@@ -0,0 +1,461 @@
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase
from frappe.utils import add_days, flt, nowdate
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_delivery_note
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.report.gross_profit.gross_profit import execute
from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice
from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note
from erpnext.stock.doctype.item.test_item import create_item
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
class TestGrossProfit(FrappeTestCase):
def setUp(self):
self.create_company()
self.create_item()
self.create_bundle()
self.create_customer()
self.create_sales_invoice()
self.clear_old_entries()
def tearDown(self):
frappe.db.rollback()
def create_company(self):
company_name = "_Test Gross Profit"
abbr = "_GP"
if frappe.db.exists("Company", company_name):
company = frappe.get_doc("Company", company_name)
else:
company = frappe.get_doc(
{
"doctype": "Company",
"company_name": company_name,
"country": "India",
"default_currency": "INR",
"create_chart_of_accounts_based_on": "Standard Template",
"chart_of_accounts": "Standard",
}
)
company = company.save()
self.company = company.name
self.cost_center = company.cost_center
self.warehouse = "Stores - " + abbr
self.finished_warehouse = "Finished Goods - " + abbr
self.income_account = "Sales - " + abbr
self.expense_account = "Cost of Goods Sold - " + abbr
self.debit_to = "Debtors - " + abbr
self.creditors = "Creditors - " + abbr
def create_item(self):
item = create_item(
item_code="_Test GP Item", is_stock_item=1, company=self.company, warehouse=self.warehouse
)
self.item = item if isinstance(item, str) else item.item_code
def create_bundle(self):
from erpnext.selling.doctype.product_bundle.test_product_bundle import make_product_bundle
item2 = create_item(
item_code="_Test GP Item 2", is_stock_item=1, company=self.company, warehouse=self.warehouse
)
self.item2 = item2 if isinstance(item2, str) else item2.item_code
# This will be parent item
bundle = create_item(
item_code="_Test GP bundle", is_stock_item=0, company=self.company, warehouse=self.warehouse
)
self.bundle = bundle if isinstance(bundle, str) else bundle.item_code
# Create Product Bundle
self.product_bundle = make_product_bundle(parent=self.bundle, items=[self.item, self.item2])
def create_customer(self):
name = "_Test GP Customer"
if frappe.db.exists("Customer", name):
self.customer = name
else:
customer = frappe.new_doc("Customer")
customer.customer_name = name
customer.type = "Individual"
customer.save()
self.customer = customer.name
def create_sales_invoice(
self, qty=1, rate=100, posting_date=nowdate(), do_not_save=False, do_not_submit=False
):
"""
Helper function to populate default values in sales invoice
"""
sinv = create_sales_invoice(
qty=qty,
rate=rate,
company=self.company,
customer=self.customer,
item_code=self.item,
item_name=self.item,
cost_center=self.cost_center,
warehouse=self.warehouse,
debit_to=self.debit_to,
parent_cost_center=self.cost_center,
update_stock=0,
currency="INR",
is_pos=0,
is_return=0,
return_against=None,
income_account=self.income_account,
expense_account=self.expense_account,
do_not_save=do_not_save,
do_not_submit=do_not_submit,
)
return sinv
def create_delivery_note(
self, item=None, qty=1, rate=100, posting_date=nowdate(), do_not_save=False, do_not_submit=False
):
"""
Helper function to populate default values in Delivery Note
"""
dnote = create_delivery_note(
company=self.company,
customer=self.customer,
currency="INR",
item=item or self.item,
qty=qty,
rate=rate,
cost_center=self.cost_center,
warehouse=self.warehouse,
return_against=None,
expense_account=self.expense_account,
do_not_save=do_not_save,
do_not_submit=do_not_submit,
)
return dnote
def clear_old_entries(self):
doctype_list = [
"Sales Invoice",
"GL Entry",
"Stock Entry",
"Stock Ledger Entry",
"Delivery Note",
]
for doctype in doctype_list:
qb.from_(qb.DocType(doctype)).delete().where(qb.DocType(doctype).company == self.company).run()
def test_invoice_without_only_delivery_note(self):
"""
Test buying amount for Invoice without `update_stock` flag set but has Delivery Note
"""
se = make_stock_entry(
company=self.company,
item_code=self.item,
target=self.warehouse,
qty=1,
basic_rate=100,
do_not_submit=True,
)
item = se.items[0]
se.append(
"items",
{
"item_code": item.item_code,
"s_warehouse": item.s_warehouse,
"t_warehouse": item.t_warehouse,
"qty": 1,
"basic_rate": 200,
"conversion_factor": item.conversion_factor or 1.0,
"transfer_qty": flt(item.qty) * (flt(item.conversion_factor) or 1.0),
"serial_no": item.serial_no,
"batch_no": item.batch_no,
"cost_center": item.cost_center,
"expense_account": item.expense_account,
},
)
se = se.save().submit()
sinv = create_sales_invoice(
qty=1,
rate=100,
company=self.company,
customer=self.customer,
item_code=self.item,
item_name=self.item,
cost_center=self.cost_center,
warehouse=self.warehouse,
debit_to=self.debit_to,
parent_cost_center=self.cost_center,
update_stock=0,
currency="INR",
income_account=self.income_account,
expense_account=self.expense_account,
)
filters = frappe._dict(
company=self.company, from_date=nowdate(), to_date=nowdate(), group_by="Invoice"
)
columns, data = execute(filters=filters)
# Without Delivery Note, buying rate should be 150
expected_entry_without_dn = {
"parent_invoice": sinv.name,
"currency": "INR",
"sales_invoice": self.item,
"customer": self.customer,
"posting_date": frappe.utils.datetime.date.fromisoformat(nowdate()),
"item_code": self.item,
"item_name": self.item,
"warehouse": "Stores - _GP",
"qty": 1.0,
"avg._selling_rate": 100.0,
"valuation_rate": 150.0,
"selling_amount": 100.0,
"buying_amount": 150.0,
"gross_profit": -50.0,
"gross_profit_%": -50.0,
}
gp_entry = [x for x in data if x.parent_invoice == sinv.name]
self.assertDictContainsSubset(expected_entry_without_dn, gp_entry[0])
# make delivery note
dn = make_delivery_note(sinv.name)
dn.items[0].qty = 1
dn = dn.save().submit()
columns, data = execute(filters=filters)
# Without Delivery Note, buying rate should be 100
expected_entry_with_dn = {
"parent_invoice": sinv.name,
"currency": "INR",
"sales_invoice": self.item,
"customer": self.customer,
"posting_date": frappe.utils.datetime.date.fromisoformat(nowdate()),
"item_code": self.item,
"item_name": self.item,
"warehouse": "Stores - _GP",
"qty": 1.0,
"avg._selling_rate": 100.0,
"valuation_rate": 100.0,
"selling_amount": 100.0,
"buying_amount": 100.0,
"gross_profit": 0.0,
"gross_profit_%": 0.0,
}
gp_entry = [x for x in data if x.parent_invoice == sinv.name]
self.assertDictContainsSubset(expected_entry_with_dn, gp_entry[0])
def test_bundled_delivery_note_with_different_warehouses(self):
"""
Test Delivery Note with bundled item. Packed Item from the bundle having different warehouses
"""
se = make_stock_entry(
company=self.company,
item_code=self.item,
target=self.warehouse,
qty=1,
basic_rate=100,
do_not_submit=True,
)
item = se.items[0]
se.append(
"items",
{
"item_code": self.item2,
"s_warehouse": "",
"t_warehouse": self.finished_warehouse,
"qty": 1,
"basic_rate": 100,
"conversion_factor": item.conversion_factor or 1.0,
"transfer_qty": flt(item.qty) * (flt(item.conversion_factor) or 1.0),
"serial_no": item.serial_no,
"batch_no": item.batch_no,
"cost_center": item.cost_center,
"expense_account": item.expense_account,
},
)
se = se.save().submit()
# Make a Delivery note with Product bundle
# Packed Items will have different warehouses
dnote = self.create_delivery_note(item=self.bundle, qty=1, rate=200, do_not_submit=True)
dnote.packed_items[1].warehouse = self.finished_warehouse
dnote = dnote.submit()
# make Sales Invoice for above delivery note
sinv = make_sales_invoice(dnote.name)
sinv = sinv.save().submit()
filters = frappe._dict(
company=self.company,
from_date=nowdate(),
to_date=nowdate(),
group_by="Invoice",
sales_invoice=sinv.name,
)
columns, data = execute(filters=filters)
self.assertGreater(len(data), 0)
def test_order_connected_dn_and_inv(self):
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
"""
Test gp calculation when invoice and delivery note aren't directly connected.
SO -- INV
|
DN
"""
se = make_stock_entry(
company=self.company,
item_code=self.item,
target=self.warehouse,
qty=3,
basic_rate=100,
do_not_submit=True,
)
item = se.items[0]
se.append(
"items",
{
"item_code": item.item_code,
"s_warehouse": item.s_warehouse,
"t_warehouse": item.t_warehouse,
"qty": 10,
"basic_rate": 200,
"conversion_factor": item.conversion_factor or 1.0,
"transfer_qty": flt(item.qty) * (flt(item.conversion_factor) or 1.0),
"serial_no": item.serial_no,
"batch_no": item.batch_no,
"cost_center": item.cost_center,
"expense_account": item.expense_account,
},
)
se = se.save().submit()
so = make_sales_order(
customer=self.customer,
company=self.company,
warehouse=self.warehouse,
item=self.item,
qty=4,
do_not_save=False,
do_not_submit=False,
)
from erpnext.selling.doctype.sales_order.sales_order import (
make_delivery_note,
make_sales_invoice,
)
make_delivery_note(so.name).submit()
sinv = make_sales_invoice(so.name).submit()
filters = frappe._dict(
company=self.company, from_date=nowdate(), to_date=nowdate(), group_by="Invoice"
)
columns, data = execute(filters=filters)
expected_entry = {
"parent_invoice": sinv.name,
"currency": "INR",
"sales_invoice": self.item,
"customer": self.customer,
"posting_date": frappe.utils.datetime.date.fromisoformat(nowdate()),
"item_code": self.item,
"item_name": self.item,
"warehouse": "Stores - _GP",
"qty": 4.0,
"avg._selling_rate": 100.0,
"valuation_rate": 125.0,
"selling_amount": 400.0,
"buying_amount": 500.0,
"gross_profit": -100.0,
"gross_profit_%": -25.0,
}
gp_entry = [x for x in data if x.parent_invoice == sinv.name]
self.assertDictContainsSubset(expected_entry, gp_entry[0])
def test_crnote_against_invoice_with_multiple_instances_of_same_item(self):
"""
Item Qty for Sales Invoices with multiple instances of same item go in the -ve. Ideally, the credit noteshould cancel out the invoice items.
"""
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_sales_return
# Invoice with an item added twice
sinv = self.create_sales_invoice(qty=1, rate=100, posting_date=nowdate(), do_not_submit=True)
sinv.append("items", frappe.copy_doc(sinv.items[0], ignore_no_copy=False))
sinv = sinv.save().submit()
# Create Credit Note for Invoice
cr_note = make_sales_return(sinv.name)
cr_note = cr_note.save().submit()
filters = frappe._dict(
company=self.company, from_date=nowdate(), to_date=nowdate(), group_by="Invoice"
)
columns, data = execute(filters=filters)
expected_entry = {
"parent_invoice": sinv.name,
"currency": "INR",
"sales_invoice": self.item,
"customer": self.customer,
"posting_date": frappe.utils.datetime.date.fromisoformat(nowdate()),
"item_code": self.item,
"item_name": self.item,
"warehouse": "Stores - _GP",
"qty": 0.0,
"avg._selling_rate": 0.0,
"valuation_rate": 0.0,
"selling_amount": -100.0,
"buying_amount": 0.0,
"gross_profit": -100.0,
"gross_profit_%": 100.0,
}
gp_entry = [x for x in data if x.parent_invoice == sinv.name]
# Both items of Invoice should have '0' qty
self.assertEqual(len(gp_entry), 2)
self.assertDictContainsSubset(expected_entry, gp_entry[0])
self.assertDictContainsSubset(expected_entry, gp_entry[1])
def test_standalone_cr_notes(self):
"""
Standalone cr notes will be reported as usual
"""
# Make Cr Note
sinv = self.create_sales_invoice(
qty=-1, rate=100, posting_date=nowdate(), do_not_save=True, do_not_submit=True
)
sinv.is_return = 1
sinv = sinv.save().submit()
filters = frappe._dict(
company=self.company, from_date=nowdate(), to_date=nowdate(), group_by="Invoice"
)
columns, data = execute(filters=filters)
expected_entry = {
"parent_invoice": sinv.name,
"currency": "INR",
"sales_invoice": self.item,
"customer": self.customer,
"posting_date": frappe.utils.datetime.date.fromisoformat(nowdate()),
"item_code": self.item,
"item_name": self.item,
"warehouse": "Stores - _GP",
"qty": -1.0,
"avg._selling_rate": 100.0,
"valuation_rate": 0.0,
"selling_amount": -100.0,
"buying_amount": 0.0,
"gross_profit": -100.0,
"gross_profit_%": 100.0,
}
gp_entry = [x for x in data if x.parent_invoice == sinv.name]
self.assertDictContainsSubset(expected_entry, gp_entry[0])

View File

@@ -53,9 +53,6 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
item_details = get_item_details()
for d in item_list:
if not d.stock_qty:
continue
item_record = item_details.get(d.item_code)
purchase_receipt = None
@@ -94,7 +91,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
"expense_account": expense_account,
"stock_qty": d.stock_qty,
"stock_uom": d.stock_uom,
"rate": d.base_net_amount / d.stock_qty,
"rate": d.base_net_amount / d.stock_qty if d.stock_qty else d.base_net_amount,
"amount": d.base_net_amount,
}
)

View File

@@ -19,14 +19,19 @@ def execute(filters=None):
return _execute(filters)
def _execute(filters=None, additional_table_columns=None, additional_query_columns=None):
def _execute(
filters=None,
additional_table_columns=None,
additional_query_columns=None,
additional_conditions=None,
):
if not filters:
filters = {}
columns = get_columns(additional_table_columns, filters)
company_currency = frappe.get_cached_value("Company", filters.get("company"), "default_currency")
item_list = get_items(filters, additional_query_columns)
item_list = get_items(filters, additional_query_columns, additional_conditions)
if item_list:
itemised_tax, tax_columns = get_tax_accounts(item_list, columns, company_currency)
@@ -97,6 +102,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
row.update({"rate": d.base_net_rate, "amount": d.base_net_amount})
total_tax = 0
total_other_charges = 0
for tax in tax_columns:
item_tax = itemised_tax.get(d.name, {}).get(tax, {})
row.update(
@@ -105,10 +111,18 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
frappe.scrub(tax + " Amount"): item_tax.get("tax_amount", 0),
}
)
total_tax += flt(item_tax.get("tax_amount"))
if item_tax.get("is_other_charges"):
total_other_charges += flt(item_tax.get("tax_amount"))
else:
total_tax += flt(item_tax.get("tax_amount"))
row.update(
{"total_tax": total_tax, "total": d.base_net_amount + total_tax, "currency": company_currency}
{
"total_tax": total_tax,
"total_other_charges": total_other_charges,
"total": d.base_net_amount + total_tax,
"currency": company_currency,
}
)
if filters.get("group_by"):
@@ -319,7 +333,7 @@ def get_columns(additional_table_columns, filters):
return columns
def get_conditions(filters):
def get_conditions(filters, additional_conditions=None):
conditions = ""
for opts in (
@@ -332,6 +346,9 @@ def get_conditions(filters):
if filters.get(opts[0]):
conditions += opts[1]
if additional_conditions:
conditions += additional_conditions
if filters.get("mode_of_payment"):
conditions += """ and exists(select name from `tabSales Invoice Payment`
where parent=`tabSales Invoice`.name
@@ -367,8 +384,8 @@ def get_group_by_conditions(filters, doctype):
return "ORDER BY `tab{0}`.{1}".format(doctype, frappe.scrub(filters.get("group_by")))
def get_items(filters, additional_query_columns):
conditions = get_conditions(filters)
def get_items(filters, additional_query_columns, additional_conditions=None):
conditions = get_conditions(filters, additional_conditions)
if additional_query_columns:
additional_query_columns = ", " + ", ".join(additional_query_columns)
@@ -477,7 +494,7 @@ def get_tax_accounts(
tax_details = frappe.db.sql(
"""
select
name, parent, description, item_wise_tax_detail,
name, parent, description, item_wise_tax_detail, account_head,
charge_type, {add_deduct_tax}, base_tax_amount_after_discount_amount
from `tab%s`
where
@@ -493,11 +510,22 @@ def get_tax_accounts(
tuple([doctype] + list(invoice_item_row)),
)
account_doctype = frappe.qb.DocType("Account")
query = (
frappe.qb.from_(account_doctype)
.select(account_doctype.name)
.where((account_doctype.account_type == "Tax"))
)
tax_accounts = query.run()
for (
name,
parent,
description,
item_wise_tax_detail,
account_head,
charge_type,
add_deduct_tax,
tax_amount,
@@ -540,7 +568,11 @@ def get_tax_accounts(
)
itemised_tax.setdefault(d.name, {})[description] = frappe._dict(
{"tax_rate": tax_rate, "tax_amount": tax_value}
{
"tax_rate": tax_rate,
"tax_amount": tax_value,
"is_other_charges": 0 if tuple([account_head]) in tax_accounts else 1,
}
)
except ValueError:
@@ -583,6 +615,13 @@ def get_tax_accounts(
"options": "currency",
"width": 100,
},
{
"label": _("Total Other Charges"),
"fieldname": "total_other_charges",
"fieldtype": "Currency",
"options": "currency",
"width": 100,
},
{
"label": _("Total"),
"fieldname": "total",

View File

@@ -232,12 +232,12 @@ def get_conditions(filters):
conditions += (
common_condition
+ "and ifnull(`tabPurchase Invoice Item`.{0}, '') in %({0})s)".format(dimension.fieldname)
+ "and ifnull(`tabPurchase Invoice`.{0}, '') in %({0})s)".format(dimension.fieldname)
)
else:
conditions += (
common_condition
+ "and ifnull(`tabPurchase Invoice Item`.{0}, '') in %({0})s)".format(dimension.fieldname)
+ "and ifnull(`tabPurchase Invoice`.{0}, '') in %({0})s)".format(dimension.fieldname)
)
return conditions

View File

@@ -370,7 +370,7 @@ def get_conditions(filters):
where parent=`tabSales Invoice`.name
and ifnull(`tab{table}`.{field}, '') = %({field})s)"""
conditions += get_sales_invoice_item_field_condition("mode_of_payments", "Sales Invoice Payment")
conditions += get_sales_invoice_item_field_condition("mode_of_payment", "Sales Invoice Payment")
conditions += get_sales_invoice_item_field_condition("cost_center")
conditions += get_sales_invoice_item_field_condition("warehouse")
conditions += get_sales_invoice_item_field_condition("brand")
@@ -390,12 +390,12 @@ def get_conditions(filters):
conditions += (
common_condition
+ "and ifnull(`tabSales Invoice Item`.{0}, '') in %({0})s)".format(dimension.fieldname)
+ "and ifnull(`tabSales Invoice`.{0}, '') in %({0})s)".format(dimension.fieldname)
)
else:
conditions += (
common_condition
+ "and ifnull(`tabSales Invoice Item`.{0}, '') in %({0})s)".format(dimension.fieldname)
+ "and ifnull(`tabSales Invoice`.{0}, '') in %({0})s)".format(dimension.fieldname)
)
return conditions

View File

@@ -63,24 +63,6 @@ frappe.query_reports["Supplier Ledger Summary"] = {
"fieldtype": "Link",
"options": "Payment Terms Template"
},
{
"fieldname":"territory",
"label": __("Territory"),
"fieldtype": "Link",
"options": "Territory"
},
{
"fieldname":"sales_partner",
"label": __("Sales Partner"),
"fieldtype": "Link",
"options": "Sales Partner"
},
{
"fieldname":"sales_person",
"label": __("Sales Person"),
"fieldtype": "Link",
"options": "Sales Person"
},
{
"fieldname":"tax_id",
"label": __("Tax Id"),

View File

@@ -14,9 +14,9 @@ def execute(filters=None):
filters.naming_series = frappe.db.get_single_value("Buying Settings", "supp_master_name")
columns = get_columns(filters)
tds_docs, tds_accounts, tax_category_map = get_tds_docs(filters)
tds_docs, tds_accounts, tax_category_map, journal_entry_party_map = get_tds_docs(filters)
res = get_result(filters, tds_docs, tds_accounts, tax_category_map)
res = get_result(filters, tds_docs, tds_accounts, tax_category_map, journal_entry_party_map)
final_result = group_by_supplier_and_category(res)
return columns, final_result

View File

@@ -26,7 +26,6 @@ def get_result(filters, tds_docs, tds_accounts, tax_category_map, journal_entry_
supplier_map = get_supplier_pan_map()
tax_rate_map = get_tax_rate_map(filters)
gle_map = get_gle_map(tds_docs)
print(journal_entry_party_map)
out = []
for name, details in gle_map.items():

View File

@@ -78,7 +78,6 @@ def validate_filters(filters):
def get_data(filters):
accounts = frappe.db.sql(
"""select name, account_number, parent_account, account_name, root_type, report_type, lft, rgt
@@ -118,12 +117,10 @@ def get_data(filters):
ignore_closing_entries=not flt(filters.with_period_closing_entry),
)
total_row = calculate_values(
accounts, gl_entries_by_account, opening_balances, filters, company_currency
)
calculate_values(accounts, gl_entries_by_account, opening_balances)
accumulate_values_into_parents(accounts, accounts_by_name)
data = prepare_data(accounts, filters, total_row, parent_children_map, company_currency)
data = prepare_data(accounts, filters, parent_children_map, company_currency)
data = filter_out_zero_value_rows(
data, parent_children_map, show_zero_values=filters.get("show_zero_values")
)
@@ -172,6 +169,7 @@ def get_rootwise_opening_balances(filters, report_type):
query_filters = {
"company": filters.company,
"from_date": filters.from_date,
"to_date": filters.to_date,
"report_type": report_type,
"year_start_date": filters.year_start_date,
"project": filters.project,
@@ -200,7 +198,7 @@ def get_rootwise_opening_balances(filters, report_type):
where
company=%(company)s
{additional_conditions}
and (posting_date < %(from_date)s or ifnull(is_opening, 'No') = 'Yes')
and (posting_date < %(from_date)s or (ifnull(is_opening, 'No') = 'Yes' and posting_date <= %(to_date)s))
and account in (select name from `tabAccount` where report_type=%(report_type)s)
and is_cancelled = 0
group by account""".format(
@@ -217,7 +215,7 @@ def get_rootwise_opening_balances(filters, report_type):
return opening
def calculate_values(accounts, gl_entries_by_account, opening_balances, filters, company_currency):
def calculate_values(accounts, gl_entries_by_account, opening_balances):
init = {
"opening_debit": 0.0,
"opening_credit": 0.0,
@@ -227,22 +225,6 @@ def calculate_values(accounts, gl_entries_by_account, opening_balances, filters,
"closing_credit": 0.0,
}
total_row = {
"account": "'" + _("Total") + "'",
"account_name": "'" + _("Total") + "'",
"warn_if_negative": True,
"opening_debit": 0.0,
"opening_credit": 0.0,
"debit": 0.0,
"credit": 0.0,
"closing_debit": 0.0,
"closing_credit": 0.0,
"parent_account": None,
"indent": 0,
"has_value": True,
"currency": company_currency,
}
for d in accounts:
d.update(init.copy())
@@ -260,8 +242,28 @@ def calculate_values(accounts, gl_entries_by_account, opening_balances, filters,
prepare_opening_closing(d)
for field in value_fields:
total_row[field] += d[field]
def calculate_total_row(accounts, company_currency):
total_row = {
"account": "'" + _("Total") + "'",
"account_name": "'" + _("Total") + "'",
"warn_if_negative": True,
"opening_debit": 0.0,
"opening_credit": 0.0,
"debit": 0.0,
"credit": 0.0,
"closing_debit": 0.0,
"closing_credit": 0.0,
"parent_account": None,
"indent": 0,
"has_value": True,
"currency": company_currency,
}
for d in accounts:
if not d.parent_account:
for field in value_fields:
total_row[field] += d[field]
return total_row
@@ -273,7 +275,7 @@ def accumulate_values_into_parents(accounts, accounts_by_name):
accounts_by_name[d.parent_account][key] += d[key]
def prepare_data(accounts, filters, total_row, parent_children_map, company_currency):
def prepare_data(accounts, filters, parent_children_map, company_currency):
data = []
for d in accounts:
@@ -304,6 +306,7 @@ def prepare_data(accounts, filters, total_row, parent_children_map, company_curr
row["has_value"] = has_value
data.append(row)
total_row = calculate_total_row(accounts, company_currency)
data.extend([{}, total_row])
return data

View File

@@ -106,12 +106,17 @@ def get_opening_balances(filters):
where company=%(company)s
and is_cancelled=0
and ifnull(party_type, '') = %(party_type)s and ifnull(party, '') != ''
and (posting_date < %(from_date)s or ifnull(is_opening, 'No') = 'Yes')
and (posting_date < %(from_date)s or (ifnull(is_opening, 'No') = 'Yes' and posting_date <= %(to_date)s))
{account_filter}
group by party""".format(
account_filter=account_filter
),
{"company": filters.company, "from_date": filters.from_date, "party_type": filters.party_type},
{
"company": filters.company,
"from_date": filters.from_date,
"to_date": filters.to_date,
"party_type": filters.party_type,
},
as_dict=True,
)

View File

@@ -28,7 +28,7 @@ def get_currency(filters):
filters["presentation_currency"] if filters.get("presentation_currency") else company_currency
)
report_date = filters.get("to_date")
report_date = filters.get("to_date") or filters.get("period_end_date")
if not report_date:
fiscal_year_to_date = get_from_and_to_date(filters.get("to_fiscal_year"))["to_date"]

View File

@@ -818,7 +818,29 @@ def get_held_invoices(party_type, party):
return held_invoices
def get_outstanding_invoices(party_type, party, account, condition=None, filters=None):
def remove_return_pos_invoices(party_type, party, invoice_list):
if invoice_list:
if party_type == "Customer":
sinv = frappe.qb.DocType("Sales Invoice")
return_pos = (
frappe.qb.from_(sinv)
.select(sinv.name)
.where((sinv.is_pos == 1) & (sinv.docstatus == 1) & (sinv.is_return == 1))
.run()
)
if return_pos:
return_pos = [x[0] for x in return_pos]
else:
return invoice_list
invoice_list = [x for x in invoice_list if x.voucher_no not in return_pos]
return invoice_list
def get_outstanding_invoices(party_type, party, account, company, condition=None, filters=None):
outstanding_invoices = []
precision = frappe.get_precision("Sales Invoice", "outstanding_amount") or 2
@@ -868,61 +890,75 @@ def get_outstanding_invoices(party_type, party, account, condition=None, filters
as_dict=True,
)
payment_entries = frappe.db.sql(
"""
select against_voucher_type, against_voucher,
ifnull(sum({payment_dr_or_cr}), 0) as payment_amount
from `tabGL Entry`
where party_type = %(party_type)s and party = %(party)s
and account = %(account)s
and {payment_dr_or_cr} > 0
and against_voucher is not null and against_voucher != ''
and is_cancelled=0
group by against_voucher_type, against_voucher
""".format(
payment_dr_or_cr=payment_dr_or_cr
),
{"party_type": party_type, "party": party, "account": account},
as_dict=True,
)
invoice_list = remove_return_pos_invoices(party_type, party, invoice_list)
pe_map = frappe._dict()
for d in payment_entries:
pe_map.setdefault((d.against_voucher_type, d.against_voucher), d.payment_amount)
if invoice_list:
invoices = [d.voucher_no for d in invoice_list]
payment_entries = frappe.db.sql(
"""
select against_voucher_type, against_voucher,
ifnull(sum({payment_dr_or_cr}), 0) as payment_amount
from `tabGL Entry`
where
company = %(company)s
and party_type = %(party_type)s and party = %(party)s
and account = %(account)s
and {payment_dr_or_cr} > 0
and ifnull(against_voucher, '') != ''
and is_cancelled=0
and against_voucher in %(invoices)s
group by against_voucher_type, against_voucher
""".format(
payment_dr_or_cr=payment_dr_or_cr,
),
{
"company": company,
"party_type": party_type,
"party": party,
"account": account,
"invoices": invoices,
},
as_dict=True,
)
for d in invoice_list:
payment_amount = pe_map.get((d.voucher_type, d.voucher_no), 0)
outstanding_amount = flt(d.invoice_amount - payment_amount, precision)
if outstanding_amount > 0.5 / (10**precision):
if (
filters
and filters.get("outstanding_amt_greater_than")
and not (
outstanding_amount >= filters.get("outstanding_amt_greater_than")
and outstanding_amount <= filters.get("outstanding_amt_less_than")
)
):
continue
pe_map = frappe._dict()
for d in payment_entries:
pe_map.setdefault((d.against_voucher_type, d.against_voucher), d.payment_amount)
if not d.voucher_type == "Purchase Invoice" or d.voucher_no not in held_invoices:
outstanding_invoices.append(
frappe._dict(
{
"voucher_no": d.voucher_no,
"voucher_type": d.voucher_type,
"posting_date": d.posting_date,
"invoice_amount": flt(d.invoice_amount),
"payment_amount": payment_amount,
"outstanding_amount": outstanding_amount,
"due_date": d.due_date,
"currency": d.currency,
}
for d in invoice_list:
payment_amount = pe_map.get((d.voucher_type, d.voucher_no), 0)
outstanding_amount = flt(d.invoice_amount - payment_amount, precision)
if outstanding_amount > 0.5 / (10**precision):
if (
filters
and filters.get("outstanding_amt_greater_than")
and not (
outstanding_amount >= filters.get("outstanding_amt_greater_than")
and outstanding_amount <= filters.get("outstanding_amt_less_than")
)
)
):
continue
if not d.voucher_type == "Purchase Invoice" or d.voucher_no not in held_invoices:
outstanding_invoices.append(
frappe._dict(
{
"voucher_no": d.voucher_no,
"voucher_type": d.voucher_type,
"posting_date": d.posting_date,
"invoice_amount": flt(d.invoice_amount),
"payment_amount": payment_amount,
"outstanding_amount": outstanding_amount,
"due_date": d.due_date,
"currency": d.currency,
}
)
)
outstanding_invoices = sorted(
outstanding_invoices, key=lambda k: k["due_date"] or getdate(nowdate())
)
outstanding_invoices = sorted(
outstanding_invoices, key=lambda k: k["due_date"] or getdate(nowdate())
)
return outstanding_invoices

View File

@@ -132,6 +132,10 @@ frappe.ui.form.on('Asset', {
}, __("Manage"));
}
if (frm.doc.depr_entry_posting_status === "Failed") {
frm.trigger("set_depr_posting_failure_alert");
}
frm.trigger("setup_chart");
}
@@ -142,6 +146,19 @@ frappe.ui.form.on('Asset', {
}
},
set_depr_posting_failure_alert: function (frm) {
const alert = `
<div class="row">
<div class="col-xs-12 col-sm-6">
<span class="indicator whitespace-nowrap red">
<span>Failed to post depreciation entries</span>
</span>
</div>
</div>`;
frm.dashboard.set_headline_alert(alert);
},
toggle_reference_doc: function(frm) {
if (frm.doc.purchase_receipt && frm.doc.purchase_invoice && frm.doc.docstatus === 1) {
frm.set_df_property('purchase_invoice', 'read_only', 1);
@@ -184,39 +201,58 @@ frappe.ui.form.on('Asset', {
})
},
setup_chart: function(frm) {
var x_intervals = [frm.doc.purchase_date];
var asset_values = [frm.doc.gross_purchase_amount];
var last_depreciation_date = frm.doc.purchase_date;
if(frm.doc.opening_accumulated_depreciation) {
last_depreciation_date = frappe.datetime.add_months(frm.doc.next_depreciation_date,
-1*frm.doc.frequency_of_depreciation);
x_intervals.push(last_depreciation_date);
asset_values.push(flt(frm.doc.gross_purchase_amount) -
flt(frm.doc.opening_accumulated_depreciation));
setup_chart: async function(frm) {
if(frm.doc.finance_books.length > 1) {
return
}
$.each(frm.doc.schedules || [], function(i, v) {
x_intervals.push(v.schedule_date);
var asset_value = flt(frm.doc.gross_purchase_amount) - flt(v.accumulated_depreciation_amount);
if(v.journal_entry) {
last_depreciation_date = v.schedule_date;
asset_values.push(asset_value);
} else {
if (in_list(["Scrapped", "Sold"], frm.doc.status)) {
asset_values.push(null);
} else {
asset_values.push(asset_value)
}
var x_intervals = [frappe.format(frm.doc.purchase_date, { fieldtype: 'Date' })];
var asset_values = [frm.doc.gross_purchase_amount];
if(frm.doc.calculate_depreciation) {
if(frm.doc.opening_accumulated_depreciation) {
var depreciation_date = frappe.datetime.add_months(
frm.doc.finance_books[0].depreciation_start_date,
-1 * frm.doc.finance_books[0].frequency_of_depreciation
);
x_intervals.push(frappe.format(depreciation_date, { fieldtype: 'Date' }));
asset_values.push(flt(frm.doc.gross_purchase_amount - frm.doc.opening_accumulated_depreciation, precision('gross_purchase_amount')));
}
});
$.each(frm.doc.schedules || [], function(i, v) {
x_intervals.push(frappe.format(v.schedule_date, { fieldtype: 'Date' }));
var asset_value = flt(frm.doc.gross_purchase_amount - v.accumulated_depreciation_amount, precision('gross_purchase_amount'));
if(v.journal_entry) {
asset_values.push(asset_value);
} else {
if (in_list(["Scrapped", "Sold"], frm.doc.status)) {
asset_values.push(null);
} else {
asset_values.push(asset_value);
}
}
});
} else {
if(frm.doc.opening_accumulated_depreciation) {
x_intervals.push(frappe.format(frm.doc.creation.split(" ")[0], { fieldtype: 'Date' }));
asset_values.push(flt(frm.doc.gross_purchase_amount - frm.doc.opening_accumulated_depreciation, precision('gross_purchase_amount')));
}
let depr_entries = (await frappe.call({
method: "get_manual_depreciation_entries",
doc: frm.doc,
})).message;
$.each(depr_entries || [], function(i, v) {
x_intervals.push(frappe.format(v.posting_date, { fieldtype: 'Date' }));
let last_asset_value = asset_values[asset_values.length - 1]
asset_values.push(flt(last_asset_value - v.value, precision('gross_purchase_amount')));
});
}
if(in_list(["Scrapped", "Sold"], frm.doc.status)) {
x_intervals.push(frm.doc.disposal_date);
x_intervals.push(frappe.format(frm.doc.disposal_date, { fieldtype: 'Date' }));
asset_values.push(0);
last_depreciation_date = frm.doc.disposal_date;
}
frm.dashboard.render_graph({
@@ -260,10 +296,6 @@ frappe.ui.form.on('Asset', {
// frm.toggle_reqd("next_depreciation_date", (!frm.doc.is_existing_asset && frm.doc.calculate_depreciation));
},
opening_accumulated_depreciation: function(frm) {
erpnext.asset.set_accumulated_depreciation(frm);
},
make_schedules_editable: function(frm) {
if (frm.doc.finance_books) {
var is_editable = frm.doc.finance_books.filter(d => d.depreciation_method == "Manual").length > 0
@@ -384,7 +416,14 @@ frappe.ui.form.on('Asset', {
set_values_from_purchase_doc: function(frm, doctype, purchase_doc) {
frm.set_value('company', purchase_doc.company);
frm.set_value('purchase_date', purchase_doc.posting_date);
if (purchase_doc.bill_date) {
frm.set_value('purchase_date', purchase_doc.bill_date);
} else {
frm.set_value('purchase_date', purchase_doc.posting_date);
}
if (!frm.doc.is_existing_asset && !frm.doc.available_for_use_date) {
frm.set_value('available_for_use_date', frm.doc.purchase_date);
}
const item = purchase_doc.items.find(item => item.item_code === frm.doc.item_code);
if (!item) {
doctype_field = frappe.scrub(doctype)
@@ -479,19 +518,23 @@ frappe.ui.form.on('Depreciation Schedule', {
},
depreciation_amount: function(frm, cdt, cdn) {
erpnext.asset.set_accumulated_depreciation(frm);
erpnext.asset.set_accumulated_depreciation(frm, locals[cdt][cdn].finance_book_id);
}
})
});
erpnext.asset.set_accumulated_depreciation = function(frm) {
if(frm.doc.depreciation_method != "Manual") return;
erpnext.asset.set_accumulated_depreciation = function(frm, finance_book_id) {
var depreciation_method = frm.doc.finance_books[Number(finance_book_id) - 1].depreciation_method;
if(depreciation_method != "Manual") return;
var accumulated_depreciation = flt(frm.doc.opening_accumulated_depreciation);
$.each(frm.doc.schedules || [], function(i, row) {
accumulated_depreciation += flt(row.depreciation_amount);
frappe.model.set_value(row.doctype, row.name,
"accumulated_depreciation_amount", accumulated_depreciation);
if (row.finance_book_id === finance_book_id) {
accumulated_depreciation += flt(row.depreciation_amount);
frappe.model.set_value(row.doctype, row.name, "accumulated_depreciation_amount", accumulated_depreciation);
};
})
};

Some files were not shown because too many files have changed in this diff Show More