Compare commits

..

73 Commits

Author SHA1 Message Date
Frappe PR Bot
0f848fd968 chore(release): Bumped to Version 14.46.0
# [14.46.0](https://github.com/frappe/erpnext/compare/v14.45.4...v14.46.0) (2023-10-31)

### Bug Fixes

* add regional support to extend purchase gl entries ([d02ebd6](d02ebd6215))
* avoid name clash in delivery stop (backport [#37306](https://github.com/frappe/erpnext/issues/37306)) ([#37701](https://github.com/frappe/erpnext/issues/37701)) ([556095d](556095daaa))
* Cash flow mapping fix ([#37522](https://github.com/frappe/erpnext/issues/37522)) ([8e31379](8e31379ecc))
* close employee loan on write off ([#37638](https://github.com/frappe/erpnext/issues/37638)) ([922ace4](922ace4076))
* **defaults:** apply discount and provisonal defaults from item group and brand if available (backport [#37466](https://github.com/frappe/erpnext/issues/37466)) ([#37703](https://github.com/frappe/erpnext/issues/37703)) ([a0893dd](a0893ddf96))
* **delivery:** rename dt fetch stop action (backport [#37605](https://github.com/frappe/erpnext/issues/37605)) ([#37606](https://github.com/frappe/erpnext/issues/37606)) ([8660faa](8660faaa54))
* GL Entries for receiving non CWIP assets using Purchase Receipt ([#37660](https://github.com/frappe/erpnext/issues/37660)) ([80774e2](80774e2da1))
* incorrect cost center in the purchase invoice (backport [#37591](https://github.com/frappe/erpnext/issues/37591)) ([#37609](https://github.com/frappe/erpnext/issues/37609)) ([50daf70](50daf701dd))
* incorrect material request quantity in production plan ([#37785](https://github.com/frappe/erpnext/issues/37785)) ([25718d9](25718d9f1b))
* incorrect process loss validation for multiple finished items (backport [#37576](https://github.com/frappe/erpnext/issues/37576)) ([#37656](https://github.com/frappe/erpnext/issues/37656)) ([638c271](638c271d70))
* indexing on Delivery Note Item (backport [#37766](https://github.com/frappe/erpnext/issues/37766)) ([#37777](https://github.com/frappe/erpnext/issues/37777)) ([9b66a06](9b66a06c86))
* make changes that enable gantt view for job cards (backport [#37661](https://github.com/frappe/erpnext/issues/37661)) ([#37756](https://github.com/frappe/erpnext/issues/37756)) ([712ddb7](712ddb75be))
* **minor:** filter bank accounts in bank statement import ([#37525](https://github.com/frappe/erpnext/issues/37525)) ([1cb9f4c](1cb9f4cf8b))
* **minor:** filter tax template based on company in subscription ([#37562](https://github.com/frappe/erpnext/issues/37562)) ([c05e0a4](c05e0a4ffc))
* **minor:** set tax values for item variants (backport [#37674](https://github.com/frappe/erpnext/issues/37674)) ([#37738](https://github.com/frappe/erpnext/issues/37738)) ([fabcfc1](fabcfc1fce))
* negative current qty causing recursion issue ([#37752](https://github.com/frappe/erpnext/issues/37752)) ([f1407bc](f1407bcfd2))
* overallocation on Payment with PO/SO ([d71b885](d71b885fb8))
* purchase receipt with stock and asset items ([375be8c](375be8cd93))
* remove from or target warehouse for non internal transfer entries (backport [#37612](https://github.com/frappe/erpnext/issues/37612)) ([#37628](https://github.com/frappe/erpnext/issues/37628)) ([78b7c26](78b7c26420))
* set correct `purchase_sle` in `get_last_sle()` ([#37708](https://github.com/frappe/erpnext/issues/37708)) ([86cf156](86cf156968))
* set empty value for tax template in item details ([#37496](https://github.com/frappe/erpnext/issues/37496)) ([ec208b8](ec208b8df5))
* typeerror on tds payable monthly report ([fea27d5](fea27d5e2e))
* update existing doc if possible ([89f07dc](89f07dcfac))
* wrong german translation ([#37658](https://github.com/frappe/erpnext/issues/37658)) ([fa5780c](fa5780ca81))

### Features

* allow return of components for SCO that don't have SCR created (backport [#37686](https://github.com/frappe/erpnext/issues/37686)) ([#37692](https://github.com/frappe/erpnext/issues/37692)) ([e96d5b3](e96d5b314a))
* **delivery:** link to delivery notes list view from delivery trip (backport [#37604](https://github.com/frappe/erpnext/issues/37604)) ([#37695](https://github.com/frappe/erpnext/issues/37695)) ([c58fefb](c58fefb359))

### Reverts

* Revert "fix: set empty value for tax template in item details (#37496)" ([ca13816](ca13816ca1)), closes [#37496](https://github.com/frappe/erpnext/issues/37496) [#37496](https://github.com/frappe/erpnext/issues/37496)
2023-10-31 12:45:11 +00:00
rohitwaghchaure
c117ab851a Merge pull request #37788 from frappe/version-14-hotfix
chore: release v14
2023-10-31 18:13:28 +05:30
rohitwaghchaure
b7b62a8966 Merge branch 'version-14' into version-14-hotfix 2023-10-31 17:38:42 +05:30
Samuel Danieli
86cf156968 fix: set correct purchase_sle in get_last_sle() (#37708)
sle_dict may look like this:
{
  'incoming': [
    {... Stock Entry ...},
    {... Purchase Receipt ...}
  ],
  'outgoing': [
    {... Stock Entry ...}
  ]
}
2023-10-31 16:07:10 +05:30
rohitwaghchaure
25718d9f1b fix: incorrect material request quantity in production plan (#37785) 2023-10-31 15:12:35 +05:30
mergify[bot]
9b66a06c86 fix: indexing on Delivery Note Item (backport #37766) (#37777)
fix: indexing on Delivery Note Item (#37766)

fix: added indexing on Delivery Note Item
(cherry picked from commit 056b74b162)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-31 14:31:38 +05:30
ruthra kumar
7c2bd24d0b Merge pull request #37765 from frappe/mergify/bp/version-14/pr-37761
chore: add index to posting_date in PLE (backport #37761)
2023-10-30 17:39:53 +05:30
ruthra kumar
af57cc6c5f Merge pull request #37762 from frappe/mergify/bp/version-14-hotfix/pr-37761
chore: add index to posting_date in PLE (backport #37761)
2023-10-30 17:31:08 +05:30
ruthra kumar
25448fcdbc chore: add index to posting_date in PLE
(cherry picked from commit ca69845238)
2023-10-30 17:01:38 +05:30
ruthra kumar
69e83ff6ab chore: add index to posting_date in PLE
(cherry picked from commit ca69845238)
2023-10-30 16:59:56 +05:30
ruthra kumar
87a8c8d08e Merge pull request #37760 from frappe/mergify/bp/version-14-hotfix/pr-37720
refactor: ignore cancelled GLE's while looking for currency of existing entries (backport #37720)
2023-10-30 16:52:50 +05:30
ruthra kumar
4c01128827 refactor: ignore cancelled GLE's while looking for currency
(cherry picked from commit 8d9b90f3f5)
2023-10-30 10:43:02 +00:00
mergify[bot]
712ddb75be fix: make changes that enable gantt view for job cards (backport #37661) (#37756)
fix: make changes that enable gantt view for job cards (#37661)

* fix: make changes that enable gantt view for job cards

* fix: add fields on listview and remove from json file

* fix: undo modified date

---------

Co-authored-by: Dietmar Fischer <fischer@kk-software.de>
(cherry picked from commit 500435b856)

Co-authored-by: Didiman1998 <118364772+Didiman1998@users.noreply.github.com>
2023-10-30 15:20:26 +05:30
Frappe PR Bot
78a9edf6c9 chore(release): Bumped to Version 14.45.4
## [14.45.4](https://github.com/frappe/erpnext/compare/v14.45.3...v14.45.4) (2023-10-30)

### Bug Fixes

* negative current qty causing recursion issue (backport [#37752](https://github.com/frappe/erpnext/issues/37752)) ([#37753](https://github.com/frappe/erpnext/issues/37753)) ([20ca948](20ca948e6b))
2023-10-30 08:55:38 +00:00
mergify[bot]
20ca948e6b fix: negative current qty causing recursion issue (backport #37752) (#37753)
fix: negative current qty causing recursion issue (#37752)

(cherry picked from commit f1407bcfd2)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-30 14:23:39 +05:30
rohitwaghchaure
f1407bcfd2 fix: negative current qty causing recursion issue (#37752) 2023-10-30 13:53:48 +05:30
mergify[bot]
b605b08ec1 refactor: remove extraneous disabled filters (backport #37732) (#37748)
* refactor: remove extraneous disabled filters

(cherry picked from commit f276fbba4f)

# Conflicts:
#	erpnext/accounts/report/profitability_analysis/profitability_analysis.js
#	erpnext/public/js/controllers/accounts.js

* chore: `conflicts`

---------

Co-authored-by: Bernd Oliver Sünderhauf <46800703+bosue@users.noreply.github.com>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-30 10:10:16 +05:30
mergify[bot]
fabcfc1fce fix(minor): set tax values for item variants (backport #37674) (#37738)
* fix: copy all child fields to item variant

(cherry picked from commit 5deba1b6f9)

* fix: only update if variant table empty

(cherry picked from commit d436a40739)

---------

Co-authored-by: Gursheen Anand <gursheen@frappe.io>
2023-10-29 12:16:34 +05:30
Anand Baburajan
cfb9d8c6be Merge pull request #37730 from frappe/mergify/copy/version-14/pr-37725
chore: allow wip_composite_asset in the MR PO PR PI flow (copy #37723) (copy #37725)
2023-10-27 19:31:38 +05:30
mergify[bot]
6a6a5b0a75 chore: allow wip_composite_asset in the MR PO PR PI flow (copy #37723) (#37725)
* chore: allow wip_composite_asset in the MR PO PR PI flow

(cherry picked from commit 0e5bea33a3)

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

* chore: resolve conflict

---------

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
(cherry picked from commit 3f296eea3a)
2023-10-27 13:26:16 +00:00
mergify[bot]
3f296eea3a chore: allow wip_composite_asset in the MR PO PR PI flow (copy #37723) (#37725)
* chore: allow wip_composite_asset in the MR PO PR PI flow

(cherry picked from commit 0e5bea33a3)

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

* chore: resolve conflict

---------

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-10-27 18:54:47 +05:30
Frappe PR Bot
8e4e4a9fb4 chore(release): Bumped to Version 14.45.3
## [14.45.3](https://github.com/frappe/erpnext/compare/v14.45.2...v14.45.3) (2023-10-27)

### Bug Fixes

* typeerror on tds payable monthly report ([52cfe3f](52cfe3f612))
2023-10-27 03:54:13 +00:00
ruthra kumar
254dd3d9bf Merge pull request #37715 from frappe/mergify/bp/version-14/pr-37714
fix: typeerror on tds payable monthly report (backport #37714)
2023-10-27 09:22:22 +05:30
Frappe PR Bot
83b3785202 chore(release): Bumped to Version 14.45.2
## [14.45.2](https://github.com/frappe/erpnext/compare/v14.45.1...v14.45.2) (2023-10-27)

### Bug Fixes

* purchase receipt with stock and asset items ([848928e](848928e7d1))
2023-10-27 03:44:35 +00:00
Deepesh Garg
b017f4a817 Merge pull request #37712 from frappe/mergify/bp/version-14/pr-37705
fix: purchase receipt with stock and asset items (#37705)
2023-10-27 09:12:57 +05:30
ruthra kumar
52cfe3f612 fix: typeerror on tds payable monthly report
(cherry picked from commit fea27d5e2e)
2023-10-27 03:23:30 +00:00
ruthra kumar
fd21dcd3b5 Merge pull request #37714 from ruthra-kumar/fix_typeerror_in_tds_montly_report
fix: typeerror on tds payable monthly report
2023-10-27 08:52:11 +05:30
ruthra kumar
fea27d5e2e fix: typeerror on tds payable monthly report 2023-10-27 07:41:30 +05:30
Smit Vora
848928e7d1 fix: purchase receipt with stock and asset items
(cherry picked from commit 375be8cd93)
2023-10-26 17:53:09 +00:00
Deepesh Garg
0f4e50185e Merge pull request #37705 from vorasmit/backport-asserts
fix: purchase receipt with stock and asset items
2023-10-26 23:22:18 +05:30
mergify[bot]
a0893ddf96 fix(defaults): apply discount and provisonal defaults from item group and brand if available (backport #37466) (#37703)
fix(defaults): apply discount and provisonal defaults from item group and brand if available (#37466)

(cherry picked from commit 1612d7ba3f)

Co-authored-by: David Arnold <dgx.arnold@gmail.com>
2023-10-26 18:14:23 +05:30
mergify[bot]
556095daaa fix: avoid name clash in delivery stop (backport #37306) (#37701)
fix: avoid name clash in delivery stop (#37306)

* fix(stock): avoid name clash in delivery stop with Document.lock()

* chore(stock): format delivery stop json according to doctype builder

(cherry picked from commit 681782121c)

Co-authored-by: David Arnold <dgx.arnold@gmail.com>
2023-10-26 18:12:01 +05:30
Smit Vora
375be8cd93 fix: purchase receipt with stock and asset items 2023-10-26 17:59:42 +05:30
mergify[bot]
c58fefb359 feat(delivery): link to delivery notes list view from delivery trip (backport #37604) (#37695)
feat(delivery): link to delivery notes list view from delivery trip

(cherry picked from commit 85488cd0dc)

Co-authored-by: David Arnold <dgx.arnold@gmail.com>
2023-10-26 13:12:44 +05:30
mergify[bot]
e96d5b314a feat: allow return of components for SCO that don't have SCR created (backport #37686) (#37692)
* feat: allow return of components for SCO that don't have SCR created

(cherry picked from commit 8e3b9ec879)

* fix: consider returned qty while calculating unsupplied qty

(cherry picked from commit 3290df5593)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-26 06:14:02 +00:00
Deepesh Garg
a615535ca5 Merge pull request #37687 from frappe/mergify/bp/version-14-hotfix/pr-37595
fix: add regional support to extend purchase gl entries (#37595)
2023-10-25 23:09:28 +05:30
Deepesh Garg
fa490ef2f0 chore: resolve conflicts 2023-10-25 19:46:51 +05:30
Deepesh Garg
e01e9ebc37 chore: resolve conflicts 2023-10-25 19:42:02 +05:30
Smit Vora
89f07dcfac fix: update existing doc if possible
(cherry picked from commit ff7108a3b1)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
2023-10-25 14:05:19 +00:00
Smit Vora
d02ebd6215 fix: add regional support to extend purchase gl entries
(cherry picked from commit 77cc91d06b)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
#	erpnext/controllers/stock_controller.py
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
2023-10-25 14:05:17 +00:00
mergify[bot]
f5e9913746 refactor: rename field Over Order Allowance to Blanket Order Allowance (backport #37669) (#37681)
* refactor: rename field `Over Order Allowance` to `Blanket Order Allowance`

(cherry picked from commit 8ffa2bfe25)

* chore: patch to rename field `over_order_allowance`

(cherry picked from commit fcfcf6957e)

# Conflicts:
#	erpnext/patches.txt

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-25 09:55:24 +00:00
mergify[bot]
a7b75a4cc1 chore: fixed test case non_internal_transfer_delivery_note (backport #37671) (#37675)
chore: fixed test case non_internal_transfer_delivery_note (#37671)

(cherry picked from commit 2bcff4c7f2)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-25 13:50:01 +05:30
ruthra kumar
912c315286 Merge pull request #37667 from frappe/mergify/bp/version-14-hotfix/pr-37625
refactor: set exchange rate on foreign currency JE from Bank Reconciliation (backport #37625)
2023-10-25 12:24:37 +05:30
ruthra kumar
2317f6a000 chore: resolve conflict 2023-10-25 11:27:51 +05:30
ruthra kumar
91130854d8 refactor: handle bank transaction in foreign currency
(cherry picked from commit 74a0d6408a)
2023-10-25 05:39:51 +00:00
ruthra kumar
677d728e67 refactor: exc rate on foreign currency JE from Bank Reconciliation
(cherry picked from commit 89f484282a)

# Conflicts:
#	erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py
2023-10-25 05:39:51 +00:00
Raffael Meyer
fa5780ca81 fix: wrong german translation (#37658) 2023-10-25 09:13:06 +05:30
Deepesh Garg
80774e2da1 fix: GL Entries for receiving non CWIP assets using Purchase Receipt (#37660)
* fix: GL Entries for receiving non CWIP assets using Purchase Receipt

* fix: rearrange functions

* chore: rearrange functions

* chore: rearrange functions

* fix: Purchase Invoice GL entires for assets

* test: cwip accounting unit tests

* chore: Attribute error

* chore: Purchase Invoice tests

* chore: Missing asset account

* chore: Missing asset account

* chore: update tests

* fix: Internal transfer GL Entries

* test: Deprecate tests

* test: Depricate tests

* test: Depricate tests

* chore: make `Reserve Stock` checkbox visible in SO

* refactor: rename field `Auto Reserve Stock for Sales Order`

* feat: add fields to hold SO and SO Item ref in PR Item

* test: Deprecate tests

* test: Depricate tests

* test: Depricate tests

* refactor: Remove expense included in valuation accounts

* chore: Add back default in transit warehousefield

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-25 09:12:27 +05:30
rohitwaghchaure
72d32a4901 chore: fixed test cases related to Internal Transfer (#37659) 2023-10-24 19:10:23 +05:30
mergify[bot]
638c271d70 fix: incorrect process loss validation for multiple finished items (backport #37576) (#37656)
fix: incorrect process loss validation for multiple finished items (#37576)

(cherry picked from commit 92cbe580e6)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-24 18:03:34 +05:30
ruthra kumar
356b1bdb38 Merge pull request #37647 from frappe/mergify/copy/version-14-hotfix/pr-37200
refactor: button in Payment Entry to filter associated Journals (copy #37200)
2023-10-24 10:23:53 +05:30
ruthra kumar
0b082f0edc chore: resolve conflict 2023-10-24 09:44:41 +05:30
ruthra kumar
be90be37c7 refactor: button on PE to filter associated Journals
(cherry picked from commit 150728deaa)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
2023-10-24 04:09:06 +00:00
Anand Baburajan
922ace4076 fix: close employee loan on write off (#37638)
* fix: exclude written off amount while calculating loan repayment

* fix: revert exclude written off amount while calculating loan repayment

* fix: close employee loan on write off
2023-10-24 09:38:08 +05:30
ruthra kumar
920de792ce Merge pull request #37646 from frappe/mergify/bp/version-14-hotfix/pr-37586
fix: overallocation on purchase order to multiple invoices (backport #37586)
2023-10-24 09:22:19 +05:30
ruthra kumar
d576fc7490 chore: resolve conflict 2023-10-24 08:48:53 +05:30
ruthra kumar
7b9daeff66 chore: fix flakiness test_sales_order_partial_advance_payment
(cherry picked from commit 4dff2c7a0d)
2023-10-24 03:14:52 +00:00
ruthra kumar
c921d7d409 refactor(test): make use of utility methods
(cherry picked from commit 547993f801)
2023-10-24 03:14:51 +00:00
ruthra kumar
c8922ad566 test: overalloction on reconciliation when PO is involved
(cherry picked from commit 946228d783)
2023-10-24 03:14:51 +00:00
ruthra kumar
d71b885fb8 fix: overallocation on Payment with PO/SO
(cherry picked from commit 23df4205f8)

# Conflicts:
#	erpnext/accounts/utils.py
2023-10-24 03:14:51 +00:00
ruthra kumar
f413530493 Merge pull request #37643 from frappe/mergify/bp/version-14-hotfix/pr-37630
refactor: configurable exchange gain or loss posting date (backport #37630)
2023-10-24 05:50:57 +05:30
ruthra kumar
ae788e8358 test: varying posting date for gain loss journal
(cherry picked from commit 514d5434a3)
2023-10-23 15:57:16 +00:00
ruthra kumar
515bed8c80 refactor: pass gain loss posting date to controller
(cherry picked from commit 7e600a6494)
2023-10-23 15:57:16 +00:00
ruthra kumar
063d658b04 refactor: introduce fields in popup
(cherry picked from commit 5323bb7bee)
2023-10-23 15:57:15 +00:00
ruthra kumar
fa7fa85d92 refactor: gain_loss posting date fields in the allocation table
(cherry picked from commit 55dbcee36a)
2023-10-23 15:57:14 +00:00
Deepesh Garg
ca13816ca1 Revert "fix: set empty value for tax template in item details (#37496)"
Revert "fix: set empty value for tax template in item details (#37496)"

This reverts commit ec208b8df5.
2023-10-23 15:11:33 +05:30
mergify[bot]
78b7c26420 fix: remove from or target warehouse for non internal transfer entries (backport #37612) (#37628)
fix: remove from or target warehouse for non internal transfer entries (#37612)

(cherry picked from commit 5136fe196b)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-23 12:27:01 +05:30
saeedkola
8e31379ecc fix: Cash flow mapping fix (#37522)
Cash flow mapping fix
2023-10-23 11:14:06 +05:30
mergify[bot]
c05e0a4ffc fix(minor): filter tax template based on company in subscription (#37562)
fix: filter tax template based on company

(cherry picked from commit 1a2f659de2)

Co-authored-by: Gursheen Anand <gursheen@frappe.io>
2023-10-23 11:01:23 +05:30
mergify[bot]
ec208b8df5 fix: set empty value for tax template in item details (#37496)
* fix: set empty value for tax template in item details (#37496)

* fix: empty tax template for items with invalid templates

* fix: test for empty tax template

* fix: test for item tax template calculation

* fix: test for pos inv tax template calculation

(cherry picked from commit b0d440c34b)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py

* chore: resolve conflicts

---------

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
2023-10-23 10:15:46 +05:30
mergify[bot]
1cb9f4cf8b fix(minor): filter bank accounts in bank statement import (#37525)
fix(minor): filter bank accounts in bank statement import (#37525)

fix: filter by company in bank account
(cherry picked from commit 9d392970f0)

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
2023-10-23 10:04:02 +05:30
mergify[bot]
50daf701dd fix: incorrect cost center in the purchase invoice (backport #37591) (#37609)
* fix: incorrect cost center in the purchase invoice (#37591)

(cherry picked from commit 14b009b093)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-20 17:02:56 +05:30
mergify[bot]
8660faaa54 fix(delivery): rename dt fetch stop action (backport #37605) (#37606)
fix(delivery): rename dt fetch stop action

(cherry picked from commit 79d51a0a0b)

Co-authored-by: David Arnold <dgx.arnold@gmail.com>
2023-10-20 16:12:42 +05:30
45 changed files with 482 additions and 915 deletions

View File

@@ -3,7 +3,7 @@ import inspect
import frappe
__version__ = "14.45.1"
__version__ = "14.46.0"
def get_default_company(user=None):

View File

@@ -17,6 +17,7 @@ from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_s
get_entries,
)
from erpnext.accounts.utils import get_balance_on
from erpnext.setup.utils import get_exchange_rate
class BankReconciliationTool(Document):
@@ -129,7 +130,7 @@ def create_journal_entry_bts(
bank_transaction = frappe.db.get_values(
"Bank Transaction",
bank_transaction_name,
fieldname=["name", "deposit", "withdrawal", "bank_account"],
fieldname=["name", "deposit", "withdrawal", "bank_account", "currency"],
as_dict=True,
)[0]
company_account = frappe.get_value("Bank Account", bank_transaction.bank_account, "account")
@@ -143,29 +144,94 @@ def create_journal_entry_bts(
)
company = frappe.get_value("Account", company_account, "company")
company_default_currency = frappe.get_cached_value("Company", company, "default_currency")
company_account_currency = frappe.get_cached_value("Account", company_account, "account_currency")
second_account_currency = frappe.get_cached_value("Account", second_account, "account_currency")
# determine if multi-currency Journal or not
is_multi_currency = (
True
if company_default_currency != company_account_currency
or company_default_currency != second_account_currency
or company_default_currency != bank_transaction.currency
else False
)
accounts = []
# Multi Currency?
accounts.append(
{
"account": second_account,
"credit_in_account_currency": bank_transaction.deposit,
"debit_in_account_currency": bank_transaction.withdrawal,
"party_type": party_type,
"party": party,
"cost_center": get_default_cost_center(company),
}
)
second_account_dict = {
"account": second_account,
"account_currency": second_account_currency,
"credit_in_account_currency": bank_transaction.deposit,
"debit_in_account_currency": bank_transaction.withdrawal,
"party_type": party_type,
"party": party,
"cost_center": get_default_cost_center(company),
}
accounts.append(
{
"account": company_account,
"bank_account": bank_transaction.bank_account,
"credit_in_account_currency": bank_transaction.withdrawal,
"debit_in_account_currency": bank_transaction.deposit,
"cost_center": get_default_cost_center(company),
}
)
company_account_dict = {
"account": company_account,
"account_currency": company_account_currency,
"bank_account": bank_transaction.bank_account,
"credit_in_account_currency": bank_transaction.withdrawal,
"debit_in_account_currency": bank_transaction.deposit,
"cost_center": get_default_cost_center(company),
}
# convert transaction amount to company currency
if is_multi_currency:
exc_rate = get_exchange_rate(bank_transaction.currency, company_default_currency, posting_date)
withdrawal_in_company_currency = flt(exc_rate * abs(bank_transaction.withdrawal))
deposit_in_company_currency = flt(exc_rate * abs(bank_transaction.deposit))
else:
withdrawal_in_company_currency = bank_transaction.withdrawal
deposit_in_company_currency = bank_transaction.deposit
# if second account is of foreign currency, convert and set debit and credit fields.
if second_account_currency != company_default_currency:
exc_rate = get_exchange_rate(second_account_currency, company_default_currency, posting_date)
second_account_dict.update(
{
"exchange_rate": exc_rate,
"credit": deposit_in_company_currency,
"debit": withdrawal_in_company_currency,
"credit_in_account_currency": flt(deposit_in_company_currency / exc_rate) or 0,
"debit_in_account_currency": flt(withdrawal_in_company_currency / exc_rate) or 0,
}
)
else:
second_account_dict.update(
{
"exchange_rate": 1,
"credit": deposit_in_company_currency,
"debit": withdrawal_in_company_currency,
"credit_in_account_currency": deposit_in_company_currency,
"debit_in_account_currency": withdrawal_in_company_currency,
}
)
# if company account is of foreign currency, convert and set debit and credit fields.
if company_account_currency != company_default_currency:
exc_rate = get_exchange_rate(company_account_currency, company_default_currency, posting_date)
company_account_dict.update(
{
"exchange_rate": exc_rate,
"credit": withdrawal_in_company_currency,
"debit": deposit_in_company_currency,
}
)
else:
company_account_dict.update(
{
"exchange_rate": 1,
"credit": withdrawal_in_company_currency,
"debit": deposit_in_company_currency,
"credit_in_account_currency": withdrawal_in_company_currency,
"debit_in_account_currency": deposit_in_company_currency,
}
)
accounts.append(second_account_dict)
accounts.append(company_account_dict)
journal_entry_dict = {
"voucher_type": entry_type,
@@ -175,6 +241,9 @@ def create_journal_entry_bts(
"cheque_no": reference_number,
"mode_of_payment": mode_of_payment,
}
if is_multi_currency:
journal_entry_dict.update({"multi_currency": True})
journal_entry = frappe.new_doc("Journal Entry")
journal_entry.update(journal_entry_dict)
journal_entry.set("accounts", accounts)

View File

@@ -29,7 +29,8 @@
{
"fieldname": "posting_date",
"fieldtype": "Date",
"label": "Posting Date"
"label": "Posting Date",
"search_index": 1
},
{
"fieldname": "account_type",
@@ -147,7 +148,7 @@
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-08-22 15:32:56.629430",
"modified": "2023-10-30 16:15:00.470283",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Ledger Entry",

View File

@@ -1676,6 +1676,7 @@ def make_purchase_receipt(source_name, target_doc=None):
"po_detail": "purchase_order_item",
"material_request": "material_request",
"material_request_item": "material_request_item",
"wip_composite_asset": "wip_composite_asset",
},
"postprocess": update_item,
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty),

View File

@@ -5,7 +5,7 @@
from typing import Optional
import frappe
from frappe import _, msgprint, scrub
from frappe import _, msgprint, qb, scrub
from frappe.contacts.doctype.address.address import get_company_address, get_default_address
from frappe.core.doctype.user_permission.user_permission import get_permitted_documents
from frappe.model.utils import get_fetch_values
@@ -459,11 +459,19 @@ def get_party_account_currency(party_type, party, company):
def get_party_gle_currency(party_type, party, company):
def generator():
existing_gle_currency = frappe.db.sql(
"""select account_currency from `tabGL Entry`
where docstatus=1 and company=%(company)s and party_type=%(party_type)s and party=%(party)s
limit 1""",
{"company": company, "party_type": party_type, "party": party},
gl = qb.DocType("GL Entry")
existing_gle_currency = (
qb.from_(gl)
.select(gl.account_currency)
.where(
(gl.docstatus == 1)
& (gl.company == company)
& (gl.party_type == party_type)
& (gl.party == party)
& (gl.is_cancelled == 0)
)
.limit(1)
.run()
)
return existing_gle_currency[0][0] if existing_gle_currency else None

View File

@@ -33,13 +33,6 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
"label": __("Accounting Dimension"),
"fieldtype": "Link",
"options": "Accounting Dimension",
"get_query": () =>{
return {
filters: {
"disabled": 0
}
}
}
},
{
"fieldname": "fiscal_year",

View File

@@ -68,7 +68,7 @@ def get_result(
tax_amount += entry.credit - entry.debit
if net_total_map.get(name):
if voucher_type == "Journal Entry":
if voucher_type == "Journal Entry" and tax_amount and rate:
# back calcalute total amount from rate and tax_amount
total_amount = grand_total = base_total = tax_amount / (rate / 100)
else:

View File

@@ -9,7 +9,6 @@ frappe.ui.form.on('Asset', {
frm.set_query("item_code", function() {
return {
"filters": {
"disabled": 0,
"is_fixed_asset": 1,
"is_stock_item": 0
}

View File

@@ -221,11 +221,11 @@
"read_only": 1
},
{
"depends_on": "eval:!(doc.is_composite_asset && !doc.capitalized_in)",
"fieldname": "gross_purchase_amount",
"fieldtype": "Currency",
"label": "Gross Purchase Amount",
"options": "Company:company:default_currency",
"read_only": 1,
"read_only_depends_on": "eval:!doc.is_existing_asset",
"reqd": 1
},
@@ -413,6 +413,7 @@
"fieldtype": "Column Break"
},
{
"depends_on": "eval:!doc.is_composite_asset && !doc.is_existing_asset",
"fieldname": "purchase_receipt",
"fieldtype": "Link",
"label": "Purchase Receipt",
@@ -430,6 +431,7 @@
"read_only": 1
},
{
"depends_on": "eval:!doc.is_composite_asset && !doc.is_existing_asset",
"fieldname": "purchase_invoice",
"fieldtype": "Link",
"label": "Purchase Invoice",
@@ -493,10 +495,11 @@
"read_only": 1
},
{
"depends_on": "eval.doc.asset_quantity",
"fieldname": "asset_quantity",
"fieldtype": "Int",
"label": "Asset Quantity",
"read_only_depends_on": "eval:!doc.is_existing_asset && !doc.is_composite_asset"
"read_only": 1
},
{
"fieldname": "depr_entry_posting_status",
@@ -555,9 +558,14 @@
"link_doctype": "Journal Entry",
"link_fieldname": "reference_name",
"table_fieldname": "accounts"
},
{
"group": "Asset Capitalization",
"link_doctype": "Asset Capitalization",
"link_fieldname": "target_asset"
}
],
"modified": "2023-10-03 23:28:26.732269",
"modified": "2023-10-27 17:03:46.629617",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset",

View File

@@ -1732,6 +1732,7 @@ def create_asset_category():
"fixed_asset_account": "_Test Fixed Asset - _TC",
"accumulated_depreciation_account": "_Test Accumulated Depreciations - _TC",
"depreciation_expense_account": "_Test Depreciations - _TC",
"capital_work_in_progress_account": "CWIP Account - _TC",
},
)
asset_category.append(

View File

@@ -832,12 +832,8 @@ def get_items_tagged_to_wip_composite_asset(asset):
"amount",
]
pi_items = frappe.get_all(
"Purchase Invoice Item", filters={"wip_composite_asset": asset}, fields=fields
)
pr_items = frappe.get_all(
"Purchase Receipt Item", filters={"wip_composite_asset": asset}, fields=fields
)
return pi_items + pr_items
return pr_items

View File

@@ -16,7 +16,7 @@
"transaction_settings_section",
"po_required",
"pr_required",
"over_order_allowance",
"blanket_order_allowance",
"column_break_12",
"maintain_same_rate",
"set_landed_cost_based_on_purchase_invoice_rate",
@@ -159,19 +159,19 @@
"fieldtype": "Check",
"label": "Set Landed Cost Based on Purchase Invoice Rate"
},
{
"default": "0",
"description": "Percentage you are allowed to order more against the Blanket Order Quantity. For example: If you have a Blanket Order of Quantity 100 units. and your Allowance is 10% then you are allowed to order 110 units.",
"fieldname": "over_order_allowance",
"fieldtype": "Float",
"label": "Over Order Allowance (%)"
},
{
"default": "0",
"description": "While making Purchase Invoice from Purchase Order, use Exchange Rate on Invoice's transaction date rather than inheriting it from Purchase Order. Only applies for Purchase Invoice.",
"fieldname": "use_transaction_date_exchange_rate",
"fieldtype": "Check",
"label": "Use Transaction Date Exchange Rate"
},
{
"default": "0",
"description": "Percentage you are allowed to order beyond the Blanket Order quantity.",
"fieldname": "blanket_order_allowance",
"fieldtype": "Float",
"label": "Blanket Order Allowance (%)"
}
],
"icon": "fa fa-cog",
@@ -179,7 +179,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2023-10-16 16:22:03.201078",
"modified": "2023-10-25 14:03:32.520418",
"modified_by": "Administrator",
"module": "Buying",
"name": "Buying Settings",

View File

@@ -524,6 +524,7 @@ def make_purchase_receipt(source_name, target_doc=None):
"material_request_item": "material_request_item",
"sales_order": "sales_order",
"sales_order_item": "sales_order_item",
"wip_composite_asset": "wip_composite_asset",
},
"postprocess": update_item,
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty)
@@ -600,6 +601,7 @@ def get_mapped_purchase_invoice(source_name, target_doc=None, ignore_permissions
"field_map": {
"name": "po_detail",
"parent": "purchase_order",
"wip_composite_asset": "wip_composite_asset",
},
"postprocess": update_item,
"condition": lambda doc: (doc.base_amount == 0 or abs(doc.billed_amt) < abs(doc.amount)),

View File

@@ -86,6 +86,8 @@
"billed_amt",
"accounting_details",
"expense_account",
"column_break_fyqr",
"wip_composite_asset",
"manufacture_details",
"manufacturer",
"manufacturer_part_no",
@@ -897,13 +899,23 @@
"fieldname": "apply_tds",
"fieldtype": "Check",
"label": "Apply TDS"
},
{
"fieldname": "wip_composite_asset",
"fieldtype": "Link",
"label": "WIP Composite Asset",
"options": "Asset"
},
{
"fieldname": "column_break_fyqr",
"fieldtype": "Column Break"
}
],
"idx": 1,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2023-09-13 16:22:40.825092",
"modified": "2023-10-27 15:50:42.655573",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order Item",

View File

@@ -44,11 +44,6 @@ frappe.query_reports["Supplier Quotation Comparison"] = {
}
}
}
else {
return {
filters: { "disabled": 0 }
}
}
}
},
{

View File

@@ -107,7 +107,7 @@ def validate_against_blanket_order(order_doc):
allowance = flt(
frappe.db.get_single_value(
"Selling Settings" if order_doc.doctype == "Sales Order" else "Buying Settings",
"over_order_allowance",
"blanket_order_allowance",
)
)
for bo_name, item_data in order_data.items():

View File

@@ -63,7 +63,7 @@ class TestBlanketOrder(FrappeTestCase):
po1.currency = get_company_currency(po1.company)
self.assertEqual(po1.items[0].qty, (bo.items[0].qty - bo.items[0].ordered_qty))
def test_over_order_allowance(self):
def test_blanket_order_allowance(self):
# Sales Order
bo = make_blanket_order(blanket_order_type="Selling", quantity=100)
@@ -74,7 +74,7 @@ class TestBlanketOrder(FrappeTestCase):
so.items[0].qty = 110
self.assertRaises(frappe.ValidationError, so.submit)
frappe.db.set_single_value("Selling Settings", "over_order_allowance", 10)
frappe.db.set_single_value("Selling Settings", "blanket_order_allowance", 10)
so.submit()
# Purchase Order
@@ -87,7 +87,7 @@ class TestBlanketOrder(FrappeTestCase):
po.items[0].qty = 110
self.assertRaises(frappe.ValidationError, po.submit)
frappe.db.set_single_value("Buying Settings", "over_order_allowance", 10)
frappe.db.set_single_value("Buying Settings", "blanket_order_allowance", 10)
po.submit()

View File

@@ -10,8 +10,8 @@ frappe.views.calendar["Job Card"] = {
},
gantt: {
field_map: {
"start": "started_time",
"end": "started_time",
"start": "expected_start_date",
"end": "expected_end_date",
"id": "name",
"title": "subject",
"color": "color",

View File

@@ -1,6 +1,6 @@
frappe.listview_settings['Job Card'] = {
has_indicator_for_draft: true,
add_fields: ["expected_start_date", "expected_end_date"],
get_indicator: function(doc) {
const status_colors = {
"Work In Progress": "orange",

View File

@@ -1734,7 +1734,10 @@ def get_raw_materials_of_sub_assembly_items(
if not item.conversion_factor and item.purchase_uom:
item.conversion_factor = get_uom_conversion_factor(item.item_code, item.purchase_uom)
item_details.setdefault(item.get("item_code"), item)
if details := item_details.get(item.get("item_code")):
details.qty += item.get("qty")
else:
item_details.setdefault(item.get("item_code"), item)
return item_details

View File

@@ -1321,6 +1321,33 @@ class TestProductionPlan(FrappeTestCase):
self.assertTrue(row.warehouse == mrp_warhouse)
self.assertEqual(row.quantity, 12)
def test_mr_qty_for_same_rm_with_different_sub_assemblies(self):
from erpnext.manufacturing.doctype.bom.test_bom import create_nested_bom
bom_tree = {
"Fininshed Goods2 For SUB Test": {
"SubAssembly2 For SUB Test": {"ChildPart2 For SUB Test": {}},
"SubAssembly3 For SUB Test": {"ChildPart2 For SUB Test": {}},
}
}
parent_bom = create_nested_bom(bom_tree, prefix="")
plan = create_production_plan(
item_code=parent_bom.item,
planned_qty=1,
ignore_existing_ordered_qty=1,
do_not_submit=1,
skip_available_sub_assembly_item=1,
warehouse="_Test Warehouse - _TC",
)
plan.get_sub_assembly_items()
plan.make_material_request()
for row in plan.mr_items:
if row.item_code == "ChildPart2 For SUB Test":
self.assertEqual(row.quantity, 2)
def create_production_plan(**args):
"""

View File

@@ -12,7 +12,7 @@ frappe.query_reports["BOM Operations Time"] = {
"options": "Item",
"get_query": () =>{
return {
filters: { "disabled": 0, "is_stock_item": 1 }
filters: { "is_stock_item": 1 }
}
}
},

View File

@@ -342,5 +342,7 @@ execute:frappe.db.set_single_value('Selling Settings', 'allow_negative_rates_for
erpnext.patches.v14_0.correct_asset_value_if_je_with_workflow
erpnext.patches.v14_0.migrate_deferred_accounts_to_item_defaults
erpnext.patches.v14_0.create_accounting_dimensions_in_sales_order_item
erpnext.patches.v14_0.rename_over_order_allowance_field
erpnext.patches.v14_0.migrate_delivery_stop_lock_field
# below migration patch should always run last
erpnext.patches.v14_0.migrate_gl_to_payment_ledger

View File

@@ -0,0 +1,7 @@
import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
if frappe.db.has_column("Delivery Stop", "lock"):
rename_field("Delivery Stop", "lock", "locked")

View File

@@ -0,0 +1,15 @@
from frappe.model.utils.rename_field import rename_field
def execute():
rename_field(
"Buying Settings",
"over_order_allowance",
"blanket_order_allowance",
)
rename_field(
"Selling Settings",
"over_order_allowance",
"blanket_order_allowance",
)

View File

@@ -28,7 +28,6 @@ frappe.ui.form.on(cur_frm.doctype, {
filters: {
"account_type": account_type,
"company": doc.company,
"disabled": 0
}
}
});

View File

@@ -25,7 +25,7 @@
"so_required",
"dn_required",
"sales_update_frequency",
"over_order_allowance",
"blanket_order_allowance",
"column_break_5",
"allow_multiple_items",
"allow_against_multiple_purchase_orders",
@@ -182,17 +182,17 @@
"fieldtype": "Check",
"label": "Allow Sales Order Creation For Expired Quotation"
},
{
"description": "Percentage you are allowed to order more against the Blanket Order Quantity. For example: If you have a Blanket Order of Quantity 100 units. and your Allowance is 10% then you are allowed to order 110 units.",
"fieldname": "over_order_allowance",
"fieldtype": "Float",
"label": "Over Order Allowance (%)"
},
{
"default": "0",
"fieldname": "allow_negative_rates_for_items",
"fieldtype": "Check",
"label": "Allow Negative rates for Items"
},
{
"description": "Percentage you are allowed to sell beyond the Blanket Order quantity.",
"fieldname": "blanket_order_allowance",
"fieldtype": "Float",
"label": "Blanket Order Allowance (%)"
}
],
"icon": "fa fa-cog",
@@ -200,7 +200,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2023-08-14 20:33:05.693667",
"modified": "2023-10-25 14:03:03.966701",
"modified_by": "Administrator",
"module": "Selling",
"name": "Selling Settings",

View File

@@ -1315,16 +1315,16 @@ class TestDeliveryNote(FrappeTestCase):
frappe.db.rollback()
frappe.db.set_single_value("Selling Settings", "dont_reserve_sales_order_qty_on_sales_return", 0)
def non_internal_transfer_delivery_note(self):
def test_non_internal_transfer_delivery_note(self):
from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
dn = create_delivery_note(do_not_submit=True)
warehouse = create_warehouse("Internal Transfer Warehouse", dn.company)
dn.items[0].db_set("target_warehouse", "warehouse")
warehouse = create_warehouse("Internal Transfer Warehouse", company=dn.company)
dn.items[0].db_set("target_warehouse", warehouse)
dn.reload()
self.assertEqual(dn.items[0].target_warehouse, warehouse.name)
self.assertEqual(dn.items[0].target_warehouse, warehouse)
dn.save()
dn.reload()

View File

@@ -1,815 +1,197 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2017-10-16 16:46:28.166950",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"actions": [],
"creation": "2017-10-16 16:46:28.166950",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"customer",
"address",
"locked",
"column_break_6",
"customer_address",
"visited",
"order_information_section",
"delivery_note",
"cb_order",
"grand_total",
"section_break_7",
"contact",
"email_sent_to",
"column_break_7",
"customer_contact",
"section_break_9",
"distance",
"estimated_arrival",
"lat",
"column_break_19",
"uom",
"lng",
"more_information_section",
"details"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Customer",
"length": 0,
"no_copy": 0,
"options": "Customer",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"columns": 2,
"fieldname": "customer",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Customer",
"options": "Customer"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "address",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Address Name",
"length": 0,
"no_copy": 0,
"options": "Address",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "address",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Address Name",
"options": "Address",
"print_hide": 1,
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "lock",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Lock",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"default": "0",
"fieldname": "locked",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Locked"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_6",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "column_break_6",
"fieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer_address",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer Address",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "customer_address",
"fieldtype": "Small Text",
"label": "Customer Address",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.docstatus==1",
"fieldname": "visited",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Visited",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"allow_on_submit": 1,
"default": "0",
"depends_on": "eval:doc.docstatus==1",
"fieldname": "visited",
"fieldtype": "Check",
"label": "Visited",
"no_copy": 1,
"print_hide": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "order_information_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Order Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "order_information_section",
"fieldtype": "Section Break",
"label": "Order Information"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "delivery_note",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Delivery Note",
"length": 0,
"no_copy": 1,
"options": "Delivery Note",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "delivery_note",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Delivery Note",
"no_copy": 1,
"options": "Delivery Note",
"print_hide": 1,
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cb_order",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "cb_order",
"fieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "grand_total",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Grand Total",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "grand_total",
"fieldtype": "Currency",
"label": "Grand Total",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_7",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Contact Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "section_break_7",
"fieldtype": "Section Break",
"label": "Contact Information"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "contact",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Contact Name",
"length": 0,
"no_copy": 0,
"options": "Contact",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "contact",
"fieldtype": "Link",
"label": "Contact Name",
"options": "Contact",
"print_hide": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "email_sent_to",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email sent to",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "email_sent_to",
"fieldtype": "Data",
"label": "Email sent to",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_7",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "column_break_7",
"fieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer_contact",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer Contact",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "customer_contact",
"fieldtype": "Small Text",
"label": "Customer Contact",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_9",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Dispatch Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "section_break_9",
"fieldtype": "Section Break",
"label": "Dispatch Information"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "distance",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Distance",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "2",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "distance",
"fieldtype": "Float",
"label": "Distance",
"precision": "2",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "estimated_arrival",
"fieldtype": "Datetime",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Estimated Arrival",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "estimated_arrival",
"fieldtype": "Datetime",
"in_list_view": 1,
"label": "Estimated Arrival"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "lat",
"fieldtype": "Float",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Latitude",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "lat",
"fieldtype": "Float",
"hidden": 1,
"label": "Latitude"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_19",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "column_break_19",
"fieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
"depends_on": "eval:doc.distance",
"fieldname": "uom",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "UOM",
"length": 0,
"no_copy": 0,
"options": "UOM",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"depends_on": "eval:doc.distance",
"fieldname": "uom",
"fieldtype": "Link",
"label": "UOM",
"options": "UOM",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "lng",
"fieldtype": "Float",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Longitude",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "lng",
"fieldtype": "Float",
"hidden": 1,
"label": "Longitude"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "more_information_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "More Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "more_information_section",
"fieldtype": "Section Break",
"label": "More Information"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "details",
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Details",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"fieldname": "details",
"fieldtype": "Text Editor",
"label": "Details"
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2018-10-16 05:23:25.661542",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Stop",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0,
"track_views": 0
],
"istable": 1,
"links": [],
"modified": "2023-09-29 09:22:53.435161",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Stop",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -64,6 +64,11 @@ frappe.ui.form.on('Delivery Trip', {
})
}, __("Get stops from"));
}
frm.add_custom_button(__("Delivery Notes"), function () {
frappe.set_route("List", "Delivery Note",
{'name': ["in", frm.doc.delivery_stops.map((stop) => {return stop.delivery_note;})]}
);
}, __("View"));
},
calculate_arrival_time: function (frm) {

View File

@@ -170,7 +170,7 @@ class DeliveryTrip(Document):
for stop in self.delivery_stops:
leg.append(stop.customer_address)
if optimize and stop.lock:
if optimize and stop.locked:
route_list.append(leg)
leg = [stop.customer_address]

View File

@@ -46,7 +46,7 @@ class TestDeliveryTrip(FrappeTestCase):
self.assertEqual(len(route_list[0]), 4)
def test_unoptimized_route_list_with_locks(self):
self.delivery_trip.delivery_stops[0].lock = 1
self.delivery_trip.delivery_stops[0].locked = 1
self.delivery_trip.save()
route_list = self.delivery_trip.form_route_list(optimize=False)
@@ -65,7 +65,7 @@ class TestDeliveryTrip(FrappeTestCase):
self.assertEqual(len(route_list[0]), 4)
def test_optimized_route_list_with_locks(self):
self.delivery_trip.delivery_stops[0].lock = 1
self.delivery_trip.delivery_stops[0].locked = 1
self.delivery_trip.save()
route_list = self.delivery_trip.form_route_list(optimize=True)

View File

@@ -280,7 +280,7 @@ class Item(Document):
# add item taxes from template
for d in template.get("taxes"):
self.append("taxes", {"item_tax_template": d.item_tax_template})
self.append("taxes", d)
# copy re-order table if empty
if not self.get("reorder_levels"):

View File

@@ -6,7 +6,6 @@ frappe.ui.form.on("Item Price", {
frm.set_query("item_code", function() {
return {
filters: {
"disabled": 0,
"has_variants": 0
}
};

View File

@@ -405,6 +405,7 @@ def make_purchase_order(source_name, target_doc=None, args=None):
["uom", "uom"],
["sales_order", "sales_order"],
["sales_order_item", "sales_order_item"],
["wip_composite_asset", "wip_composite_asset"],
],
"postprocess": update_item,
"condition": select_item,

View File

@@ -37,6 +37,10 @@
"rate",
"col_break3",
"amount",
"accounting_details_section",
"expense_account",
"column_break_glru",
"wip_composite_asset",
"manufacture_details",
"manufacturer",
"manufacturer_part_no",
@@ -50,11 +54,10 @@
"lead_time_date",
"sales_order",
"sales_order_item",
"col_break4",
"production_plan",
"material_request_plan_item",
"job_card_item",
"col_break4",
"expense_account",
"section_break_46",
"page_break"
],
@@ -455,13 +458,28 @@
"label": "Job Card Item",
"no_copy": 1,
"print_hide": 1
},
{
"fieldname": "accounting_details_section",
"fieldtype": "Section Break",
"label": "Accounting Details"
},
{
"fieldname": "column_break_glru",
"fieldtype": "Column Break"
},
{
"fieldname": "wip_composite_asset",
"fieldtype": "Link",
"label": "WIP Composite Asset",
"options": "Asset"
}
],
"idx": 1,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2023-05-07 20:23:31.250252",
"modified": "2023-10-27 15:53:41.444236",
"modified_by": "Administrator",
"module": "Stock",
"name": "Material Request Item",

View File

@@ -543,17 +543,19 @@ class PurchaseReceipt(BuyingController):
d, gl_entries, self.posting_date, d.get("provisional_expense_account")
)
elif flt(d.qty) and (flt(d.valuation_rate) or self.is_return):
is_asset_pr = any(d.is_fixed_asset for d in self.get("items"))
remarks = self.get("remarks") or _("Accounting Entry for {0}").format(
"Asset" if is_asset_pr else "Stock"
"Asset" if d.is_fixed_asset else "Stock"
)
if not (erpnext.is_perpetual_inventory_enabled(self.company) or is_asset_pr):
return
if not (
(erpnext.is_perpetual_inventory_enabled(self.company) and d.item_code in stock_items)
or d.is_fixed_asset
):
continue
stock_asset_rbnb = (
self.get_company_default("asset_received_but_not_billed")
if is_asset_pr
if d.is_fixed_asset
else self.get_company_default("stock_received_but_not_billed")
)
landed_cost_entries = get_item_account_wise_additional_cost(self.name)
@@ -1037,6 +1039,7 @@ def make_purchase_invoice(source_name, target_doc=None):
"is_fixed_asset": "is_fixed_asset",
"asset_location": "asset_location",
"asset_category": "asset_category",
"wip_composite_asset": "wip_composite_asset",
},
"postprocess": update_item,
"filter": lambda d: get_pending_qty(d)[0] <= 0

View File

@@ -923,7 +923,8 @@
"label": "Delivery Note Item",
"no_copy": 1,
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"collapsible": 1,
@@ -1052,7 +1053,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2023-10-19 10:50:58.071735",
"modified": "2023-10-30 17:32:24.560337",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt Item",

View File

@@ -191,7 +191,7 @@ class SerialNo(StockController):
sle_dict = self.get_stock_ledger_entries(serial_no)
if sle_dict:
if sle_dict.get("incoming", []):
entries["purchase_sle"] = sle_dict["incoming"][0]
entries["purchase_sle"] = sle_dict["incoming"][-1]
if len(sle_dict.get("incoming", [])) - len(sle_dict.get("outgoing", [])) > 0:
entries["last_sle"] = sle_dict["incoming"][0]

View File

@@ -988,14 +988,34 @@ class StockEntry(StockController):
& (se.docstatus == 1)
& (se_detail.item_code == se_item.item_code)
& (
(se.purchase_order == self.purchase_order)
((se.purchase_order == self.purchase_order) & (se_detail.po_detail == se_item.po_detail))
if self.subcontract_data.order_doctype == "Purchase Order"
else (se.subcontracting_order == self.subcontracting_order)
else (
(se.subcontracting_order == self.subcontracting_order)
& (se_detail.sco_rm_detail == se_item.sco_rm_detail)
)
)
)
).run()[0][0]
).run()[0][0] or 0
if flt(total_supplied, precision) > flt(total_allowed, precision):
total_returned = 0
if self.subcontract_data.order_doctype == "Subcontracting Order":
total_returned = (
frappe.qb.from_(se)
.inner_join(se_detail)
.on(se.name == se_detail.parent)
.select(Sum(se_detail.transfer_qty))
.where(
(se.purpose == "Material Transfer")
& (se.docstatus == 1)
& (se.is_return == 1)
& (se_detail.item_code == se_item.item_code)
& (se_detail.sco_rm_detail == se_item.sco_rm_detail)
& (se.subcontracting_order == self.subcontracting_order)
)
).run()[0][0] or 0
if flt(total_supplied - total_returned, precision) > flt(total_allowed, precision):
frappe.throw(
_("Row {0}# Item {1} cannot be transferred more than {2} against {3} {4}").format(
se_item.idx,

View File

@@ -95,13 +95,6 @@ frappe.ui.form.on("Stock Reconciliation", {
fieldname: "item_code",
fieldtype: "Link",
options: "Item",
"get_query": function() {
return {
"filters": {
"disabled": 0,
}
};
}
},
{
label: __("Ignore Empty Stock"),

View File

@@ -647,7 +647,7 @@ class StockReconciliation(StockController):
{"voucher_detail_no": row.name, "actual_qty": ("<", 0), "is_cancelled": 0},
"name",
)
and current_qty
and current_qty > 0
):
new_sle = self.get_sle_for_items(row)
new_sle.actual_qty = current_qty * -1

View File

@@ -302,7 +302,7 @@ def get_basic_details(args, item, overwrite_warehouse=True):
if not item:
item = frappe.get_doc("Item", args.get("item_code"))
if item.variant_of:
if item.variant_of and not item.taxes:
item.update_template_tables()
item_defaults = get_item_defaults(item.name, args.company)
@@ -364,8 +364,12 @@ def get_basic_details(args, item, overwrite_warehouse=True):
),
"expense_account": expense_account
or get_default_expense_account(args, item_defaults, item_group_defaults, brand_defaults),
"discount_account": get_default_discount_account(args, item_defaults),
"provisional_expense_account": get_provisional_account(args, item_defaults),
"discount_account": get_default_discount_account(
args, item_defaults, item_group_defaults, brand_defaults
),
"provisional_expense_account": get_provisional_account(
args, item_defaults, item_group_defaults, brand_defaults
),
"cost_center": get_default_cost_center(
args, item_defaults, item_group_defaults, brand_defaults
),
@@ -719,12 +723,22 @@ def get_default_expense_account(args, item, item_group, brand):
)
def get_provisional_account(args, item):
return item.get("default_provisional_account") or args.default_provisional_account
def get_provisional_account(args, item, item_group, brand):
return (
item.get("default_provisional_account")
or item_group.get("default_provisional_account")
or brand.get("default_provisional_account")
or args.default_provisional_account
)
def get_default_discount_account(args, item):
return item.get("default_discount_account") or args.discount_account
def get_default_discount_account(args, item, item_group, brand):
return (
item.get("default_discount_account")
or item_group.get("default_discount_account")
or brand.get("default_discount_account")
or args.discount_account
)
def get_default_deferred_account(args, item, fieldname=None):

View File

@@ -107,7 +107,7 @@ frappe.ui.form.on('Subcontracting Order', {
get_materials_from_supplier: function (frm) {
let sco_rm_details = [];
if (frm.doc.status != "Closed" && frm.doc.supplied_items && frm.doc.per_received > 0) {
if (frm.doc.status != "Closed" && frm.doc.supplied_items) {
frm.doc.supplied_items.forEach(d => {
if (d.total_supplied_qty > 0 && d.total_supplied_qty != d.consumed_qty) {
sco_rm_details.push(d.name);
@@ -193,7 +193,7 @@ erpnext.buying.SubcontractingOrderController = class SubcontractingOrderControll
}
has_unsupplied_items() {
return this.frm.doc['supplied_items'].some(item => item.required_qty > item.supplied_qty);
return this.frm.doc['supplied_items'].some(item => item.required_qty > (item.supplied_qty - item.returned_qty));
}
make_subcontracting_receipt() {

View File

@@ -1,13 +1,6 @@
frappe.ui.form.on("Issue", {
onload: function(frm) {
frm.email_field = "raised_by";
frm.set_query("customer", function () {
return {
filters: {
"disabled": 0
}
};
});
frappe.db.get_value("Support Settings", {name: "Support Settings"},
["allow_resetting_service_level_agreement", "track_service_level_agreement"], (r) => {