Compare commits

...

1248 Commits

Author SHA1 Message Date
Sahil Khan
66a33bf7d9 Merge branch 'v12-pre-release' into version-12 2020-06-18 20:06:18 +05:30
Sahil Khan
aa27a0e85c bumped to version 12.10.0 2020-06-18 20:26:18 +05:50
sahil28297
a9dbff0eae chore: correct version in release note 2020-06-18 20:03:00 +05:30
Deepesh Garg
fc488a2b46 fix: Do not copy Item Tax template from SO to PO (#22326) 2020-06-18 18:19:49 +05:30
Nabin Hait
f53ee9026b chore: Added Change log 2020-06-18 18:13:51 +05:30
mergify[bot]
5bd479e8ee refactor: handle exceptions when updating addresses (#22307) (#22316)
* refactor: handle exceptions when updating addresses

* refactor: fold common statements in a loop

(cherry picked from commit 34d2bfbb3e)

Co-authored-by: Shivam Mishra <scmmishra@users.noreply.github.com>
2020-06-18 17:04:45 +05:30
mergify[bot]
62882ea65b fix: asset maintenance fixes (#21277) (#22300)
* fix: asset maintenance fixes

* fix: tests

(cherry picked from commit 9c494d3e72)

Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2020-06-18 15:30:04 +05:30
mergify[bot]
2417d9492f fix(HR): typo in error message in Employee Balance Report (#22306) (#22313)
* fix: typo in date error message

* fix: error message cleanup in Leave Balance report

(cherry picked from commit af6a0f3a9d)

Co-authored-by: Kenneth Sequeira <33246109+kennethsequeira@users.noreply.github.com>
2020-06-18 15:28:39 +05:30
rohitwaghchaure
130d254b5a Merge pull request #22310 from rohitwaghchaure/fixed-incorrect-variable-used-pre-release
fix: incorrect variable used while adding items in the submitted sale…
2020-06-18 14:18:22 +05:30
Rohit Waghchaure
82abcc94fa fix: incorrect variable used while adding items in the submitted sales order 2020-06-18 14:17:16 +05:30
Mangesh-Khairnar
6a0bd556d7 fix: update shopify api version (#22297) 2020-06-18 12:48:52 +05:30
Marica
c5c179490b Merge pull request #22293 from marination/variant-error-msg-pre-release
fix: Typo in Item Variant Error Message
2020-06-17 19:24:11 +05:30
marination
e256a7439e fix: Typo 2020-06-17 19:20:56 +05:30
Marica
b665da7cb4 Merge pull request #22282 from frappe/mergify/bp/v12-pre-release/pr-22281
fix: Message Formatting for missing Expense Account (bp #22281)
2020-06-17 13:55:25 +05:30
marination
7be4ba9351 fix: Message Formatting
(cherry picked from commit 17ec1d6b28)
2020-06-17 08:24:16 +00:00
rohitwaghchaure
d4c2c4e170 Merge pull request #22276 from frappe/mergify/bp/v12-pre-release/pr-22268
fix: pos, serial no popup coming two times (bp #22268)
2020-06-17 12:27:20 +05:30
rohitwaghchaure
23a2d789ec Merge pull request #22277 from frappe/mergify/bp/v12-pre-release/pr-22248
fix: v12 travis (bp #22248)
2020-06-17 12:27:07 +05:30
Rohit Waghchaure
5e68fdbaee fix: travis
(cherry picked from commit e4834d2a37)
2020-06-17 05:40:14 +00:00
rohitwaghchaure
9c55efa8c6 fix: pos, serial no popup comin two times (#22268)
(cherry picked from commit 03f688acd9)
2020-06-17 05:35:50 +00:00
rohitwaghchaure
256b6950f5 Merge pull request #22273 from frappe/mergify/bp/v12-pre-release/pr-22267
refactor: hide company currency fields in the routing (bp #22267)
2020-06-17 10:59:58 +05:30
rohitwaghchaure
956368e457 refactor: hide company currency fields in the routing (#22267)
(cherry picked from commit fd3ff6be18)
2020-06-17 04:13:12 +00:00
Sahil Khan
b6c6406206 Merge branch 'version-12-hotfix' of https://github.com/frappe/erpnext into v12-pre-release 2020-06-15 16:58:22 +05:30
rohitwaghchaure
253a698708 Merge pull request #22247 from marination/backflush-rm-rate-hotfix
fix: Wrong key sent to get_valuation_rate
2020-06-15 14:50:02 +05:30
marination
b819d8cdb6 fix: Wrong key sent to gte_valuation_rate 2020-06-15 14:47:37 +05:30
P-Froggy
84f44588d8 fix: Validation of Purchase Order against Material Request missing (#22224)
Validation of Purchase Order and Purchase Order Item against the linked Material Request Item was missing.
This way, it was possible to exchange items while making a purchase order and still fulfill the material request, even though the items did not match.

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2020-06-15 13:40:54 +05:30
rohitwaghchaure
14961e55c8 Merge pull request #22196 from marination/add-to-cart-stock-hotfix
fix: Handle unavailable Variants in Website
2020-06-15 13:11:18 +05:30
rohitwaghchaure
db48fc2559 Merge pull request #22218 from marination/update-items-permission-fix-hotfix
fix: submitted sales order can be updated with no permission
2020-06-15 13:10:15 +05:30
marination
713cbcea44 fix: Travis 2020-06-15 12:09:04 +05:30
marination
0a31e2ea92 fix: Fetch cart setting from argument 2020-06-15 12:02:28 +05:30
rohitwaghchaure
087278baba Merge pull request #22209 from frappe/michellealva-expense-claim
fix: add filter for cost center in expense table
2020-06-15 10:36:31 +05:30
rohitwaghchaure
faff772619 Merge pull request #22220 from Anurag810/quality_procedure_fix_v12
fix: Child is shown in Parent process if added from tree view
2020-06-15 10:34:09 +05:30
Deepesh Garg
fa1af6d74e Merge pull request #22200 from marination/qi-on-return-hotfix
fix: Don't prompt for Quality Inspection on Return Documents.
2020-06-14 17:10:13 +05:30
rohitwaghchaure
01d2548235 Merge pull request #22238 from rohitwaghchaure/item-none-not-found-opening-creation-tool
fix: item none not found while making sales invoice using opening inv…
2020-06-14 15:09:08 +05:30
Rohit Waghchaure
5b11d18d86 fix: item none not found while making sales invoice using opening invoice creation tool 2020-06-14 14:06:12 +05:30
Deepesh Garg
d2ed36f167 Merge pull request #22229 from deepeshgarg007/financial_statement_to_date
fix: Data not appearing properly for some fiscal_year in financial statements
2020-06-13 19:19:55 +05:30
Deepesh Garg
1222fb074f fix: Data not appearing properly for some fiscal_year in financial statemets 2020-06-13 19:16:37 +05:30
Abhishek Balam
486be1049c fix(HR): Rename due_advance_amount field in Employee Advance for v12 (#22216)
* added patch for moving data

* changed fieldname and references for easier debugging

* style: Added EOF

* reload doc for patch
2020-06-13 01:18:29 +05:30
Anurag Mishra
9319153ab3 fix: Child is shown in Parent process if added from tree view 2020-06-12 17:04:25 +05:30
rohitwaghchaure
9ea539d335 Merge pull request #22158 from pipech/v12-hotfix-pricing_rule-missing_income_account
fix(pricing_rule): missing income account when getting free product
2020-06-12 17:00:13 +05:30
marination
f6054a2de8 fix: Added PO test and conversion factor fix
- Don't change conversion factor if stock uom and uom is the same
- Added PO test
- Added Accounts User basic role in PO
- Minor fixes, wrong variables
2020-06-12 16:28:44 +05:30
Saqib Ansari
6a9f368292 fix: unexpected removal of print hide field 2020-06-12 16:25:57 +05:30
Saqib Ansari
9ee4841520 fix: cannot update delivery date 2020-06-12 16:25:38 +05:30
Saqib Ansari
39e125b8a2 fix: label 2020-06-12 16:25:28 +05:30
Saqib Ansari
37b614af0e fix: submitted sales order can be updated with no permission 2020-06-12 16:25:07 +05:30
Marica
1dc3c40b00 Merge branch 'version-12-hotfix' into qi-on-return-hotfix 2020-06-12 12:32:27 +05:30
Marica
8ce5e04777 Update stock_controller.py 2020-06-12 12:32:12 +05:30
Michelle Alva
d6cdc3378a fix: add filter for cost center in expense table
Added filter for cost center in expense table (company and group_node filter)
2020-06-12 10:30:32 +05:30
Deepesh Garg
18ccd6b253 Merge pull request #22204 from marination/account-tree-hotfix
fix: Check for Company before rendering tree in Account Tree
2020-06-12 10:03:21 +05:30
marination
5ee33bdbe9 fix: Check for Company before rendering tree in Account Tree 2020-06-11 20:31:08 +05:30
marination
a965773c97 fix: Don't prompt for Quality Inspection on Return Documents. 2020-06-11 16:45:36 +05:30
marination
821606f001 fix: Handle unavailable Variants in Website 2020-06-11 13:32:58 +05:30
Deepesh Garg
95695f0628 Merge pull request #22189 from frappe/mergify/bp/version-12-hotfix/pr-22188
fix: Update payment schedule based on payment terms (bp #22188)
2020-06-10 22:31:28 +05:30
Deepesh Garg
755b8490e7 fix: Update payment schedule based on payment terms
(cherry picked from commit a0fd97f2ac)
2020-06-10 16:52:58 +00:00
Rohan
8a2c719359 fix: only auto-set serial nos and batches if allowed in Stock Settings (v12) (#21779)
* fix: only auto-set serial nos and batches if allowed in Stock Settings

* fix: bug with setting disabled batch no in Pick List

* Remove auto_set_batch_no

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2020-06-10 19:11:20 +05:30
rohitwaghchaure
eaa6218003 Merge pull request #22183 from marination/website-price-list-hotfix
fix: Prioritize Default Customer Price List in Portal
2020-06-10 19:07:00 +05:30
marination
8710866886 fix: Prioritize Default Customer Price List in Portal 2020-06-10 18:28:14 +05:30
rohitwaghchaure
f09db536af Merge pull request #22178 from rohitwaghchaure/code-cleanup-for-handling-batch-case-in-SI
fix: Cannot read property 'has_batch_no' of undefined
2020-06-10 17:07:05 +05:30
Rohit Waghchaure
c848b97757 fix: Cannot read property 'has_batch_no' of undefined 2020-06-10 17:04:40 +05:30
rohitwaghchaure
8fcd86cb9e Merge pull request #22062 from marination/procurement-tracker
fix: Procurement Tracker Data Consistency
2020-06-10 14:13:19 +05:30
rohitwaghchaure
8c69991c12 Merge pull request #22097 from marination/valuation-rate-hotfix
fix: '>=' not supported between instances of 'str' and 'int'
2020-06-10 14:12:03 +05:30
rohitwaghchaure
6b07ae89c0 Merge pull request #22168 from pipech/v12-hotfix-loyalty_program
fix(loyalty): loyalty point entry use wrong tier
2020-06-10 12:53:12 +05:30
mergify[bot]
703cee6abf fix: update program course (#22166) (#22173)
(cherry picked from commit 934e30ecac)

Co-authored-by: Anupam Kumar <anupamvns0099@gmail.com>
2020-06-10 12:51:29 +05:30
Poranut Chollavorn
5a5361815f docs(loyalty): fix wrong comment 2020-06-09 15:16:28 +00:00
Poranut Chollavorn
9831c5beca fix(loyalty): loyalty point entry use wrong tier 2020-06-09 15:06:44 +00:00
rohitwaghchaure
139627b331 Merge pull request #22148 from marination/finished-good-valuation-hotfix
fix: Finished Product Valuation at Repack
2020-06-09 17:41:58 +05:30
Poranut Chollavorn
dfd410ded2 fix(pricing_rule): missing income account 2020-06-09 03:16:49 +00:00
Deepesh Garg
02e3fc141a Merge pull request #22150 from deepeshgarg007/tdss_desscription_default
fix(accounting): Tax Withholding Category Description default
2020-06-08 14:05:54 +05:30
Deepesh Garg
65fb3f2c48 fix: Remove strip 2020-06-08 14:00:27 +05:30
Kevin Chan
5befddca39 fix: Tax Withholding Category Description default
This commit fixes a bug that happens when a Purchase Invoice uses a
Tax Withholding Category without a category_name. The category_name is
used as the tax description which is a required field. The bug was
fixed by using the Tax Withholding Category's name as the description
if the category_name is empty.
2020-06-08 14:00:17 +05:30
marination
189663f576 fix: Finished Product Valuation at Repack 2020-06-08 13:12:00 +05:30
rohitwaghchaure
b56156296b Merge pull request #22093 from marination/shippinng-address-hotfix
fix: Apply shipping rule without address too
2020-06-08 10:36:30 +05:30
mergify[bot]
6732c9ab14 fix: fetch tax lines within the shipping lines (#22138) (#22139)
(cherry picked from commit 3031128167)

Co-authored-by: Mangesh-Khairnar <mkhairnar10@gmail.com>
2020-06-07 18:59:06 +05:30
Deepesh Garg
38546cae33 Merge pull request #22068 from marination/item-attribute-hotfix
fix: Misleading Error message for Item Attribute.
2020-06-05 11:21:33 +05:30
P-Froggy
efdb55a083 fix: Wrong Ordered-Status Indicator for Material Request Items (#22117)
The indicator displaying if a material request item has been ordered or not (green/orange) used the wrong quantity field for determining the status.
The qty field is not in stock uom while the ordered_qty field is. Now, the stock_qty field is used for correct comparison with ordered_qty.
2020-06-05 10:56:30 +05:30
Marica
a569fa36bd Merge branch 'version-12-hotfix' into valuation-rate-hotfix 2020-06-04 15:31:35 +05:30
rohitwaghchaure
237ee1a9c6 Merge pull request #22110 from rohitwaghchaure/routing-operations-not-in-a-sequence-hotfix
fix: routing operations not added sequentially in the BOM
2020-06-04 14:52:08 +05:30
Rohit Waghchaure
1ae2376a83 fix: routing operations not added sequentially in the BOM 2020-06-04 14:50:22 +05:30
rohitwaghchaure
d0d35f03d0 Merge pull request #22108 from rohitwaghchaure/fixed-import-supplier-invoice-not-worked-v12
fix: import supplier invoice not working
2020-06-04 14:35:10 +05:30
Rohit Waghchaure
58a43be4f5 fix: import supplier invoice not working 2020-06-04 14:32:57 +05:30
Deepesh Garg
869d0c37b8 Merge pull request #22099 from frappe/mergify/bp/version-12-hotfix/pr-22098
fix: Error when no data is present in AR/AP report (bp #22098)
2020-06-03 22:40:30 +05:30
Deepesh Garg
c84961be85 fix: Error when no data is present in AR/AP reeport
(cherry picked from commit 7135a75e5e)
2020-06-03 16:49:52 +00:00
marination
89dd0bad28 fix: '>=' not supported between instances of 'str' and 'int' 2020-06-03 17:22:56 +05:30
Sahil Khan
b293e4b110 Merge branch 'v12-pre-release' into version-12 2020-06-03 15:10:41 +05:30
Sahil Khan
be104e5dcf bumped to version 12.9.4 2020-06-03 15:30:41 +05:50
sahil28297
051ae36bec Merge pull request #22094 from nextchamp-saqib/asset-error-fix-pre
fix: cannot create existing assets
2020-06-03 14:50:21 +05:30
sahil28297
12ad34b44a Merge pull request #22091 from nextchamp-saqib/asset-error-fix
fix: cannot create existing assets
2020-06-03 14:50:16 +05:30
Saqib Ansari
fc975cfc3a fix: cannot create existing assets 2020-06-03 14:48:38 +05:30
marination
1a1ce9a743 fix: Apply shipping rule without address too 2020-06-03 14:42:46 +05:30
Saqib Ansari
4e3caa8ece fix: cannot create existing assets 2020-06-03 14:15:16 +05:30
Deepesh Garg
28c9f3103f Merge pull request #22087 from MyuddinKhatri/purchase-receipt-hotfix
fix(stock): create purchase invoice from purchase receipt dashboard
2020-06-03 13:37:36 +05:30
Myuddin khatri
99f5ece31c fix(stock): able to create purchase invoice from purchase receipt dashboard
able to create purchase invoice from purchase receipt dashboard
2020-06-03 11:27:18 +05:30
gavin
5448be6f34 Merge pull request #22079 from frappe/mergify/bp/version-12-hotfix/pr-21491
feat(Tally migration): Errored documents handling (bp #21491)
2020-06-03 01:41:07 +05:30
mergify[bot]
38ed43ca59 Merge branch 'version-12-hotfix' into mergify/bp/version-12-hotfix/pr-21491 2020-06-02 09:26:34 +00:00
Gavin D'souza
2e825a108f chore: verbose error message for coa recursion
(cherry picked from commit cb1376b036)
2020-06-02 08:24:58 +00:00
Gavin D'souza
43a19da27a fix: un-using buggy JS frappe.new_doc
(cherry picked from commit 0c353a64a4)
2020-06-02 08:24:58 +00:00
Gavin D'souza
8ea9b0a415 feat: maintain tally voucher numbers
feat: create seperate customer and supplier entries for same party if
case exists

(cherry picked from commit af612ddb6d)
2020-06-02 08:24:58 +00:00
Gavin D'souza
d50cceaafa feat: prompt that company and COA will be overwritten
(cherry picked from commit 51305a028b)
2020-06-02 08:24:58 +00:00
Gavin D'souza
0a7afd77e2 fix: toggle read only for accounts post daybook data processing
style: code comments and updates
(cherry picked from commit f4926a8205)
2020-06-02 08:24:58 +00:00
Gavin D'souza
adb864828a perf: reduce JS memory heap and maintain namespaces
(cherry picked from commit 6b850b7e71)
2020-06-02 08:24:57 +00:00
Gavin D'souza
18d432a843 fix: table cleanups, updated summary block
(cherry picked from commit 0d61b35b0b)
2020-06-02 08:24:57 +00:00
Gavin D'souza
d3d511d31a fix: run summary logger
style: indent fixes
(cherry picked from commit 27b7172fa4)
2020-06-02 08:24:57 +00:00
Gavin D'souza
6950c10c6f feat: handle resolve and unresolved errors
restructured and reused components

(cherry picked from commit 2e1b531f4f)
2020-06-02 08:24:57 +00:00
Gavin D'souza
28a6e1deec feat: maintain logs of errors successfully fixed
(cherry picked from commit 640636bbcd)
2020-06-02 08:24:57 +00:00
Gavin D'souza
2f5208b08d feat: order failed import log by creation, handle rollbacks and commits
(cherry picked from commit 1b5eea691c)
2020-06-02 08:24:56 +00:00
Gavin D'souza
7ee6e83605 perf: reduce failed_error_log size
(cherry picked from commit 0805307514)
2020-06-02 08:24:56 +00:00
Gavin D'souza
0a2bbfaf24 feat: error log handling
fix: toggle required accounts
(cherry picked from commit 82e7a9de28)
2020-06-02 08:24:56 +00:00
Gavin D'souza
2ab6c8fa60 fix: set default round off acount
(cherry picked from commit 38c677689d)
2020-06-02 08:24:56 +00:00
Gavin D'souza
61381963b7 feat: Error logging via doc
fix: Handle duplicate company and COA
feat: Error logging via doc
feat: fetch defaults for accounts
(cherry picked from commit 2de4a5a7c8)
2020-06-02 08:24:56 +00:00
Gavin D'souza
5c448de2ae feat: Add Failed error logs
fix: set defaults
(cherry picked from commit defeb73747)
2020-06-02 08:24:55 +00:00
marination
f42d656cd3 fix: Misleading Error message for Item Attribute. 2020-06-01 12:03:20 +05:30
marination
144facf203 fix: Procurement Tracker Data Consistency 2020-05-31 20:11:40 +05:30
Deepesh Garg
0cd8102e0e Merge pull request #22059 from frappe/mergify/bp/version-12-hotfix/pr-22057
fix(ewb): remove checksum validation for TRANSIN (bp #22057)
2020-05-30 20:22:51 +05:30
karthikeyan5
ffbc812271 fix(ewb): remove checksum validation for TRANSIN
(cherry picked from commit ca46bedfcb)
2020-05-30 14:25:39 +00:00
Deepesh Garg
056854fd9e Merge pull request #22056 from marination/qty-validation-in-stock-entry-hotfix
fix: '<' not supported between instances of 'str' and 'int'
2020-05-30 19:49:57 +05:30
Rohit Waghchaure
e7e3af1684 fix: '<' not supported between instances of 'str' and 'int' 2020-05-30 18:38:41 +05:30
rohitwaghchaure
f214789e4b fix: routing operations table is blank on pull of operations in BOM (#22040) 2020-05-29 21:27:31 +05:30
mergify[bot]
0407f018dd fix: cannot assign same task to other asset maintenance (#22024) (#22032)
(cherry picked from commit cd8b5d1e4c)

Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2020-05-29 21:26:40 +05:30
mergify[bot]
592965a4d9 fix: disposed asset creates inconsistencies in asset depr report (#22021) (#22030)
(cherry picked from commit 3c460364b5)

Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2020-05-29 21:26:29 +05:30
mergify[bot]
5b695d6e9f fix: transaction date not found in sales invoice (bp #22001) (#22029)
* fix: transaction date not found in sales invoice

(cherry picked from commit 603cc3d05e)

* chore: tests

(cherry picked from commit dd39ba0014)

Co-authored-by: Saqib Ansari <nextchamp.saqib@gmail.com>
2020-05-29 21:26:16 +05:30
Deepesh Garg
245b8be435 Merge pull request #22033 from frappe/mergify/bp/version-12-hotfix/pr-21597
fix: cannot make payment entry against shareholder (bp #21597)
2020-05-29 13:21:59 +05:30
Saqib
840225d47b fix: cannot make payment entry against shareholder (#21597)
(cherry picked from commit d46696fa03)
2020-05-29 05:57:59 +00:00
Mangesh-Khairnar
0fcb79f361 fix: make transaction date of the oldest transaction as the last integration date (#22017)
* fix: make transaction date of the oldest transaction as the last integration date

* fix: only save end date when transactions are returned
2020-05-29 10:17:18 +05:30
Rucha Mahabal
74ddc04031 Merge pull request #22002 from frappe/mergify/bp/version-12-hotfix/pr-21999
fix: change modified time (bp #21999)
2020-05-28 13:03:18 +05:30
Michelle Alva
d65000a361 fix: change modified time
changed modified time to sync the changes

(cherry picked from commit 8653419c4c)
2020-05-28 07:31:23 +00:00
Deepesh Garg
6f37035617 Merge pull request #21920 from marination/import-italian-invoice
chore: Added Italian Import Supplier Invoice to Menu
2020-05-28 12:33:12 +05:30
Marica
aa6280f5cd Merge branch 'version-12-hotfix' into import-italian-invoice 2020-05-28 12:20:35 +05:30
mergify[bot]
64078da47b fix: change description for field (#21995) (#21996)
grammatical fixes for description of Default Customer

(cherry picked from commit f7beeff2d8)

Co-authored-by: Michelle Alva <50285544+michellealva@users.noreply.github.com>
2020-05-28 11:10:32 +05:30
Deepesh Garg
d9013dc7c9 Merge pull request #21987 from deepeshgarg007/tds_computation_summary_v12
fix: TDS computation summary report
2020-05-27 22:56:36 +05:30
Deepesh Garg
a23f929005 fix: TDS computation summary report 2020-05-27 22:51:36 +05:30
Marica
4f75a3a29b Merge branch 'version-12-hotfix' into import-italian-invoice 2020-05-27 21:53:18 +05:30
marination
d9e6900e07 fix: Added permission via regional setup and patch 2020-05-27 21:53:01 +05:30
Deepesh Garg
b4a3e5f70b fix: Total for ageing column 121-Above (#21973) 2020-05-27 20:30:41 +05:30
Deepesh Garg
aee9a61e0d fix: Post Dated unallocated amount not considered in Advance Amount in AR/AP summary (#21838)
* fix: Post Dated unallocateed amount not considered in Advance Amount in AR/AP summary report

* fix: Add future payment filter in AR/AP summary

* fix: Show unallocated future payments only till current creation date

* fix: Remove extra query

* fix: Remove debug

* fix: Condition
2020-05-27 12:46:18 +05:30
Deepesh Garg
ccb8edd7a3 Merge pull request #21941 from deepeshgarg007/acc_dim_report_filter_v12
fix: Do not add filters in report on accounting dimension creation if it already exists
2020-05-26 19:41:06 +05:30
Deepesh Garg
bb2bcc8a30 fix: Remove console statement 2020-05-26 19:31:33 +05:30
Deepesh Garg
9720406086 fix: Do not add filters in report on accounting dimension creation if it already exists 2020-05-26 19:31:21 +05:30
mergify[bot]
3c0e22c98c fix: shopify error message on failure of sales order creation (#21924) (#21937)
(cherry picked from commit 7402451b96)

Co-authored-by: Mangesh-Khairnar <mkhairnar10@gmail.com>
2020-05-26 18:37:25 +05:30
mergify[bot]
f912d78023 fix: check for warehouse in the woocommerce settings (#21925) (#21936)
(cherry picked from commit ddc170521f)

Co-authored-by: Mangesh-Khairnar <mkhairnar10@gmail.com>
2020-05-26 18:21:31 +05:30
Rohan
61257d829e fix: throw error if no serial numbers are found in Pick List (#21914)
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2020-05-26 18:11:39 +05:30
Andrew McLeod
c9014b1ba9 fix: website_list_for_contact, fix changed frappe.db.exist keyword argument (#21827) 2020-05-26 18:09:00 +05:30
Anurag Mishra
9ad46f7487 fix: Added column Expired Leave (#21859) 2020-05-26 18:08:08 +05:30
Deepesh Garg
b094178734 fix(UAE): Incorrect VAT rate display in Sales Invoice (#21883) 2020-05-26 18:02:08 +05:30
Anurag Mishra
a3ec869c58 fix: showing Wrong balance on allocation boundary dates (#21908) 2020-05-26 18:00:27 +05:30
mergify[bot]
7177514b0d fix: adding dashboard in course and assessment plan (#21889) (#21919)
* Adding dashboards

* adding dashboard in course and assessment plan

(cherry picked from commit 0a147d5c76)

Co-authored-by: Anupam Kumar <anupamvns0099@gmail.com>
2020-05-26 17:59:24 +05:30
marination
277f5273a4 chore: Add Import Supplier Invoice to Menu 2020-05-25 21:49:33 +05:30
Saqib
8ae7bb2bc4 fix: fetch depreciation amount only if depr entry is made (#21894) 2020-05-25 19:20:54 +05:30
Sahil Khan
7aa8eab228 Merge branch 'v12-pre-release' into version-12 2020-05-25 19:02:37 +05:30
Sahil Khan
70439c9cd8 bumped to version 12.9.3 2020-05-25 19:22:37 +05:50
Anurag Mishra
bbec37f713 fix: Validation for dates (#21887) 2020-05-25 18:39:26 +05:30
mergify[bot]
8ddf30201f fix: Item Price and Add to Cart not showing on Website (#21905) (#21916)
* fix: Item Price and Add to Cart not showing on Website

* fix: Use None as default argument

(cherry picked from commit 4e70ecb97d)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2020-05-25 18:38:54 +05:30
Marica
4e70ecb97d fix: Item Price and Add to Cart not showing on Website (#21905)
* fix: Item Price and Add to Cart not showing on Website

* fix: Use None as default argument
2020-05-25 18:26:42 +05:30
rohitwaghchaure
666dd27d42 Merge pull request #21911 from rohitwaghchaure/fixed-comparison-operator
fix: comparison operator
2020-05-25 16:39:37 +05:30
Rohit Waghchaure
410196974e fix: comparison operator 2020-05-25 16:38:22 +05:30
Rohan
b9d5c71405 fix: filter batches based on item and warehouse in Pick List (#21778)
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2020-05-25 15:25:42 +05:30
Vishal Dhayagude
18b3c4802b fix: pound, gram to Ounce converion factor added (#21710)
* fix: pound, grams to Ounce converion factor added

* fix: patch date updated for UOM Conversion Factor

* fix: grams move to gram

* fix: duplicate entry of uom converion factor and patch added

* fix: typo fix

* fix: minor changes

* Update patches.txt

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2020-05-25 15:13:09 +05:30
rohitwaghchaure
cbe476d455 Merge pull request #21900 from rohitwaghchaure/fixed-stock-and-account-value-comparison-report-hotfix
fix: local variable 'lft' referenced before assignment
2020-05-25 12:50:50 +05:30
Rohit Waghchaure
b4b6b694af fix: local variable 'lft' referenced before assignment 2020-05-25 12:49:27 +05:30
rohitwaghchaure
aa299d0faf Merge pull request #21868 from rohitwaghchaure/delivery-date-not-allowed-to-change-after-submit
fix: allow on submit for the delivery date field not working for sale…
2020-05-25 11:11:11 +05:30
sahil28297
1f6c5c295f fix(patch): rerun remove_duplicate_leave_ledger_entries (#21874) 2020-05-22 15:52:46 +05:30
sahil28297
5d8dafc2ec fix(patch): rerun remove_duplicate_leave_ledger_entries (#21875) 2020-05-22 14:18:08 +05:30
Saurabh
34eb306e39 Merge pull request #21873 from frappe/sahil28297-patch-3
fix(patch): rerun remove_duplicate_leave_ledger_entries
2020-05-22 13:48:53 +05:30
sahil28297
439af124f9 fix(patch): rerun remove_duplicate_leave_ledger_entries 2020-05-22 13:42:55 +05:30
Sahil Khan
8abcf42e20 Merge branch 'v12-pre-release' into version-12 2020-05-22 13:37:26 +05:30
Sahil Khan
485f6cd7a2 bumped to version 12.9.2 2020-05-22 13:57:25 +05:50
Nabin Hait
5447decd9e fix: Remove duplicate leave ledger entry (#21870)
* fix: Remove duplicate leave ledger entry

* fix: Remove duplicate leave ledger entry
2020-05-22 13:13:09 +05:30
Nabin Hait
1287f16acd fix: Remove duplicate leave ledger entry (#21867) 2020-05-22 13:13:04 +05:30
Rohit Waghchaure
589c5335d1 fix: allow on submit for the delivery date field not working for sales order 2020-05-22 12:41:07 +05:30
Deepesh Garg
5f82999397 fix: Item tax template not getting mapped from source to traget doc (#21863) 2020-05-22 12:29:19 +05:30
Nabin Hait
115cedb8e9 fix: Remove duplicate leave ledger entry (#21864) 2020-05-22 12:27:19 +05:30
mergify[bot]
d2491e403b fix: convert goals point to flt (#21840) (#21858)
(cherry picked from commit 4c779300fd)

Co-authored-by: Anurag Mishra <32095923+Anurag810@users.noreply.github.com>
2020-05-22 11:43:14 +05:30
mergify[bot]
44d6ce49b5 fix: expense account error message in DN (#21851) (#21856)
Changed error message if expense account not set for item in Delivery Note.
Earlier: Expense or Difference account is mandatory for Item IT - 6 as it impacts overall stock value
After fix: Expense Account not set for Item IT - 6. Please set an Expense Account for the item in the Items table

(cherry picked from commit 1763d3e706)

Co-authored-by: Michelle Alva <50285544+michellealva@users.noreply.github.com>
2020-05-22 11:06:19 +05:30
sahil28297
7b795734e8 Merge pull request #21855 from frappe/mergify/bp/v12-pre-release/pr-21846
fix: set customer and supplier details using sql (bp #21846)
2020-05-22 11:05:40 +05:30
Chinmay Pai
b6bbd0efcf fix: set customer and supplier details using sql (#21846)
* fix: set customer and supplier details using sql

instead of slowing down the query with get_doc and save()
we can just use sql to update the required values for
customer and supplier

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: remove extra quote

Co-authored-by: Himanshu <himanshuwarekar@yahoo.com>

* fix: update sql query to include tabPrice List

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

Co-authored-by: Himanshu <himanshuwarekar@yahoo.com>
(cherry picked from commit baef43977b)
2020-05-22 05:29:49 +00:00
mergify[bot]
7522e598db fix: set customer and supplier details using sql (#21846) (#21854)
* fix: set customer and supplier details using sql

instead of slowing down the query with get_doc and save()
we can just use sql to update the required values for
customer and supplier

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: remove extra quote

Co-authored-by: Himanshu <himanshuwarekar@yahoo.com>

* fix: update sql query to include tabPrice List

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

Co-authored-by: Himanshu <himanshuwarekar@yahoo.com>
(cherry picked from commit baef43977b)

Co-authored-by: Chinmay Pai <chinmaydpai@gmail.com>
2020-05-22 10:59:16 +05:30
Marica
5ec0289d98 fix: Added Inactive serial no status (#21850) 2020-05-22 10:49:07 +05:30
Marica
576374a8a7 fix: Added Inactive serial no status (#21849) 2020-05-22 10:49:00 +05:30
mergify[bot]
030abc14a4 fix(patch): Handle single value in patch (#21823) (#21833)
(cherry picked from commit 5cef8db4db)

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2020-05-21 18:57:24 +05:30
Anurag Mishra
4c779300fd fix: convert goals point to flt (#21840) 2020-05-21 18:47:30 +05:30
sahil28297
c5921c605f fix(set_serial_no_status): auto commit on many writes (#21841) 2020-05-21 18:46:42 +05:30
sahil28297
da23bb6bf4 fix(set_serial_no_status): auto commit on many writes (#21843) 2020-05-21 18:46:38 +05:30
Sahil Khan
0c303c4f54 Merge branch 'v12-pre-release' into version-12 2020-05-21 15:26:42 +05:30
Sahil Khan
746e879187 bumped to version 12.9.1 2020-05-21 15:46:42 +05:50
Suraj Shetty
a24362a83f Merge pull request #21836 from frappe/surajshetty3416-patch-1 2020-05-21 15:25:18 +05:30
Suraj Shetty
69a5a7f11e fix(patch): Handle single value in patch 2020-05-21 15:23:06 +05:30
Sahil Khan
d062a4b6b5 Merge branch 'v12-pre-release' into version-12 2020-05-21 15:00:37 +05:30
Sahil Khan
ab79a9554b bumped to version 12.9.0 2020-05-21 15:20:37 +05:50
rohitwaghchaure
3e5a65e090 Merge pull request #21829 from marination/italian-invoice-import-hotfix
fix: Supplier Invoice No not fetched in Import Supplier Invoice
2020-05-21 14:23:20 +05:30
rohitwaghchaure
f5d8d6e4e6 Merge pull request #21830 from marination/italian-invoice-import-pre-release
fix: Supplier Invoice No not fetched in Import Supplier Invoice
2020-05-21 14:22:36 +05:30
rohitwaghchaure
fae4805d3f Merge pull request #21826 from marination/pick-list-dn-pre-release
fix: Fetch customer into Delivery Note from Pick List
2020-05-21 14:20:31 +05:30
rohitwaghchaure
bc55dafdae Merge pull request #21825 from marination/pick-list-dn-hotfix
fix: Fetch customer into Delivery Note from Pick List
2020-05-21 14:19:05 +05:30
marination
cb74ff870d fix: Supplier Invoice No not fetched in Import Supplier Invoice 2020-05-21 14:06:57 +05:30
marination
d1458c6c0a fix: Supplier Invoice No not fetched in Import Supplier Invoice 2020-05-21 14:06:14 +05:30
marination
3c84ef3b5e fix: Fetch customer into Delivery Note from Pick List 2020-05-21 13:18:06 +05:30
marination
a8b2f222ea fix: Fetch customer into Delivery Note from Pick List 2020-05-21 13:17:22 +05:30
Marica
2894640d56 fix: plc conversion rate set infinitely (#21822) 2020-05-21 12:08:15 +05:30
Marica
ee1c3831bc fix: plc conversion rate set infinitely (#21821) 2020-05-21 12:08:04 +05:30
rohitwaghchaure
fc5f5c8fd9 Merge pull request #21819 from rohitwaghchaure/tax-template-not-applied-if-valid-from-blank-hotfix
fix: item tax template not applied if valid from is blank
2020-05-21 10:24:33 +05:30
rohitwaghchaure
a45ff8e3ba Merge pull request #21818 from rohitwaghchaure/tax-template-not-applied-if-valid-from-blank
fix: item tax template not applied if valid from is blank
2020-05-21 10:22:37 +05:30
Rohit Waghchaure
2caac24071 fix: item tax template not applied if valid from is blank 2020-05-21 10:15:03 +05:30
Rohit Waghchaure
74dd64501c fix: item tax template not applied if valid from is blank 2020-05-21 10:09:42 +05:30
Deepesh Garg
bd8b94c9dd Merge pull request #21816 from deepeshgarg007/trial_balance_project_filter_pre
fix: Project filter in Trial Baalance Report
2020-05-20 22:28:53 +05:30
Deepesh Garg
928bc96d76 Merge pull request #21815 from deepeshgarg007/trial_balance_project_filter_v12
fix: Project filter in Trial Baalance Report
2020-05-20 22:28:35 +05:30
Deepesh Garg
d1569b9581 fix: Project filter in Trial Baalance Report 2020-05-20 22:20:23 +05:30
Deepesh Garg
67c9f00917 fix: Project filter in Trial Baalance Report 2020-05-20 22:18:30 +05:30
mergify[bot]
c75303b0ab feat: remove website settings from boot (#21801) (#21809)
(cherry picked from commit e091789332)

Co-authored-by: Shivam Mishra <scmmishra@users.noreply.github.com>
2020-05-20 18:24:05 +05:30
Anupam Kumar
ee56de3091 enable Allow Rename in sales stage (#21800) 2020-05-20 16:15:16 +05:30
Anupam Kumar
938cde30e3 enable Allow Rename in sales stage (#21803) 2020-05-20 16:14:58 +05:30
Marica
d53d6cabb4 fix: Validate Payment Gateway only if it exists in Payment Request. (#21806) 2020-05-20 16:13:38 +05:30
Marica
0550b3537d fix: Validate Payment Gateway only if it exists in Payment Request. (#21807) 2020-05-20 16:13:34 +05:30
Deepesh Garg
ea6f08cb26 Merge pull request #21798 from deepeshgarg007/general_ledger_against_voucher_v12_pre
fix: Against voucher in General Ledger
2020-05-20 11:32:13 +05:30
Deepesh Garg
96a05f65aa fix: Against voucher in General Ledger 2020-05-20 11:26:14 +05:30
rohitwaghchaure
0e63f4ba08 Merge pull request #21794 from deepeshgarg007/general_ledger_against_voucher_v12
fix: Against voucher in General Ledger
2020-05-20 10:30:20 +05:30
Deepesh Garg
74b943392b Merge pull request #21786 from anupamvs/sales-order-tax-hotfix
fix: tax id is not fetched when creating sales order from quotation
2020-05-19 21:49:34 +05:30
Anupam K
9245133b99 tax id is not fetched in when creating sales order from quoation 2020-05-19 21:37:19 +05:30
Deepesh Garg
05aae4341e fix: Against voucher in General Ledger 2020-05-19 20:59:51 +05:30
rohitwaghchaure
e85c3a50cd refactor: changed the fieldtype from data to small text (#21789) 2020-05-19 20:30:11 +05:30
Deepesh Garg
dc04d44a20 Merge pull request #21791 from deepeshgarg007/gst_1_instate_v1
fix: Tax amount in GSTR-1 JSON
2020-05-19 20:01:18 +05:30
Deepesh Garg
e2e5ba345c fix: Tax amount in GSTR-1 JSON 2020-05-19 19:56:51 +05:30
rohitwaghchaure
07924d3c7c refactor: changed the fieldtype from data to small text (#21783) 2020-05-19 19:05:17 +05:30
Deepesh Garg
bd29244d66 Merge pull request #21787 from deepeshgarg007/gst_1_instate
fix: Instate Invoice not appearing in GSTR-1 report
2020-05-19 19:04:11 +05:30
Deepesh Garg
b384ed74cd fix: Instate Invoice not appearing in GSTR-1 report 2020-05-19 18:53:08 +05:30
Shivam Mishra
72892a40d6 refactor: use text editor in issue web form (#21772) 2020-05-19 16:36:25 +05:30
Himanshu
8209507a8f fix: add naming series (#21775) 2020-05-19 16:02:41 +05:30
Himanshu
ca5384343f Merge pull request #21773 from scmmishra/issue-form-pre-12
refactor: use text editor in issue web form
2020-05-19 15:23:46 +05:30
Shivam Mishra
a4e92cf577 refactor: use text editor in issue web form 2020-05-19 15:12:18 +05:30
mergify[bot]
113048347c feat: save shipping address and contact to woocommerece customer (bp #21654) (#21771) 2020-05-19 14:36:29 +05:30
Himanshu
8b144a38cc fix: add naming series (#21770) 2020-05-19 14:27:01 +05:30
Nabin Hait
632c65cd59 chore: Added change log 2020-05-18 19:54:52 +05:30
Nabin Hait
70ab59f473 fix: merge conflict 2020-05-18 17:10:36 +05:30
Deepesh Garg
c4d6cca9f1 Merge pull request #21762 from frappe/mergify/bp/version-12-hotfix/pr-21761
fix: Validate Filters in Sales Funnel. (bp #21761)
2020-05-18 16:45:20 +05:30
Marica
795d318fcc fix: Validate Filters in Sales Funnel. (#21761)
* fix: Validate Filters in Sales Funnel.

* fix: Style fixes

(cherry picked from commit c734db5d45)
2020-05-18 09:15:45 +00:00
Himanshu
6dbb02d293 fix: show searchfields result (#21760) 2020-05-18 14:26:43 +05:30
rohitwaghchaure
ea4c91f51c fix: bom incorrect price list rate for raw material if price list currency is different from company currency (#21586)
* fix: bom incorrect price list rate for raw material if price list currency is different from company currency

* fixed test cases

* fixed base_rate calculation and added plc_conversion_rate trigger
2020-05-18 14:22:42 +05:30
Marica
395da09dae fix: Patch to set status in old serial no data (#21721)
* fix: Patch to set status in old serial no data

* fix: Avoid get_doc in patch

* fix: fetch all values and check status in one query
2020-05-18 11:18:56 +05:30
Raffael Meyer
9b08258955 fix: remove guest access (#21692) 2020-05-17 20:57:51 +05:30
rohitwaghchaure
7f2aedb67c fix: incorrect stock valuation for repack entry (#21737) 2020-05-17 20:28:21 +05:30
Anurag Mishra
1045dc49f5 fix: Future date half day validation (#21719)
* fix: Future date half day validation

* fix: Allow half day attendance only via leave application

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-05-17 20:17:39 +05:30
Deepesh Garg
a569fed4da Merge pull request #21746 from frappe/mergify/bp/version-12-hotfix/pr-21712
fix: error log title for failing bank transactions (bp #21712)
2020-05-16 17:15:05 +05:30
rohitwaghchaure
9af9b438af Merge pull request #21748 from rohitwaghchaure/fix-supplier-schema-save-issue-hotfix
fix: promotional scheme not able to save
2020-05-16 11:34:33 +05:30
Rohit Waghchaure
3e321d5c24 fix: promotional scheme not able to savce 2020-05-16 05:01:30 +05:30
Mangesh-Khairnar
e2f53cdc83 fix: error log title for failing bank transactions
(cherry picked from commit 4a9fd9ef6d)
2020-05-15 18:16:22 +00:00
Deepesh Garg
f9834504c8 Merge pull request #21745 from deepeshgarg007/coa_ux_v12
fix: Excel support and UX fixes for chart of accounts importer
2020-05-15 20:08:54 +05:30
Deepesh Garg
ec19926a97 Move logic for download template to dialog 2020-05-15 19:45:47 +05:30
Deepesh Garg
39790f05e7 fix: Linting fixes 2020-05-15 19:44:45 +05:30
Deepesh Garg
317b53a8b6 fix: Description on template selection 2020-05-15 19:44:36 +05:30
Deepesh Garg
101612e599 fix: Added template types for download 2020-05-15 19:44:27 +05:30
Deepesh Garg
838ed77797 fix: Blank chart preview 2020-05-15 19:44:18 +05:30
Deepesh Garg
8ff718249e fix: Linting Errors 2020-05-15 19:44:07 +05:30
Deepesh Garg
88c2ba54ab fix: Excel support and UX fixes for chart of accounts importer 2020-05-15 19:43:56 +05:30
rohitwaghchaure
a52fe009cc fix: user not able to view product (#21697) 2020-05-15 19:35:35 +05:30
Deepesh Garg
79b691fe18 fix: Better validation message for group accounts (#21726) 2020-05-15 19:23:16 +05:30
Deepesh Garg
29f1a219d1 Merge pull request #21743 from nextchamp-saqib/payment-remark-fix-v12
fix: update remark on submitting payment entry
2020-05-15 17:49:11 +05:30
Deepesh Garg
73e3ba2c30 Merge pull request #21744 from frappe/mergify/bp/version-12-hotfix/pr-21729
fix: Submit perm for other income and removed caching while getting hra and basic from company (bp #21729)
2020-05-15 17:47:10 +05:30
Nabin Hait
78f69e448b fix: Added submit permission in employee other income
(cherry picked from commit 200f80c3d3)
2020-05-15 11:28:08 +00:00
Nabin Hait
52890341d5 fix: Get basic and hra component from db, not from cache
(cherry picked from commit 10df3d5081)
2020-05-15 11:28:08 +00:00
Saqib Ansari
725684a0c3 fix: update remark on submitting payment entry 2020-05-15 16:39:45 +05:30
Deepesh Garg
dc59831aa9 Merge pull request #21700 from nextchamp-saqib/pur-inv-status-fix-v12
fix: purchase inv shows overdue for fraction of outstanding
2020-05-15 15:45:36 +05:30
Saqib Ansari
2fa841821a fix: add tests for set_status 2020-05-15 14:31:19 +05:30
rohitwaghchaure
3b14810564 Merge pull request #21714 from nextchamp-saqib/off-pos-tax-template-v12
fix: item tax template fetching in offline pos
2020-05-15 13:47:01 +05:30
Deepesh Garg
8ed066ba1f fix: Add misssing dimensions in GL entries (#21691)
* fix: Add misssing dimensions in GL entries

* fix: expnese_taxes_and_charges.json

* fix: Add project filter in trial balance report

* fix: Use current dimensions instead of dimensions from asset
2020-05-15 12:58:19 +05:30
Rohan
f344369068 format: better error messages for invalid coupon codes (v12) (#21598)
* format: better error messages for invalid coupon codes

* fix: remove unnecessary docstatus check
2020-05-15 12:09:16 +05:30
Mangesh-Khairnar
71d9a52a07 fix: duplicate leave expiry creation (#21506)
* fix: validate existing ledger entries to avoid duplicates

* patch: remove duplicate ledger entries created

* fix: consider only submitted ledger entries

* fix: delete duplicate leaves from the ledger

* fix: check if duplicate ledger entry exists

* chore: formatting changes

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-05-15 11:55:36 +05:30
Saqib Ansari
0af125f6fe fix: test 2020-05-15 05:26:41 +05:30
Saqib
b432f3358e fix: item price not fetching when customer is unset in item price (#21489)
* fix: item price not fetching when customer is unset in item price

* fix: item price of selling type has hidden supplier value

* fix: remove test variable

* fix: test

* Update erpnext/stock/get_item_details.py

Co-authored-by: Marica <maricadsouza221197@gmail.com>

* patch: invalid customer/supplier based on item price type

* fix: remove patches from develop branch

* fix: patch

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2020-05-15 04:25:10 +05:30
Saqib
441bb760ee Merge branch 'version-12-hotfix' into off-pos-tax-template-v12 2020-05-14 14:28:11 +05:30
Saqib
f69da75e33 Merge branch 'version-12-hotfix' into pur-inv-status-fix-v12 2020-05-14 14:27:44 +05:30
Saqib Ansari
12739ec464 fix: invalid conditional statement 2020-05-13 22:03:20 +05:30
Marica
6a317a8e78 fix: Add total rows in Report Purchase Order Items to be Received or Billed (#21711) 2020-05-13 18:58:03 +05:30
Saqib Ansari
cb1cc96210 fix: item tax template fetching in offline pos 2020-05-13 16:30:47 +05:30
Saqib Ansari
b47f5830f4 fix: purchase inv shows overdue for fraction of outstanding 2020-05-12 14:13:16 +05:30
mergify[bot]
855373a253 fix: Message for missing valuation rate (#21686) (#21688)
(cherry picked from commit 97715f2877)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2020-05-11 21:26:18 +05:30
mergify[bot]
c8ed6b1e79 fix: Run income-tax-slab patch only if slab already exists in payroll period (#21684) (#21687)
(cherry picked from commit 85a89812a4)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-05-11 19:29:18 +05:30
sahil28297
00bbc76605 fix(patch): use translated string while setting notification template (#21678) 2020-05-11 19:28:49 +05:30
rohitwaghchaure
0df4f1738c Merge pull request #21602 from anupamvs/lead-customer-issue-hotfix
fix: adding Email and Phone in Contact child table
2020-05-11 13:02:41 +05:30
rohitwaghchaure
12a2da49ee Merge pull request #21662 from marination/barcode-update-fix
fix: Item Barcode stays the same after updation.
2020-05-11 11:01:13 +05:30
rohitwaghchaure
65d6efdaee Merge pull request #21666 from anupamvs/assessment-issue-hotfix
fix: Assessment Plan not getting created
2020-05-11 07:17:28 +05:30
rohitwaghchaure
f861a3e720 Merge pull request #21603 from rohitwaghchaure/fix-completed-qty-in-work-order-hotfix
fix: work order operation completed qty
2020-05-11 07:07:16 +05:30
Deepesh Garg
767d17ce2f Merge pull request #21672 from deepeshgarg007/budget_variance_report_v12
Budget variance report v12
2020-05-10 17:31:41 +05:30
Deepesh Garg
0f455060ab fix: Formatting fixes 2020-05-10 17:27:29 +05:30
Kevin Chan
861f2726a2 fix: Simplify get_dimension_account_month_map
This commit updates get_dimension_account_month_map to no longer show
the actual expense when there is no budget. This also removes the other
functions and queries related to it. Spaces are also converted to tabs.
2020-05-10 17:27:01 +05:30
Kevin Chan
55640be627 fix: Fix Budget Variance Report
This commit fixes a bug in Budget Variance Report where it combines the
actual expense amounts across different fiscal years. This was fixed by
updating the function and queries for computing the actual expense
amounts.
2020-05-10 17:26:29 +05:30
Kevin Chan
d837b6cedc style: Improve formatting
This commit improves indentations and makes sql queries more readable.
2020-05-10 17:26:16 +05:30
Anupam K
27b2988938 Assessment Plan not getting created 2020-05-09 16:44:36 +05:30
Anupam K
c739c2d355 Appending Email and Phone in Child Table 2020-05-08 17:38:14 +05:30
marination
231f65ff59 fix: Item Barcode stays the same after updation. 2020-05-08 16:43:02 +05:30
Sahil Khan
626585e9f3 Merge branch 'v12-pre-release' into version-12 2020-05-08 15:42:18 +05:30
Sahil Khan
5afcc9c185 bumped to version 12.8.0 2020-05-08 16:02:18 +05:50
sahil28297
41ff2cb4a7 chore: correct link to documentation 2020-05-08 15:40:03 +05:30
sahil28297
664f536e9b chore: correct version for release note 2020-05-08 15:24:23 +05:30
Nabin Hait
923fcc7738 chore: Change log 2020-05-08 15:14:39 +05:30
rohitwaghchaure
368afc551d Merge pull request #21640 from MyuddinKhatri/lead-update-fix-hotfix
fix(crm): fix lead while updating contact details (hotfix)
2020-05-08 10:37:28 +05:30
rohitwaghchaure
3a328b0413 Merge pull request #21645 from anupamvs/lms-label-hotfix
fix: renaming LMS to Learning Management System
2020-05-08 10:29:54 +05:30
rohitwaghchaure
970b21075e Merge pull request #21650 from anupamvs/payment-order-hotfix
fix: Payment Order not allowing to create Payment Entry
2020-05-08 10:26:55 +05:30
Deepesh Garg
d769a2036b Merge pull request #21648 from ruchamahabal/remove-old-analytics-v12
fix: delete old appointment analytics tree grid report
2020-05-08 10:23:46 +05:30
Anupam K
56a3b9abc4 Payment Order not allowing to create Payment Entry 2020-05-08 02:25:09 +05:30
Rucha Mahabal
6844dd75da fix: delete old appointment analytics tree grid report 2020-05-07 23:40:17 +05:30
Anupam K
0b6ef55e78 renaming LMS to Learning Management System 2020-05-07 19:51:46 +05:30
sahil28297
9fa952d10e fix(patch): Reload GSTR 3B report 2020-05-07 19:28:33 +05:30
sahil28297
6d4f451d0d fix(patch): reload Expense Claim doctype 2020-05-07 19:28:17 +05:30
sahil28297
1c03d154ce fix(item): patch to rename duplicate item_code values to name (#21619) 2020-05-07 19:27:30 +05:30
Nabin Hait
2d430ec077 feat: Income tax slab (#21631)
* feat: Income tax slab (#21406)

* Feat: Multiple tax as per new taxation rule

* patch:for multiple tax slab, fix: payroll and exemption validation

* Test: Fixture

* feat: income tax slab with other charges and tax exempted deduction components

* fix: added missing init file

* fix: Patch fixed

* fix: Patch fixed

* fix: test fixes

* fix: validate duplicate exemption declaration

* fix: payment entry test case

Co-authored-by: Anurag Mishra <mishranaman123@gmail.com>

* fix: Income tax slab patch (#21448)

* fix: reload income_tax_slab_other_charges in patch

* fix: reload lower_deduction_certificate in patch

* fix: Consider any kind of exemptions only if tax exemptions are allowed on tax slab (#21475)

* fix: Tax calcualtion based on slab (#21497)

* fix: Desk links for Income Tax Slab and Employee Other Income (#21511)

* fix: patch

Co-authored-by: Anurag Mishra <mishranaman123@gmail.com>
2020-05-07 18:57:01 +05:30
Myuddin khatri
cd0fcfd84c solved merge conflicts 2020-05-07 16:11:08 +05:30
rohitwaghchaure
43118e3551 Merge pull request #21635 from TurkerTunali/patch-3
fix: Job Card submitted qty
2020-05-07 16:08:21 +05:30
Türker Tunalı
9bd6d119c4 fix: Job Card submitted qty
Update Operation Status function in work order was throwing exception without checking the "Overproduction Percentage For Work Order" setting. To submit Job Card qty for more than the Work Order's "To Manufacture Qty" we need to apply this fix.
2020-05-07 12:38:37 +03:00
sahil28297
2aa045865f fix(item): patch to rename duplicate item_code values to name (#21619) 2020-05-07 12:11:23 +05:30
rohitwaghchaure
ec3a462acd fix: list index out of range (#21614) 2020-05-07 12:06:05 +05:30
Deepesh Garg
a6066009aa Merge pull request #21520 from nextchamp-saqib/sales-report-total-row-v12
chore: add total row in sales analytics report
2020-05-06 10:50:53 +05:30
Deepesh Garg
60b19fe935 Merge branch 'version-12-hotfix' into sales-report-total-row-v12 2020-05-06 10:48:38 +05:30
Deepesh Garg
70b52c37d5 Merge pull request #21606 from frappe/sahil28297-patch-1
fix(patch): reload Expense Claim doctype
2020-05-05 20:21:23 +05:30
sahil28297
178ad9b4d6 fix(patch): reload Expense Claim doctype 2020-05-05 20:07:48 +05:30
Rohit Waghchaure
b4311a41c5 fix: work order operation completed qty 2020-05-05 16:36:31 +05:30
Anupam K
c6e0dbb1c4 Appending Email and Phone in Child Table 2020-05-05 16:26:05 +05:30
rohitwaghchaure
d476eb79b4 fix: against voucher no not all records showing in case of Group By Voucher (consolidated) (#21591) 2020-05-05 16:17:03 +05:30
Saqib
10ea82001f chore: fix error message (#21594)
* chore: fix error message

* chore: add row idx
2020-05-05 16:14:12 +05:30
Saqib
794bb6ebdd fix: handle make_gl_entry in case of cwip enable after puchasing (#21530)
* fix: handle make_gl_entry in case of cwip enable after puchasing

* fix: invalid variable assignment

* fix: make gl entries if cwip has been booked even if cwip is disabled
* add tests

* fix: conditions

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-05-05 16:12:10 +05:30
Saqib Ansari
c3a9513978 fix: test 2020-05-04 20:24:30 +05:30
Deepesh Garg
a4a019f9d9 Merge pull request #21584 from frappe/sahil28297-patch-3
fix(patch): Reload GSTR 3B report
2020-05-04 19:26:46 +05:30
sahil28297
67ed21d443 fix(patch): Reload GSTR 3B report 2020-05-04 19:23:26 +05:30
rohitwaghchaure
c89d750e5c fix: heatmap not working for customer and supplier (#21579) 2020-05-04 18:53:26 +05:30
mergify[bot]
c253f0621d fix: fieldname update for 'Credit' and 'Debit' (#21405) (#21577)
* fix: fieldname update for 'Credit' and 'Debit'

'credit' updated to 'credit_in_account_currency'
'debit' updated to 'debit_in_account_currency'

* Update journal_entry.py

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
(cherry picked from commit f7a0b8b5b6)

Co-authored-by: Andy Zhu <andy007yan@gmail.com>
2020-05-04 12:40:39 +05:30
Deepesh Garg
3202b0a486 fix: Accounting Dimensions in Period Closing Voucher (#21565) 2020-05-04 11:12:19 +05:30
Rucha Mahabal
4a37ee8908 fix(Healthcare): remove hardcoded UOM during Item creation for templates (#21575) 2020-05-04 11:09:19 +05:30
Rucha Mahabal
bdbfd2ad0c fix: handle exception if sending Appointment Confirmation message fails (#21568) 2020-05-04 11:07:10 +05:30
Deepesh Garg
933d1262f2 Merge pull request #21376 from marination/commonify-warehouse-autofill-hotfix
chore: Commonify autofilling warehouses in child tables
2020-05-03 20:34:20 +05:30
rohitwaghchaure
c4752e36eb Merge pull request #21517 from marination/stock-balance-cleanup-hotfix
chore: Added company filter and minor cleanup in Stock Balance Report
2020-05-03 16:31:58 +05:30
Saqib Ansari
0da919c091 fix: test 2020-05-03 14:53:40 +05:30
Saqib
12b5d72e70 chore: add validation for gross purchase amount (#21535)
* chore: add validation for gross purchase amount

* fix: tests
2020-05-03 13:20:30 +05:30
Saqib Ansari
272d2bc0b3 fix: review fixes 2020-05-02 19:51:09 +05:30
Saqib Ansari
55b7904e2f fix: incorrect total in sales analytics for customer/item group 2020-05-02 19:39:42 +05:30
Marica
ed709b36b4 fix: variable referenced before assignment (#21561) 2020-05-02 17:55:47 +05:30
Saqib
bf1fc47564 fix: accounts payable shows advance amount of other company (#21549) 2020-05-01 18:15:20 +05:30
Deepesh Garg
db6953dc78 fix: Party Type filter in payment entry list view (#21542) 2020-05-01 15:01:04 +05:30
rohitwaghchaure
438e0f5d49 fix: 'NoneType' object is not iterable (#21538) 2020-05-01 10:50:02 +05:30
rohitwaghchaure
5a9476e0d4 Merge pull request #21502 from nextchamp-saqib/validate-paid-inv-msg-v12
chore: validate and warn payment against paid invoices
2020-05-01 10:37:32 +05:30
marination
f77a735469 fix: Make Company the first filter 2020-05-01 00:04:49 +05:30
Saqib Ansari
4451b7eda9 chore: calculate total row month-wise in sales analytics 2020-04-30 20:07:12 +05:30
mergify[bot]
426f0bc168 fix: only check for payment_account on bank entry (#21445) (#21518)
* fix: only check for payment_account on bank entry

Since all the fields (company, start and end date are mandatory before form submission, there is no need to check for them again after submission.

* fix: cur_frm to frm

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
(cherry picked from commit 95b186268c)

Co-authored-by: Michelle Alva <50285544+michellealva@users.noreply.github.com>
2020-04-30 19:53:59 +05:30
Saqib
a8b87ccce0 chore: asset accounts should have company currency (#21525) 2020-04-30 18:39:16 +05:30
Saqib Ansari
c31fc19f08 chore: add total row in sales analytics report 2020-04-30 16:29:21 +05:30
marination
5e817b2aee chore: Added company filter and minor cleanup in Stock Balance Report 2020-04-30 14:05:24 +05:30
Saqib Ansari
393857d7de chore: handle credit note validation 2020-04-30 13:24:51 +05:30
Saqib
0ffff47b64 feat: force cost center renaming from cost center form (#21504) 2020-04-30 11:29:03 +05:30
Saqib
6397590f07 fix: list index out of range error (#21468)
* fix: list index out of range error

* fix: condition
2020-04-30 11:04:51 +05:30
Nabin Hait
2620ac31f9 fix: Desk links for Income Tax Slab and Employee Other Income (#21511) 2020-04-30 11:03:57 +05:30
Nabin Hait
22c4f82fc6 fix: Tax calcualtion based on slab (#21497) 2020-04-30 11:03:01 +05:30
Nabin Hait
ae5414fced fix: Consider any kind of exemptions only if tax exemptions are allowed on tax slab (#21475) 2020-04-30 11:02:45 +05:30
Saqib
61584c8601 fix: print heading field shown in gst section for india region (#21500)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-04-30 10:58:01 +05:30
rohitwaghchaure
99dfe6c571 Merge pull request #21469 from Alchez/v12-update-lead-contact
fix: update lead if contact details are changed (v12)
2020-04-29 22:14:24 +05:30
Saqib Ansari
fd1ab37bc8 chore: validate and warn payment against paid invoices 2020-04-29 15:20:05 +05:30
Rohan Bansal
bd969477b1 fix: AttributeError 2020-04-29 13:09:16 +05:30
Deepesh Garg
a816788039 Merge pull request #21494 from deepeshgarg007/item_wise_sale_purchase_v12
fix: Group by filter fix in item wise sales and purchase register
2020-04-29 12:36:22 +05:30
Deepesh Garg
c099a410c8 fix: Group by filter fix in item wise sales and purchase register 2020-04-29 12:21:52 +05:30
Anurag Mishra
e33c44ae33 fix: Permission issue Employee Tax exemption (#21492) 2020-04-29 12:13:26 +05:30
Marica
4930233bbe Merge branch 'version-12-hotfix' into commonify-warehouse-autofill-hotfix 2020-04-29 11:36:48 +05:30
Deepesh Garg
e383727394 Merge pull request #21487 from rohitwaghchaure/not-able-to-make-payment-request-against-fees-hotfix
fix: payment request not able to make against fees
2020-04-29 09:36:55 +05:30
Rohit Waghchaure
3d2dcd8c59 fix: payment request not able to make against fees 2020-04-29 02:29:43 +05:30
Deepesh Garg
6647f45eb5 Merge pull request #21477 from deepeshgarg007/duplicate_code_v12
fix: Remove duplicate code from accounting dimension
2020-04-28 20:32:36 +05:30
Deepesh Garg
bd9625d150 fix: Remove duplicate code from accounting dimension 2020-04-28 20:26:56 +05:30
marination
c832291bd6 fix: Handle empty child table 2020-04-28 19:23:13 +05:30
Rohan Bansal
7c67c38bc5 fix: update lead if contact details are changed 2020-04-28 16:12:02 +05:30
Rucha Mahabal
8076deb080 Merge pull request #21465 from akurungadam/patch-3
fix: clinical procedure - set stock entry type
2020-04-28 15:37:30 +05:30
Anoop
dd8566ecde fix: clinical procedure - set stock entry type
clinical procedure - complete and consume - set stock entry type to "Material Issue"

report -
https://discuss.erpnext.com/t/cant-complete-and-consume/60927
2020-04-28 14:52:10 +05:30
Marica
fa7d496413 fix: Blanket Order in SO/PO child tables (#21444) 2020-04-28 13:00:51 +05:30
Deepesh Garg
3b8ad79445 Merge pull request #21458 from deepeshgarg007/gross_profit_width_v12
fix: Default column width in Gross profit report
2020-04-28 12:36:00 +05:30
Deepesh Garg
558c3284a0 fix: Default column width in Gross profit report 2020-04-28 12:03:05 +05:30
Nabin Hait
95f7807b78 fix: Income tax slab patch (#21448)
* fix: reload income_tax_slab_other_charges in patch

* fix: reload lower_deduction_certificate in patch
2020-04-28 11:15:57 +05:30
Deepesh Garg
6ece7fe265 Merge pull request #21438 from deepeshgarg007/ewb_bill_error_message_v12
fix: E-Way bill error message
2020-04-27 15:04:45 +05:30
Deepesh Garg
5aa2241439 fix: Test 2020-04-27 14:06:38 +05:30
Deepesh Garg
68d7b77314 fix: Utils messsage cleanup 2020-04-27 11:16:39 +05:30
Deepesh Garg
93e8b5d87e fix: E-way bill fix in List view 2020-04-27 11:15:23 +05:30
Deepesh Garg
6b082b5edb fix: E-way bill fix in sales invoice 2020-04-27 11:15:04 +05:30
Rucha Mahabal
093720b870 fix: add hook for sending appointment reminders in v12 (#21432) 2020-04-27 10:36:11 +05:30
Rucha Mahabal
e1697fd9cc Merge pull request #21429 from akurungadam/patch-2
fix: name 'patient' is not defined
2020-04-27 00:42:39 +05:30
Anoop
c2f952045c fix: name 'patient' is not defined
possible escape while refactoring, fixed in develop added here.

Reported via -
https://discuss.erpnext.com/t/healthcare-outpatient-sms-alert-error/60812
2020-04-27 00:33:26 +05:30
Nabin Hait
2b5bca4ce6 fix: Procurement tracker report (#21422)
* fix: procurement report data was not coming

* fix: leave allocation minor issue
2020-04-26 23:28:54 +05:30
Himanshu
de6f0f7a05 fix: add quality inspection template (#21424) 2020-04-26 23:27:29 +05:30
Anurag Mishra
1f3584b9a8 refactor: employee leave balance report v12 (#21282)
* fix: Employee Balance repor fixes

* refactor: Employee Leave Balance report For Version-12

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-04-26 21:05:09 +05:30
Deepesh Garg
5bfdf0af4d feat: Allow tax withholding category selection at invoice level (#20871)
* feat: Allow tax withholding category selection at invoice level

* fix: Linitng fixes

* feat: TDS calculation using common PAN

* fix: Add provision to deduct Lower TDS in purchase invoice

* fix: Consider only ref docs company while computing TDS

* fix: Default permission fixes

* fix: Add validation for dates in fiscal year

* fix: Undefined variable
2020-04-26 20:10:16 +05:30
rohitwaghchaure
14a50a9403 Merge pull request #21390 from marination/stock-entry-qty-hotfix
fix: Issues on qty trigger in Stock Entry Detail
2020-04-26 18:00:07 +05:30
marination
b724fec6c9 fix: Remove callback outside if condition 2020-04-26 17:18:41 +05:30
Nabin Hait
1d5ea4feee feat: Income tax slab (#21406)
* Feat: Multiple tax as per new taxation rule

* patch:for multiple tax slab, fix: payroll and exemption validation

* Test: Fixture

* feat: income tax slab with other charges and tax exempted deduction components

* fix: added missing init file

* fix: Patch fixed

* fix: Patch fixed

* fix: test fixes

* fix: validate duplicate exemption declaration

* fix: payment entry test case

Co-authored-by: Anurag Mishra <mishranaman123@gmail.com>
2020-04-26 12:37:52 +05:30
Saqib
7fedff260d fix: (ux) set jv voucher type depending on mode of payment (#21412) 2020-04-26 09:41:02 +05:30
rohitwaghchaure
9fc78e44ea Merge pull request #21402 from DeeMysterio/hotfix-si-actual-qty
feat(accounting): show actual qty for warehouse in sales invoice
2020-04-25 01:19:04 +05:30
Diksha Jadhav
be97087d32 feat(accounting): show actual qty for warehouse in sales invoice 2020-04-24 21:09:59 +05:30
Rucha Mahabal
b0f829e541 Merge pull request #21381 from anupamvs/email-camp-end-date-hotfix
fix: set end_date in Email Campaign
2020-04-24 20:44:18 +05:30
Rucha Mahabal
0455a96dcd Merge branch 'version-12-hotfix' into email-camp-end-date-hotfix 2020-04-24 20:04:55 +05:30
Deepesh Garg
d771ba2895 Merge pull request #21398 from nextchamp-saqib/tax-breakup-for-cn-v12
fix: show positive taxes in credit notes
2020-04-24 19:01:46 +05:30
rohitwaghchaure
c8e5b42dba Merge pull request #21395 from nextchamp-saqib/price-rule-fix
fix: rate gets overwritten when pricing rule is set
2020-04-24 16:46:47 +05:30
Saqib Ansari
424dbef139 fix: rate gets overwritten when pricing rule is set 2020-04-24 16:40:03 +05:30
Saqib Ansari
6256ca81b1 fix: show positive taxes in credit notes 2020-04-24 16:01:11 +05:30
marination
fda451f3e3 fix: Issues on qty trigger in Stock Entry Detail 2020-04-23 20:35:18 +05:30
Rucha Mahabal
2307385210 Merge branch 'version-12-hotfix' into email-camp-end-date-hotfix 2020-04-23 19:42:04 +05:30
Deepesh Garg
bd4b5da11b feat: Payment allocation based on payment terms (#20946)
* feat: Payment allocation based on payment terms

* fix: Add desccription for checkbox

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-04-23 16:09:08 +05:30
Sahil Khan
7ed7c3237a Merge branch 'v12-pre-release' into version-12 2020-04-23 13:55:06 +05:30
Sahil Khan
522cf08f67 bumped to version 12.7.1 2020-04-23 14:15:06 +05:50
Anupam K
ef7f9c6ecc Review changes 2020-04-23 13:45:19 +05:30
Anupam K
097c643a59 setting end date in email campaign 2020-04-23 12:29:00 +05:30
Deepesh Garg
dd560d676e fix: Budget against accounting dimensions (#21269)
* fix: Budget warning against custom accounting dimension

* fix: Codacy
2020-04-23 10:35:35 +05:30
rohitwaghchaure
794fd75ca1 fix: bom update cost is not working (#21348)
* fix: bom update cost is not working

* added test case for bom cost
2020-04-23 09:48:31 +05:30
rohitwaghchaure
015e1c123c fix: patch and validation message to fix target warehouse issue (#21370) 2020-04-23 09:46:12 +05:30
rohitwaghchaure
f49e66e721 fix: BOM stock report (#21377)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-04-23 09:45:26 +05:30
rohitwaghchaure
8fd1e08763 fix: incorrect out value in stock balance due to precision issue (#21378) 2020-04-23 09:44:54 +05:30
marination
c5d108c954 chore: Commonify autofilling warehouses in child tables 2020-04-23 00:38:19 +05:30
rohitwaghchaure
f2c43ca81e fix: patch and validation message to fix target warehouse issue (#21359) 2020-04-22 16:08:36 +05:30
Deepesh Garg
9d6ee99d99 Merge pull request #21368 from scmmishra/cal-report-12
fix: specify column width
2020-04-22 12:03:35 +05:30
Shivam Mishra
0578cf5a73 fix: specify column width 2020-04-22 11:53:18 +05:30
Michelle Alva
499f9198b9 fix: better error message due date (#21366) 2020-04-22 11:37:09 +05:30
Deepesh Garg
4daab871d5 Merge pull request #21354 from anupamvs/error-message-changes-hotfix
fix: Add better error message
2020-04-22 09:28:16 +05:30
Deepesh Garg
17585710b2 Merge pull request #21360 from rohitwaghchaure/fixed-unsupported-operand-type-issue
fix: unsupported operand type issue in pricing rule
2020-04-22 08:43:29 +05:30
Rohit Waghchaure
56e7887511 fix: unsupported operand type issue in pricing rule 2020-04-22 02:45:55 +05:30
Anupam K
08c782709a Better error message 2020-04-21 17:03:56 +05:30
Anupam Kumar
fb20982194 fix: on item change UOM not updated (#21254)
* fix: on item change UOM not updated

* removing uom from js
2020-04-21 12:57:08 +05:30
Marica
9453add3dd fix: Re-order Item Error Email format (#21343)
* fix: Re-order Item Error Email format

* fix: Translated strings
2020-04-21 12:53:17 +05:30
rohitwaghchaure
c62cf98d7e fix: scrap items order not showing correctly in stock entry (#21347) 2020-04-21 11:26:49 +05:30
rohitwaghchaure
ea8e302833 Merge pull request #21339 from scmmishra/issue-list-context-12
fix: filters as dictionary
2020-04-21 01:25:34 +05:30
rohitwaghchaure
5d3fd9dc43 Merge pull request #21344 from rohitwaghchaure/fixed_free_item_qty_hotfix
fix: free item quantity issue
2020-04-21 01:08:13 +05:30
rohitwaghchaure
c9ba147615 Merge pull request #21323 from marination/pick-list-enhance-hotfix
Pick list enhance hotfix
2020-04-21 01:07:50 +05:30
Rohit Waghchaure
7ef57533ec fix: free item quantity issue 2020-04-21 00:19:19 +05:30
gavin
712abe4cd2 Merge pull request #21338 from gavindsouza/tally-migration-fixes-v12
fix: Tally migration
2020-04-20 19:30:40 +05:30
Shivam Mishra
1a93977ef7 fix: filters as dictionary 2020-04-20 13:56:20 +05:30
Gavin D'souza
fc078c1d45 style: removed unused imports and updated formatting 2020-04-20 12:57:59 +05:30
Gavin D'souza
77532b96b8 fix: strip data fields of whitespaces 2020-04-20 12:57:48 +05:30
Gavin D'souza
4171c5ceeb fix(tally-migration): DocType improvement 2020-04-20 12:57:36 +05:30
Gavin D'souza
fa07e0fb9d fix: handle errors in enqueued methods and update status 2020-04-20 12:57:24 +05:30
Raffael Meyer
e80702b6c2 fix(regional): backport DATEV fix (#21281)
* fix: quote nonnumeric values

* fix(DATEV Settings): restrict max length of IDs

* fix: display Columns as Dynamic Link instead of as Data

* fix: add column "Belegfeld 1"

* fix: truncate column Buchungstext to 60 chars

* fix: make header compatible to current DATEV Format 7.00

* fix: column names and descriptions
2020-04-19 20:16:18 +05:30
Nabin Hait
7345b8494d fix: removed unwanted method call from scheduler 2020-04-19 19:29:47 +05:30
Nabin Hait
5817adbb64 fix: Valid warehouse in woocommerce syncing and other small fixes (#21332)
* fix: Valid warehouse in woocommerce syncing

* fix: dmall fixes in gross & net profit report

* fix: company is required for getting party details

* fix: None issue while getting raw material rate based on last purchase rate
2020-04-19 19:28:32 +05:30
Anoop
4de4cb055f fix: removed reference to method not in version-12 (#21335)
removed scheduler event incorrectly added in this version.

as reported on discuss -
https://discuss.erpnext.com/t/internal-server-error-and-healthcare-module-missing/60479/6?u=akurungadam
2020-04-19 19:26:31 +05:30
Deepesh Garg
19c841eb64 fix: Total amount field ordering in transactions (#21315) 2020-04-18 22:14:14 +05:30
Deepesh Garg
5f10e0ac26 Merge pull request #21329 from rohitwaghchaure/fixed-account-name-in-gl_print-hotfix
fix: account name not showing in the gl print
2020-04-18 20:41:03 +05:30
Rohit Waghchaure
64bb910015 fix: account name not showing in the gl print 2020-04-18 19:04:20 +05:30
marination
6b7848232c fix: Use reload_doc in patch 2020-04-17 21:49:25 +05:30
marination
b9df3793fb fix: Commonified code and added server side validation 2020-04-17 21:47:58 +05:30
marination
09f95858c0 fix: Added patch to patches.txt 2020-04-17 21:47:41 +05:30
marination
fcd7548220 fix: Pick List Enhancements 2020-04-17 21:45:58 +05:30
sahil28297
9989bfe2dc Merge pull request #21322 from Thunderbottom/gl-entry-fix
fix: add label to gl entry
2020-04-17 20:26:23 +05:30
Mangesh-Khairnar
4af9ab702f fix: add label to gl entry 2020-04-17 20:22:28 +05:30
Deepesh Garg
b882d7046b Merge pull request #21321 from Mangesh-Khairnar/gl-entry-label-fix
fix: add label to gl entry
2020-04-17 19:59:19 +05:30
Mangesh-Khairnar
b33f82d4e8 fix: add label to gl entry 2020-04-17 19:55:20 +05:30
rohitwaghchaure
e8bd7c0233 Merge pull request #21317 from sahil28297/fix_italy_einvoicing_v12_pre_release
fix(patch): reload 'Import Supplier Invoice' doc
2020-04-17 13:33:55 +05:30
rohitwaghchaure
cfb00fb887 Merge pull request #21314 from sahil28297/fix_italy_einvoicing_v12_hotfix
fix(patch): reload 'Import Supplier Invoice' doc
2020-04-17 13:29:12 +05:30
rohitwaghchaure
2128dc8d87 Merge pull request #21316 from sahil28297/fix_italy_einvoicing_v12
fix(patch): reload 'Import Supplier Invoice' doc
2020-04-17 13:28:22 +05:30
Sahil Khan
46ae415923 fix(patch): reload 'Import Supplier Invoice' doc 2020-04-17 13:24:28 +05:30
Sahil Khan
21b34b9607 fix(patch): reload 'Import Supplier Invoice' doc 2020-04-17 13:22:28 +05:30
Sahil Khan
44f0c077ff fix(patch): reload 'Import Supplier Invoice' doc 2020-04-17 13:15:15 +05:30
Sahil Khan
d959463cbc Merge branch 'v12-pre-release' into version-12 2020-04-17 11:27:54 +05:30
Sahil Khan
e6d02ecd7f bumped to version 12.7.0 2020-04-17 11:47:54 +05:50
Nabin Hait
3b2aa5ead3 fix: requested qty for customer provided item and rate for sales (#21300)
* fix: requested qty for customer provided item and rate for sales

* fix: requested qty for material transfer

* fix: customer provided item can be sales item

* fix: requested qty test cases
2020-04-17 10:52:23 +05:30
Nabin Hait
4770626bbd fix: requested qty for customer provided item and rate for sales (#21301)
* fix: requested qty for customer provided item and rate for sales

* fix: requested qty for material transfer

* fix: customer provided item can be sales item

* fix: requested qty test cases
2020-04-17 10:52:18 +05:30
rohitwaghchaure
df045e9f6d Merge pull request #21308 from rohitwaghchaure/fixed_job_card_time_issue_pre_release
fix: job card timer issue
2020-04-17 00:56:16 +05:30
rohitwaghchaure
2c045179a3 Merge pull request #21310 from rohitwaghchaure/fixed_timer_issue_version_12_hotfix
fix: job card timer issue
2020-04-17 00:55:50 +05:30
Rohit Waghchaure
da83af1213 fix: job card timer issue 2020-04-17 00:54:20 +05:30
Rohit Waghchaure
c10c920914 fix: job card time issue 2020-04-17 00:48:08 +05:30
rohitwaghchaure
61fc2d3263 fix: job card time issue (#21306) 2020-04-16 23:57:49 +05:30
rohitwaghchaure
a66be0f5c5 Merge pull request #21295 from nabinhait/b12-7-pre-release-fix1
fix: requested qty calculation and some other small fixes
2020-04-16 19:19:17 +05:30
rohitwaghchaure
fd99cc8494 Merge pull request #21294 from nabinhait/b12-7-pre-release-1
fix: requested qty calculation and some other small fixes
2020-04-16 19:18:54 +05:30
Nabin Hait
cf1f777ae2 Merge branch 'version-12-hotfix' into b12-7-pre-release-fix1 2020-04-16 19:08:35 +05:30
Nabin Hait
9ea9ed4256 Merge branch 'v12-pre-release' into b12-7-pre-release-1 2020-04-16 19:07:45 +05:30
Deepesh Garg
c7b5309dcd Merge pull request #21105 from nextchamp-saqib/asset-cat-validation-v12
fix: no server side validations for accounts in asset category
2020-04-16 16:25:37 +05:30
Saqib
65eea97e0c fix: serial and batch selection from delivery note bug fix (#21293) 2020-04-16 16:22:16 +05:30
Saqib
45d454b14d fix: serial and batch selection from delivery note bug fix (#21292) 2020-04-16 16:21:54 +05:30
Saqib Ansari
f390b8062c fix: incorrect transalation 2020-04-16 16:16:58 +05:30
Nabin Hait
90adf076f3 fix: Made received qty readonly and no-copy 2020-04-16 14:30:26 +05:30
Nabin Hait
2b6942d9ce fix: Made release date mandatory 2020-04-16 14:30:18 +05:30
Nabin Hait
4dca806737 fix: requested qty calculation fix for UOM 2020-04-16 14:28:22 +05:30
Nabin Hait
bd57cbda03 fix: requested qty calculation fix for UOM 2020-04-16 14:27:25 +05:30
Nabin Hait
31c8f8e795 chore: added change log v12.7.0 (#21289) 2020-04-16 12:46:42 +05:30
Nabin Hait
ccfc005932 fix: Made received qty readonly and no-copy 2020-04-16 11:25:15 +05:30
Nabin Hait
b4dfc8e1bf fix: Made release date mandatory 2020-04-16 11:24:43 +05:30
Deepesh Garg
3379cac956 Merge branch 'version-12-hotfix' into asset-cat-validation-v12 2020-04-16 11:23:21 +05:30
Deepesh Garg
ed48755a6f Merge pull request #21266 from vishdha/chart_account_hotfix
fix: Chart of account importer UX improved
2020-04-16 11:21:44 +05:30
vishdha
c43e759b87 fix: fix Transalation 2020-04-16 11:12:52 +05:30
rohitwaghchaure
05e9af60bd Merge pull request #21284 from marination/stock-entry-get-items-mr-hotfix
fix: Fetch Material Requests with type Issue as well in Stock Entry via Get Items from
2020-04-16 00:33:15 +05:30
Marica
3635b17f22 Merge pull request #21287 from nextchamp-saqib/warehouse-fix-pre-release
fix: warehouse unset when cannot find item warehouse
2020-04-15 23:56:39 +05:30
Marica
de9220568e Merge pull request #21286 from nextchamp-saqib/warehouse-fix
fix: warehouse unset when cannot find item warehouse
2020-04-15 23:55:52 +05:30
Saqib Ansari
5d3e211531 fix: warehouse unset when cannot find item warehouse
* cannot set delivery date when all items gets deleted and new are added
2020-04-15 22:10:00 +05:30
Saqib Ansari
bde676ef74 fix: pos not accessible without default customer 2020-04-15 22:09:50 +05:30
Saqib Ansari
4879858657 fix: warehouse unset when cannot find item warehouse
* cannot set delivery date when all items gets deleted and new are added
2020-04-15 22:08:12 +05:30
Saqib Ansari
773eb6ce68 fix: pos not accessible without default customer 2020-04-15 22:08:04 +05:30
marination
8e1201d31e fix: Fetch Material Requests with type Issue as well in Stock Entry via Get Items from 2020-04-15 21:25:12 +05:30
rohitwaghchaure
18a04a24b3 Merge pull request #21278 from marination/default-item-manufacturer-pre-release
feat: Provision to set Default Item Manufacturer
2020-04-15 16:47:47 +05:30
marination
64f053d583 feat: Provision to set Default Item Manufacturer
- Is Default checkbox added in Item Manufacturer
- Default Item Manufacturer and Part No fields added to Item Master
- Manufacturer Part No field editable in all child tables with validation
- Manufacturer and Part No auto fetched via get_item_details in child table
2020-04-15 16:43:41 +05:30
rohitwaghchaure
bf401290d1 Merge pull request #21218 from marination/default-item-manufacturer-hotfix
feat: Provision to set Default Item Manufacturer
2020-04-15 16:36:01 +05:30
Nabin Hait
1fc8de32f1 fix: merge conflict 2020-04-14 20:31:50 +05:30
rohitwaghchaure
09f6199b36 fix: pick list test (#21267) 2020-04-14 19:43:26 +05:30
Rohan
b0f000b1c8 fix: order_type validation restriction (#18096) (#21264)
Co-authored-by: Don-Leopardo <46027152+Don-Leopardo@users.noreply.github.com>
2020-04-14 19:42:21 +05:30
Nabin Hait
49b653b444 fix: merge conflict 2020-04-14 19:34:48 +05:30
Nabin Hait
107229de04 fix: Fixed expense claim payment status 2020-04-14 19:33:05 +05:30
vishdha
af33f71562 fix: message bold 2020-04-14 17:20:48 +05:30
vishdha
25c26b5904 fix: Chart of account importer UX improved 2020-04-14 17:20:48 +05:30
Deepesh Garg
1112bd0f23 Merge pull request #21260 from Alchez/v12-stock-available-order-desk
fix: [minor] show stock UOM in POS (v12)
2020-04-14 17:00:49 +05:30
rohitwaghchaure
8c931e4185 Merge pull request #21263 from rohitwaghchaure/fixed_stock_reco_test_case
fix: stock reco test case
2020-04-14 14:50:49 +05:30
Rohit Waghchaure
5771aabc49 fix: stock reco test case 2020-04-14 14:49:47 +05:30
Rohan Bansal
954c6540fd fix: show stock UOM in POS 2020-04-14 14:22:10 +05:30
rohitwaghchaure
4eea8bd2c0 fix: on changing qty free item not removed (#21250) 2020-04-14 12:49:38 +05:30
Marica
335d35a988 fix: Lead Contact with blank first name via Customer (#21248) 2020-04-14 11:53:00 +05:30
Faris Ansari
2833db559e fix: Set Price List in case of User Permissions (#21238)
Frontport of #18968
2020-04-14 11:50:54 +05:30
rohitwaghchaure
3d667bfe55 fix: minor issues (#21203) 2020-04-14 11:48:56 +05:30
Marica
7841653a03 fix: Project Update Email Error (#21209)
* fix: Project Update Email Error

* fix: Removed mandatory depends on

Co-authored-by: Himanshu <himanshuwarekar@yahoo.com>
2020-04-14 11:47:22 +05:30
Saqib
02a9b5a8a5 chore: hide redundant base received amount (#21229)
* fix: formatting

* chore: hide redundant base received amount
2020-04-14 11:45:56 +05:30
Vishal Dhayagude
4b1d0d19fb fix: str object not callable (#21228) 2020-04-14 11:42:22 +05:30
Mangesh-Khairnar
8b31e3ec2a fix: consider revereted expired leaves entry (#21256) 2020-04-14 09:33:53 +05:30
Marica
b2ba5dbd6a Merge pull request #21214 from vishdha/batch_message
fix(UX): batch error message improved
2020-04-13 15:38:59 +05:30
Marica
b2a9413c06 Merge branch 'version-12-hotfix' into batch_message 2020-04-13 13:20:43 +05:30
vishdha
1b15734bd8 fix: batch message ux improved 2020-04-13 12:36:54 +05:30
Deepesh Garg
725d6b235f Merge pull request #21241 from mujeerhashmi/v12_gstr_3b_report_fix
fix: GSTR 3B Report tax amount calculation
2020-04-13 11:05:24 +05:30
Syed Mujeer Hashmi
87c6b6d12f fix: GSTR 3B Report tax amount calculation
The tax amount after discount amount should be considered for tax
calculation.

Fixes #21231

Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>
(cherry picked from commit 58a16f1a3b)
2020-04-11 22:56:00 +05:30
Deepesh Garg
703e20df79 Merge pull request #21178 from nextchamp-saqib/purchase-register-filters-v12
feat: (minor) purchase register filters
2020-04-11 18:12:20 +05:30
Saqib Ansari
ae8a0940f5 fix: cannot iterate over dict_keys 2020-04-11 18:12:13 +05:30
Saqib Ansari
de423f8183 Merge branch 'asset-cat-validation-v12' of https://github.com/nextchamp-saqib/erpnext into asset-cat-validation-v12 2020-04-11 18:11:42 +05:30
Nabin Hait
c7bf050e8b Merge branch 'version-12-hotfix' into asset-cat-validation-v12 2020-04-11 10:21:17 +05:30
Deepesh Garg
9d0af22b88 Merge pull request #21202 from marination/serial-no-status-hotfix
fix: Added Status field in Serial No for filter and report builder
2020-04-10 20:48:45 +05:30
Deepesh Garg
073d1c4c13 fix: SQL ssyntax error 2020-04-10 20:33:03 +05:30
Deepesh Garg
c4115c19e4 Merge branch 'version-12-hotfix' of https://github.com/frappe/erpnext into purchase-register-filters-v12 2020-04-10 20:32:30 +05:30
Saqib Ansari
39b8e150bf fix: travis 2020-04-10 12:39:34 +05:30
marination
849ec84852 feat: Provision to set Default Item Manufacturer
- Is Default checkbox added in Item Manufacturer
- Default Item Manufacturer and Part No fields added to Item Master
- Manufacturer Part No field editable in all child tables with validation
- Manufacturer and Part No auto fetched via get_item_details in child table
2020-04-09 14:50:03 +05:30
rohitwaghchaure
38896efd6d Merge pull request #21157 from marination/mr-customer-provided-to-stock-entry-hotfix
fix: Mapping Customer Provided Material Request to Stock Entry
2020-04-09 13:19:41 +05:30
Marica
b225ffa003 fix: Error on any new doc from Shipping Rule. (#21207) 2020-04-09 12:01:29 +05:30
vishdha
c3bb5a97f8 fix: item_name added for message 2020-04-09 11:25:02 +05:30
marination
cdd589a58a fix: Status field in Serial No for filter and report builder 2020-04-08 16:08:09 +05:30
Mangesh-Khairnar
bf5c7fc4d3 fix(MWS): add new regions to marketplace (#21195)
* fix(MWS): add marketplace region for uae

* fix: rename the fields for mws integrations

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-04-08 12:56:22 +05:30
Saqib
27eba1fc61 fix: cannot find accounting module while rendering breadcrumb (#21191) 2020-04-08 11:49:34 +05:30
Nabin Hait
95b6e8afda fix: Replace newlines with spaces before evaluation of condition and formula (#21166) 2020-04-08 09:34:39 +05:30
Saqib
7c1f2ce4eb fix: [ux] enforce 'get references from' in payment order (#21176) 2020-04-08 09:20:41 +05:30
rohitwaghchaure
af64300c18 Merge pull request #21066 from marination/bin-requested-qty-hotfix
fix: Updated Bin Requested Qty logic
2020-04-07 18:06:07 +05:30
rohitwaghchaure
6668544b4c Merge pull request #21169 from rohitwaghchaure/get_serial_nos_based_on_posting_date_and_time
fix: get serial nos based on posting date and time
2020-04-07 18:02:34 +05:30
Deepesh Garg
5e841b40f3 Merge pull request #21189 from deepeshgarg007/dimension_filter_fix_v12
fix: Use separate condition for tree and normal doctype
2020-04-07 15:23:25 +05:30
Deepesh Garg
5e79f763b5 fix: Use separate condition for tree and normal doctype 2020-04-07 15:19:21 +05:30
Rohit Waghchaure
aebf0e47f3 fix: get serial nos based on posting date and time 2020-04-07 14:41:24 +05:30
rohitwaghchaure
645ef9db87 Merge pull request #21182 from marination/purchase-receipt-scan-barcode-hotfix
feat: Scan Barcode in Purchase Receipt
2020-04-07 14:37:17 +05:30
Marica
d76ecb960e fix: Validate Serial/Batch No naming series in Item itself (#21168)
* fix: Validate Serial/Batch No naming series in Item itself

* fix: Consider '#' too
2020-04-07 14:15:48 +05:30
Vishal Dhayagude
d2da8bd6e2 fix(shopping cart): UX Improvements (#21035)
* fix: nontype error for resolved and moved place order button at bottom left

* fix: removed inline style

* fix: Request for quotation move to lower right

* fix: move buttons

Co-authored-by: Naren <patilnarendra3@gmail.com>
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2020-04-07 12:19:40 +05:30
Saqib
a5fb07e475 fix(shopping-cart): address is made mandatory to place order (#20922)
fix(shopping-cart): address is made mandatory to place order
2020-04-07 12:09:28 +05:30
rohitwaghchaure
bcf1897e60 Merge pull request #21173 from rohitwaghchaure/material_request_incorrect_filter_issue
fix: material request type manufacture shows items with Is Purchase I…
2020-04-07 12:06:04 +05:30
Vishal Dhayagude
044abbace8 fix: Make Sales Invoice paid when it create from shopping cart (#20878)
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2020-04-07 12:05:18 +05:30
Deepesh Garg
36a763bdc5 Merge pull request #21106 from nextchamp-saqib/payment-req-status-fix-v12
fix: payment request status fixes
2020-04-07 10:13:29 +05:30
marination
2dd488f878 feat: Scan Barcode in Purchase Receipt 2020-04-06 23:16:57 +05:30
Saqib Ansari
34288b0f38 feat: (minor) purchase register filters 2020-04-06 18:26:03 +05:30
Rohit Waghchaure
d7389b1920 fix: material request type manufacture shows items with Is Purchase Item enabled 2020-04-06 17:49:49 +05:30
Marica
42eddbf89b Merge branch 'version-12-hotfix' into bin-requested-qty-hotfix 2020-04-06 16:38:06 +05:30
Saqib
8e206f55be Merge branch 'version-12-hotfix' into cart-address-update-hotfix 2020-04-06 14:22:06 +05:30
Saqib Ansari
de9c73c5cd fix: tests 2020-04-06 12:41:51 +05:30
Saqib Ansari
4ea7df69b4 fix: change request status on payment entry cancel 2020-04-06 12:35:54 +05:30
Marica
da6ef63bc4 Merge pull request #20865 from deepeshgarg007/po_supplier_skip_v12
feat: Allow PI creation without PO
2020-04-06 12:16:02 +05:30
Nabin Hait
5da9663ae4 Merge branch 'version-12-hotfix' into expense-claim-fix-v12 2020-04-06 12:14:27 +05:30
Nabin Hait
322660c644 fix: Merge conflict 2020-04-06 11:16:31 +05:30
Nabin Hait
2378572e1b fix: update attendace from leave application (#21154) 2020-04-06 10:15:50 +05:30
Deepesh Garg
ab436d4147 Merge pull request #21164 from deepeshgarg007/gst_3b_user_perm_v12
fix: User permissions in GSTR 3B report
2020-04-04 21:48:31 +05:30
Deepesh Garg
18cd3a029d fix: User permissions in GSTR 3B report 2020-04-04 20:07:44 +05:30
Saqib
dba4bd6f26 fix: [ux] credit to & debit to error message (#21133)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-04-03 19:36:00 +05:30
Marica
7bc70758fb Merge branch 'version-12-hotfix' into po_supplier_skip_v12 2020-04-03 18:35:29 +05:30
Deepesh Garg
69e0700101 Merge pull request #21158 from scmmishra/coa_importer
fix: TypeError for _ in coa importer
2020-04-03 18:34:44 +05:30
marination
dfe4d36e8d fix: Test Cases and block expense on outward entry
- Throw error if rate present against Customer Provided Item in DN and SI
- Added test cases for Sales Invoice and Delivery Note
- Allow SI and DN with 0 rate in Test
2020-04-03 18:29:30 +05:30
Shivam Mishra
55ded1379e Merge branch 'version-12-hotfix' into coa_importer 2020-04-03 17:21:42 +05:30
Shivam Mishra
64ed25abfb fix: TypeError for _ 2020-04-03 17:17:04 +05:30
marination
7b70679bf0 fix: Mapping Customer Provided Material Request to Stock Entry
- Fixed inability to map Material Request to Stock Entry
- Commonified Customer Provided Item validation
2020-04-03 15:57:32 +05:30
Deepesh Garg
31fbafe16f Merge pull request #21151 from scmmishra/fix-patch-dashboard-12
fix (tests): module import error for Dashboard Chart Field
2020-04-03 11:05:11 +05:30
Shivam Mishra
878e4cb3ce fix: lms quiz type error (#21153) 2020-04-03 10:07:44 +05:30
Marica
73bc29c011 fix: Update Received Qty in Material Request as per Stock UOM (#21055)
* fix: Update Received Qty in Material Request as per Stock UOM

* fix: Process each PR only once

* fix: minor suggested changes

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-04-03 10:06:39 +05:30
Saqib
44dbd98d90 fix: cannot set warehouse on deleting all so items and updating them (#21079)
* fix: cannot set warehouse on deleting all so items and updating them

* fix: travis

* fix: travis

* fix: docname is editable in update items dialog

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2020-04-03 10:01:14 +05:30
Saqib Ansari
04201028d1 fix: tests 2020-04-02 22:18:12 +05:30
Marica
8b5693b77f Merge branch 'version-12-hotfix' into po_supplier_skip_v12 2020-04-02 21:14:19 +05:30
Deepesh Garg
76d2bd9633 Merge branch 'version-12-hotfix' into fix-patch-dashboard-12 2020-04-02 20:24:10 +05:30
Deepesh Garg
83c7561a84 Merge pull request #21149 from deepeshgarg007/travis_company_fixture_v12
fix: Travis(v12)
2020-04-02 20:22:53 +05:30
Shivam Mishra
f8cb81c9f9 fix (tests): reload doctype 2020-04-02 19:59:47 +05:30
marination
4a59b1d3b5 fix: Fixed Test Cases for Material Request
- Reduce quantity on Material Transfer/Issue
- No effect on Customer Provided Material Request
2020-04-02 19:38:38 +05:30
Deepesh Garg
763aab3301 fix: Travis 2020-04-02 19:12:36 +05:30
rohitwaghchaure
0bbc78cdbd Merge pull request #21145 from anupamvs/year-sum-hotfix
Sum of years not needed.
2020-04-02 12:00:55 +05:30
Anupam K
29fc063764 Sum of years not needed. 2020-04-02 11:34:42 +05:30
Anupam K
a66da0ddf4 Sum of years not needed. 2020-04-02 01:06:30 +05:30
Deepesh Garg
4fd447a31d Merge pull request #21136 from marination/stock-ledger-typo-hotfix
fix: Typo in stock level validation in Stock Ledger
2020-04-01 11:20:55 +05:30
marination
122049a9b4 fix: Typo in stock level validation in Stock Ledger 2020-04-01 11:07:46 +05:30
Marica
6a49ea5262 Merge pull request #21097 from rohitwaghchaure/item_code_showing_as_mandatory_issue_hotfix
fix: item code showing as mandatory even if the 'Item Naming By' is set as Naming Series in stock settings
2020-04-01 10:56:14 +05:30
Marica
9f709aa64c Merge branch 'version-12-hotfix' into item_code_showing_as_mandatory_issue_hotfix 2020-04-01 10:46:55 +05:30
Deepesh Garg
702e0ac29e Merge pull request #21117 from nextchamp-saqib/customer-group-price-list-in-pos-v12
fix: customer group price list not fetched in pos
2020-04-01 09:41:04 +05:30
Saqib Ansari
954276ff0e fix: check if selling price exists then set it 2020-03-31 18:49:28 +05:30
Saqib Ansari
0541b2ee27 fix: travis 2020-03-31 18:44:38 +05:30
Saqib Ansari
086e5c4dac fix: no server side validations for accounts in asset category 2020-03-31 18:21:08 +05:30
Marica
dc6a3ae99c Merge pull request #21071 from pipech/v12_fix_pos-display-stock-item
fix(pos): fix pos not display only in-stock item
2020-03-31 18:13:44 +05:30
Marica
2512435a7b Merge branch 'version-12-hotfix' into v12_fix_pos-display-stock-item 2020-03-31 18:08:10 +05:30
Deepesh Garg
7d8d351668 Merge pull request #21064 from P-Froggy/fix-add-bank-account-reference-in-supplier-dashboard-hotfix
fix: Add missing bank accounts reference in supplier dashboard
2020-03-31 16:33:19 +05:30
Deepesh Garg
0126ef78c8 Merge pull request #21093 from scmmishra/multiple-option-fix-12
fix: use setup from Supplier Quotation Controller
2020-03-31 16:29:10 +05:30
rohitwaghchaure
489a5d203f Merge pull request #21016 from marination/so-mr-mapping-uom-hotfix
fix: UOM fixes in Sales Order,Material Request & Production Plan
2020-03-31 16:11:57 +05:30
Deepesh Garg
4716fc5eb8 Merge branch 'version-12-hotfix' into fix-add-bank-account-reference-in-supplier-dashboard-hotfix 2020-03-31 16:04:21 +05:30
rohitwaghchaure
437689371d Merge pull request #21002 from Alchez/v12-stock-entry-fg-validation
fix: allow target warehouses to be changed for work order stock entries (v12)
2020-03-31 15:43:28 +05:30
Saqib
798d532a11 fix: warehouse_account_map not getting reset for diff company transac… (#20997)
* fix: warehouse_account_map not getting reset for diff company transaction

* fix: potential key errors while fetching warehouse_account_map

* fix: travis

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-31 15:30:53 +05:30
rohitwaghchaure
c5a3bcca70 fix: make for quantity as non mandatory in job card (#21080) 2020-03-31 15:28:15 +05:30
rohitwaghchaure
e4cb523181 fix: serial no scan not adding the serial nos in stock entry (#21082) 2020-03-31 15:26:24 +05:30
Rucha Mahabal
b80213d65d fix: Healthcare Domain Issues (#21112)
* fix (Lab Test): None TypeError in Patient Medical Record

* fix: Lab Test Template data import failing in Lab Test Item creation

* fix: disabled Procedure Template shown as enabled in List View

* fix: change item_code from Link to Data to avoid item not found error

* fix: disabled patient shown as enabled

* fix: disabled practitioner schedule shown as enabled in list view

* fix: appointment reminders not working

* fix: Batch not getting fetched in Clinical Procedure Item
2020-03-31 10:52:51 +05:30
Anupam Kumar
d13e7d00b0 fix: email_to, party_type and party are not set in payment request (#21085)
* fix: email_to, party_type and party are not set in payment request when order made from portal

* fix: email_to, party_type and party are not set in payment request when order made from portal

Co-authored-by: Anupam K <anupam@Anupams-MacBook-Air.local>
2020-03-31 10:50:53 +05:30
Saqib
f492ba1e2d fix: auto created asset message (#21109)
* fix: auto created asset message

* Update erpnext/controllers/buying_controller.py

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-31 10:48:57 +05:30
Deepesh Garg
83111a4a2a fix: Expense account currency validation in Landed Cost voucher (#21074)
* fix: Expense account currency validation in Landed Cost voucher

* fix: Remove unused imports
2020-03-31 10:45:37 +05:30
Deepesh Garg
5a482a6685 Merge pull request #21068 from Alchez/v12-add-issue-status-filter
feat: add status filter in issue web form (v12)
2020-03-30 12:24:34 +05:30
Deepesh Garg
bda11e628b Merge pull request #21118 from rohitwaghchaure/fixed_parent_account_error_while_adding_equity_account
fix: not able to add equity account in the chart of accounts
2020-03-30 12:14:32 +05:30
Deepesh Garg
b8be73caea Merge pull request #21111 from nextchamp-saqib/cancel-error-hyperlink-v12
chore: hyperlinks in cannot cancel message
2020-03-29 21:54:09 +05:30
Deepesh Garg
df151ad6fa Merge pull request #21116 from nextchamp-saqib/course-report-perm-fix-v12
fix: cannot view report for course doctype - permission problem
2020-03-29 21:52:02 +05:30
Rohit Waghchaure
7e7787c298 fix: not able to add equity account in the chart of accounts 2020-03-29 16:33:30 +05:30
Saqib Ansari
1dd0c8f54c fix: customer group price list not fetched in pos 2020-03-29 12:58:30 +05:30
Saqib Ansari
dc04cbf9a9 fix: cannot view report for course doctype - permission problem 2020-03-29 12:52:43 +05:30
Deepesh Garg
77673f33db Merge pull request #21090 from scmmishra/print-format-fix-12
fix: total currency formatting in Acc Receivable and Payable
2020-03-28 21:28:20 +05:30
Deepesh Garg
f4e7de3cef Merge pull request #21104 from nextchamp-saqib/stock-ledger-warehouse-filter-v12
chore: [ux] filter warehouse based on company
2020-03-28 21:10:01 +05:30
Deepesh Garg
9b4ef1059c Merge pull request #21107 from nextchamp-saqib/gl-entry-currency-fix-v12
fix: currency formatting in gl entry dr cr field
2020-03-28 21:09:29 +05:30
Saqib Ansari
8ba661b8ed chore: hyperlinks in cannot cancel message 2020-03-28 20:11:59 +05:30
Saqib Ansari
1125ed8830 fix: currency formatting in gl entry dr cr field 2020-03-28 19:32:27 +05:30
Saqib Ansari
58351de797 fix: payment request status fixes 2020-03-28 19:30:03 +05:30
Saqib Ansari
9578ead7f9 fix: no server side validations for accounts in asset category 2020-03-28 19:27:37 +05:30
Saqib Ansari
f9ce7c2e18 chore: [ux] filter warehouse based on company 2020-03-28 19:16:00 +05:30
rohitwaghchaure
221189ab6e Merge pull request #21095 from anupamvs/item-wise-sales-history-billed-amount-bug-hotfix
bug: Item-wise Sales History - Billed amount
2020-03-28 15:00:46 +05:30
Rohit Waghchaure
8f854c7d93 fix: item code showing as mandatory even if the 'Item Naming By' is set as Naming Series in stock settings 2020-03-28 14:56:45 +05:30
Anupam K
728edacfd4 bug: Item-wise Sales History - Billed amount 2020-03-28 13:48:42 +05:30
Deepesh Garg
9aa8cabf93 Merge pull request #21088 from nabinhait/item_defaults_fix
fix: Add item defaults based on global settings only if default company and warehouse is mentioned
2020-03-27 21:50:19 +05:30
Shivam Mishra
cf2ab9b129 fix: use setup from Supplier Quotation Controller 2020-03-27 21:21:38 +05:30
Shivam Mishra
2313d2d80a fix: total currency formatting 2020-03-27 19:37:26 +05:30
Nabin Hait
b03d1327a5 fix: Add item defaults based on global settings only if default company and warehouse is mentioned 2020-03-27 19:24:17 +05:30
rohitwaghchaure
8110edbc62 Merge pull request #21076 from rohitwaghchaure/default_item_is_not_coming_while_making_new_bom
fix: item not showing in popup while making batch
2020-03-27 13:49:07 +05:30
Rohit Waghchaure
d90f658163 fix: item not showing in popup while making batch 2020-03-27 12:54:01 +05:30
Poranut Chollavorn
0b8191d566 fix(pos): fix pos display item instock 2020-03-26 13:46:36 +00:00
Rohan Bansal
27f0d13bdd feat: add status filter in issue web form 2020-03-26 16:06:07 +05:30
marination
c944676bb5 fix: Updated Bin Requested Qty logic 2020-03-26 15:44:52 +05:30
Nabin Hait
ff49a2f0b6 fix: Ignored user permission for parent_company and existing_company field in Company (#21010) 2020-03-26 13:36:21 +05:30
Deepesh Garg
8a5587749b fix: Added hidden GL column in general ledger (#21022)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-26 13:29:36 +05:30
Marica
3c378aaac7 fix: Make shelf life mandatory in Batched Item if it has expiry date (#21045) 2020-03-26 13:28:42 +05:30
Raffael Meyer
72430e91b2 fix: account groups (#21046) 2020-03-26 13:25:14 +05:30
Marica
6b038bda0d fix: Project field in Stock Entry Detail should be editable (#21000) 2020-03-26 13:23:54 +05:30
Saqib
01f80b239d fix: wrong calculation of depreciation eliminated for a period (#21032) 2020-03-26 13:23:06 +05:30
Saqib
b9f81d913b fix: currency not fetched on quotation creation (#20998) 2020-03-26 13:20:27 +05:30
Saqib
750985dc23 feat: auto set batch no on serial no selection (#20758)
* feat: auto set batch no on serial no selection

* fix: dialog not shown if set warehouse selected

* fix: typo

* fix: merge conflict

* fix: callback no getting called after serial no selected

* fix: callback no getting called after serial no selected

* fix: available batch qty not fetched without set_warehouse selected

* fix: item batch not synced with dialog batch table
2020-03-26 13:18:36 +05:30
P-Froggy
bcb9c28597 Fix: Add missing bank accounts reference in supplier dashboard 2020-03-26 02:35:09 +01:00
Deepesh Garg
23891a918d Merge pull request #21058 from deepeshgarg007/gstr_1_pos_validation_v12
fix: Place of supply validation in GSTR-1 report
2020-03-25 17:02:19 +05:30
Deepesh Garg
4f1a3876ec fix: Remove debug 2020-03-25 16:56:09 +05:30
Deepesh Garg
43806f3e68 fix: Place of supply validation in GSTR-1 report 2020-03-25 16:55:59 +05:30
Deepesh Garg
f4405246ed Merge pull request #21012 from Thunderbottom/log_error-fix-v12
chore: pass traceback and error message as kwargs
2020-03-24 20:19:42 +05:30
rohitwaghchaure
8cc507af53 Merge pull request #21039 from rohitwaghchaure/manufacturing_ux_fixes_hotfix
fix: Manufacturing UX, added calendar view for job card
2020-03-24 16:33:34 +05:30
rohitwaghchaure
6c8bbf9a1c Merge pull request #21029 from rohitwaghchaure/import_supplier_invoices
feat: import supplier invoices
2020-03-24 16:33:00 +05:30
rohitwaghchaure
ea470609fd Merge pull request #21036 from rohitwaghchaure/fixed_batch_selector_popup
fix: batch selection popup not coming for stock entry
2020-03-24 16:31:56 +05:30
Deepesh Garg
ad44f52a26 Merge pull request #21042 from deepeshgarg007/default_dimension_clean_up_v12
fix: Default dimension set code cleanup
2020-03-24 15:48:01 +05:30
Deepesh Garg
1e7cba9dd3 fix: Default dimension set code cleanup 2020-03-24 15:45:22 +05:30
Rohit Waghchaure
87b3dbb214 fix: Manufacturing UX, added calendar view for job card 2020-03-24 14:06:56 +05:30
Rohit Waghchaure
243283eec8 fix: batch selection popup not coming for stock entry 2020-03-24 11:34:44 +05:30
Rohit Waghchaure
b05922026d feat: import supplier invoices 2020-03-23 16:31:39 +05:30
Rohan
ed8e44b467 Merge branch 'version-12-hotfix' into v12-stock-entry-fg-validation 2020-03-23 14:49:59 +05:30
Deepesh Garg
76e163a889 Merge pull request #21026 from deepeshgarg007/dimension_perm_v12
fix: Remove quick entry from accounting dimensions
2020-03-22 21:56:47 +05:30
Deepesh Garg
20ab2c1e20 fix: Remove quick entry from accouting dimensions 2020-03-22 21:53:50 +05:30
Deepesh Garg
3f7ea072c3 Merge pull request #21004 from rohitwaghchaure/qty_must_be_positive_for_stock_entry
fix: stock entry qty must be positive
2020-03-21 20:45:50 +05:30
Deepesh Garg
601db77801 Merge pull request #21014 from surajshetty3416/fix-opportunity-listview-version-12-hotfix
fix: Add currency in options of Opportunity Amount
2020-03-20 20:22:46 +05:30
marination
93e72fdd21 fix: UOM fixes in Sales Order,Material Request & Production Plan 2020-03-20 18:06:25 +05:30
Suraj Shetty
e2bb2593db fix: Add currency in options of Opportunity Amount - To show currect symbol in list view 2020-03-20 15:13:07 +05:30
Chinmay D. Pai
e53e96f01b chore: pass traceback and error message as kwargs
fixes issue where the system tries to generate an error log but fails
with the following error:

Traceback (most recent call last):
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/setup/doctype/company/company.py", line 421, in install_country_fixtures
    frappe.get_attr(module_name)(company_doc, False)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/regional/india/setup.py", line 17, in setup
    make_fixtures(company)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/regional/india/setup.py", line 523, in make_fixtures
    set_tax_withholding_category(company)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/regional/india/setup.py", line 543, in set_tax_withholding_category
    fiscal_year = get_fiscal_year(today(), company=company)[0]
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/accounts/utils.py", line 24, in get_fiscal_year
    return get_fiscal_years(date, fiscal_year, label, verbose, company, as_dict=as_dict)[0]
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/accounts/utils.py", line 80, in get_fiscal_years
    raise FiscalYearError(error_msg)
erpnext.accounts.utils.FiscalYearError: Date 20-03-2020 not in any active Fiscal Year.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/app.py", line 62, in application
    response = frappe.api.handle()
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/handler.py", line 61, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/__init__.py", line 1054, in call
    return fn(*args, **newargs)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
    doc.save()
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/document.py", line 273, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/document.py", line 296, in _save
    self.insert()
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/document.py", line 260, in insert
    self.run_post_save_methods()
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/document.py", line 926, in run_post_save_methods
    self.run_method("on_update")
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/document.py", line 794, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/document.py", line 1065, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/document.py", line 1048, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/document.py", line 788, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/setup/doctype/company/company.py", line 107, in on_update
    install_country_fixtures(self.name)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/setup/doctype/company/company.py", line 423, in install_country_fixtures
    frappe.log_error(str(e), frappe.get_traceback())
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/__init__.py", line 1524, in log_error
    method=title)).insert(ignore_permissions=True)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/document.py", line 231, in insert
    self._validate()
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/document.py", line 463, in _validate
    self._validate_length()
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/base_document.py", line 583, in _validate_length
    self.throw_length_exceeded_error(df, max_length, value)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/model/base_document.py", line 599, in throw_length_exceeded_error
    .format(reference, _(df.label), max_length, value), frappe.CharacterLengthExceededError, title=_('Value too big'))
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/__init__.py", line 377, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/__init__.py", line 356, in msgprint
    _raise_exception()
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/frappe/frappe/__init__.py", line 316, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.CharacterLengthExceededError: Error Log f2cbb8c0f2: 'Title' (Traceback (most recent call last):
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/setup/doctype/company/company.py", line 421, in install_country_fixtures
    frappe.get_attr(module_name)(company_doc, False)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/regional/india/setup.py", line 17, in setup
    make_fixtures(company)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/regional/india/setup.py", line 523, in make_fixtures
    set_tax_withholding_category(company)
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/regional/india/setup.py", line 543, in set_tax_withholding_category
    fiscal_year = get_fiscal_year(today(), company=company)[0]
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/accounts/utils.py", line 24, in get_fiscal_year
    return get_fiscal_years(date, fiscal_year, label, verbose, company, as_dict=as_dict)[0]
  File "/home/frappe/benches/bench-version-12-2020-03-19/apps/erpnext/erpnext/accounts/utils.py", line 80, in get_fiscal_years
    raise FiscalYearError(error_msg)
erpnext.accounts.utils.FiscalYearError: Date 20-03-2020 not in any active Fiscal Year.
) will get truncated, as max characters allowed is 140

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-03-20 13:57:30 +05:30
Rohit Waghchaure
794064db9f fix: stock entry qty must be positive 2020-03-19 14:44:16 +05:30
Rohan
4c4a1aa56d fix: allow target warehouses to be changed for work order stock entries 2020-03-19 13:19:08 +05:30
Sahil Khan
84a5e34319 Merge branch 'v12-pre-release' into version-12 2020-03-19 12:44:10 +05:30
Sahil Khan
d1bbda6d71 bumped to version 12.6.0 2020-03-19 13:04:10 +05:50
Deepesh Garg
8c56f8595e fix: Unable to submit landed cost voucher (#20978) 2020-03-19 11:03:14 +05:30
Deepesh Garg
c2f6782658 fix: Unable to submit landed cost voucher (#20979) 2020-03-19 11:02:34 +05:30
Deepesh Garg
7c0398c8e3 fix: Update is_tree field in Tree doctypes (#20983) 2020-03-19 11:01:40 +05:30
Deepesh Garg
71e9f23d77 fix: Update is_tree field in Tree doctypes (#20982) 2020-03-19 11:00:55 +05:30
Nabin Hait
7b45ae1f2d fix: Multiple fixes during pre-release testing (#20985) 2020-03-19 10:58:41 +05:30
Nabin Hait
bf0f9c5cb4 fix: Multiple fixes during pre-release testing (#20986) 2020-03-19 10:58:07 +05:30
Deepesh Garg
3f1682a4f3 Merge pull request #20993 from rohitwaghchaure/fixed_bom_comparision_issue_pre_release
fix: bom comparison issue
2020-03-19 10:54:51 +05:30
Deepesh Garg
4dd8f390e2 Merge pull request #20992 from rohitwaghchaure/fixed_bom_comparision_issue_hotfix
fix: bom comparison issue
2020-03-19 10:54:29 +05:30
Rohit Waghchaure
82661aa042 fix: bom comparison issue 2020-03-19 10:06:55 +05:30
Rohit Waghchaure
210a718a04 fix: bom comparison issue 2020-03-19 10:03:06 +05:30
Deepesh Garg
1d94f6c848 Merge pull request #20989 from rohitwaghchaure/fixed_shortage_qty_in_stock_projected_qty_report_pre_release
fix: shortage qty in stock projected qty report
2020-03-19 09:32:50 +05:30
Rohit Waghchaure
d21a9fa917 fix: shortage qty in stock projected qty report 2020-03-19 09:25:15 +05:30
Deepesh Garg
51cbfa6aa6 Merge pull request #20972 from rohitwaghchaure/fixed_shortage_qty_in_stock_projected_qty_report
fix: shortage qty in stock projected qty report
2020-03-19 09:04:30 +05:30
Rohit Waghchaure
1ed5993ff6 fix: shortage qty in stock projected qty report 2020-03-18 13:33:55 +05:30
Marica
e655648b18 fix: Missing if condition in Customer Default Bank Account Validation. (#20971) 2020-03-18 11:35:43 +05:30
Marica
da7c6b0d99 fix: Missing if condition in Customer Default Bank Account Validation. (#20970) 2020-03-18 11:29:02 +05:30
Nabin Hait
a5b836d3d4 core: Added change log 2020-03-17 21:02:22 +05:30
Nabin Hait
8a7ecebc03 fix: merge conflict 2020-03-17 19:49:25 +05:30
Anurag Mishra
7cf245895e refactor: Report BOM Sock Calculated (#19431) 2020-03-17 19:45:33 +05:30
Priyanka Gangar
738517c6e8 Label changes in account settings hotfix (#20964)
* fix: Account setting words switches to US Terminology

* created united_states.js

* Remove Unwanted Spaces

* Remove all changes

* Add spaces between arguments

Co-authored-by: PriyankaGangar <pinka0925@gmail.com>
2020-03-17 19:39:06 +05:30
rohitwaghchaure
a6cd666b10 fix: reserved qty for production issue for partial completion of work order (#20900) 2020-03-17 17:00:41 +05:30
Saqib
bc8a881e64 fix: purchase return are allowed even when assets are not cancelled (#20798)
* fix: purchase return are allowed even when assets are not cancelled

* chore: test case

* fix: error message

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-17 17:00:24 +05:30
Deepesh Garg
224059e7ba fix: Party Name not visible in statement of accounts (#20914)
* fix: Party name in Statement Of Accounts

* Update general_ledger.html

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-17 16:59:09 +05:30
Sun Howwrongbum
6f454dce20 fix: null fields being set in Integration Request (#20894)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-17 12:13:01 +05:30
Deepesh Garg
3528149329 fix: Add check to skip PR in supplier master 2020-03-17 11:48:11 +05:30
Deepesh Garg
6c148ef314 fix: Add check to skip SO and DN in customer master 2020-03-17 11:47:23 +05:30
Anurag Mishra
7f58f6af39 fix: leave based on multiple holiday list (#20849)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-17 10:58:17 +05:30
Marica
3ddcc2e5c7 fix: Item alternative must have similar fields as orignal item (#20799)
* fix: Item alternative must have similar fields as orignal item

* fix: Using db.get_values and meta instead of get_value and get_doc

* fix: Made code more DRY

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-17 10:56:13 +05:30
Deepesh Garg
756f47af04 feat: Nested set filtering for accounting dimension (#20866)
* feat: Nested set filtering for accounting dimension

* fix: Remove print statement
2020-03-17 10:52:56 +05:30
Anurag Mishra
b9e1d9ad7d Deduction based on earnins/gross pay (#20935)
* fix: deductions calculation based on gross pay

* test: salary structure deduction based on gross pay

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-16 22:44:17 +05:30
Deepesh Garg
169ba6f9b2 Merge pull request #20959 from deepeshgarg007/mode_of_payment_fix_v12
fix: Mode of payment not fetcched in Item wise purchase register
2020-03-16 22:43:24 +05:30
nmimsnikhil
7c0e89d785 fix: added a Reason for Rejection field for each items (#20828)
* fix: added a Reason for Rejection field for each items

* Update delivery_note_item.json

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-16 22:41:23 +05:30
Deepesh Garg
dd8059a3aa fix: Mode of payment not fetcched in Item wise purchase register 2020-03-16 22:39:32 +05:30
Don-Leopardo
0dcd5a0f34 fix: sql injection (#20817) 2020-03-16 22:35:01 +05:30
rohitwaghchaure
d2a2837034 fix: bom replace tool issue (#20841)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-16 21:42:51 +05:30
Anurag Mishra
22a069d4b0 fix: Wrong status 2020-03-16 19:15:33 +05:30
Rohan
281a9fdf07 fix: handle error handling (#20814) 2020-03-16 17:57:15 +05:30
Saqib
e7a6a4b009 fix: is_pos gets reset on making s_inv from s_ord (#20887)
* s_inv has is_pos default set as 1
2020-03-16 17:48:21 +05:30
Nabin Hait
5c760175d1 fix: deletion of auto-created batch (#20953) 2020-03-16 17:26:02 +05:30
Deepesh Garg
11fb93d022 fix: Add bank transaction in module view (#20823) 2020-03-16 16:54:34 +05:30
Saqib
43a0011987 fix: serial_no_selector showing for non serialized batched item (#20852) 2020-03-16 16:28:54 +05:30
Vishal Dhayagude
37886a72ef fix(HR): Leave application company field made read-only and filter in Monthly attendance sheet (#20911)
* fix(HR): Leave application company field made Readonly

* fix: in monthly report attandance employee filter based on company

* fix: minor typo
2020-03-16 15:57:42 +05:30
Deepesh Garg
98573fb868 Merge pull request #20921 from deepeshgarg007/c_from_fix_v12
fix: Get invoice details only if invoice is selected
2020-03-16 15:56:19 +05:30
Deepesh Garg
4d954f1a5f Merge pull request #20836 from Thunderbottom/welcome-email-fix-v12
fix: use ERPNext in welcome email when default company is not set
2020-03-16 15:54:09 +05:30
Prssanna Desai
46053f6c8f fix: fix options of currency fieldtype in Expense Taxes and Charges (#20910) 2020-03-16 15:52:00 +05:30
Chinmay Pai
6f3941c9cc fix: remove make_purchase_invoice from demo script (#20906)
currently demo fails with the following error:

frappe@bf54a9834cfe:/workspace/development/frappe-bench$ bench --site test1.localhost execute erpnext.demo.demo.make
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/workspace/development/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
    main()
  File "/workspace/development/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/workspace/development/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/workspace/development/frappe-bench/apps/frappe/frappe/commands/utils.py", line 145, in execute
    ret = frappe.get_attr(method)(*args, **kwargs)
  File "/workspace/development/frappe-bench/apps/frappe/frappe/__init__.py", line 1042, in get_attr
    return getattr(get_module(modulename), methodname)
  File "/workspace/development/frappe-bench/apps/frappe/frappe/__init__.py", line 823, in get_module
    return importlib.import_module(modulename)
  File "/workspace/development/frappe-bench/env/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/workspace/development/frappe-bench/apps/erpnext/erpnext/demo/demo.py", line 6, in <module>
    from erpnext.demo.user import hr, sales, purchase, manufacturing, stock, accounts, projects, fixed_asset
  File "/workspace/development/frappe-bench/apps/erpnext/erpnext/demo/user/fixed_asset.py", line 9, in <module>
    from erpnext.assets.doctype.asset.asset import make_purchase_invoice, make_sales_invoice
ImportError: cannot import name 'make_purchase_invoice' from 'erpnext.assets.doctype.asset.asset' (/workspace/development/frappe-bench/apps/erpnext/erpnext/assets/doctype/asset/asset.py)

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-03-16 15:49:50 +05:30
Raffael Meyer
cd71114c15 fix(accounts): add account_type and tax_rate to some VAT accounts (#20941)
* Add account_type and tax rate to some VAT accounts

* fix indentation
2020-03-16 15:44:32 +05:30
Nabin Hait
e2a31f221a fix: Multiple fixes for travis (#20950) 2020-03-16 15:36:10 +05:30
Anurag Mishra
97dfe2ac32 fix: local variable 'benefit_amount' referenced before assignment (#20948) 2020-03-16 13:47:47 +05:30
Myuddin khatri
9c63b1d2c9 fix(shopping-cart): setting billing and shipping address
setting billing and shipping address
2020-03-12 16:15:05 +05:30
Myuddin khatri
0f807bf7ee fix(shopping-cart): address is made mandatory to place order 2020-03-12 14:40:34 +05:30
Deepesh Garg
ee003495f6 fix: Get invoice details only if invoice is selected 2020-03-12 13:25:06 +05:30
Deepesh Garg
08f0e9d6f3 Merge pull request #20891 from deepeshgarg007/itemised_purchase_register_v12
fix: HSN code not visible in GST Itemised Purchase register
2020-03-10 10:05:21 +05:30
Deepesh Garg
4d6fb59bfb Merge pull request #20885 from deepeshgarg007/first_row_dimension_v12
fix: Acccounting Dimension disappearing in first row after refresh
2020-03-09 22:47:46 +05:30
Deepesh Garg
0317576434 fix: HSN code not visible in GST Itemised Purchase register 2020-03-09 22:42:21 +05:30
Saqib
b607963fba fix: [pos] customer group filter resets on syncing offline invoices (#20874) 2020-03-09 18:30:42 +05:30
Marica
d08cff9efc fix: Validate Serial No/Batch No against unserialized Item in Stock Reconciliation (#20859) 2020-03-09 18:13:38 +05:30
Marica
2f2cef6c5f fix: ModuleNotFoundError on Turkey Company setup (#20854) 2020-03-09 18:07:55 +05:30
Deepesh Garg
875e0f5fb2 fix: Acccounting Dimension disappearing in first row after refresh 2020-03-09 18:05:35 +05:30
Deepesh Garg
d9ab412032 feat: Allow PI creation without PO 2020-03-06 19:04:41 +05:30
Saqib
6c4cddccf6 fix: show uom in print formats instead of stock uom (#20844)
Co-authored-by: Saqib Ansari <saqibansari@Saqibs-MacBook-Pro.local>
2020-03-06 11:06:41 +05:30
Marica
69d3c4ff25 fix: update_child_qty_rate() missing argument (#20839) 2020-03-06 10:57:43 +05:30
Nabin Hait
1f80c8dffe perf: improve gl entry submission (#20802)
* perf: improve gl entry submission

* perf: add indexes

* fix: replace **kwargs with *args

* fix: syntax error

* fix: travis

* chore: remove purchase invoice from status updater

* fix: set_staus args

Co-Authored-By: Nabin Hait <nabinhait@gmail.com>

* fix: only update status for invoices & fees

* [bug][fix]: set status to object instead of variable (#20790)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
Co-authored-by: Saurabh <saurabh6790@gmail.com>
2020-03-05 13:04:53 +05:30
Chinmay D. Pai
12cdf0fb52 fix: use ERPNext in welcome email when default company is not set
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-03-05 10:11:55 +05:30
Deepesh Garg
b6a3a06c4b Merge pull request #20821 from deepeshgarg007/gst_itemised_v12
fix: HSN code no visible in GST itemised sales register
2020-03-04 10:41:55 +05:30
Deepesh Garg
2728590471 fix: HSN code no visible in GST itemised sales register 2020-03-04 10:26:25 +05:30
Priyanka Gangar
7766530afc fix: fetch sales person name (#20801)
* fix: fetch sales person name

* Update sales_person.js

Co-authored-by: pinka0925 <44537026+pinka0925@users.noreply.github.com>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-02 19:24:14 +05:30
Deepesh Garg
d7839eb8ac fix: Total amount not displayed in Journal Entry (#20795)
* fix: Total amount not displayed in Journal Entry

* fix: Update paid_to_received field

* fix: set total amount

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-03-02 18:09:24 +05:30
Prssanna Desai
6a734ecd34 fix: use get all instead of get list to fetch item attributes (#20793) 2020-03-02 18:06:21 +05:30
Mangesh-Khairnar
acd93b3bd1 fix: use system language to translate strings (#20792) 2020-03-02 18:05:59 +05:30
Marica
94200b1179 chore: Item Price and Product Bundle Form cleanup (#20773)
* chore: Item Price and Product Bundle Form cleanup

* fix: Trailing comma
2020-03-02 15:51:22 +05:30
Saqib
a6bf96322b chore: control reposting of future gl entries with flags (#20775) 2020-03-02 15:19:28 +05:30
Saqib
27163e60bb feat: link serial no to batch no (#20779)
* feat: link serial no to batch no

* fix: test cases
2020-03-02 15:03:18 +05:30
Saqib
1041516e8e fix: reconciled entries showing in bank reco (#20788) 2020-03-02 15:00:42 +05:30
Deepesh Garg
b7bbd827fd Merge pull request #20769 from marination/buying-dashboard-hotfix
chore: Rearranged Buying Module Dashboard
2020-02-29 17:34:35 +05:30
Sahil Khan
fda7cbeca4 Merge branch 'v12-pre-release' into version-12 2020-02-28 15:06:03 +05:30
Sahil Khan
2fc58b3327 bumped to version 12.5.2 2020-02-28 15:26:03 +05:50
marination
3fcd575f53 chore: Rearranged Buying Module Dashboard 2020-02-28 13:08:38 +05:30
Deepesh Garg
0cee807dfb Merge pull request #20766 from deepeshgarg007/bank_reco_release
fix: Journal Entry not being fetched in Bank Reconciliation
2020-02-28 12:35:06 +05:30
Deepesh Garg
a51c56c4b3 fix: Remove debug statement 2020-02-28 12:32:18 +05:30
Deepesh Garg
d2f26e57d2 fix: Journal Entry not being fetched in Bank Reconciliation 2020-02-28 12:32:05 +05:30
Deepesh Garg
b7790c0394 fix: Item Wise report query fix (#20765) 2020-02-28 12:30:29 +05:30
Deepesh Garg
d17e0b5aca fix: Item Wise report query fix (#20761) 2020-02-28 12:29:11 +05:30
Shivam Mishra
f08b5e4866 feat: ignore permission when deleting linked emails (#20753) 2020-02-27 19:07:39 +05:30
Deepesh Garg
78ae5e7721 Merge pull request #20749 from deepeshgarg007/bank_reco_jv_v12
fix: Journal Entry not being fetched in Bank Reconciliation
2020-02-27 16:19:01 +05:30
Deepesh Garg
5fb66a3953 fix: Remove debug statement 2020-02-27 16:15:43 +05:30
Deepesh Garg
d952e71d97 fix: Journal Entry not being fetched in Bank Reconciliation 2020-02-27 16:15:16 +05:30
rohitwaghchaure
fe337dfb66 fix: serial no material transfer performance issue (#20722) 2020-02-27 14:27:43 +05:30
Saqib
45329232b3 fix: only update items if rate or qty changed (#20743) 2020-02-27 12:51:23 +05:30
Rohan
30ad21b7d8 fix: sort Issues chronologically (#20740) 2020-02-26 18:53:48 +05:30
Marica
4e3ad9c3f2 fix: Lock stock ledger entries that are being reposted. (#20739)
- If stock ledger entries are being reposted, don't let any other transaction apply itself on the same.
2020-02-26 18:51:35 +05:30
Sahil Khan
2a1e9b542e Merge branch 'v12-pre-release' into version-12 2020-02-26 18:20:16 +05:30
Sahil Khan
8f458feafc bumped to version 12.5.1 2020-02-26 18:40:16 +05:50
Deepesh Garg
e116d8f819 Merge pull request #20738 from deepeshgarg007/bank_reco_fix_v12_pre
fix: Mandatory bank account error fix
2020-02-26 17:42:14 +05:30
Deepesh Garg
f3674ccc6c fix: SQL condition 2020-02-26 17:40:13 +05:30
Deepesh Garg
6f35a63f2d fix: Mandatory bank account error fix 2020-02-26 17:40:04 +05:30
Deepesh Garg
acbc4f648d fix: Mandatory bank account error fix (#20734)
* fix: Mandatory bank account error fix

* fix: SQL condition
2020-02-26 17:17:06 +05:30
Anurag Mishra
5475b5f562 fix: validated leave allocation (#20635)
* fix: validated leave allocation

* fix: changes requested

* Update erpnext/hr/doctype/leave_encashment/leave_encashment.py

Co-Authored-By: Nabin Hait <nabinhait@gmail.com>

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-02-26 14:50:52 +05:30
rohitwaghchaure
39861c270c fix: same free item not working for pricing rule (#20713) 2020-02-26 12:51:53 +05:30
RJPvT
6eaa542709 fix: smaller then instead of bigger then :-( dumb mistake v12 #20693 (#20701) 2020-02-26 11:59:06 +05:30
Saqib
2a8981929a perf: search for customer's return invoices then filter out gl_entries (#20710) 2020-02-26 11:36:38 +05:30
rohitwaghchaure
0aa7aa5996 fix: rate and amount in material request copying from sales order (#20718) 2020-02-26 11:27:49 +05:30
rohitwaghchaure
a20bd89c20 fix: reorder material request not created if doctype has custom mandatory field (#20720) 2020-02-26 11:25:30 +05:30
Deepesh Garg
aa7af30382 Merge pull request #20715 from rohitwaghchaure/account_dashboard_not_working_hotfix
fix: account dashboard not working
2020-02-26 10:18:27 +05:30
Rohit Waghchaure
9921d28ea7 fix: account dashboard not working 2020-02-25 12:17:25 +05:30
Sahil Khan
b26fd04843 Merge branch 'v12-pre-release' into version-12 2020-02-20 18:26:58 +05:30
Sahil Khan
1b78d20d3c bumped to version 12.5.0 2020-02-20 18:46:57 +05:50
sahil28297
b203406d4c fix: proper release note version 2020-02-20 18:20:33 +05:30
Mangesh-Khairnar
5a0017c61a Merge pull request #20686 from Anurag810/additional_salary_fixes
fix: Additional salary can be created only for active employee
2020-02-20 16:21:55 +05:30
Anurag Mishra
df15c758f6 fix: Additional salary can be created only for active employee 2020-02-20 15:29:09 +05:30
Mangesh-Khairnar
588a89f957 fix: return null for attribute (#20684) 2020-02-20 13:41:00 +05:30
Mangesh-Khairnar
c74343531f fix: skip earned leaves check for max leaves set to zero or less (#20536)
* fix: skip earned leaves check for max leaves set to zero or less

* test: earned leaves creation
2020-02-20 13:25:45 +05:30
Deepesh Garg
a257189c77 Merge pull request #20451 from Anurag810/fleet-management_v12
fix: odometer value was not syncing properly
2020-02-20 13:20:21 +05:30
Rohan
355051bf75 fix: apply url encoding to project names (#20641) 2020-02-20 12:59:21 +05:30
Anurag Mishra
ab8aa43ffb fix: changed field type which was affecting filters (#20670) 2020-02-20 12:52:37 +05:30
Mathieu Brunot
a6f56bbc3e chore(ci-coverage): Pin coverage 4.5.4 #20646 (#20648)
* chore(ci-coverage): Pin coveralls 4.5.4 #20646

Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>

* chore: Pin coverage

Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
2020-02-20 12:50:09 +05:30
gavin
4e2b9395b9 chore: drop cypress requirement (#20675) 2020-02-20 12:48:32 +05:30
Saqib
ae9159fbd8 fix: mandatory on hold comment for purchase invoice (#20667) 2020-02-20 12:33:07 +05:30
Saqib
8e80c17602 chore: SINV set_status remove redundant function calls (#20661) 2020-02-20 12:32:09 +05:30
Saqib
8903258362 fix: mandatory on hold comment for purchase invoice (#20668)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-02-20 12:30:35 +05:30
Saqib
1beeb28908 fix: check for available stock in product bundle's website warehouse (#20680) 2020-02-20 12:22:33 +05:30
Saqib
2d2aa7d664 fix: check for available stock in product bundle's website warehouse (#20679)
* fix: check for available stock in product bundle's website warehouse

* test: earned leaves creation

* fix: minor change

Co-authored-by: Mangesh-Khairnar <mkhairnar10@gmail.com>
2020-02-20 12:22:01 +05:30
Nabin Hait
cd6b60df70 core: Added change log 2020-02-20 12:18:21 +05:30
Nabin Hait
b18790f5c2 Merge branch 'version-12-hotfix' into v12-pre-release 2020-02-19 19:19:36 +05:30
Mangesh-Khairnar
f6d7090f07 fix: earned leaves creation for zero maximum leaves (#20677) 2020-02-19 19:16:40 +05:30
Deepesh Garg
017d280877 Merge pull request #20664 from marination/stock-settings-query-v12-hotfix
fix: Set Query on warehouse fields in Stock Settings
2020-02-19 18:58:46 +05:30
Anurag Mishra
031d4092d0 test: syncing of odometer value 2020-02-19 16:49:13 +05:30
marination
0119d15adb fix: Server side validation for Warehouses 2020-02-19 11:21:55 +05:30
Deepesh Garg
df6cb3c43b Merge pull request #20633 from scmmishra/tree-fix-qms
fix: filters for quality_procedure tree
2020-02-19 09:40:52 +05:30
marination
1ed737cf64 fix: Set Query on warehouse fields in Stock Settings 2020-02-18 21:45:52 +05:30
Deepesh Garg
c64e46fe67 Merge pull request #20483 from racitup/plaid-20343-fix
fix: Plaid fixes and enhancements
2020-02-18 18:03:16 +05:30
Nabin Hait
f579b0e3de fix: merge conflict 2020-02-18 17:49:20 +05:30
Deepesh Garg
b63c041aa4 feat: Group by AR/AP report (#20574)
* feat: Group by AR/AP report

* fix: Do not consider total row in charts

* fix: Subtotal row for last party
2020-02-18 16:09:37 +05:30
rohitwaghchaure
22f9a5f09f Merge pull request #20639 from nextchamp-saqib/pos-mode-of-pay-fix-v12
fix: disabled mode of payments fetches in sales invoices
2020-02-18 12:38:14 +05:30
rohitwaghchaure
e47875340e Merge pull request #20655 from marination/precision-mr-item-hotfix
fix: Stock Quantity not calculated on client side in Material Request…
2020-02-18 12:34:27 +05:30
marination
6f28383531 fix: Stock Quantity not calculated on client side in Material Request Items. 2020-02-18 11:08:16 +05:30
Deepesh Garg
95050702f1 Merge branch veersion-12-hotfix into plaid-20343-fix 2020-02-17 22:11:14 +05:30
Deepesh Garg
ae8f717fe5 Merge pull request #20640 from gavindsouza/updated-requirements
chore(requirements): Pin requirements
2020-02-17 22:05:26 +05:30
Gavin D'souza
f95ac99baa fix(travis): add lib cups for updated frappe requirements 2020-02-17 16:52:27 +05:30
Shivam Mishra
660b4d1e2f feat: show numeric values in item configurator (#20430) 2020-02-17 15:58:31 +05:30
thefalconx33
5bfebaf1c0 fix: disabled mode of payments fetches in sales invoices 2020-02-17 14:16:49 +05:30
Deepesh Garg
980e54c5f4 Merge pull request #20570 from Er-Naren719/hotfix-user-table-columns-updated
feat: columns under user table updated
2020-02-17 11:19:23 +05:30
Shivam Mishra
efbfeb2d89 fix: filters for quality_procedure tree 2020-02-17 10:50:05 +05:30
rohitwaghchaure
0676ed08b1 Merge pull request #20540 from rohitwaghchaure/fixed_purchase_receipt_time_out_error
fix: time out error while submitting the purchase receipt
2020-02-11 19:55:04 +05:30
rohitwaghchaure
e9946672e0 Merge branch 'version-12-hotfix' into fixed_purchase_receipt_time_out_error 2020-02-11 19:54:54 +05:30
rohitwaghchaure
6124f83e6e Merge pull request #20556 from ashish-greycube/patch-3
fix: backflush raw material based on - Material Transferred for Manufacture
2020-02-11 19:50:09 +05:30
Deepesh Garg
2b83debc72 Merge pull request #20564 from govindsmenokee/patch-4
fix: get_students not respecting the program
2020-02-11 17:03:24 +05:30
Er-Naren719
fc4cc9ab42 feat: column width increased for view attachments field (#314) 2020-02-11 10:17:34 +00:00
Deepesh Garg
cd19974d7a Merge pull request #20566 from vishdha/filter_serial_based_on_batch_v12
fix: filter serial no based on batch no
2020-02-11 13:44:54 +05:30
vishal
cde48a44cf fix: filter serial no based on batch no 2020-02-11 12:39:49 +05:30
Govind S Menokee
57d33f9ce6 fix: get_students not respecting the program
The get_students function is not taking into account the program for which the fee needs to be created. If a student is enrolled for multiple programs then the fee schedule pull up the wrong count of students.
2020-02-11 11:23:16 +05:30
Deepesh Garg
90a46acc0d Merge pull request #20557 from rohitwaghchaure/added_indexing_on_columns_to_fix_performance_issue
fix: added indexing on columns to fix performace issue
2020-02-11 10:13:24 +05:30
Deepesh Garg
60634cc829 Merge pull request #20252 from deepeshgarg007/group_by_sales_v12
feat: Group by item wise sales register
2020-02-10 22:20:21 +05:30
Rohit Waghchaure
a7c27596bb fix: added indexing on columns to fix performace issue 2020-02-10 15:30:22 +05:30
Deepesh Garg
b4e3146665 Merge pull request #20550 from nextchamp-saqib/so-update-items-warehouse-fix-v12
fix: mandatory warehouse wrror while updating items after submission
2020-02-10 12:09:38 +05:30
Ashish Shah
495ab6c7f2 fix: backflush raw material based on - Material Transferred for Manufacture
Hi @nabinhait ,
 
Issue : Manufacturing setting > Backflush Raw Material Based on “Material Transferred for Manufacture” doesn't fetch the actual raw material transferred qty. It fetches qty based on "BOM"

The issue is because @creamdory in PR #https://github.com/frappe/erpnext/pull/13384
commit : https://github.com/frappe/erpnext/pull/13384/files#diff-91f0ed661ef4b6e1f167fc7961b1a79b

```
changed from: if trans_qty and manufacturing_qty >= (produced_qty + flt(self.fg_completed_qty)):
to : if trans_qty and manufacturing_qty > (produced_qty + flt(self.fg_completed_qty)):
```
**'='** was added by her in the condition, which was not there before her commit.
Kindly except the fix for the issue.


https://github.com/frappe/erpnext/blob/develop/erpnext/stock/doctype/stock_entry/stock_entry.py#L1057

https://github.com/frappe/erpnext/pull/13384

https://github.com/frappe/erpnext/pull/13384/files#diff-91f0ed661ef4b6e1f167fc7961b1a79b

**before fix gif** :  Stock Entry = Manufacture shows raw material quantity as per BOM.

![FetchTransQtyError](https://user-images.githubusercontent.com/29812965/74123824-ffdd8600-4bf5-11ea-8873-95de24a7ef09.gif)

**after fix gi**f :  Stock Entry = "Manufacture" shows raw material quantity as per "Material Transfer for Manufacture".

![FetchTransQtyFix](https://user-images.githubusercontent.com/29812965/74123836-0c61de80-4bf6-11ea-86fb-d9619fd9b02b.gif)
2020-02-10 11:13:27 +05:30
Deepesh Garg
0e396a62b1 Merge pull request #20554 from ruchamahabal/fix_regional_data_v12
fix: patch for creating irs_1099 custom field (United States)
2020-02-10 09:08:55 +05:30
Rucha Mahabal
1343a4b755 fix: patch for creating irs_1099 custom field (United States) 2020-02-10 00:31:44 +05:30
rohitwaghchaure
ec45c096a0 fix: pricing rule not working on item groups (#20546) 2020-02-09 19:45:42 +05:30
thefalconx33
c7e523cee4 fix: mandatory warehouse wrror while updating items after submission 2020-02-09 12:21:01 +05:30
rohitwaghchaure
9e436336e2 Merge pull request #20542 from rohitwaghchaure/fixed_incorrect_material_request_warehouse_in_production_plan
fix: incorrect warehouse for material request in production plan
2020-02-07 17:43:32 +05:30
Rohit Waghchaure
a9205adfbd fix: test cases 2020-02-07 15:38:56 +05:30
Deepesh Garg
f5bff5f15d fix: Styling and minor fixes 2020-02-07 15:25:43 +05:30
Rohit Waghchaure
bbeacb9acf fix: incorrect warehouse for material request in production plan 2020-02-07 15:04:37 +05:30
Rohit Waghchaure
7027584391 fix: time out error while submitting the purchase receipt which has more than 100 serial nos 2020-02-07 14:41:00 +05:30
Deepesh Garg
372d4e2e05 Merge branch 'group_by_sales_v12' of github.com:deepeshgarg007/erpnext into group_by_sales_v12 2020-02-07 11:10:10 +05:30
Deepesh Garg
bdfa2ff33a fix: Do not calculate total for rate 2020-02-07 11:09:43 +05:30
Deepesh Garg
787b31674a Merge pull request #20534 from rohitwaghchaure/procurement_tracker_not_working_for_special_char_company_name_v12_hotfix
fix: Procurement Tracker report not working
2020-02-07 10:44:13 +05:30
Rohit Waghchaure
0eb9f7408e fix: Procurement Tracker report not working 2020-02-06 14:38:51 +05:30
Deepesh Garg
5c96415eb5 Merge pull request #20530 from nextchamp-saqib/mv-fix-v12
fix: typo; serial no doesn't have amc start date
2020-02-06 13:58:29 +05:30
thefalconx33
d9f8347fc8 fix: typo; serial no doesn't have amc start date 2020-02-06 12:58:48 +05:30
Deepesh Garg
2a48fe6ce6 Merge pull request #20524 from deepeshgarg007/bank_account_label__v12
Bank account label  v12
2020-02-05 18:04:12 +05:30
deepeshgarg007
3ed574532d fix: filter 2020-02-05 18:02:31 +05:30
deepeshgarg007
9f58e59a2c fix: Label and UX fixes while creating payment entry against customer 2020-02-05 18:02:19 +05:30
Deepesh Garg
23c6d6cf16 Merge pull request #20522 from rohitwaghchaure/picklist_nonetype_error
fix: unsupported operand type(s) for += 'int' and 'NoneType'
2020-02-05 17:44:46 +05:30
Rohit Waghchaure
8e0a9e8748 fix: unsupported operand type(s) for += 'int' and 'NoneType' 2020-02-05 16:17:16 +05:30
Deepesh Garg
67dbeee7b2 fix: Add total row 2020-02-05 15:34:08 +05:30
Parth J. Kharwar
b4a0c773ae fix: half day leave date value reset (#20488)
* fix: full day leaves not tagged as half day in attendance

* chore: code cleanup for half day date value set
2020-02-05 15:00:58 +05:30
Anurag Mishra
ce598530db fix: requested changes 2020-02-05 12:49:11 +05:30
Deepesh Garg
694f57fbb4 Merge pull request #20521 from deepeshgarg007/fixnancial_query_fix_v12
fix: SQL query in financial statements
2020-02-05 12:33:06 +05:30
Deepesh Garg
0f90b870fb fix: SQL query in financial statements 2020-02-05 12:30:15 +05:30
Nabin Hait
bd5b37dbb7 Merge branch 'v12-pre-release' into version-12 2020-02-03 19:00:36 +05:30
Nabin Hait
7e93e87244 bumped to version 12.4.3 2020-02-03 19:20:36 +05:50
Deepesh Garg
02f4aa6db6 fix: Unable to submit landed cost voucher (#20494)
* fix: Unable to submit landed cost voucher

* fix: Test case for multiple landed cost voucher against a Purchase receipt

* fix: Test Case
2020-02-03 18:56:43 +05:30
Deepesh Garg
ade2c36123 fix: Unable to submit landed cost voucher (#20494)
* fix: Unable to submit landed cost voucher

* fix: Test case for multiple landed cost voucher against a Purchase receipt

* fix: Test Case
2020-02-03 18:54:35 +05:30
Pranav Nachnekar
3ef80f2d2e fix: disallow quick entry for doctypes with tree view (#20453)
* fix: imporer escaping

* fix: disallow quick entry for doctypes with tree view
2020-02-03 17:05:30 +05:30
Himanshu
85c6480b41 fix(Report): Quality Review report sql fix (#20425)
* fix: report fix

* fix: add QM permission

* fix: add QM permission
2020-02-03 16:16:42 +05:30
Saqib
f3c94315c3 feat: add tax category in pos profile (#20414)
* feat: add tax category in pos profile

* fix: review fixes
2020-02-03 15:53:22 +05:30
Saqib
a4219f1cfe fix: gst permission for gst settings & hsn code (#20501)
* fix: gst permission for gst settings & hsn code

* Fix: Typo

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2020-02-03 15:40:53 +05:30
Deepesh Garg
831a7ddd6f fix: Minor fixes 2020-02-01 23:15:21 +05:30
Parth J. Kharwar
43886ca016 fix: employee checkin doctype time permissions (#20473) 2020-01-31 14:37:56 +05:30
rohitwaghchaure
61b4244837 Merge pull request #20479 from deepeshgarg007/finance-book-filter-new-v12
fix: Do not show any finance book record if no finance book filter is applied
2020-01-31 13:19:49 +05:30
Deepesh Garg
6871979acc Merge pull request #20470 from alyf-de/version-12-hotfix
fix(regional): byte strings in DATEV Report
2020-01-31 11:20:51 +05:30
Deepesh Garg
bb7cf81d52 fix: Cash flow filter fix 2020-01-31 11:18:26 +05:30
Deepesh Garg
9826291c52 fix: Filtering fixes in financial statement 2020-01-31 11:18:13 +05:30
racitup
08661250d2 Ignore codacy SQL injection warning (internal code only) and add copyright notice 2020-01-30 15:22:34 +00:00
racitup
814001a90f fix: attempt at pymysql InternalError 1054 about clearance_date in field list when removing payments from bank transactions 2020-01-30 15:22:34 +00:00
racitup
eef73a0d92 manually added patch for bank reconciliation fields since develop branch was in a different place #20380 2020-01-30 15:22:34 +00:00
racitup
a1e3202054 fix: Bank Reconciliation Bank Account and Bank Account No field names 2020-01-30 15:22:34 +00:00
racitup
bee017e17c fix: Plaid transaction import order, transaction_id duplicate check, added transaction category tags 2020-01-30 15:22:34 +00:00
racitup
a054508211 fix: Plaid automatic_synchronization TypeError on filter & add info log message #20343 2020-01-30 15:22:34 +00:00
racitup
feaa82a8ea fix: KeyError about bank_account_no due to non-existent field: #20343 2020-01-30 15:22:34 +00:00
racitup
a175e06149 fix: pymysql.err.InternalError about t2.bank_account_no due to removal of field from Journal Entry Account table: #20343 2020-01-30 15:22:34 +00:00
Deepesh Garg
ba4d9469ff fix: Do not show any finance book record if no finance book filter is applied 2020-01-30 15:41:44 +05:30
Deepesh Garg
54c6f91dde Merge pull request #20474 from ParthKharwar/hotfix-brand-breadcrumb
fix: rename breadcrumb for Brand DocType from Selling to Stock
2020-01-30 13:14:21 +05:30
Parth Kharwar
e552e958de fix: rename breadcrumb for Brand DocType from Selling to Stock 2020-01-30 12:35:02 +05:30
Raffael Meyer
7524ecbc59 fix #20469 2020-01-30 00:08:25 +01:00
Deepesh Garg
be2ca5f8cc Merge pull request #20460 from 0Pranav/fix-supplier-quotation-button-v12
fix: missing plus button in request for quotaion for supplier quotation
2020-01-29 10:45:32 +05:30
0Pranav
d4d641a07e fix: missing plus button in request for quotaion for supplier quotation 2020-01-29 09:36:48 +05:30
rohitwaghchaure
8e5b812a97 fix: incorrect work order qty for sub assembly items (#20448) 2020-01-28 14:34:54 +05:30
Nabin Hait
df94f0565e fix: cannot complete task if dependent task are not completed / cancelled (#20434) 2020-01-28 14:08:48 +05:30
Anurag Mishra
637915f295 fix: odometer value was not syncing properly 2020-01-28 13:15:26 +05:30
Pranav Nachnekar
f2838c4a13 fix: discounting not applied on sales invoice created by subscriptions (#20432)
* fix: imporer escaping

* fix: discounting not applied on sales invoice created by subscriptions
2020-01-28 12:52:42 +05:30
Marica
fe56c7ce39 fix: Column 'project' in where clause is ambiguous (#20439)
* fix: Column 'project' in where clause is ambiguous

* fix: Fixed alias in query
2020-01-28 12:44:03 +05:30
Deepesh Garg
29ecbde445 Merge pull request #20446 from Alchez/v12-driver-address-fetch
fix: only fetch driver address if not set (v12)
2020-01-28 09:20:53 +05:30
Deepesh Garg
611f212aa4 Merge pull request #20443 from fproldan/fix_sqlinjection_hotfix_v12
fix: SQL Injection in get_product_list_for_group method
2020-01-28 09:18:11 +05:30
Rohan Bansal
6fbafa1924 fix: only fetch driver address if not set 2020-01-27 18:04:33 +05:30
NahuelOperto
875bac8bb9 Fix sql injection 2020-01-27 08:58:01 -03:00
Saqib
b4b410f1d2 refac: filters and columns of fixed asset register report (#20420) 2020-01-27 16:06:15 +05:30
deepeshgarg007
eec0ee83e2 fix: Changes in total row display 2020-01-27 15:51:20 +05:30
Deepesh Garg
148951e6f3 fix: Finance book filtering in financial statements (#20411)
* fix: Finance book filtering in financial statements

* fix: Use IS NULL instead of ifnull
2020-01-27 15:18:45 +05:30
Saqib
612e3b77fd fix: incorrect status for fraction of outstanding amount (#20370) 2020-01-27 14:23:05 +05:30
Deepesh Garg
a60849f6ab Merge pull request #20415 from hrwX/customer_primary_addr_v12
fix(Customer): Change `primary_address` fieldtype to Text
2020-01-27 12:33:38 +05:30
deepeshgarg007
6f27e97980 fix: Add group by functionality to purchase register 2020-01-27 08:49:52 +05:30
deepeshgarg007
8d9145aaac fix: Code cleanup and commonification 2020-01-27 08:49:42 +05:30
Himanshu Warekar
25a7330db0 fix: change primary addr fieldtype to Text 2020-01-24 17:36:59 +05:30
Saqib
92c999afcb fix: wrong outstanding invoices fetched against employee (#20374) 2020-01-24 16:23:05 +05:30
Anurag Mishra
9e3dc25b1c fix: Duplicate Attendance Due Wrong Date format (#20389) 2020-01-24 16:14:38 +05:30
Rucha Mahabal
2a3cd7d601 fix(Healthcare): disabled Lab Test Template shown as Enabled in List View (#20379)
* fix (Healthcare): disabled Lab Test Template shown as enabled in List View

* fix: remove custom disabled button and unhide disabled field
2020-01-24 16:11:16 +05:30
Marica
3ca67ceebb fix: Product Page non-stock item status (#20384) 2020-01-24 15:52:12 +05:30
Rucha Mahabal
245fc49089 fix: healthcare settings registration fee NoneType error (#20396) 2020-01-24 15:50:40 +05:30
rohitwaghchaure
78199dbf0a Merge pull request #20399 from rohitwaghchaure/fixed_serial_no_button_not_working_v12_hotfix
fix: add serial no button not working
2020-01-24 13:49:25 +05:30
Deepesh Garg
2ac33c9ce9 Merge pull request #20402 from deepeshgarg007/general_ledger_sort_v12
fix: Order GL entries by creation time in General ledger
2020-01-24 13:19:56 +05:30
Deepesh Garg
34cd035d8c Merge pull request #20392 from rohitwaghchaure/unlink_reference_name_from_batch_on_cancel_of_stock_transactions
fix: unlink references from batch on cancellation of stock transactions
2020-01-23 22:41:21 +05:30
deepeshgarg007
ba4f565ca3 fix: Order GL entries by creation time in General ledger 2020-01-23 17:48:41 +05:30
Rohit Waghchaure
5860427bc5 delete the auto created batch 2020-01-23 17:43:30 +05:30
Rohit Waghchaure
89f42eef49 fix: add serial no button not working 2020-01-23 15:53:45 +05:30
Deepesh Garg
eacbfa15c0 Merge pull request #20385 from rohitwaghchaure/fixed_lead_date_comparision_issue
fix: lead date comparison issue
2020-01-23 15:23:28 +05:30
Deepesh Garg
5d45c2c184 Merge pull request #20387 from rohitwaghchaure/lead_showing_two_times_in_the_report
fix: lead details duplicate entries
2020-01-23 15:21:11 +05:30
Deepesh Garg
b24b0378ea Merge pull request #20382 from nextchamp-saqib/small-fix-asset-v12
fix: tuple index out of range error
2020-01-23 15:02:29 +05:30
Rohit Waghchaure
144012a5de fix: unlink references from batch on cacnellation of stock transactions 2020-01-23 12:42:42 +05:30
rohitwaghchaure
5fb4027375 Merge pull request #20376 from rohitwaghchaure/zero_division_qty_error_while_completing_fg_entry_v12_pre_release
fix: Zero division error while making finished good entry against the…
2020-01-22 17:01:21 +05:30
rohitwaghchaure
3fa65f1363 Merge pull request #20375 from rohitwaghchaure/zero_division_qty_error_while_completing_fg_entry
fix: Zero division error while making finished good entry against the…
2020-01-22 17:00:44 +05:30
Rohit Waghchaure
79f630661a fix: lead details duplicate entries 2020-01-22 16:53:30 +05:30
Rohit Waghchaure
61b9fe6a81 fix: lead date comparison issue 2020-01-22 14:43:37 +05:30
thefalconx33
f38d9d8f0d fix: tuple index out of range error 2020-01-22 12:24:03 +05:30
Rohit Waghchaure
3a67daa1fd fix: Zero division error while making finished good entry against the work order 2020-01-21 19:25:27 +05:30
Rohit Waghchaure
813726b415 fix: Zero division error while making finished good entry against the work order 2020-01-21 19:22:27 +05:30
rohitwaghchaure
87fe2143be fix: not able to import chart of account if parent account is missing (#20367) 2020-01-21 15:32:12 +05:30
Saqib
c759b06f16 fix: account not added to child company (#20364)
* fix: account not added to child company

* fix: removed print

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-01-21 15:26:46 +05:30
Chinmay Pai
c32249a72f fix: Set Quotation expired if not Ordered or Lost (#20365)
Co-authored-by: Chinmay Pai <chinmaydpai@gmail.com>

Co-authored-by: KanchanChauhan <angel143.dr@gmail.com>
2020-01-21 14:12:49 +05:30
Nabin Hait
7cd6022a0b Merge branch 'v12-pre-release' into version-12 2020-01-21 13:07:27 +05:30
Nabin Hait
67274d01e8 bumped to version 12.4.2 2020-01-21 13:27:26 +05:50
Nabin Hait
19d7e43b90 fix: Don't fetch price list rate on change of qty (#20360) 2020-01-21 13:04:30 +05:30
Nabin Hait
05f4be69f4 fix: Don't fetch price list rate on change of qty (#20362) 2020-01-21 13:04:26 +05:30
Mangesh-Khairnar
541881162a fix: calculate remaining leave balance (#20342)
* fix: calculate remaining leave balance

* fix: nonetype issue in the total leaves calculation
2020-01-20 19:42:49 +05:30
Sahil Khan
c8884257b9 Merge branch 'v12-pre-release' into version-12 2020-01-20 18:02:31 +05:30
Sahil Khan
4674fec320 bumped to version 12.4.1 2020-01-20 18:22:31 +05:50
rohitwaghchaure
c7f0ab8ed6 fix: incorrect number of gl entries issue (#20351) 2020-01-20 17:53:44 +05:30
rohitwaghchaure
19c5e031a9 fix: incorrect number of gl entries issue (#20350) 2020-01-20 17:52:53 +05:30
Marica
8b943af911 fix: 'get_additonal_costs' is not defined (#20349)
* fix: 'get_additonal_costs' is not defined

* fix: Re-added get_items on Work order change.
2020-01-20 15:47:47 +05:30
Marica
863eb86a1d fix: 'get_additonal_costs' is not defined (#20345)
* fix: 'get_additonal_costs' is not defined

* fix: Re-added get_items on Work order change.
2020-01-20 15:46:50 +05:30
Nabin Hait
e5fbebe126 fix: deprecated fetching item price based on min_qty (#20348) 2020-01-20 15:45:09 +05:30
Nabin Hait
45be9fe416 fix: deprecated fetching item price based on min_qty (#20346) 2020-01-20 15:44:48 +05:30
Nabin Hait
1596352585 fix: close_opportunity_after_days field is in selling settings (#20334) 2020-01-17 15:59:02 +05:30
Nabin Hait
4b893b1d51 fix: Plaid TypeError in add_bank_accounts (#20336) 2020-01-17 15:57:43 +05:30
Parth J. Kharwar
d85e144944 chore: changed employee contact field name (#20227) 2020-01-17 11:47:49 +05:30
Rohan
4dfff5a271 fix: handle default value for batch size in BOM operation (#20327) 2020-01-17 11:46:00 +05:30
Pranav Nachnekar
c2b9598966 fix: imporer escaping (#20329) 2020-01-17 11:45:03 +05:30
Vishal Dhayagude
d16e7c096b fix: salary structure assignment filter employee based on company (#20319)
* fix: pick company from employee salary structure

* fix: Salary structure assignment fetch company from enmployee

* Revert "fix: Salary structure assignment fetch company from enmployee"

This reverts commit ab2da691c79646d6d095f347ea3e273f466ee34f.

* fix: Salary structure assignment fetch company from enmployee

* fix: filter on company for salary structure assignment

* fix: minor changes

* fix: minor changes

* fix: added company to salary strucutre assignment
2020-01-17 11:44:20 +05:30
sahil28297
d5676a87a8 Merge pull request #20331 from 0Pranav/version-12
fix: imporer escaping
2020-01-16 17:51:32 +05:30
0Pranav
73dff8993a fix: imporer escaping 2020-01-16 17:38:11 +05:30
Sahil Khan
0ef799dff8 Merge branch 'v12-pre-release' into version-12 2020-01-16 14:30:35 +05:30
Sahil Khan
e8476ef42a bumped to version 12.4.0 2020-01-16 14:50:35 +05:50
Himanshu
5511912251 fix: don't hide primary_address_and_contact_detail (#20321) 2020-01-16 13:39:03 +05:30
Saqib
514d3c37b9 fix: hide total amount field from journal entry PF (#20325) 2020-01-16 13:38:21 +05:30
Nabin Hait
9fef6e1b68 docs: Added change log for v12.4.0 (#20326) 2020-01-16 13:37:46 +05:30
Nabin Hait
37c51f5913 fix: Multiple fixes based on testing on pre-release branch (#20300)
* fix: Multiple fixes based on testing on pre-release branch

* fix: reload hr settings
2020-01-16 13:37:30 +05:30
Nabin Hait
7721954bbb fix: Multiple fixes based on testing on pre-release branch (#20303)
* fix: Multiple fixes based on testing on pre-release branch

* fix: reload hr settings
2020-01-16 13:37:20 +05:30
Nabin Hait
7e33d875e0 Revert "fix: incorrect required qty for subcontracting purchase receipt (#20288)" (#20323)
This reverts commit b65b525c44.
2020-01-16 13:02:40 +05:30
Marica
0a50088a0e fix: Applied query on PO Supplier popup field in Material Request. (#20232) 2020-01-15 19:24:10 +05:30
Marica
6ba6ba27bd fix: Missing argument in status updater (#20284) 2020-01-15 19:22:21 +05:30
Saqib
611e23c149 fix: make jv depreciations only if calculate depr is checked (#20283) 2020-01-15 19:05:42 +05:30
sahil28297
89affd8d09 fix(patch): reload tax category (#20307) 2020-01-15 18:58:09 +05:30
sahil28297
ab2e52ca07 fix(patch): reload tax category (#20309) 2020-01-15 18:57:40 +05:30
sahil28297
8dfd5535f1 fix(patch): do not append taxes to template if account name is not set (#20311) 2020-01-15 18:57:20 +05:30
sahil28297
dc0ea3fdb0 fix(patch): do not append taxes to template if account name is not set (#20310) 2020-01-15 18:57:08 +05:30
rohitwaghchaure
b65b525c44 fix: incorrect required qty for subcontracting purchase receipt (#20288) 2020-01-15 16:37:10 +05:30
Saqib
8c45ae73b3 fix: get existing payment req amount only from unpaid req (#20290) 2020-01-15 16:36:19 +05:30
rohitwaghchaure
4872417f86 fix: incorrect number of GL Entries error in stock entry (#20298) 2020-01-15 16:35:15 +05:30
rohitwaghchaure
fed9e2861c fix: incorrect number of GL Entries error in stock entry (#20297) 2020-01-15 16:35:02 +05:30
Pranav Nachnekar
c50f08a23a fix: remove debugger statement (#20294)
introduced in https://github.com/frappe/erpnext/pull/20222
2020-01-15 14:49:42 +05:30
Pranav Nachnekar
6e115638a1 fix: remove debugger statement (#20295)
backport of https://github.com/frappe/erpnext/pull/20294
2020-01-15 14:49:28 +05:30
Saqib
2d37bbedaa fix: auto cancel if movement exists (#20268)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-01-14 12:42:43 +05:30
rohitwaghchaure
00f6f114e7 Merge pull request #20278 from rohitwaghchaure/fixed_report_stock_and_account_value_comparison_v12_pre_release
fix: filter issue for the stock and account value comparision report
2020-01-14 12:19:04 +05:30
rohitwaghchaure
437be1162e Merge pull request #20277 from rohitwaghchaure/fixed_report_stock_and_account_value_comparison_v12_hotfix
fix: filter issue for the stock and account value comparision report
2020-01-14 12:18:50 +05:30
Rohit Waghchaure
ca4789c9f7 fix: filter issue for the stock and account value comparision report 2020-01-14 12:17:27 +05:30
Rohit Waghchaure
e3b6a14ab1 fix: filter issue for the stock and account value comparision report 2020-01-14 12:15:06 +05:30
Saqib
eb7893768b fix: payment entry can be created against on hold PI (#20271) 2020-01-14 12:07:30 +05:30
Saqib
6e1ef4f5c2 fix: gl not generated on manual asset creation (#20266) 2020-01-14 11:38:00 +05:30
Saqib
d56bc81daf fix: gl not generated on manual asset creation (#20267) 2020-01-14 11:36:47 +05:30
Deepesh Garg
7d7027f47c fix: Remove patch to set automatic tax fetching from item tax template (#20235)
* fix: Remove patch to set automatic tax fetching from item tax template

* fix: Remove duplicate patch
2020-01-13 15:09:21 +05:30
Deepesh Garg
a14f72590d fix: Remove patch to set automatic tax fetching from item tax template (#20236)
* fix: Remove patch to set automatic tax fetching from item tax template

* fix: Remove duplicate patch
2020-01-13 15:09:16 +05:30
Deepesh Garg
7086ecb3b0 Merge pull request #20246 from nextchamp-saqib/asset-cancel-fix-v12
fix: auto cancel if movement exists
2020-01-13 15:07:57 +05:30
Saqib
4b401f0573 Merge pull request #20263 from nextchamp-saqib/customer-jv-fix-v12-pre
fix: remove default customer as party type
2020-01-13 14:12:22 +05:30
thefalconx33
5beee8af58 fix: remove default customer as party type 2020-01-13 13:51:17 +05:30
Deepesh Garg
8508ace50e Merge pull request #20258 from nextchamp-saqib/revery-hv-v12
fix: remove default customer as party type
2020-01-13 13:49:20 +05:30
thefalconx33
c52ef56875 fix: remove default customer as party type 2020-01-13 12:45:08 +05:30
deepeshgarg007
4dfe8ab483 fix: Remove debug param 2020-01-12 22:15:25 +05:30
deepeshgarg007
ea5e0a9d5b fix: Grand total query fix 2020-01-12 21:56:31 +05:30
deepeshgarg007
30111e6403 fix: Remove group-by item 2020-01-12 21:56:22 +05:30
deepeshgarg007
e5a572a4a8 fix: Group by sales register report 2020-01-12 21:56:12 +05:30
thefalconx33
83ed7df8cd fix: auto cancel if movement exists 2020-01-11 14:20:18 +05:30
Deepesh Garg
97e93c6257 Merge pull request #20238 from deepeshgarg007/hsn_template_v12
fix: Item tax template fetching from HSN Code
2020-01-10 21:45:22 +05:30
Deepesh Garg
f7cd8c2702 Merge pull request #20239 from deepeshgarg007/hsn_template_v12
fix: Item tax template fetching from HSN Code
2020-01-10 21:43:26 +05:30
deepeshgarg007
f67b3f8a79 fix: Item tax template fetching from HSN Code 2020-01-10 15:04:34 +05:30
Nabin Hait
8356d214e1 Merge branch 'version-12-hotfix' into v12-pre-release 2020-01-09 15:09:20 +05:30
rohitwaghchaure
64f3577148 feat: report to show difference between stock and account value (#20226) 2020-01-09 15:05:26 +05:30
Marica
ff3ff9a3c2 fix: Employee name in Report trial balance for party (#20224)
* fix: Employee name in Report trial balance for party

* fix: Add account filter in trial balance for party report

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2020-01-09 13:34:30 +05:30
Pranav Nachnekar
03c1396fc7 fix: Parent Item of Product Bundle should not appear in dialog (#20222)
* fix: add new delivery note button in Sales Order

* fix: parent item should not appear in raw material request dialog
2020-01-09 13:31:53 +05:30
Pranav Nachnekar
4479b93c1a fix: escape % in customer name (#20203)
* fix: add new delivery note button in Sales Order

* fix: escape % in customer name

* Update sales_order.js

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-01-09 12:22:11 +05:30
Anurag Mishra
da82edf711 fix: submit salary is not showing after creating slary slip in payroll (#20225) 2020-01-09 12:06:14 +05:30
Saqib
7b8bf4f4d4 Merge pull request #20213 from nextchamp-saqib/pay-entry-v12
fix: paid amount gets overwritten by get_outstanding_invoices
2020-01-07 13:33:16 +05:30
thefalconx33
07c915d00b fix: paid amount gets overwritten by get_outstanding_invoices 2020-01-07 13:14:01 +05:30
Marica
75b62cdd9f fix: Added description and title to supplier selection popup in Material Request. (#20180) 2020-01-07 13:06:13 +05:30
Don-Leopardo
54f2d53522 fix: get_item_price not working properly (#20206)
* fix: min_qty not working without party and valid_from not being used to order results

* fix: fetch price on item qty change
2020-01-07 11:35:56 +05:30
Deepesh Garg
55bdaae3ee feat: Validity for Item taxes (#20136)
* feat: Validity for Item taxes

* fix: Add HSN wise taxes

* fix: Sort taxes based on validity

* fix: Validation for item tax template and filters based on validity

* fix: Add missing semicolon

* fix: Validate tax template only if item code available

* fix: Do not validate or filter item tax template if no item taxes applied

* fix: Consider item group for validating taxes

* fix: Test cases for item tax  validation

* fix: Item tax template filtering fixes

* fix: Add missing semicolon

* fix: Remove unnecessary query
2020-01-07 11:31:19 +05:30
sahil28297
6bbfce13fe fix(item_tax_template): fetch parent account if not set (#20197) 2020-01-07 11:30:18 +05:30
Pranav Nachnekar
0980ebe93e fix: add new delivery note button in Sales Order (#20200)
* fix: add new delivery note button in Sales Order

* fix: removed debugger

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-01-07 11:29:45 +05:30
Rohan
ded5a255af fix: integer UOM check in transactions (#20177) 2020-01-07 11:24:02 +05:30
Anurag Mishra
13c29aeec4 fix: loan deduction during creation of bank entry in payroll (#20194) 2020-01-07 11:13:58 +05:30
rohitwaghchaure
cf261d0788 Merge pull request #20196 from rohitwaghchaure/fixed_party_type_in_payment_request_hotfix
fix: incorrect party type in payment request
2020-01-06 15:16:30 +05:30
Rohit Waghchaure
3074679d7e fix: party type in payment request 2020-01-06 15:09:09 +05:30
rohitwaghchaure
a037f9d55e Merge pull request #20171 from nabinhait/inter-company-serial-no-outgoing-rate-v12
fix: Get outgoing rate of serial no from SLE if serial no already transferred to another company
2020-01-06 12:06:08 +05:30
rohitwaghchaure
3530d0d7c9 fix: incorrect valuation rate for finished good entry (#20166) 2020-01-06 11:51:36 +05:30
Deepesh Garg
3da9967fa8 Merge pull request #20178 from Alchez/fix-v12-item-price-list-view
feat: show item name in Item Price list view (v12)
2020-01-06 08:06:07 +05:30
Himanshu
f276e8d6a1 fix(plaid): change json structure (#20190) 2020-01-06 01:01:37 +05:30
Rohan
9e0d9aa947 feat: show item name in Item Price list view (#20156) 2020-01-03 15:21:58 +05:30
Marica
df363d7dd6 Merge pull request #20173 from nextchamp-saqib/item-min-qty-v12
ux: add description for minimum purchase qty
2020-01-03 12:54:45 +05:30
thefalconx33
81e2f2a45f ux: add description for minimum purchase qty 2020-01-02 19:16:36 +05:30
Nabin Hait
255361ba92 fix: Get outgoing rate of serial no from SLE if serial no already transferred to another company 2020-01-02 19:01:48 +05:30
rohitwaghchaure
67bcfde3de Merge pull request #20168 from rohitwaghchaure/fix_pricing_rule_issue_for_ignore_pricing_rule
fix: ignore pricing rule for other item group
2020-01-02 17:32:43 +05:30
Rohit Waghchaure
b6351b4ca0 fix: ignore pricing rule for other item group 2020-01-02 17:29:50 +05:30
Deepesh Garg
c5a8d33374 Merge pull request #20162 from deepeshgarg007/general_ledger_print_v12
fix: Show closing row in general ledger print
2020-01-02 17:06:05 +05:30
deepeshgarg007
f4589da806 fix: Show closing row in general ledger print 2020-01-02 12:26:12 +05:30
Rucha Mahabal
c5cd7cd65d fix(Subscription): pass start_date while computing next_schedu… (#20160) 2019-12-31 19:15:48 +05:30
Anurag Mishra
a5e56dfb6f fix: set currency to company default currency (#20158) 2019-12-31 17:23:25 +05:30
Saqib
adb35d8703 fix: don't show transfer button if already items are supplied (#20155) 2019-12-31 17:20:07 +05:30
Deepesh Garg
db4f3d98ab Merge pull request #20150 from nextchamp-saqib/rounded-total-ss-v12
feat: added provision to disable rounded total for salary slips
2019-12-31 17:03:11 +05:30
thefalconx33
cd2899f429 feat: added provision to disable rounded total for salary slips 2019-12-31 15:29:36 +05:30
thefalconx33
8f6a6e8d2a feat: added provision to disable rounded total for salary slips 2019-12-31 14:35:03 +05:30
Anurag Mishra
fd68a682ca fix(refactor): loan in HRMS (#20023)
* fix: update laon on salary slip submission and Cancelation

* fix(refactor): Loan in HRMS

* fix: Changes requested

* Update loan.py

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2019-12-31 14:01:22 +05:30
Saqib
25fd2743a8 fix: party account currency not fetched from account for SO (#20147) 2019-12-31 13:55:34 +05:30
Saqib
826989afda fix: none type object updates AR report row (#20148) 2019-12-31 13:46:39 +05:30
Marica
10622aee7f fix: Field 'other_charges_calculation' column type changed. (#20142) 2019-12-30 22:20:27 +05:30
Anurag Mishra
26e86e7576 fix: added extra condition (#20139) 2019-12-30 16:17:10 +05:30
Rucha Mahabal
efa7d5c831 fix: format currency field in bank and cash payment voucher print format (#20138) 2019-12-30 15:18:02 +05:30
rohitwaghchaure
55cf2477cd fix: incorrect batch fetched for the serialized items (#20118) 2019-12-30 13:27:10 +05:30
ci2014
5c144c992e Skip validate_duplicate_apply_on if not necessary (#20128)
Skip the validation of duplicate fields if the type is transaction, for example.
2019-12-30 11:50:43 +05:30
rohitwaghchaure
2fcc51dece fix: service item's cost showing incorrect amount in stock entry (#20105) 2019-12-30 11:42:01 +05:30
Deepesh Garg
e76670562c Merge pull request #20124 from nextchamp-saqib/so-update-items-hfix
fix: don't allow deletion of items which has work order assigned to it
2019-12-28 21:01:47 +05:30
Deepesh Garg
e1aa48968e Merge pull request #20126 from marination/stock-module-desk-hotfix
chore: Added Reports to Stock Module Desk
2019-12-28 17:45:31 +05:30
marination
2faa8f92be chore: Added Reports to Stock Module Desk 2019-12-27 17:21:08 +05:30
thefalconx33
82c5a2bf45 fix: don't allow deletion of items which has work order assigned to it 2019-12-27 17:08:57 +05:30
Marica
ed386376dc fix: Removed unneccesary Duplicate Entry Error. (#20121) 2019-12-27 16:53:09 +05:30
Marica
65353e5590 fix: Show both warehouse columns in Stock Entry Grid view. (#20114) 2019-12-27 15:30:47 +05:30
Saqib
aab1fb0d6a fix: unpaid invoices are created even if current invoice is paid (#20082) 2019-12-27 13:02:33 +05:30
Deepesh Garg
2dec923740 fix: Patch incorrect GST category in invoices (#20085)
* fix: Patch to set GST category for unregistered invoice

* fix: Move patch up in line

* fix: Remove unwanted patch statements
2019-12-27 12:58:38 +05:30
Saqib
6ea509f7f4 feat: allow adding and deleting of items in submitted SO & PO (#19912)
* feat: allow adding of items after quotation submission

* feat: allow deletion of items from submitted SO & PO

* fix: case when items are added and deleted at once

* fix: add test cases
* For deletion of items while Updating Items after submitting PO & SO
2019-12-27 12:56:17 +05:30
Sammish Thundiyil
dfdd684fbf modified: erpnext/hr/doctype/repayment_schedule/repayment_schedule.json (#20112) 2019-12-27 12:52:40 +05:30
rohitwaghchaure
b299026280 fix: incorrect reorder level in stock balance report (#20110) 2019-12-27 12:36:14 +05:30
Rohan
3d2e61eef3 fix: Add Serial No button prompt (#20098) 2019-12-27 12:34:43 +05:30
rohitwaghchaure
47eda0fa6d fix: incorrect validation for scrap items (#20108) 2019-12-27 12:21:10 +05:30
Mangesh-Khairnar
8ec1d8d5da fix: fetch opening accumulated depreciation (#20096) 2019-12-27 12:14:27 +05:30
rohitwaghchaure
6adf617a72 Merge pull request #20078 from nabinhait/rounding-adjustment-v12
fix: rounding adjustment while both inclusive tax and discount amount present
2019-12-27 11:52:10 +05:30
Deepesh Garg
7c7291ed4f Merge pull request #20088 from nextchamp-saqib/pay-reco-hfix
fix: undefined dr_or_cr_notes in case of party type Employee
2019-12-27 08:12:33 +05:30
rohitwaghchaure
a169292f6e Merge pull request #20103 from deepeshgarg007/travis-fix-v12
fix: Travis(v12)
2019-12-26 22:51:13 +05:30
thefalconx33
5869757860 fix: travis failing for leave application test 2019-12-26 21:52:54 +05:30
Deepesh Garg
6fefdb5b18 Merge pull request #20092 from nextchamp-saqib/account-period-hfix
fix: only show doctypes which impact accounting in accounting period
2019-12-26 15:23:54 +05:30
Saqib
8c08db33d7 Merge pull request #20094 from prssanna/grid-fix-v12
fix: wrong items in table being deleted
2019-12-26 14:54:16 +05:30
prssanna
bc15ea68b8 fix: wrong items in table being deleted 2019-12-26 14:44:47 +05:30
thefalconx33
ee28663836 fix: undefined dr_or_cr_notes in case of party type Employee 2019-12-26 14:43:03 +05:30
thefalconx33
c522df8f9d fix: only show doctypes which impact accounting in accounting period 2019-12-26 13:56:36 +05:30
Himanshu
d0e39e6fac fix: remove quote (#20077) 2019-12-25 15:16:35 +05:30
Nabin Hait
4c4da06a71 fix: rounding adjustment while both inclusive tax and discount amount present 2019-12-25 14:00:51 +05:30
rohitwaghchaure
827ac91e7f fix: supplier email id field not showing in the notification for purchase cycle doctypes (#20070) 2019-12-24 13:03:41 +05:30
Deepesh Garg
379b6df361 Merge pull request #20008 from deepeshgarg007/budget_variance_dimension_v12
feat: Dynamic filters for dimensions in budget variance report
2019-12-24 12:58:22 +05:30
Deepesh Garg
2e461551d6 fix: Allow creation of multiple landed cost voucher against a Purchase Document (#20059) 2019-12-24 12:55:18 +05:30
Himanshu
2d30dc583c fix: resolve ambigious error (#20067) 2019-12-24 12:31:34 +05:30
Sun Howwrongbum
9de6083dbf feat: consider expiry_date during Batch queries (#20064) 2019-12-24 12:29:05 +05:30
RJPvT
9512e55704 Update supplier_scorecard.py (#20060) 2019-12-24 12:25:05 +05:30
rohitwaghchaure
9635df4f26 Merge pull request #20066 from rohitwaghchaure/job_card_operation_id_showing_blank
fix: Map custom job card create button with dashboard
2019-12-24 12:11:16 +05:30
Rohit Waghchaure
7bbeb31015 fix: Map custom job card create button with dashboard 2019-12-24 12:08:58 +05:30
Deepesh Garg
1f4b251f53 Merge pull request #20045 from deepeshgarg007/employee_advance_return_v12
feat: Capture return amount against Employee Advance via Journal Entry
2019-12-24 11:55:24 +05:30
Deepesh Garg
34dabc715b fix: Update return amount label 2019-12-24 11:54:04 +05:30
DeeMysterio
3881ce94ef fix(employee onboarding): stop showing irrelevant job offer links for a job applicant (#20054) 2019-12-23 19:02:44 +05:30
Marica
065bbc9cb3 enhancement: Added Set Reserve Warehouse field in Purchase Order. (#19992) 2019-12-23 18:24:28 +05:30
Pranav Nachnekar
139bb92df9 fix: wrap scheduled_time with getdate (#20046) 2019-12-23 18:19:52 +05:30
Deepesh Garg
15c8caac57 fix: Do not validate accounting dimensions if from repost (#20043)
* fix: Do not check for accounting dimensions in case of repost

* fix: Do not validate accounting dimensions if from repost
2019-12-23 17:58:44 +05:30
Saqib
7b926f228f fix: bad condition while checking last asset movement entry (#20048) 2019-12-23 16:08:40 +05:30
Saqib
dab963aac0 fix: remove mandatory purchase reference for existing asset (#19981) 2019-12-23 15:56:50 +05:30
Saqib
170c9d0ab8 fix: remove mandatory purchase reference for existing asset (#19980) 2019-12-23 15:56:44 +05:30
Saqib
f27a6528db fix: exchange rate not fetching correctly (#19985) 2019-12-23 15:52:59 +05:30
Anurag Mishra
b139f2fc0f feat: fixed party and party type in Accrual journal entry (#20022) 2019-12-23 15:50:20 +05:30
Mangesh-Khairnar
498ebfba9d fix(expense-claim): update status (#20032)
* fix(expense-claim): update status

* fix(expense-claim): compare using grandtotal precision
2019-12-23 15:48:18 +05:30
Deepesh Garg
2ebafb39ac Merge pull request #20011 from nextchamp-saqib/pi-payable-filter-hotfix
fix: bad credit to filter query in purchase invoice
2019-12-23 14:51:50 +05:30
thefalconx33
adc1b9dc0a fix: bad query for debit_to field in sales invoice 2019-12-23 13:08:46 +05:30
deepeshgarg007
b7012a47a2 fix: Remove trailing whitespace and add semicolon 2019-12-23 11:13:53 +05:30
deepeshgarg007
f1036c6985 feat: Custom button to create return entry from Employee Advance 2019-12-23 11:13:44 +05:30
deepeshgarg007
8f6e989f57 feat: Capture return amount against Employee advance via Journal Entry 2019-12-23 11:13:34 +05:30
deepeshgarg007
9609cce7b7 fix: Dashboard for employee advance doctype 2019-12-23 11:13:24 +05:30
Deepesh Garg
e14961a6c6 Merge pull request #20013 from nextchamp-saqib/share-transf-perm
fix: no role has cancelling permission for share transfer doctype
2019-12-21 17:22:15 +05:30
Deepesh Garg
f47afecc42 Merge pull request #20035 from rohitwaghchaure/fixed_patch_for_add_export_type_field_in_party_master_v12_hotfix
fix: patch
2019-12-21 17:20:28 +05:30
Sahil Khan
782f45ae5f Merge branch 'v12-pre-release' into version-12 2019-12-20 17:11:52 +05:30
Sahil Khan
f9ac8f63cf bumped to version 12.3.1 2019-12-20 17:31:52 +05:50
sahil28297
411b8e86b3 Merge pull request #20036 from rohitwaghchaure/fixed_patch_for_add_export_type_field_in_party_master_v12_pre_release
fix: patch
2019-12-20 17:09:09 +05:30
Rohit Waghchaure
2b14669b58 fix: patch 2019-12-20 17:06:57 +05:30
Rohit Waghchaure
14f624f587 fix: patch 2019-12-20 17:06:00 +05:30
Sahil Khan
98ddbf05b1 Merge branch 'v12-pre-release' into version-12 2019-12-20 15:55:12 +05:30
Sahil Khan
67d25028b2 bumped to version 12.3.0 2019-12-20 16:15:12 +05:50
Mangesh-Khairnar
328d5920bd fix(expense-claim): update status (#20033)
* fix(expense-claim): update status

* fix(expense-claim): compare using grandtotal precision
2019-12-20 15:26:49 +05:30
rohitwaghchaure
81d614b6bd Merge pull request #20007 from 0Pranav/appointment-schedulling-v12
fix: multiple issues with appointment schedulling
2019-12-20 15:17:41 +05:30
rohitwaghchaure
fdb7cec244 Merge pull request #20006 from 0Pranav/appointment-schedulling-v12
fix: multiple issues with appointment schedulling
2019-12-20 15:17:23 +05:30
thefalconx33
3aabeb88b4 fix: account manager doesn't have cancel submit perm for share transfer 2019-12-20 14:49:18 +05:30
rohitwaghchaure
b7fd9a652d Merge pull request #19929 from 0Pranav/delete-company-txn-query-v12
fix: replace sql with orm query for deleting company communications
2019-12-20 13:48:23 +05:30
rohitwaghchaure
63bc8f2d90 Merge pull request #20026 from rohitwaghchaure/subcontracting_issue_for_partial_purchase_receipt
fix: incorrect consumed qty for partial purchase receipt in subcontra…
2019-12-20 13:36:06 +05:30
rohitwaghchaure
b6d7fba936 Merge pull request #20025 from deepeshgarg007/gstr-2-fix-v12
fix: Tax amount not visible for some invoices
2019-12-20 13:35:41 +05:30
rohitwaghchaure
38540e85e8 Merge pull request #20029 from deepeshgarg007/gstr-2-fix-v12
fix: Tax amount not visible for some invoices
2019-12-20 13:35:14 +05:30
rohitwaghchaure
b3d97a560f Merge pull request #20027 from rohitwaghchaure/subcontracting_issue_for_partial_purchase_receipt_pre_release
fix: incorrect consumed qty for partial purchase receipt in subcontra…
2019-12-20 13:05:19 +05:30
Rohit Waghchaure
39436c6d38 fix: incorrect consumed qty for partial purchase receipt in subcontracting 2019-12-20 12:59:56 +05:30
Rohit Waghchaure
59cecb29a0 fix: incorrect consumed qty for partial purchase receipt in subcontracting 2019-12-20 12:56:01 +05:30
deepeshgarg007
55bf951ff5 fix: Tax amount not visible for some invoices 2019-12-20 12:43:55 +05:30
Deepesh Garg
4f543ce42a Merge pull request #20015 from marination/valuation_rate_company_hotfix
fix: Company None not found in get_valuation_rate
2019-12-20 11:56:58 +05:30
Deepesh Garg
8931b3d602 Merge pull request #19989 from deepeshgarg007/sales_register_upgrade_v12
fix: Update sales register report
2019-12-19 13:53:35 +05:30
marination
b13eebe657 fix: Company None not found in get_valuation_rate 2019-12-19 13:39:41 +05:30
thefalconx33
fcb296aafb fix: no role has cancelling permission for share transfer doctype 2019-12-19 13:19:50 +05:30
thefalconx33
5109b36689 fix: bad filter query 2019-12-19 13:12:37 +05:30
deepeshgarg007
2149d7ca4f feat: Dynamic filters for dimensions in budget variance report 2019-12-19 13:05:52 +05:30
0Pranav
220a208f4e fix: default timezone selection 2019-12-19 12:28:12 +05:30
0Pranav
0c8e46fdea fix: remove timezones in js 2019-12-19 12:25:29 +05:30
Deepesh Garg
ee4901f4a0 Merge pull request #19990 from 0Pranav/mapped-doc-for-customer-quotation-v12
fix: use open_mapped_doc instead of create_new_doc
2019-12-19 12:00:53 +05:30
Deepesh Garg
a0c847920f Merge pull request #19984 from 0Pranav/mapped-doc-for-customer-quotation-v12
fix: use open_mapped_doc instead of create_new_doc
2019-12-19 12:00:23 +05:30
rohitwaghchaure
86e5ff3cf9 Merge pull request #19997 from rohitwaghchaure/fixed_pricing_rule_issue_for_product_discount_v12_hotfix
fix: Pricing Rule Discount for Product
2019-12-19 11:12:15 +05:30
rohitwaghchaure
5dd7503516 Merge pull request #19995 from rohitwaghchaure/fixed_pricing_rule_issue_for_product_discount_pre_relesae
fix: Pricing Rule Discount for Product
2019-12-19 11:11:37 +05:30
deepeshgarg007
5cc0e08a41 fix: Use get_value instead of get_doc and formatting 2019-12-19 11:07:43 +05:30
Rohit Waghchaure
6b00d60b46 fix: Pricing Rule Discount for Product 2019-12-18 17:54:28 +05:30
Rohit Waghchaure
fecf5a9a15 fix: Pricing Rule Discount for Product 2019-12-18 17:48:39 +05:30
0Pranav
5b4050a4ff add link to appointment booking in sidebar 2019-12-18 16:30:54 +05:30
0Pranav
4d7862ef4c fix: defualt timezone not getting selected 2019-12-18 16:27:16 +05:30
0Pranav
6e41475612 fix : only set price list if it exists for customer 2019-12-18 16:05:59 +05:30
sahil28297
803e0ec27c Merge pull request #19988 from rohitwaghchaure/change_log_for_v12_3_0
feat: v12_3_0 change log
2019-12-18 15:54:37 +05:30
Rohit Waghchaure
b3addff99e v12_3_0 change log 2019-12-18 15:49:32 +05:30
deepeshgarg007
c6e098881f fix: Update sales register report 2019-12-18 15:43:14 +05:30
0Pranav
200ceb5352 use open_mapped_doc instead of create_new_doc 2019-12-18 12:34:19 +05:30
rohitwaghchaure
8c50f5c23f Merge pull request #19977 from Mangesh-Khairnar/fix-compensatory-off-pre
fix: compensatory off leave creation
2019-12-18 11:29:18 +05:30
rohitwaghchaure
6351a9395c Merge pull request #19975 from rohitwaghchaure/not_able_to_make_work_order_from_bom_v12_hotfix
fix: not able to make work order from BOM
2019-12-18 11:12:45 +05:30
Rushabh Mehta
fb2153c0eb Merge pull request #19966 from alyf-de/version-12-hotfix
fix(regional): Py3 compatibility for DATEV Export
2019-12-18 08:48:50 +05:30
Mangesh-Khairnar
86600ac8b9 fix: allow creation of additional leave ledger entry 2019-12-17 18:37:15 +05:30
Mangesh-Khairnar
b76a04b470 fix: compensatory leave request creation 2019-12-17 18:37:09 +05:30
Rohit Waghchaure
bb42fc615e fix: not able to make work order from BOM 2019-12-17 18:18:17 +05:30
rohitwaghchaure
80913994da Merge pull request #19974 from rohitwaghchaure/not_able_to_make_work_order_from_bom
fix: not able to make work order from BOM
2019-12-17 18:15:37 +05:30
Rohit Waghchaure
92ecdbe0c8 fix: not able to make work order from BOM 2019-12-17 18:13:54 +05:30
rohitwaghchaure
089dcaed70 Merge pull request #19969 from rohitwaghchaure/fixed_incorrect_outstanding_amount_showing_in_the_ap_ar_report
fix: incorrect outstanding amount showing in the AP/AR report
2019-12-17 17:15:28 +05:30
Mangesh-Khairnar
03a427a9e7 Merge pull request #19961 from Mangesh-Khairnar/compensatory-off-fix
fix: compensatory leave request creation
2019-12-17 13:32:05 +05:30
Rohit Waghchaure
764c2c7f17 fix: incorrect outstanding amount shwoing in the AP/AR report 2019-12-17 12:44:19 +05:30
Mangesh-Khairnar
b4d9b80fed fix: allow creation of additional leave ledger entry 2019-12-17 12:25:25 +05:30
Raffael Meyer
215274719e fix(regional): PY3 compatibility 2019-12-16 17:33:44 +01:00
rohitwaghchaure
c920efc156 Merge pull request #19963 from rohitwaghchaure/allow_overproduction_against_work_order_version_12_hotfix
fix: not allow to over production against work order
2019-12-16 18:04:27 +05:30
rohitwaghchaure
3b9fe1ae6f Merge pull request #19959 from rohitwaghchaure/fixed_incorrect_child_bom_fecthed
fix: incorrect child boms fetched
2019-12-16 17:00:08 +05:30
Rohit Waghchaure
c76c5e699b fix: now allow to over production against work order 2019-12-16 16:59:01 +05:30
Mangesh-Khairnar
ce6923ecb6 fix: compensatory leave request creation 2019-12-16 16:56:57 +05:30
0Pranav
03db85f3e7 fix: replace sql query by orm in delete_communications and added tests 2019-12-16 16:54:03 +05:30
Rohit Waghchaure
666fba94e2 fix: incorrect children boms fetched 2019-12-16 16:18:33 +05:30
rohitwaghchaure
48a8a40703 Merge pull request #19944 from nextchamp-saqib/gl-precision-hotfix
fix: gl entries doesn't filter based on debit precision
2019-12-16 15:29:04 +05:30
rohitwaghchaure
5646816282 Merge pull request #19870 from nextchamp-saqib/website-hotfix
fix: website showing disabled items in product list
2019-12-16 15:25:07 +05:30
thefalconx33
f8df3c7af2 fix: review changes 2019-12-16 15:03:27 +05:30
rohitwaghchaure
62d4dfa883 Merge pull request #19956 from nextchamp-saqib/pos-serial-no
fix: display serial no selection on adding items to cart
2019-12-16 14:54:23 +05:30
thefalconx33
b8f9fd023b fix: display serial no selection on adding items to cart 2019-12-16 14:49:59 +05:30
rohitwaghchaure
0df3c93737 Merge pull request #19936 from benknowles/patch-3
fix: task validation error when adding tasks to projects
2019-12-16 14:01:20 +05:30
rohitwaghchaure
e0e7dcd2f6 Merge pull request #19914 from nextchamp-saqib/cart-address-hotfix
fix: enable adding of address without enabling checkout feature
2019-12-16 13:52:48 +05:30
rohitwaghchaure
d5b1baed39 Merge pull request #19907 from 0Pranav/appointment-schedulling-v12
fix: change book-appointment route
2019-12-16 13:50:47 +05:30
rohitwaghchaure
800545ff5b Merge pull request #19947 from rohitwaghchaure/pricing_rule_not_working_for_product_discount_v12_hotfix
fix: pricing rule not working for product discount
2019-12-16 13:37:45 +05:30
rohitwaghchaure
388a177f75 Merge pull request #19939 from marination/item_manufacturer_table
fix(ui): Removed 'manufacturers' table from Item Master
2019-12-16 13:36:56 +05:30
Rohit Waghchaure
821166c628 fix: schedule date 2019-12-16 12:29:39 +05:30
marination
2b8df06f8e fix: Removed validation from non existent manufacturers table 2019-12-16 12:18:24 +05:30
Rohit Waghchaure
4e8e466a98 fix: pricing rule not working for production discount 2019-12-16 11:16:36 +05:30
Deepesh Garg
31d4482336 Merge pull request #19953 from surajshetty3416/fix-profit-and-loss-statement-version-12-hotfix
fix: Profit and Lost (financial statement) report
2019-12-15 20:23:05 +05:30
Suraj Shetty
5cd8c7c722 fix: Financial statement report
- Hidden column should note be considered in the report
- Remove hardcoded currency formatting
- Remove duplicate letterhead in the report
(print_template already adds one)
- Remove extra quotes from Total Amount text
2019-12-14 23:33:14 +05:30
Deepesh Garg
e14d9b5476 Merge pull request #19951 from deepeshgarg007/patch-and-address-fix-v12
fix: Add missing import
2019-12-14 23:03:27 +05:30
deepeshgarg007
6a8ff1bebe fix: Add missing import 2019-12-14 21:31:11 +05:30
rohitwaghchaure
a41d464198 Merge pull request #19942 from deepeshgarg007/pricing_rule_fix_v12
fix: Price rule filtering fix
2019-12-13 16:01:35 +05:30
thefalconx33
980793bde0 fix: gl entries doesn't filter based on debit precision 2019-12-13 15:42:34 +05:30
deepeshgarg007
b7329eac19 fix: Price rule filtering fix 2019-12-13 13:49:12 +05:30
marination
9ec5cb2570 fix: Removed 'manufacturers' table from Item Master 2019-12-13 13:12:10 +05:30
Deepesh Garg
44296a392d Merge pull request #19735 from marination/zero-division-v12-hotfix
fix: Division by zero error in Stock Entry
2019-12-13 09:24:31 +05:30
Ben Knowles
9097c7e11c fix: task validation error when adding tasks to projects
Related to PR #19919
2019-12-12 11:30:17 -06:00
Deepesh Garg
0256d7549c Merge pull request #19931 from deepeshgarg007/regional_address_fix_v12
fix: Get regional address details
2019-12-12 16:54:34 +05:30
marination
94d8b99ef9 fix: Distribute charges based on quantity if Total Basic Amount is Zero. 2019-12-12 16:51:11 +05:30
Deepesh Garg
3fe1335f7b Merge pull request #19926 from prssanna/file-upload-fix-v12
fix: Bank statement not getting attached in Bank Reconciliation
2019-12-12 15:19:36 +05:30
Deepesh Garg
dc7a4ac8af Merge pull request #19925 from rohitwaghchaure/not_able_to_submit_the_landed_cost_voucher_version_12
fix: not able to submit the landed cost voucher
2019-12-12 15:17:05 +05:30
Deepesh Garg
c0ff769214 Merge pull request #19924 from rohitwaghchaure/not_able_to_submit_the_landed_cost_voucher_version_12_hotfix
fix: not able to submit the landed cost voucher
2019-12-12 15:16:31 +05:30
deepeshgarg007
0a527b9f9a fix: Get regional address details fix 2019-12-12 15:13:30 +05:30
prssanna
e03871f9de fix: empty fname and fcontent of uploaded file 2019-12-12 12:22:03 +05:30
Rohit Waghchaure
c0286780bd fix: not able to submit the landed cost voucher 2019-12-12 12:14:26 +05:30
Rohit Waghchaure
9cc484650b fix: not able to submit the landed cost voucher 2019-12-12 12:13:40 +05:30
rohitwaghchaure
319f126258 Merge pull request #19901 from rohitwaghchaure/not_able_to_cancel_landed_cost_voucher_v12
fix: not able to cancel the landed cost voucher
2019-12-12 12:11:02 +05:30
0Pranav
234de12836 fix: add init files for book-appointments 2019-12-12 11:20:31 +05:30
rohitwaghchaure
4c19000ed9 Merge pull request #19918 from rohitwaghchaure/fixed_pricing_rule_working_on_other_items_v12_cherry_pick
fix: pricing rule not working
2019-12-12 10:20:05 +05:30
Deepesh Garg
a1651ca5f2 Merge pull request #19898 from hrwX/qms-int-fix-v12
fix: rename labels
2019-12-12 08:45:20 +05:30
Rohit Waghchaure
4d042cd81a Merge branch 'version-12' into fixed_pricing_rule_working_on_other_items_v12_cherry_pick 2019-12-11 22:53:27 +05:30
rohitwaghchaure
d72fae670a Merge pull request #19916 from rohitwaghchaure/fixed_pricing_rule_working_on_other_items
fix: pricing rule working on non pricing rule items
2019-12-11 22:18:07 +05:30
Rohit Waghchaure
d458e25dc5 fix: pricing rule working on non pricing rule items 2019-12-11 21:55:28 +05:30
Deepesh Garg
43474a3afa Merge pull request #19896 from hrwX/project-fix_v12
fix: Set project in child table via dashboard
2019-12-11 18:43:29 +05:30
Deepesh Garg
7daa2a2085 Merge pull request #19894 from marination/rounded_total_v12_hotfix
fix: Disable Rounded Total always showing field default value
2019-12-11 18:41:25 +05:30
Deepesh Garg
45075d8915 Merge pull request #19900 from rohitwaghchaure/not_able_to_cancel_landed_cost_voucher_v12_hotfix
fix: not able to cancel the landed cost voucher
2019-12-11 18:37:34 +05:30
thefalconx33
1de3040ecb fix: additional notes from Quotations not saved in SO 2019-12-11 18:11:48 +05:30
thefalconx33
af10f659d9 fix: enable address without checkout feature
* fix add address form country link field
2019-12-11 17:44:08 +05:30
thefalconx33
6f36691c64 fix: handle scenario with no condition 2019-12-11 16:10:56 +05:30
0Pranav
dfe629aff7 fix: change book-appointment route 2019-12-11 15:18:59 +05:30
Rohit Waghchaure
23bf2a6647 fix: not able to cancel the landed cost voucher 2019-12-11 13:52:47 +05:30
Rohit Waghchaure
b69cb8080c fix: not able to cancel the landed cost voucher 2019-12-11 13:52:18 +05:30
Himanshu Warekar
f23b5ed23b fix: rename labels 2019-12-11 13:10:31 +05:30
Himanshu Warekar
0a28387c70 fix: set project 2019-12-11 12:49:43 +05:30
marination
caae8c57bc fix: Disable Rounded Total always showing field default value 2019-12-11 12:18:51 +05:30
Nabin Hait
44ae135c36 Merge branch 'version-12' into version-12-hotfix 2019-12-11 09:12:10 +05:30
Deepesh Garg
47e786ef62 fix: Rounding Adjustment GL entry fix (#19839)
* fix: Rounding Adjustment GL entry fix

* fix: Spacing in tab

* fix: Comment fix
2019-12-11 09:06:37 +05:30
Deepesh Garg
f10be395c1 fix: NoneType' object has no attribute '__getitem_'_ (#19860) 2019-12-11 09:06:25 +05:30
rohitwaghchaure
ac967d09ec fix: Item-wise Sales History report not working (#19890) 2019-12-10 21:34:20 +05:30
Saqib
d1e8e8652f fix: incorrect account mapping for child companies (#19888)
* fix: incorrect account mapping for child companies on adding account to parent company

* Update account.py
2019-12-10 21:32:57 +05:30
Deepesh Garg
72649c207f feat(regional): Auto state wise taxation for GST India (#19877)
* feat(regional): Auto state wise taxation for GST India

* fix: Update gst category on addition of GSTIN

* fix: Codacy and travis fixes

* fix: Travis

* fix(test): Update GST category only if GSTIN field available

* fix: Test Cases

* fix: Do not skip accounts if place of supply is not present

* fix: Auto GST taxation for SEZ Party types

* fix: Automatic taxation for multi state

* fix: Codacy and travis fixes

* fix: Auto GST template selection in Sales Order

* fix: Move inter state check and source state to tax category

* fix: Remove unique check from tax template

* fix: Remove unique check from tax template

* fix: Address fetching logic in Sales

* fix: fecth tax template on company address change

* fix: fetch company gstin on address change

* fix: company_gstin set value fix

* fix: Mutiple fixes and code refactor

* fix: Add missing semicolon

* fix: Company address fetching in sales invoice

* fix: Remove print statement

* fix: Import functools

* fix: Naming fixes and code cleanup

* fix: Update patches

* fix: Remove changes in patches.txt

* fix: Iteritems compatibility for python 3
2019-12-10 15:54:29 +05:30
Deepesh Garg
d06b685fdf fix: Append expense account only if expense account exists (#19881) 2019-12-10 12:15:06 +05:30
marination
6411a56cdc fix: Changed check condition and added test 2019-12-09 21:36:02 +05:30
Saqib
34b3b04fb0 fix: error message displays asset category as None (#19874)
* fix: error message displays asset category as None

* fix: asset gl_entries doesn't considers asset category's cwip account
2019-12-09 19:06:14 +05:30
Deepesh Garg
b1a2a16f43 Merge pull request #19868 from nextchamp-saqib/report-col-hotfix
fix: column data not visible after manual selection of columns
2019-12-09 17:57:41 +05:30
thefalconx33
f092e68a58 fix: website showing disabled items in product list 2019-12-09 17:03:32 +05:30
thefalconx33
6d497ccb4c fix: column data not visible after manual selection of columns 2019-12-09 15:24:39 +05:30
Deepesh Garg
a7b97f7bac Merge pull request #19867 from nextchamp-saqib/cart-fix-hotfix
fix: Error while placing order of cart items added yesterday
2019-12-09 15:23:04 +05:30
thefalconx33
f40d3bd10f fix: due date before posting date for items added to cart yesterday 2019-12-09 14:07:25 +05:30
Deepesh Garg
1e2be32860 fix: Consistency in button positions in Sales Order and Purchase Order (#19834) 2019-12-09 13:04:58 +05:30
Deepesh Garg
6aec9e32d4 fix: Rounding Adjustment GL entry fix (#19839)
* fix: Rounding Adjustment GL entry fix

* fix: Spacing in tab

* fix: Comment fix
2019-12-09 13:03:02 +05:30
Deepesh Garg
59cc0e5029 fix: NoneType' object has no attribute '__getitem_'_ (#19860) 2019-12-09 11:28:35 +05:30
Deepesh Garg
851f39cee1 Merge pull request #19837 from deepeshgarg007/gst_1_validation_msg_v12
fix: Validation msg fix in GSTR-1 report
2019-12-07 19:53:03 +05:30
rohitwaghchaure
6822a30f8c Merge pull request #19850 from rohitwaghchaure/fixed_timsheet_overlap_issue_v12_hotfix
fix: timesheet overlap error
2019-12-07 14:10:54 +05:30
Rohit Waghchaure
495ba1618b fix: timsheet overlap error 2019-12-07 13:22:08 +05:30
deepeshgarg007
778d7595aa fix: Add missing semicolon 2019-12-06 20:00:56 +05:30
deepeshgarg007
a40dbd0384 fix: Validation msg fix in GSTR-1 report 2019-12-06 19:46:32 +05:30
Deepesh Garg
80dfb9f834 Merge pull request #19835 from deepeshgarg007/accounts_payable_terms_v12
feat: Accounts Payable report based on payment terms
2019-12-06 19:41:27 +05:30
deepeshgarg007
dabb303358 feat: Accounts Payable report based on payment terms 2019-12-06 17:52:48 +05:30
Pranav Nachnekar
d16ef54665 fix: query for finding lost quotation (#19801)
* fix:query for finding lost quotation

* Update opportunity.py
2019-12-04 15:31:25 +05:30
Nabin Hait
dc248b9458 optimize: Optimization of Receivable report filtered based on sales person (#19797) 2019-12-04 15:30:39 +05:30
Nabin Hait
bf0f26b4a4 fix: Service start and end date validation for deferred accounting (#19806) 2019-12-04 15:29:54 +05:30
Mangesh-Khairnar
929fd4ce47 enhancement(fixed-asset-register): add date filter (#19804)
* feat: add date filter in the fixed asset register

* fix: remove function from keyword argument
2019-12-04 14:10:41 +05:30
Deepesh Garg
81c895b21e Merge pull request #19793 from nabinhait/ar-summary-based-on-terms-v12
feat: Receivable / payable summary based on payment terms
2019-12-04 11:23:31 +05:30
Shivam Mishra
27a21f80d7 feat: allow searching from meta fields (#19725)
* feat: allow searching from meta fields

* feat: remove description in query based on number of items
2019-12-03 17:26:50 +05:30
sahil28297
aa7085e11c fix(patch): set proper tax_type based on company and set proper account if not already present (#19788) 2019-12-03 17:07:26 +05:30
Nabin Hait
6e5363ba48 feat: Receivable / payable summary based on payment terms 2019-12-03 16:58:02 +05:30
Deepesh Garg
53746636c3 fix: Party name field in trial balacne for party report (#19790) 2019-12-03 16:30:09 +05:30
Deepesh Garg
485d48c101 fix: Unable to see parties with negative balance in AR/AP Summary (#19777) 2019-12-03 15:12:28 +05:30
Marica
0e1ef35968 fix: Item qty cannot be zero in Purchase Receipt (#19780) 2019-12-03 12:59:15 +05:30
gavin
35effe9be0 fix: AttributeError on new Student creation (#19787) 2019-12-03 12:54:18 +05:30
Shivam Mishra
648d6e46f3 fix: query for item group listing (#19785) 2019-12-03 12:52:58 +05:30
Nabin Hait
d6d9a3ddd7 Update employee.py 2019-12-03 12:52:12 +05:30
Deepesh Garg
18f05db19a Merge pull request #19763 from Mangesh-Khairnar/fix-pr-creation-so
fix(sales-order): allow payment request creation for so that are not billed
2019-12-03 10:42:53 +05:30
Rucha Mahabal
586fecfe73 fix: render_template for subject in Email Campaign (#19771) 2019-12-02 16:25:29 +05:30
sahil28297
14018b3dea bumped to version 12.2.2 2019-12-02 13:05:27 +05:30
Deepesh Garg
1c196f958f Merge pull request #19768 from deepeshgarg007/avaiable_stock_for_v12
fix: Available stock for packing item report
2019-12-02 11:57:45 +05:30
rohitwaghchaure
91f2cfb999 Merge pull request #19769 from rohitwaghchaure/sales_invoice_none_type_error_serial_no_validation
fix: Serial no validation against sales invoice
2019-12-02 09:46:23 +05:30
deepeshgarg007
c0a0331570 fix: Validation msg 2019-12-02 09:43:11 +05:30
deepeshgarg007
4ceba43e43 fix: Serial no validation against sales invoice 2019-12-02 09:43:04 +05:30
deepeshgarg007
9b64e2e24c fix: Available stock for packing item report 2019-12-01 22:20:18 +05:30
Deepesh Garg
da5e227ad6 fix: Post GL entry fix for asset (#19752) 2019-12-01 10:06:31 +05:30
Mangesh-Khairnar
4f95e5d092 fix: show create payment request for so that are not billed 2019-11-30 20:31:18 +05:30
Deepesh Garg
6a8fd0102f fix: Serial no validation against sales invoice (#19749)
* fix: Serial no validation against sales invoice

* fix: Validation msg
2019-11-29 18:48:30 +05:30
Suraj Shetty
2b172ec4b4 fix: valuation of "finished good" item in purchase receipt (#19745)
* fix: Remove redundant purchase orders and unwanted condition

* fix: [WIP] Purchase receipt value

* fix: Add raw material cost based on transfered raw material

* fix: get_qty_to_be_received

* fix: Remove debugger statement

* fix: Reset rm_supp_cost before setting subcontracted raw_materials

* test: Fix and modify tests for backflush_based_on_stock_entry

* fix: Add non stock items to Purchase Receipt from Purchase Order

* fix: Ignore valuation rate check for non stock raw material

* fix: Rename check all rows

* fix: Remove amount from test

* test: Fix item rate error

* fix: handling of serial nos in backflush

* fix: Add serial no. of raw materials

* fix: [WIP] Handle Batch nos for purchase reciept backflushed raw material

* fix: Raw material batch number selection in purchase receipt

* Update test_purchase_order.py
2019-11-29 16:59:21 +05:30
Marica
5d2ad7fc38 fix: UOM was not fetching in purchase invoice (#19732) (#19737)
* fix: UOM was not fetching in purchase invoice

* fix: Changes requested

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2019-11-28 20:00:51 +05:30
rohitwaghchaure
3347473aa1 fix: removed stock value and account balance out of sync validation (#19728) 2019-11-28 20:00:41 +05:30
Rohit Waghchaure
7f951b5595 fix: revert value out of sync feature 2019-11-28 20:00:33 +05:30
Marica
208c69f196 fix: Permission issue in Stock Entry (#19739) 2019-11-28 19:39:55 +05:30
Marica
32b69bf122 fix: UOM was not fetching in purchase invoice (#19732) (#19737)
* fix: UOM was not fetching in purchase invoice

* fix: Changes requested

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2019-11-28 19:03:14 +05:30
Marica
b1fac1817c fix: Validation for Suppliers in SO to PO (#19700)
- Check if there is a Supplier against atleast one item in Sales Order
- Validation message earlier was vague
2019-11-28 18:23:11 +05:30
Marica
6516358a71 fix: Changed type of column 'serial_no' in Stock Ledger Entry (#19704) 2019-11-28 18:20:53 +05:30
marination
c6e2087673 fix: Division by zero error in Stock Entry 2019-11-28 16:54:58 +05:30
Shivam Mishra
d8469a7bfa fix: handle None case for get_shipping_amount_from_rules (#19724) 2019-11-28 16:47:14 +05:30
Marica
cf645aceae chore: Added Quick Stock Balance to Stock Module (#19727)
- Also 'Stock Balance Report' button no longer primary button
2019-11-28 16:44:56 +05:30
rohitwaghchaure
3dd72e238f fix: removed stock value and account balance out of sync validation (#19728) 2019-11-28 16:44:05 +05:30
Deepesh Garg
b74ce74ec9 Merge pull request #19718 from deepeshgarg007/status_fix_v12
fix: Path for quotation expiry method in hooks
2019-11-28 12:24:20 +05:30
deepeshgarg007
074aaa6005 fix: Path for quotation expiry method in hooks 2019-11-28 10:31:11 +05:30
Marica
9d5f43f4f0 fix: get_batch_qty_and_serial_no() requires argument 'stock_qty' (#19694) 2019-11-27 15:50:45 +05:30
rohitwaghchaure
7522aadc6e Merge pull request #19697 from rohitwaghchaure/dont_stop_submitting_entry_due_to_mismatch_issue
fix: revert value out of sync feature
2019-11-27 12:32:04 +05:30
rohitwaghchaure
326fdcb454 Merge pull request #19687 from deepeshgarg007/sales_invoice_fix_develop
fix: Serial no validation against sales invoice
2019-11-27 11:36:10 +05:30
Rohit Waghchaure
c41addec96 fix: revert value out of sync feature 2019-11-27 08:49:08 +05:30
deepeshgarg007
defed15528 fix: Validation msg 2019-11-26 16:12:29 +05:30
deepeshgarg007
cbc29989fe fix: Serial no validation against sales invoice 2019-11-26 15:13:23 +05:30
Gavin D'souza
73089470b1 chore: pinned backwards compatible dependencies 2019-11-15 17:38:32 +05:30
Gavin D'souza
3798f8bd25 style(requirements): alphabetically sorted requirements 2019-11-15 13:59:15 +05:30
Gavin D'souza
f805a76e79 chore: pinned requirements 2019-11-13 17:27:16 +05:30
596 changed files with 22150 additions and 39082 deletions

View File

@@ -63,6 +63,7 @@ install:
- tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
- sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
- sudo chmod o+x /usr/local/bin/wkhtmltopdf
- sudo apt-get install libcups2-dev
- cd ~/frappe-bench
@@ -76,5 +77,6 @@ install:
- bench --site test_site reinstall --yes
after_script:
- pip install coverage==4.5.4
- pip install python-coveralls
- coveralls -b apps/erpnext -d ../../sites/.coverage

View File

@@ -1,3 +0,0 @@
{
"baseUrl": "http://test_site_ui:8000"
}

View File

@@ -1,5 +0,0 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

View File

@@ -1,31 +0,0 @@
context('Form', () => {
before(() => {
cy.login('Administrator', 'qwe');
cy.visit('/desk');
});
it('create a new opportunity', () => {
cy.visit('/desk#Form/Opportunity/New Opportunity 1');
cy.get('.page-title').should('contain', 'Not Saved');
cy.fill_field('opportunity_from', 'Customer', 'Select');
cy.fill_field('party_name', 'Test Customer', 'Link').blur();
cy.get('.primary-action').click();
cy.get('.page-title').should('contain', 'Open');
cy.get('.form-inner-toolbar button:contains("Lost")').click({ force: true });
cy.get('.modal input[data-fieldname="lost_reason"]').as('input');
cy.get('@input').focus().type('Higher', { delay: 200 });
cy.get('.modal .awesomplete ul')
.should('be.visible')
.get('li:contains("Higher Price")')
.click({ force: true });
cy.get('@input').focus().type('No Followup', { delay: 200 });
cy.get('.modal .awesomplete ul')
.should('be.visible')
.get('li:contains("No Followup")')
.click();
cy.fill_field('detailed_reason', 'Test Detailed Reason', 'Text');
cy.get('.modal button:contains("Declare Lost")').click({ force: true });
cy.get('.page-title').should('contain', 'Lost');
});
});

View File

@@ -1,17 +0,0 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
// module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
// }

View File

@@ -1,25 +0,0 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

View File

@@ -1,22 +0,0 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// import frappe commands
import '../../../frappe/cypress/support/index';
// Import commands.js using ES2015 syntax:
import './commands';
// Alternatively you can use CommonJS syntax:
// require('./commands')

View File

@@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '12.2.0'
__version__ = '12.10.0'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day, formatdate
from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day, formatdate, get_link_to_form
from erpnext.accounts.report.general_ledger.general_ledger import execute
from frappe.core.page.dashboard.dashboard import cache_source, get_from_date_from_timespan
from frappe.desk.doctype.dashboard_chart.dashboard_chart import get_period_ending
@@ -30,8 +30,13 @@ def get(chart_name = None, chart = None, no_cache = None, from_date = None, to_d
account = filters.get("account")
company = filters.get("company")
if not account and chart:
frappe.throw(_("Account is not set for the dashboard chart {0}").format(chart))
if not account and chart_name:
frappe.throw(_("Account is not set for the dashboard chart {0}")
.format(get_link_to_form("Dashboard Chart", chart_name)))
if not frappe.db.exists("Account", account) and chart_name:
frappe.throw(_("Account {0} does not exists in the dashboard chart {1}")
.format(account, get_link_to_form("Dashboard Chart", chart_name)))
if not to_date:
to_date = nowdate()

View File

@@ -159,7 +159,7 @@ def book_deferred_income_or_expense(doc, posting_date=None):
total_days, total_booking_days, account_currency)
make_gl_entries(doc, credit_account, debit_account, against,
amount, base_amount, end_date, project, account_currency, item.cost_center, item.name)
amount, base_amount, end_date, project, account_currency, item.cost_center, item)
if getdate(end_date) < getdate(posting_date) and not last_gl_entry:
_book_deferred_revenue_or_expense(item)
@@ -170,7 +170,7 @@ def book_deferred_income_or_expense(doc, posting_date=None):
_book_deferred_revenue_or_expense(item)
def make_gl_entries(doc, credit_account, debit_account, against,
amount, base_amount, posting_date, project, account_currency, cost_center, voucher_detail_no):
amount, base_amount, posting_date, project, account_currency, cost_center, item):
# GL Entry for crediting the amount in the deferred expense
from erpnext.accounts.general_ledger import make_gl_entries
@@ -184,10 +184,10 @@ def make_gl_entries(doc, credit_account, debit_account, against,
"credit": base_amount,
"credit_in_account_currency": amount,
"cost_center": cost_center,
"voucher_detail_no": voucher_detail_no,
"voucher_detail_no": item.name,
'posting_date': posting_date,
'project': project
}, account_currency)
}, account_currency, item=item)
)
# GL Entry to debit the amount from the expense
gl_entries.append(
@@ -197,10 +197,10 @@ def make_gl_entries(doc, credit_account, debit_account, against,
"debit": base_amount,
"debit_in_account_currency": amount,
"cost_center": cost_center,
"voucher_detail_no": voucher_detail_no,
"voucher_detail_no": item.name,
'posting_date': posting_date,
'project': project
}, account_currency)
}, account_currency, item=item)
)
if gl_entries:

View File

@@ -1,4 +1,5 @@
{
"actions": [],
"allow_copy": 1,
"allow_import": 1,
"creation": "2013-01-30 12:49:46",
@@ -196,10 +197,13 @@
],
"icon": "fa fa-money",
"idx": 1,
"modified": "2019-10-10 19:10:02.967554",
"is_tree": 1,
"links": [],
"modified": "2020-03-18 18:26:03.992861",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",
"nsm_parent_field": "parent_account",
"owner": "Administrator",
"permissions": [
{

View File

@@ -89,34 +89,35 @@ class Account(NestedSet):
throw(_("Root cannot be edited."), RootNotEditable)
if not self.parent_account and not self.is_group:
frappe.throw(_("Root Account must be a group"))
frappe.throw(_("The root account {0} must be a group").format(frappe.bold(self.name)))
def validate_root_company_and_sync_account_to_children(self):
# ignore validation while creating new compnay or while syncing to child companies
if frappe.local.flags.ignore_root_company_validation or self.flags.ignore_root_company_validation:
return
ancestors = get_root_company(self.company)
if ancestors:
if frappe.get_value("Company", self.company, "allow_account_creation_against_child_company"):
return
if not frappe.db.get_value("Account",
{'account_name': self.account_name, 'company': ancestors[0]}, 'name'):
frappe.throw(_("Please add the account to root level Company - %s" % ancestors[0]))
else:
elif self.parent_account:
descendants = get_descendants_of('Company', self.company)
if not descendants: return
parent_acc_name_map = {}
parent_acc_name = frappe.db.get_value('Account', self.parent_account, "account_name")
for d in frappe.db.get_values('Account',
{"company": ["in", descendants], "account_name": parent_acc_name},
["company", "name"], as_dict=True):
parent_acc_name, parent_acc_number = frappe.db.get_value('Account', self.parent_account, \
["account_name", "account_number"])
filters = {
"company": ["in", descendants],
"account_name": parent_acc_name,
}
if parent_acc_number:
filters["account_number"] = parent_acc_number
for d in frappe.db.get_values('Account', filters=filters, fieldname=["company", "name"], as_dict=True):
parent_acc_name_map[d["company"]] = d["name"]
if not parent_acc_name_map: return
self.create_account_for_child_company(parent_acc_name_map, descendants, parent_acc_name)
def validate_group_or_ledger(self):
@@ -174,7 +175,6 @@ class Account(NestedSet):
filters["account_number"] = self.account_number
child_account = frappe.db.get_value("Account", filters, 'name')
if not child_account:
doc = frappe.copy_doc(self)
doc.flags.ignore_root_company_validation = True

View File

@@ -1,7 +1,7 @@
frappe.provide("frappe.treeview_settings")
frappe.treeview_settings["Account"] = {
breadcrumbs: "Accounts",
breadcrumb: "Accounts",
title: __("Chart Of Accounts"),
get_tree_root: false,
filters: [
@@ -14,6 +14,9 @@ frappe.treeview_settings["Account"] = {
on_change: function() {
var me = frappe.treeview_settings['Account'].treeview;
var company = me.page.fields_dict.company.get_value();
if (!company) {
frappe.throw(__("Please set a Company"));
}
frappe.call({
method: "erpnext.accounts.doctype.account.account.get_root_company",
args: {

View File

@@ -406,11 +406,11 @@
"is_group": 1,
"Bewertungskorrektur zu Forderungen aus Lieferungen und Leistungen": {
"account_number": "9960"
},
"Debitoren": {
"is_group": 1,
"account_number": "10000"
},
},
"Debitoren": {
"is_group": 1,
"account_number": "10000"
},
"Forderungen aus Lieferungen und Leistungen": {
"account_number": "1200",
"account_type": "Receivable"
@@ -663,16 +663,22 @@
"account_number": "1400"
},
"Abziehbare Vorsteuer 7 %": {
"account_number": "1401"
"account_number": "1401",
"account_type": "Tax",
"tax_rate": 7.0
},
"Abziehbare Vorsteuer aus innergem. Erwerb": {
"account_number": "1402"
},
"Abziehbare Vorsteuer aus innergem. Erwerb 19%": {
"account_number": "1404"
"account_number": "1404",
"account_type": "Tax",
"tax_rate": 19.0
},
"Abziehbare Vorsteuer 19 %": {
"account_number": "1406"
"account_number": "1406",
"account_type": "Tax",
"tax_rate": 19.0
},
"Abziehbare Vorsteuer nach \u00a7 13b UStG 19 %": {
"account_number": "1407"
@@ -1197,15 +1203,15 @@
"is_group": 1,
"Bewertungskorrektur zu Verb. aus Lieferungen und Leistungen": {
"account_number": "9964"
},
"Kreditoren": {
"account_number": "70000",
"is_group": 1,
"Wareneingangs-­Verrechnungskonto" : {
"account_number": "70001",
"account_type": "Stock Received But Not Billed"
}
},
},
"Kreditoren": {
"account_number": "70000",
"is_group": 1,
"Wareneingangs-­Verrechnungskonto" : {
"account_number": "70001",
"account_type": "Stock Received But Not Billed"
}
},
"Verb. aus Lieferungen und Leistungen": {
"account_number": "3300",
"account_type": "Payable"
@@ -1488,17 +1494,21 @@
},
"Umsatzsteuer 7 %": {
"account_number": "3801",
"account_type": "Tax"
"account_type": "Tax",
"tax_rate": 7.0
},
"Umsatzsteuer aus innergem. Erwerb": {
"account_number": "3802"
},
"Umsatzsteuer aus innergem. Erwerb 19 %": {
"account_number": "3804"
"account_number": "3804",
"account_type": "Tax",
"tax_rate": 19.0
},
"Umsatzsteuer 19 %": {
"account_number": "3806",
"account_type": "Tax"
"account_type": "Tax",
"tax_rate": 19.0
},
"Umsatzsteuer aus im Inland steuerpfl. EU-Lieferungen": {
"account_number": "3807"
@@ -2295,49 +2305,49 @@
},
"6 - sonstige betriebliche Ertr\u00e4ge": {
"root_type": "Income",
"is_group": 1,
"Erhaltene Boni (Gruppe)": {
"is_group": 1,
"Erhaltene Boni 7 % Vorsteuer": {
"account_number": "5750"
},
"Erhaltene Boni aus Einkauf Roh-, Hilfs- und Betriebsstoffe": {
"account_number": "5753"
},
"Erhaltene Boni aus Einkauf Roh-, Hilfs- und Betriebsstoffe 7% Vorsteuer": {
"account_number": "5754"
},
"Erhaltene Boni aus Einkauf Roh-, Hilfs- und Betriebsstoffe 19% Vorsteuer": {
"account_number": "5755"
},
"Erhaltene Boni 19 % Vorsteuer": {
"account_number": "5760"
},
"Erhaltene Boni": {
"account_number": "5769"
}
},
"Erhaltene Rabatte (Gruppe)": {
"is_group": 1,
"Erhaltene Rabatte": {
"account_number": "5770"
},
"Erhaltene Rabatte 7 % Vorsteuer": {
"account_number": "5780"
},
"Erhaltene Rabatte aus Einkauf Roh-, Hilfs- und Betriebsstoffe": {
"account_number": "5783"
},
"Erhaltene Rabatte aus Einkauf Roh-, Hilfs- und Betriebsstoffe 7% Vorsteuer": {
"account_number": "5784"
},
"Erhaltene Rabatte aus Einkauf Roh-, Hilfs- und Betriebsstoffe 19% Vorsteuer": {
"account_number": "5785"
},
"Erhaltene Rabatte 19 % Vorsteuer": {
"account_number": "5790"
}
},
"is_group": 1,
"Erhaltene Boni (Gruppe)": {
"is_group": 1,
"Erhaltene Boni 7 % Vorsteuer": {
"account_number": "5750"
},
"Erhaltene Boni aus Einkauf Roh-, Hilfs- und Betriebsstoffe": {
"account_number": "5753"
},
"Erhaltene Boni aus Einkauf Roh-, Hilfs- und Betriebsstoffe 7% Vorsteuer": {
"account_number": "5754"
},
"Erhaltene Boni aus Einkauf Roh-, Hilfs- und Betriebsstoffe 19% Vorsteuer": {
"account_number": "5755"
},
"Erhaltene Boni 19 % Vorsteuer": {
"account_number": "5760"
},
"Erhaltene Boni": {
"account_number": "5769"
}
},
"Erhaltene Rabatte (Gruppe)": {
"is_group": 1,
"Erhaltene Rabatte": {
"account_number": "5770"
},
"Erhaltene Rabatte 7 % Vorsteuer": {
"account_number": "5780"
},
"Erhaltene Rabatte aus Einkauf Roh-, Hilfs- und Betriebsstoffe": {
"account_number": "5783"
},
"Erhaltene Rabatte aus Einkauf Roh-, Hilfs- und Betriebsstoffe 7% Vorsteuer": {
"account_number": "5784"
},
"Erhaltene Rabatte aus Einkauf Roh-, Hilfs- und Betriebsstoffe 19% Vorsteuer": {
"account_number": "5785"
},
"Erhaltene Rabatte 19 % Vorsteuer": {
"account_number": "5790"
}
},
"Andere aktivierte Eigenleistungen": {
"account_number": "4820"
},
@@ -2407,29 +2417,26 @@
"Erl\u00f6se aus Verk\u00e4ufen Sachanlageverm\u00f6gen (bei Buchgewinn)": {
"account_number": "4849"
},
"Erl\u00f6se aus Verk\u00e4ufen immaterieller VG (bei Buchgewinn) (Gruppe)": {
"is_group": 1,
"Erl\u00f6se aus Verk\u00e4ufen immaterieller VG (bei Buchgewinn)": {
"account_number": "4850"
},
"Erl\u00f6se aus Verk\u00e4ufen Finanzanlagen (bei Buchgewinn)": {
"account_number": "4851"
},
"Erl\u00f6se aus Verk\u00e4ufen Finanzanlagen (inl\u00e4ndische Kap.Ges., bei Buchgewinn)": {
"account_number": "4852"
},
"Anlagenabg\u00e4nge Sachanlagen (Restbuchwert bei Buchvergewinn)": {
"account_number": "4855"
},
"Anlagenabg\u00e4nge immaterielle VG (Restbuchwert bei Buchgewinn)": {
"account_number": "4856"
},
"Anlagenabg\u00e4nge Finanzanlagen (Restbuchwert bei Buchgewinn)": {
"account_number": "4857"
},
"Anlagenabg\u00e4nge Finanzanlagen (inl\u00e4ndische Kap.Ges., Restbuchwert bei Buchgewinn)": {
"account_number": "4858"
}
"Erl\u00f6se aus Verk\u00e4ufen immaterieller VG (bei Buchgewinn)": {
"account_number": "4850"
},
"Erl\u00f6se aus Verk\u00e4ufen Finanzanlagen (bei Buchgewinn)": {
"account_number": "4851"
},
"Erl\u00f6se aus Verk\u00e4ufen Finanzanlagen (inl\u00e4ndische Kap.Ges., bei Buchgewinn)": {
"account_number": "4852"
},
"Anlagenabg\u00e4nge Sachanlagen (Restbuchwert bei Buchvergewinn)": {
"account_number": "4855"
},
"Anlagenabg\u00e4nge immaterielle VG (Restbuchwert bei Buchgewinn)": {
"account_number": "4856"
},
"Anlagenabg\u00e4nge Finanzanlagen (Restbuchwert bei Buchgewinn)": {
"account_number": "4857"
},
"Anlagenabg\u00e4nge Finanzanlagen (inl\u00e4ndische Kap.Ges., Restbuchwert bei Buchgewinn)": {
"account_number": "4858"
},
"Ertr\u00e4ge aus Zuschreibungen des Sachanlageverm\u00f6gens": {
"account_number": "4910",
@@ -2552,20 +2559,17 @@
"Entnahme von Gegenst\u00e4nden ohne USt": {
"account_number": "4605"
},
"Verwendung von Gegenst\u00e4nden f. Zwecke au\u00dferhalb des Unternehmens 7 % USt (Gruppe)": {
"is_group": 1,
"Verwendung von Gegenst\u00e4nden f. Zwecke au\u00dferhalb des Unternehmens 7 % USt": {
"account_number": "4630"
},
"Verwendung von Gegenst\u00e4nden f. Zwecke au\u00dferhalb des Unternehmens ohne USt": {
"account_number": "4637"
},
"Verwendung von Gegenst\u00e4nden f. Zwecke au\u00dferhalb des Unternnehmens ohne USt (Telefon-Nutzung)": {
"account_number": "4638"
},
"Verwendung von Gegenst\u00e4nden f. Zwecke au\u00dferhalb des Unternehmens ohne USt (Kfz-Nutzung)": {
"account_number": "4639"
}
"Verwendung von Gegenst\u00e4nden f. Zwecke au\u00dferhalb des Unternehmens 7 % USt": {
"account_number": "4630"
},
"Verwendung von Gegenst\u00e4nden f. Zwecke au\u00dferhalb des Unternehmens ohne USt": {
"account_number": "4637"
},
"Verwendung von Gegenst\u00e4nden f. Zwecke au\u00dferhalb des Unternnehmens ohne USt (Telefon-Nutzung)": {
"account_number": "4638"
},
"Verwendung von Gegenst\u00e4nden f. Zwecke au\u00dferhalb des Unternehmens ohne USt (Kfz-Nutzung)": {
"account_number": "4639"
},
"Verwendung von Gegenst\u00e4nden f. Zwecke au\u00dferhalb des Unternehmens 19 % USt (Gruppe)": {
"is_group": 1,
@@ -2603,14 +2607,11 @@
"Unentgeltliche Zuwendung von Gegenst\u00e4nden ohne USt": {
"account_number": "4689"
},
"Nicht steuerbare Ums\u00e4tze (Innenums\u00e4tze) (Gruppe)": {
"is_group": 1,
"Nicht steuerbare Ums\u00e4tze (Innenums\u00e4tze)": {
"account_number": "4690"
},
"Umsatzsteuerverg\u00fctungen, z.B. nach \u00a7 24 UStG": {
"account_number": "4695"
}
"Nicht steuerbare Ums\u00e4tze (Innenums\u00e4tze)": {
"account_number": "4690"
},
"Umsatzsteuerverg\u00fctungen, z.B. nach \u00a7 24 UStG": {
"account_number": "4695"
},
"Au\u00dferordentliche Ertr\u00e4ge (Gruppe)": {
"is_group": 1,
@@ -2620,48 +2621,42 @@
"Au\u00dferordentliche Ertr\u00e4ge finanzwirksam": {
"account_number": "7401"
},
"Au\u00dferordentliche Ertr\u00e4ge nicht finanzwirksam (Gruppe)": {
"is_group": 1,
"Au\u00dferordentliche Ertr\u00e4ge nicht finanzwirksam": {
"account_number": "7450"
},
"Ertr\u00e4ge durch Verschmelzung und Umwandlung": {
"account_number": "7451"
},
"Ertr\u00e4ge durch den Verkauf von bedeutenden Beteiligungen": {
"account_number": "7452"
},
"Ert\u00e4ge durch den Verkauf von bedeutenden Grundst\u00fccken": {
"account_number": "7453"
},
"Gewinn aus der Ver\u00e4u\u00dferung oder der Aufgabe von Gesch\u00e4ftsaktivit\u00e4ten nach Steuern": {
"account_number": "7454"
}
"Au\u00dferordentliche Ertr\u00e4ge nicht finanzwirksam": {
"account_number": "7450"
},
"Au\u00dferordentliche Ertr\u00e4ge aus der Anwendung von \u00dcbergangsvorschriften (Gruppe)": {
"is_group": 1,
"Au\u00dferordentliche Ertr\u00e4ge aus der Anwendung von \u00dcbergangsvorschriften": {
"account_number": "7460"
},
"Au\u00dferordentliche Ertr\u00e4ge: Zuschreibung f. Sachanlageverm\u00f6gen": {
"account_number": "7461"
},
"Au\u00dferordentliche Ertr\u00e4ge: Zuschreibung f. Finanzanlageverm\u00f6gen": {
"account_number": "7462"
},
"Au\u00dferordentliche Ertr\u00e4ge: Wertpapiere im Umlaufverm\u00f6gen": {
"account_number": "7463"
},
"Au\u00dferordentliche Ertr\u00e4ge: latente Steuern": {
"account_number": "7464"
}
"Ertr\u00e4ge durch Verschmelzung und Umwandlung": {
"account_number": "7451"
},
"Ertr\u00e4ge durch den Verkauf von bedeutenden Beteiligungen": {
"account_number": "7452"
},
"Ert\u00e4ge durch den Verkauf von bedeutenden Grundst\u00fccken": {
"account_number": "7453"
},
"Gewinn aus der Ver\u00e4u\u00dferung oder der Aufgabe von Gesch\u00e4ftsaktivit\u00e4ten nach Steuern": {
"account_number": "7454"
},
"Au\u00dferordentliche Ertr\u00e4ge aus der Anwendung von \u00dcbergangsvorschriften": {
"account_number": "7460"
},
"Au\u00dferordentliche Ertr\u00e4ge: Zuschreibung f. Sachanlageverm\u00f6gen": {
"account_number": "7461"
},
"Au\u00dferordentliche Ertr\u00e4ge: Zuschreibung f. Finanzanlageverm\u00f6gen": {
"account_number": "7462"
},
"Au\u00dferordentliche Ertr\u00e4ge: Wertpapiere im Umlaufverm\u00f6gen": {
"account_number": "7463"
},
"Au\u00dferordentliche Ertr\u00e4ge: latente Steuern": {
"account_number": "7464"
}
}
},
"7 - sonstige betriebliche Aufwendungen": {
"root_type": "Expense",
"is_group": 1,
"Erl\u00f6sschm\u00e4lerungen (Gruppe)": {
"is_group": 1,
"Erl\u00f6sschm\u00e4lerungen (Gruppe)": {
"is_group": 1,
"Erl\u00f6sschm\u00e4lerungen": {
"account_number": "4700"
@@ -2692,40 +2687,43 @@
},
"Erl\u00f6sschm\u00e4lerungen aus im Inland steuerpfl. EU-Lieferungen 16 % USt": {
"account_number": "4729"
}
},
"Gew\u00e4hrte Skonti (Gruppe)": {
"is_group": 1,
"Gew. Skonti": {
"account_number": "4730"
},
"Gew\u00e4hrte Skonti (Gruppe)": {
"is_group": 1,
"Gew. Skonti": {
"account_number": "4730"
},
"Gew. Skonti 7 % USt": {
"account_number": "4731"
},
"Gew. Skonti 19 % USt": {
"account_number": "4736"
},
"Gew. Skonti aus Lieferungen von Mobilfunkger./Schaltkr., f. die der Leistungsempf. die Ust. schuldet": {
"account_number": "4738"
},
"Gew. Skonti aus Leistungen, f. die der Leistungsempf. die Umsatzsteuer nach \u00a7 13b UStG schuldet": {
"account_number": "4741"
},
"Gew. Skonti aus Erl\u00f6sen aus im anderen EU-Land steuerpfl. Leistungen, f. die der Leistungsempf. die Ust. schuldet": {
"account_number": "4742"
},
"Gew. Skonti aus steuerfreien innergem. Lieferungen \u00a7 4 Nr. 1b UStG": {
"account_number": "4743"
},
"Gew. Skonti aus im Inland steuerpfl. EU-Lieferungen": {
"account_number": "4745"
},
"Gew. Skonti aus im Inland steuerpfl. EU-Lieferungen 7% USt": {
"account_number": "4746"
},
"Gew. Skonti aus im Inland steuerpfl. EU-Lieferungen 19% USt": {
"account_number": "4748"
}
"Gew. Skonti 7 % USt": {
"account_number": "4731"
},
"Gew. Skonti 19 % USt": {
"account_number": "4736"
},
"Gew. Skonti aus Lieferungen von Mobilfunkger./Schaltkr., f. die der Leistungsempf. die Ust. schuldet": {
"account_number": "4738"
},
"Gew. Skonti aus Leistungen, f. die der Leistungsempf. die Umsatzsteuer nach \u00a7 13b UStG schuldet": {
"account_number": "4741"
},
"Gew. Skonti aus Erl\u00f6sen aus im anderen EU-Land steuerpfl. Leistungen, f. die der Leistungsempf. die Ust. schuldet": {
"account_number": "4742"
},
"Gew. Skonti aus steuerfreien innergem. Lieferungen \u00a7 4 Nr. 1b UStG": {
"account_number": "4743"
},
"Gew. Skonti aus im Inland steuerpfl. EU-Lieferungen": {
"account_number": "4745"
},
"Gew. Skonti aus im Inland steuerpfl. EU-Lieferungen 7% USt": {
"account_number": "4746"
},
"Gew. Skonti aus im Inland steuerpfl. EU-Lieferungen 19% USt": {
"account_number": "4748"
}
},
"Gew\u00e4hrte Boni (Gruppe)": {
"is_group": 1,
"Gew\u00e4hrte Boni 7 % USt": {
"account_number": "4750"
},
@@ -2744,7 +2742,7 @@
"Gew\u00e4hrte Rabatte 19 % USt": {
"account_number": "4790"
}
},
},
"Sonstige betriebliche Aufwendungen": {
"account_number": "6300"
},
@@ -2838,103 +2836,79 @@
"account_number": "6398"
}
},
"Versicherungen (Gruppe)": {
"is_group": 1,
"Versicherungen": {
"account_number": "6400"
},
"Versicherungen f. Geb\u00e4ude, die zum Betriebsverm\u00f6gen geh\u00f6ren": {
"account_number": "6405"
},
"Netto-Pr\u00e4mie f. R\u00fcckdeckung k\u00fcnftiger Versorgungsleistungen": {
"account_number": "6410"
},
"Beitr\u00e4ge": {
"account_number": "6420"
},
"Sonstige Abgaben": {
"account_number": "6430"
},
"Steuerlich abzugsf\u00e4hige Versp\u00e4tungszuschl\u00e4ge und Zwangsgelder": {
"account_number": "6436"
},
"Steuerlich nicht abzugsf\u00e4hige Versp\u00e4tungszuschl\u00e4ge und Zwangsgelder": {
"account_number": "6437"
},
"Ausgleichsabgabe i. S. d. Schwerbehindertengesetzes": {
"account_number": "6440"
},
"Reparaturen und Instandhaltung von Bauten": {
"account_number": "6450"
},
"Reparaturen und Instandhaltung von technischenAnlagen und Maschinen": {
"account_number": "6460"
},
"Reparaturen und Instandhaltung von anderen Anlagen und Betriebs- und Gesch\u00e4ftsausstattung": {
"account_number": "6470"
},
"Zuf\u00fchrung zu Aufwandsr\u00fcckstellungen": {
"account_number": "6475"
},
"Reparaturen und Instandhaltung von anderen Anlagen": {
"account_number": "6485"
},
"Sonstige Reparaturen und Instandhaltungen": {
"account_number": "6490"
},
"Wartungskosten f. Hard- und Software": {
"account_number": "6495"
},
"Mietleasing (bewegliche Wirtschaftsg\u00fcter)": {
"account_number": "6498"
}
"Versicherungen": {
"account_number": "6400"
},
"Versicherungen f. Geb\u00e4ude, die zum Betriebsverm\u00f6gen geh\u00f6ren": {
"account_number": "6405"
},
"Netto-Pr\u00e4mie f. R\u00fcckdeckung k\u00fcnftiger Versorgungsleistungen": {
"account_number": "6410"
},
"Beitr\u00e4ge": {
"account_number": "6420"
},
"Sonstige Abgaben": {
"account_number": "6430"
},
"Steuerlich abzugsf\u00e4hige Versp\u00e4tungszuschl\u00e4ge und Zwangsgelder": {
"account_number": "6436"
},
"Steuerlich nicht abzugsf\u00e4hige Versp\u00e4tungszuschl\u00e4ge und Zwangsgelder": {
"account_number": "6437"
},
"Ausgleichsabgabe i. S. d. Schwerbehindertengesetzes": {
"account_number": "6440"
},
"Reparaturen und Instandhaltung von Bauten": {
"account_number": "6450"
},
"Reparaturen und Instandhaltung von technischenAnlagen und Maschinen": {
"account_number": "6460"
},
"Reparaturen und Instandhaltung von anderen Anlagen und Betriebs- und Gesch\u00e4ftsausstattung": {
"account_number": "6470"
},
"Zuf\u00fchrung zu Aufwandsr\u00fcckstellungen": {
"account_number": "6475"
},
"Reparaturen und Instandhaltung von anderen Anlagen": {
"account_number": "6485"
},
"Sonstige Reparaturen und Instandhaltungen": {
"account_number": "6490"
},
"Wartungskosten f. Hard- und Software": {
"account_number": "6495"
},
"Mietleasing (bewegliche Wirtschaftsg\u00fcter)": {
"account_number": "6498"
},
"Fahrzeugkosten (Gruppe)": {
"is_group": 1,
"Fahrzeugkosten": {
"account_number": "6500"
},
"Kfz-Versicherungen (Gruppe)": {
"is_group": 1,
"Kfz-Versicherungen": {
"account_number": "6520"
}
"Kfz-Versicherungen": {
"account_number": "6520"
},
"Laufende Kfz-Betriebskosten (Gruppe)": {
"is_group": 1,
"Laufende Kfz-Betriebskosten": {
"account_number": "6530"
}
"Laufende Kfz-Betriebskosten": {
"account_number": "6530"
},
"Kfz-Reparaturen (Gruppe)": {
"is_group": 1,
"Kfz-Reparaturen": {
"account_number": "6540"
}
"Kfz-Reparaturen": {
"account_number": "6540"
},
"Garagenmiete (Gruppe)": {
"is_group": 1,
"Garagenmiete": {
"account_number": "6550"
}
"Garagenmiete": {
"account_number": "6550"
},
"Mietleasing Kfz (Gruppe)": {
"is_group": 1,
"Mietleasing Kfz": {
"account_number": "6560"
}
"Mietleasing Kfz": {
"account_number": "6560"
},
"Sonstige Kfz-Kosten (Gruppe)": {
"is_group": 1,
"Sonstige Kfz-Kosten": {
"account_number": "6570"
}
"Sonstige Kfz-Kosten": {
"account_number": "6570"
},
"Mautgeb\u00fchren (Gruppe)": {
"is_group": 1,
"Mautgeb\u00fchren": {
"account_number": "6580"
}
"Mautgeb\u00fchren": {
"account_number": "6580"
},
"Kfz-Kosten f. betrieblich genutzte zum Privatverm\u00f6gen geh\u00f6rende Kraftfahrzeuge": {
"account_number": "6590"
@@ -2996,20 +2970,23 @@
"Nicht abzugsf\u00e4hige Betriebsausgaben aus Werbe- und Repr\u00e4sentationskosten": {
"account_number": "6645"
},
"Reisekosten Arbeitnehmer": {
"account_number": "6650"
},
"Reisekosten Arbeitnehmer \u00dcbernachtungsaufwand": {
"account_number": "6660"
},
"Reisekosten Arbeitnehmer Fahrtkosten": {
"account_number": "6663"
},
"Reisekosten Arbeitnehmer Verpflegungsmehraufwand": {
"account_number": "6664"
},
"Kilometergelderstattung Arbeitnehmer": {
"account_number": "6668"
"Reisekosten Arbeitnehmer (Gruppe)": {
"is_group": 1,
"Reisekosten Arbeitnehmer": {
"account_number": "6650"
},
"Reisekosten Arbeitnehmer \u00dcbernachtungsaufwand": {
"account_number": "6660"
},
"Reisekosten Arbeitnehmer Fahrtkosten": {
"account_number": "6663"
},
"Reisekosten Arbeitnehmer Verpflegungsmehraufwand": {
"account_number": "6664"
},
"Kilometergelderstattung Arbeitnehmer": {
"account_number": "6668"
}
},
"Reisekosten Unternehmer (Gruppe)": {
"is_group": 1,

View File

@@ -69,6 +69,7 @@ class TestAccount(unittest.TestCase):
acc.account_name = "Accumulated Depreciation"
acc.parent_account = "Fixed Assets - _TC"
acc.company = "_Test Company"
acc.account_type = "Accumulated Depreciation"
acc.insert()
doc = frappe.get_doc("Account", "Securities and Deposits - _TC")
@@ -149,7 +150,7 @@ def _make_test_records(verbose):
# fixed asset depreciation
["_Test Fixed Asset", "Current Assets", 0, "Fixed Asset", None],
["_Test Accumulated Depreciations", "Current Assets", 0, None, None],
["_Test Accumulated Depreciations", "Current Assets", 0, "Accumulated Depreciation", None],
["_Test Depreciations", "Expenses", 0, None, None],
["_Test Gain/Loss on Asset Disposal", "Expenses", 0, None, None],

View File

@@ -48,12 +48,6 @@ frappe.ui.form.on('Accounting Dimension', {
frm.set_value('label', frm.doc.document_type);
frm.set_value('fieldname', frappe.model.scrub(frm.doc.document_type));
if (frm.is_new()){
let row = frappe.model.add_child(frm.doc, "Accounting Dimension Detail", "dimension_defaults");
row.reference_document = frm.doc.document_type;
frm.refresh_fields("dimension_defaults");
}
frappe.db.get_value('Accounting Dimension', {'document_type': frm.doc.document_type}, 'document_type', (r) => {
if (r && r.document_type) {
frm.set_df_property('document_type', 'description', "Document type is already set as dimension");

View File

@@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "field:label",
"creation": "2019-05-04 18:13:37.002352",
"doctype": "DocType",
@@ -46,7 +47,8 @@
"options": "Accounting Dimension Detail"
}
],
"modified": "2019-07-17 16:49:31.134385",
"links": [],
"modified": "2020-03-22 20:34:39.805728",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounting Dimension",
@@ -63,9 +65,20 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"write": 1
}
],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "ASC",
"track_changes": 1

View File

@@ -162,9 +162,9 @@ def toggle_disabling(doc):
def get_doctypes_with_dimensions():
doclist = ["GL Entry", "Sales Invoice", "Purchase Invoice", "Payment Entry", "Asset",
"Expense Claim", "Stock Entry", "Budget", "Payroll Entry", "Delivery Note", "Sales Invoice Item", "Purchase Invoice Item",
"Purchase Order Item", "Journal Entry Account", "Material Request Item", "Delivery Note Item", "Purchase Receipt Item",
"Stock Entry Detail", "Payment Entry Deduction", "Sales Taxes and Charges", "Purchase Taxes and Charges", "Shipping Rule",
"Expense Claim", "Expense Claim Detail", "Expense Taxes and Charges", "Stock Entry", "Budget", "Payroll Entry", "Delivery Note",
"Sales Invoice Item", "Purchase Invoice Item", "Purchase Order Item", "Journal Entry Account", "Material Request Item", "Delivery Note Item",
"Purchase Receipt Item", "Stock Entry Detail", "Payment Entry Deduction", "Sales Taxes and Charges", "Purchase Taxes and Charges", "Shipping Rule",
"Landed Cost Item", "Asset Value Adjustment", "Loyalty Program", "Fee Schedule", "Fee Structure", "Stock Reconciliation",
"Travel Request", "Fees", "POS Profile", "Opening Invoice Creation Tool", "Opening Invoice Creation Tool Item", "Subscription",
"Subscription Plan"]
@@ -172,7 +172,7 @@ def get_doctypes_with_dimensions():
return doclist
def get_accounting_dimensions(as_list=True):
accounting_dimensions = frappe.get_all("Accounting Dimension", fields=["label", "fieldname", "disabled"])
accounting_dimensions = frappe.get_all("Accounting Dimension", fields=["label", "fieldname", "disabled", "document_type"])
if as_list:
return [d.fieldname for d in accounting_dimensions]
@@ -186,6 +186,18 @@ def get_checks_for_pl_and_bs_accounts():
return dimensions
def get_dimension_with_children(doctype, dimension):
if isinstance(dimension, list):
dimension = dimension[0]
all_dimensions = []
lft, rgt = frappe.db.get_value(doctype, dimension, ["lft", "rgt"])
children = frappe.get_all(doctype, filters={"lft": [">=", lft], "rgt": ["<=", rgt]}, order_by="lft")
all_dimensions += [c.name for c in children]
return all_dimensions
@frappe.whitelist()
def get_dimension_filters():
dimension_filters = frappe.db.sql("""
@@ -194,12 +206,13 @@ def get_dimension_filters():
WHERE disabled = 0
""", as_dict=1)
default_dimensions = frappe.db.sql("""SELECT parent, company, default_dimension
FROM `tabAccounting Dimension Detail`""", as_dict=1)
default_dimensions = frappe.db.sql("""SELECT p.fieldname, c.company, c.default_dimension
FROM `tabAccounting Dimension Detail` c, `tabAccounting Dimension` p
WHERE c.parent = p.name""", as_dict=1)
default_dimensions_map = {}
for dimension in default_dimensions:
default_dimensions_map.setdefault(dimension['company'], {})
default_dimensions_map[dimension['company']][dimension['parent']] = dimension['default_dimension']
default_dimensions_map.setdefault(dimension.company, {})
default_dimensions_map[dimension.company][dimension.fieldname] = dimension.default_dimension
return dimension_filters, default_dimensions_map

View File

@@ -41,8 +41,8 @@ class AccountingPeriod(Document):
def get_doctypes_for_closing(self):
docs_for_closing = []
doctypes = ["Sales Invoice", "Purchase Invoice", "Journal Entry", "Payroll Entry", "Bank Reconciliation",
"Asset", "Purchase Order", "Sales Order", "Leave Application", "Leave Allocation", "Stock Entry"]
doctypes = ["Sales Invoice", "Purchase Invoice", "Journal Entry", "Payroll Entry", \
"Bank Reconciliation", "Asset", "Stock Entry"]
closed_doctypes = [{"document_type": doctype, "closed": 1} for doctype in doctypes]
for closed_doctype in closed_doctypes:
docs_for_closing.append(closed_doctype)

View File

@@ -0,0 +1,8 @@
frappe.ui.form.on('Accounts Settings', {
refresh: function(frm) {
frm.set_df_property("acc_frozen_upto", "label", "Books Closed Through");
frm.set_df_property("frozen_accounts_modifier", "label", "Role Allowed to Close Books & Make Changes to Closed Periods");
frm.set_df_property("credit_controller", "label", "Credit Manager");
}
});

View File

@@ -1,4 +1,5 @@
{
"actions": [],
"allow_import": 1,
"allow_rename": 1,
"creation": "2017-05-29 21:35:13.136357",
@@ -82,7 +83,7 @@
"default": "0",
"fieldname": "is_default",
"fieldtype": "Check",
"label": "Is the Default Account"
"label": "Is Default Account"
},
{
"default": "0",
@@ -211,7 +212,8 @@
"read_only": 1
}
],
"modified": "2019-10-02 01:34:12.417601",
"links": [],
"modified": "2020-01-29 20:42:26.458316",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Account",

View File

@@ -6,6 +6,7 @@ from __future__ import unicode_literals
import frappe, json
from frappe.model.document import Document
from frappe import _
from frappe.desk.search import sanitize_searchfield
class BankGuarantee(Document):
def validate(self):
@@ -22,5 +23,8 @@ 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(json.loads(column_list)), doctype=doctype), docname, as_dict=1)[0]

View File

@@ -3,16 +3,16 @@
frappe.ui.form.on("Bank Reconciliation", {
setup: function(frm) {
frm.add_fetch("bank_account", "account_currency", "account_currency");
frm.add_fetch("account", "account_currency", "account_currency");
},
onload: function(frm) {
let default_bank_account = frappe.defaults.get_user_default("Company")?
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
frm.set_value("bank_account", default_bank_account);
frm.set_value("account", default_bank_account);
frm.set_query("bank_account", function() {
frm.set_query("account", function() {
return {
"filters": {
"account_type": ["in",["Bank","Cash"]],

View File

@@ -19,10 +19,9 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Select account head of the bank where cheque was deposited.",
"fetch_from": "bank_account_no.account",
"fetch_from": "bank_account.account",
"fetch_if_empty": 1,
"fieldname": "bank_account",
"fieldname": "account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -31,7 +30,7 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Bank Account",
"label": "Account",
"length": 0,
"no_copy": 0,
"options": "Account",
@@ -164,7 +163,6 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -183,8 +181,9 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Select the Bank Account to reconcile.",
"fetch_if_empty": 0,
"fieldname": "bank_account_no",
"fieldname": "bank_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -193,12 +192,11 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Bank Account No",
"label": "Bank Account",
"length": 0,
"no_copy": 0,
"options": "Bank Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -450,7 +448,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2019-04-09 18:41:06.110453",
"modified": "2020-01-22 00:00:00.000000",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation",
@@ -483,4 +481,4 @@
"track_changes": 0,
"track_seen": 0,
"track_views": 0
}
}

View File

@@ -13,17 +13,15 @@ form_grid_templates = {
class BankReconciliation(Document):
def get_payment_entries(self):
if not (self.bank_account and self.from_date and self.to_date):
msgprint(_("Bank Account, From Date and To Date are Mandatory"))
return
if not (self.from_date and self.to_date):
frappe.throw(_("From Date and To Date are Mandatory"))
if not self.account:
frappe.throw(_("Account is mandatory to get payment entries"))
condition = ""
if not self.include_reconciled_entries:
condition = " and (clearance_date is null or clearance_date='0000-00-00')"
account_cond = ""
if self.bank_account_no:
account_cond = " and t2.bank_account_no = {0}".format(frappe.db.escape(self.bank_account_no))
condition = "and (clearance_date IS NULL or clearance_date='0000-00-00')"
journal_entries = frappe.db.sql("""
select
@@ -34,15 +32,15 @@ class BankReconciliation(Document):
from
`tabJournal Entry` t1, `tabJournal Entry Account` t2
where
t2.parent = t1.name and t2.account = %s and t1.docstatus=1
and t1.posting_date >= %s and t1.posting_date <= %s
and ifnull(t1.is_opening, 'No') = 'No' {0} {1}
t2.parent = t1.name and t2.account = %(account)s and t1.docstatus=1
and t1.posting_date >= %(from)s and t1.posting_date <= %(to)s
and ifnull(t1.is_opening, 'No') = 'No' {condition}
group by t2.account, t1.name
order by t1.posting_date ASC, t1.name DESC
""".format(condition, account_cond), (self.bank_account, self.from_date, self.to_date), as_dict=1)
""".format(condition=condition), {"account": self.account, "from": self.from_date, "to": self.to_date}, as_dict=1)
if self.bank_account_no:
condition = " and bank_account = %(bank_account_no)s"
if self.bank_account:
condition += 'and bank_account = %(bank_account)s'
payment_entries = frappe.db.sql("""
select
@@ -55,12 +53,12 @@ class BankReconciliation(Document):
from `tabPayment Entry`
where
(paid_from=%(account)s or paid_to=%(account)s) and docstatus=1
and posting_date >= %(from)s and posting_date <= %(to)s {0}
and posting_date >= %(from)s and posting_date <= %(to)s
{condition}
order by
posting_date ASC, name DESC
""".format(condition),
{"account":self.bank_account, "from":self.from_date,
"to":self.to_date, "bank_account_no": self.bank_account_no}, as_dict=1)
""".format(condition=condition), {"account": self.account, "from":self.from_date,
"to": self.to_date, "bank_account": self.bank_account}, as_dict=1)
pos_entries = []
if self.include_pos_transactions:
@@ -72,11 +70,10 @@ class BankReconciliation(Document):
from `tabSales Invoice Payment` sip, `tabSales Invoice` si, `tabAccount` account
where
sip.account=%(account)s and si.docstatus=1 and sip.parent = si.name
and account.name = sip.account and si.posting_date >= %(from)s and si.posting_date <= %(to)s {0}
and account.name = sip.account and si.posting_date >= %(from)s and si.posting_date <= %(to)s
order by
si.posting_date ASC, si.name DESC
""".format(condition),
{"account":self.bank_account, "from":self.from_date, "to":self.to_date}, as_dict=1)
""", {"account":self.account, "from":self.from_date, "to":self.to_date}, as_dict=1)
entries = sorted(list(payment_entries)+list(journal_entries+list(pos_entries)),
key=lambda k: k['posting_date'] or getdate(nowdate()))

View File

@@ -15,8 +15,8 @@ def upload_bank_statement():
with open(frappe.uploaded_file, "rb") as upfile:
fcontent = upfile.read()
else:
from frappe.utils.file_manager import get_uploaded_content
fname, fcontent = get_uploaded_content()
fcontent = frappe.local.uploaded_file
fname = frappe.local.uploaded_filename
if frappe.safe_encode(fname).lower().endswith("csv".encode('utf-8')):
from frappe.utils.csvutils import read_csv_content

View File

@@ -110,6 +110,15 @@
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"depends_on": "eval:doc.docstatus==1",
"fieldname": "clearance_date",
"fieldtype": "Date",
"label": "Clearance Date",
"no_copy": 1,
"print_hide": 1,
"read_only": 1
}
],
"has_web_view": 0,
@@ -122,7 +131,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2018-12-06 10:57:02.635141",
"modified": "2020-01-22 00:00:00.000000",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Transaction Payments",
@@ -138,4 +147,4 @@
"track_changes": 1,
"track_seen": 0,
"track_views": 0
}
}

View File

@@ -9,6 +9,7 @@ from frappe.utils import flt, getdate, add_months, get_last_day, fmt_money, nowd
from frappe.model.naming import make_autoname
from erpnext.accounts.utils import get_fiscal_year
from frappe.model.document import Document
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions
class BudgetError(frappe.ValidationError): pass
class DuplicateBudgetError(frappe.ValidationError): pass
@@ -98,30 +99,32 @@ def validate_expense_against_budget(args):
if not (args.get('account') and args.get('cost_center')) and args.item_code:
args.cost_center, args.account = get_item_details(args)
if not (args.cost_center or args.project) and not args.account:
if not args.account:
return
for budget_against in ['project', 'cost_center']:
for budget_against in ['project', 'cost_center'] + get_accounting_dimensions():
if (args.get(budget_against) and args.account
and frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"})):
if args.project and budget_against == 'project':
condition = "and b.project=%s" % frappe.db.escape(args.project)
args.budget_against_field = "Project"
doctype = frappe.unscrub(budget_against)
elif args.cost_center and budget_against == 'cost_center':
cc_lft, cc_rgt = frappe.db.get_value("Cost Center", args.cost_center, ["lft", "rgt"])
condition = """and exists(select name from `tabCost Center`
where lft<=%s and rgt>=%s and name=b.cost_center)""" % (cc_lft, cc_rgt)
args.budget_against_field = "Cost Center"
if frappe.get_cached_value('DocType', doctype, 'is_tree'):
lft, rgt = frappe.db.get_value(doctype, args.get(budget_against), ["lft", "rgt"])
condition = """and exists(select name from `tab%s`
where lft<=%s and rgt>=%s and name=b.%s)""" % (doctype, lft, rgt, budget_against) #nosec
args.is_tree = True
else:
condition = "and b.%s=%s" % (budget_against, frappe.db.escape(args.get(budget_against)))
args.is_tree = False
args.budget_against = args.get(budget_against)
args.budget_against_field = budget_against
args.budget_against_doctype = doctype
budget_records = frappe.db.sql("""
select
b.{budget_against_field} as budget_against, ba.budget_amount, b.monthly_distribution,
ifnull(b.applicable_on_material_request, 0) as for_material_request,
ifnull(applicable_on_purchase_order,0) as for_purchase_order,
ifnull(applicable_on_purchase_order, 0) as for_purchase_order,
ifnull(applicable_on_booking_actual_expenses,0) as for_actual_expenses,
b.action_if_annual_budget_exceeded, b.action_if_accumulated_monthly_budget_exceeded,
b.action_if_annual_budget_exceeded_on_mr, b.action_if_accumulated_monthly_budget_exceeded_on_mr,
@@ -132,9 +135,7 @@ def validate_expense_against_budget(args):
b.name=ba.parent and b.fiscal_year=%s
and ba.account=%s and b.docstatus=1
{condition}
""".format(condition=condition,
budget_against_field=frappe.scrub(args.get("budget_against_field"))),
(args.fiscal_year, args.account), as_dict=True)
""".format(condition=condition, budget_against_field=budget_against), (args.fiscal_year, args.account), as_dict=True) #nosec
if budget_records:
validate_budget_records(args, budget_records)
@@ -210,10 +211,10 @@ def get_requested_amount(args, budget):
item_code = args.get('item_code')
condition = get_other_condition(args, budget, 'Material Request')
data = frappe.db.sql(""" select ifnull((sum(mri.stock_qty - mri.ordered_qty) * rate), 0) as amount
from `tabMaterial Request Item` mri, `tabMaterial Request` mr where mr.name = mri.parent and
mri.item_code = %s and mr.docstatus = 1 and mri.stock_qty > mri.ordered_qty and {0} and
mr.material_request_type = 'Purchase' and mr.status != 'Stopped'""".format(condition), item_code, as_list=1)
data = frappe.db.sql(""" select ifnull((sum(child.stock_qty - child.ordered_qty) * rate), 0) as amount
from `tabMaterial Request Item` child, `tabMaterial Request` parent where parent.name = child.parent and
child.item_code = %s and parent.docstatus = 1 and child.stock_qty > child.ordered_qty and {0} and
parent.material_request_type = 'Purchase' and parent.status != 'Stopped'""".format(condition), item_code, as_list=1)
return data[0][0] if data else 0
@@ -221,45 +222,55 @@ def get_ordered_amount(args, budget):
item_code = args.get('item_code')
condition = get_other_condition(args, budget, 'Purchase Order')
data = frappe.db.sql(""" select ifnull(sum(poi.amount - poi.billed_amt), 0) as amount
from `tabPurchase Order Item` poi, `tabPurchase Order` po where
po.name = poi.parent and poi.item_code = %s and po.docstatus = 1 and poi.amount > poi.billed_amt
and po.status != 'Closed' and {0}""".format(condition), item_code, as_list=1)
data = frappe.db.sql(""" select ifnull(sum(child.amount - child.billed_amt), 0) as amount
from `tabPurchase Order Item` child, `tabPurchase Order` parent where
parent.name = child.parent and child.item_code = %s and parent.docstatus = 1 and child.amount > child.billed_amt
and parent.status != 'Closed' and {0}""".format(condition), item_code, as_list=1)
return data[0][0] if data else 0
def get_other_condition(args, budget, for_doc):
condition = "expense_account = '%s'" % (args.expense_account)
budget_against_field = frappe.scrub(args.get("budget_against_field"))
budget_against_field = args.get("budget_against_field")
if budget_against_field and args.get(budget_against_field):
condition += " and %s = '%s'" %(budget_against_field, args.get(budget_against_field))
condition += " and child.%s = '%s'" % (budget_against_field, args.get(budget_against_field))
if args.get('fiscal_year'):
date_field = 'schedule_date' if for_doc == 'Material Request' else 'transaction_date'
start_date, end_date = frappe.db.get_value('Fiscal Year', args.get('fiscal_year'),
['year_start_date', 'year_end_date'])
alias = 'mr' if for_doc == 'Material Request' else 'po'
condition += """ and %s.%s
between '%s' and '%s' """ %(alias, date_field, start_date, end_date)
condition += """ and parent.%s
between '%s' and '%s' """ %(date_field, start_date, end_date)
return condition
def get_actual_expense(args):
if not args.budget_against_doctype:
args.budget_against_doctype = frappe.unscrub(args.budget_against_field)
budget_against_field = args.get('budget_against_field')
condition1 = " and gle.posting_date <= %(month_end_date)s" \
if args.get("month_end_date") else ""
if args.budget_against_field == "Cost Center":
lft_rgt = frappe.db.get_value(args.budget_against_field,
args.budget_against, ["lft", "rgt"], as_dict=1)
if args.is_tree:
lft_rgt = frappe.db.get_value(args.budget_against_doctype,
args.get(budget_against_field), ["lft", "rgt"], as_dict=1)
args.update(lft_rgt)
condition2 = """and exists(select name from `tabCost Center`
where lft>=%(lft)s and rgt<=%(rgt)s and name=gle.cost_center)"""
elif args.budget_against_field == "Project":
condition2 = "and exists(select name from `tabProject` where name=gle.project and gle.project = %(budget_against)s)"
condition2 = """and exists(select name from `tab{doctype}`
where lft>=%(lft)s and rgt<=%(rgt)s
and name=gle.{budget_against_field})""".format(doctype=args.budget_against_doctype, #nosec
budget_against_field=budget_against_field)
else:
condition2 = """and exists(select name from `tab{doctype}`
where name=gle.{budget_against} and
gle.{budget_against} = %({budget_against})s)""".format(doctype=args.budget_against_doctype,
budget_against = budget_against_field)
return flt(frappe.db.sql("""
amount = flt(frappe.db.sql("""
select sum(gle.debit) - sum(gle.credit)
from `tabGL Entry` gle
where gle.account=%(account)s
@@ -268,7 +279,9 @@ def get_actual_expense(args):
and gle.company=%(company)s
and gle.docstatus=1
{condition2}
""".format(condition1=condition1, condition2=condition2), (args))[0][0])
""".format(condition1=condition1, condition2=condition2), (args))[0][0]) #nosec
return amount
def get_accumulated_monthly_budget(monthly_distribution, posting_date, fiscal_year, annual_budget):
distribution = {}

View File

@@ -13,7 +13,7 @@ from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journ
class TestBudget(unittest.TestCase):
def test_monthly_budget_crossed_ignore(self):
set_total_expense_zero("2013-02-28", "Cost Center")
set_total_expense_zero("2013-02-28", "cost_center")
budget = make_budget(budget_against="Cost Center")
@@ -26,7 +26,7 @@ class TestBudget(unittest.TestCase):
budget.cancel()
def test_monthly_budget_crossed_stop1(self):
set_total_expense_zero("2013-02-28", "Cost Center")
set_total_expense_zero("2013-02-28", "cost_center")
budget = make_budget(budget_against="Cost Center")
@@ -41,7 +41,7 @@ class TestBudget(unittest.TestCase):
budget.cancel()
def test_exception_approver_role(self):
set_total_expense_zero("2013-02-28", "Cost Center")
set_total_expense_zero("2013-02-28", "cost_center")
budget = make_budget(budget_against="Cost Center")
@@ -114,7 +114,7 @@ class TestBudget(unittest.TestCase):
budget.cancel()
def test_monthly_budget_crossed_stop2(self):
set_total_expense_zero("2013-02-28", "Project")
set_total_expense_zero("2013-02-28", "project")
budget = make_budget(budget_against="Project")
@@ -129,7 +129,7 @@ class TestBudget(unittest.TestCase):
budget.cancel()
def test_yearly_budget_crossed_stop1(self):
set_total_expense_zero("2013-02-28", "Cost Center")
set_total_expense_zero("2013-02-28", "cost_center")
budget = make_budget(budget_against="Cost Center")
@@ -141,7 +141,7 @@ class TestBudget(unittest.TestCase):
budget.cancel()
def test_yearly_budget_crossed_stop2(self):
set_total_expense_zero("2013-02-28", "Project")
set_total_expense_zero("2013-02-28", "project")
budget = make_budget(budget_against="Project")
@@ -153,7 +153,7 @@ class TestBudget(unittest.TestCase):
budget.cancel()
def test_monthly_budget_on_cancellation1(self):
set_total_expense_zero("2013-02-28", "Cost Center")
set_total_expense_zero("2013-02-28", "cost_center")
budget = make_budget(budget_against="Cost Center")
@@ -177,7 +177,7 @@ class TestBudget(unittest.TestCase):
budget.cancel()
def test_monthly_budget_on_cancellation2(self):
set_total_expense_zero("2013-02-28", "Project")
set_total_expense_zero("2013-02-28", "project")
budget = make_budget(budget_against="Project")
@@ -201,8 +201,8 @@ class TestBudget(unittest.TestCase):
budget.cancel()
def test_monthly_budget_against_group_cost_center(self):
set_total_expense_zero("2013-02-28", "Cost Center")
set_total_expense_zero("2013-02-28", "Cost Center", "_Test Cost Center 2 - _TC")
set_total_expense_zero("2013-02-28", "cost_center")
set_total_expense_zero("2013-02-28", "cost_center", "_Test Cost Center 2 - _TC")
budget = make_budget(budget_against="Cost Center", cost_center="_Test Company - _TC")
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
@@ -241,25 +241,30 @@ class TestBudget(unittest.TestCase):
def set_total_expense_zero(posting_date, budget_against_field=None, budget_against_CC=None):
if budget_against_field == "Project":
if budget_against_field == "project":
budget_against = "_Test Project"
else:
budget_against = budget_against_CC or "_Test Cost Center - _TC"
existing_expense = get_actual_expense(frappe._dict({
args = frappe._dict({
"account": "_Test Account Cost for Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
"monthly_end_date": posting_date,
"company": "_Test Company",
"fiscal_year": "_Test Fiscal Year 2013",
"budget_against_field": budget_against_field,
"budget_against": budget_against
}))
})
if not args.get(budget_against_field):
args[budget_against_field] = budget_against
existing_expense = get_actual_expense(args)
if existing_expense:
if budget_against_field == "Cost Center":
if budget_against_field == "cost_center":
make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", -existing_expense, "_Test Cost Center - _TC", posting_date="2013-02-28", submit=True)
elif budget_against_field == "Project":
elif budget_against_field == "project":
make_journal_entry("_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC", -existing_expense, "_Test Cost Center - _TC", submit=True, project="_Test Project", posting_date="2013-02-28")

View File

@@ -32,10 +32,12 @@ frappe.ui.form.on('C-Form Invoice Detail', {
invoice_no(frm, cdt, cdn) {
let d = frappe.get_doc(cdt, cdn);
frm.call('get_invoice_details', {
invoice_no: d.invoice_no
}).then(r => {
frappe.model.set_value(cdt, cdn, r.message);
});
if (d.invoice_no) {
frm.call('get_invoice_details', {
invoice_no: d.invoice_no
}).then(r => {
frappe.model.set_value(cdt, cdn, r.message);
});
}
}
});

View File

@@ -17,17 +17,60 @@ frappe.ui.form.on('Chart of Accounts Importer', {
if (frm.page && frm.page.show_import_button) {
create_import_button(frm);
}
},
// show download template button when company is properly selected
if(frm.doc.company) {
// download the csv template file
frm.add_custom_button(__("Download template"), function () {
let get_template_url = 'erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template';
open_url_post(frappe.request.url, { cmd: get_template_url, doctype: frm.doc.doctype });
});
} else {
frm.set_value("import_file", "");
}
download_template: function(frm) {
var d = new frappe.ui.Dialog({
title: __("Download Template"),
fields: [
{
label : "File Type",
fieldname: "file_type",
fieldtype: "Select",
reqd: 1,
options: ["Excel", "CSV"]
},
{
label: "Template Type",
fieldname: "template_type",
fieldtype: "Select",
reqd: 1,
options: ["Sample Template", "Blank Template"],
change: () => {
let template_type = d.get_value('template_type');
if (template_type === "Sample Template") {
d.set_df_property('template_type', 'description',
`The Sample Template contains all the required accounts pre filled in the template.
You can add more accounts or change existing accounts in the template as per your choice.`);
} else {
d.set_df_property('template_type', 'description',
`The Blank Template contains just the account type and root type required to build the Chart
of Accounts. Please enter the account names and add more rows as per your requirement.`);
}
}
}
],
primary_action: function() {
var data = d.get_values();
if (!data.template_type) {
frappe.throw(__('Please select <b>Template Type</b> to download template'));
}
open_url_post(
'/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template',
{
file_type: data.file_type,
template_type: data.template_type
}
);
d.hide();
},
primary_action_label: __('Download')
});
d.show();
},
import_file: function (frm) {
@@ -41,21 +84,24 @@ frappe.ui.form.on('Chart of Accounts Importer', {
},
company: function (frm) {
// validate that no Gl Entry record for the company exists.
frappe.call({
method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.validate_company",
args: {
company: frm.doc.company
},
callback: function(r) {
if(r.message===false) {
frm.set_value("company", "");
frappe.throw(__("Transactions against the company already exist! "));
} else {
frm.trigger("refresh");
if (frm.doc.company) {
// validate that no Gl Entry record for the company exists.
frappe.call({
method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.validate_company",
args: {
company: frm.doc.company
},
callback: function(r) {
if(r.message===false) {
frm.set_value("company", "");
frappe.throw(__(`Transactions against the company already exist!
Chart Of accounts can be imported for company with no transactions`));
} else {
frm.trigger("refresh");
}
}
}
});
});
}
}
});
@@ -77,7 +123,7 @@ var validate_csv_data = function(frm) {
};
var create_import_button = function(frm) {
frm.page.set_primary_action(__("Start Import"), function () {
frm.page.set_primary_action(__("Import"), function () {
frappe.call({
method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.import_coa",
args: {
@@ -118,7 +164,8 @@ var generate_tree_preview = function(frm) {
args: {
file_name: frm.doc.import_file,
parent: parent,
doctype: 'Chart of Accounts Importer'
doctype: 'Chart of Accounts Importer',
file_type: frm.doc.file_type
},
onclick: function(node) {
parent = node.value;

View File

@@ -1,226 +1,71 @@
{
"allow_copy": 1,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2019-02-01 12:24:34.761380",
"custom": 0,
"actions": [],
"allow_copy": 1,
"creation": "2019-02-01 12:24:34.761380",
"description": "Import Chart of Accounts from a csv file",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Other",
"editable_grid": 1,
"engine": "InnoDB",
"doctype": "DocType",
"document_type": "Other",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"company",
"download_template",
"import_file",
"chart_preview",
"chart_tree"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"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": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"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": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "import_file_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,
"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
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"depends_on": "company",
"fieldname": "import_file",
"fieldtype": "Attach",
"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": "Attach custom Chart of Accounts file",
"length": 0,
"no_copy": 0,
"options": "",
"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
},
"label": "Attach custom Chart of Accounts file"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "chart_preview",
"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": "Chart Preview",
"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
},
"fieldtype": "Section Break",
"label": "Chart Preview"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "chart_tree",
"fieldtype": "HTML",
"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": "Chart Tree",
"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
"label": "Chart Tree"
},
{
"depends_on": "company",
"fieldname": "download_template",
"fieldtype": "Button",
"label": "Download Template"
}
],
"has_web_view": 0,
"hide_heading": 1,
"hide_toolbar": 1,
"idx": 0,
"image_view": 0,
"in_create": 1,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2019-02-04 23:10:30.136807",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Chart of Accounts Importer",
"name_case": "",
"owner": "Administrator",
],
"hide_toolbar": 1,
"in_create": 1,
"issingle": 1,
"links": [],
"modified": "2020-02-28 08:49:11.422846",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Chart of Accounts Importer",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"create": 1,
"read": 1,
"role": "Accounts Manager",
"share": 1,
"write": 1
}
],
"quick_entry": 1,
"read_only": 1,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "",
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0,
"track_views": 0
],
"quick_entry": 1,
"read_only": 1,
"sort_field": "modified",
"sort_order": "DESC"
}

View File

@@ -4,18 +4,28 @@
from __future__ import unicode_literals
from functools import reduce
import frappe, csv
import frappe, csv, os
from frappe import _
from frappe.utils import cstr
from frappe.utils import cstr, cint
from frappe.model.document import Document
from frappe.utils.csvutils import UnicodeWriter
from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import create_charts, build_tree_from_json
from frappe.utils.xlsxutils import read_xlsx_file_from_attached_file, read_xls_file_from_attached_file
class ChartofAccountsImporter(Document):
pass
@frappe.whitelist()
def validate_company(company):
parent_company, allow_account_creation_against_child_company = frappe.db.get_value('Company',
{'name': company}, ['parent_company',
'allow_account_creation_against_child_company'])
if parent_company and (not allow_account_creation_against_child_company):
frappe.throw(_("""{0} is a child company. Please import accounts against parent company
or enable {1} in company master""").format(frappe.bold(company),
frappe.bold('Allow Account Creation Against Child Company')), title='Wrong Company')
if frappe.db.get_all('GL Entry', {"company": company}, "name", limit=1):
return False
@@ -25,42 +35,85 @@ def import_coa(file_name, company):
unset_existing_data(company)
# create accounts
forest = build_forest(generate_data_from_csv(file_name))
file_doc, extension = get_file(file_name)
if extension == 'csv':
data = generate_data_from_csv(file_doc)
else:
data = generate_data_from_excel(file_doc, extension)
forest = build_forest(data)
create_charts(company, custom_chart=forest)
# trigger on_update for company to reset default accounts
set_default_accounts(company)
def generate_data_from_csv(file_name, as_dict=False):
''' read csv file and return the generated nested tree '''
if not file_name.endswith('.csv'):
frappe.throw("Only CSV files can be used to for importing data. Please check the file format you are trying to upload")
def get_file(file_name):
file_doc = frappe.get_doc("File", {"file_url": file_name})
parts = file_doc.get_extension()
extension = parts[1]
extension = extension.lstrip(".")
if extension not in ('csv', 'xlsx', 'xls'):
frappe.throw("Only CSV and Excel files can be used to for importing data. Please check the file format you are trying to upload")
return file_doc, extension
def generate_data_from_csv(file_doc, as_dict=False):
''' read csv file and return the generated nested tree '''
file_doc = frappe.get_doc('File', {"file_url": file_name})
file_path = file_doc.get_full_path()
data = []
with open(file_path, 'r') as in_file:
csv_reader = list(csv.reader(in_file))
headers = csv_reader[1][1:]
del csv_reader[0:2] # delete top row and headers row
headers = csv_reader[0]
del csv_reader[0] # delete top row and headers row
for row in csv_reader:
if as_dict:
data.append({frappe.scrub(header): row[index+1] for index, header in enumerate(headers)})
data.append({frappe.scrub(header): row[index] for index, header in enumerate(headers)})
else:
if not row[2]: row[2] = row[1]
data.append(row[1:])
if not row[1]: row[1] = row[0]
data.append(row)
# convert csv data
return data
def generate_data_from_excel(file_doc, extension, as_dict=False):
content = file_doc.get_content()
if extension == "xlsx":
rows = read_xlsx_file_from_attached_file(fcontent=content)
elif extension == "xls":
rows = read_xls_file_from_attached_file(content)
data = []
headers = rows[0]
del rows[0]
for row in rows:
if as_dict:
data.append({frappe.scrub(header): row[index] for index, header in enumerate(headers)})
else:
if not row[1]: row[1] = row[0]
data.append(row)
return data
@frappe.whitelist()
def get_coa(doctype, parent, is_root=False, file_name=None):
''' called by tree view (to fetch node's children) '''
file_doc, extension = get_file(file_name)
parent = None if parent==_('All Accounts') else parent
forest = build_forest(generate_data_from_csv(file_name))
if extension == 'csv':
data = generate_data_from_csv(file_doc)
else:
data = generate_data_from_excel(file_doc, extension)
forest = build_forest(data)
accounts = build_tree_from_json("", chart_data=forest) # returns alist of dict in a tree render-able form
# filter out to show data for the selected node only
@@ -91,12 +144,19 @@ def build_forest(data):
# returns the path of any node in list format
def return_parent(data, child):
from frappe import _
for row in data:
account_name, parent_account = row[0:2]
if parent_account == account_name == child:
return [parent_account]
elif account_name == child:
return [child] + return_parent(data, parent_account)
parent_account_list = return_parent(data, parent_account)
if not parent_account_list:
frappe.throw(_("The parent account {0} does not exists in the uploaded template").format(
frappe.bold(parent_account)))
return [child] + parent_account_list
charts_map, paths = {}, []
@@ -104,13 +164,13 @@ def build_forest(data):
error_messages = []
for i in data:
account_name, _, account_number, is_group, account_type, root_type = i
account_name, dummy, account_number, is_group, account_type, root_type = i
if not account_name:
error_messages.append("Row {0}: Please enter Account Name".format(line_no))
charts_map[account_name] = {}
if is_group == 1: charts_map[account_name]["is_group"] = is_group
if cint(is_group) == 1: charts_map[account_name]["is_group"] = is_group
if account_type: charts_map[account_name]["account_type"] = account_type
if root_type: charts_map[account_name]["root_type"] = root_type
if account_number: charts_map[account_name]["account_number"] = account_number
@@ -128,24 +188,94 @@ def build_forest(data):
return out
def build_response_as_excel(writer):
filename = frappe.generate_hash("", 10)
with open(filename, 'wb') as f:
f.write(cstr(writer.getvalue()).encode('utf-8'))
f = open(filename)
reader = csv.reader(f)
from frappe.utils.xlsxutils import make_xlsx
xlsx_file = make_xlsx(reader, "Chart Of Accounts Importer Template")
f.close()
os.remove(filename)
# write out response as a xlsx type
frappe.response['filename'] = 'coa_importer_template.xlsx'
frappe.response['filecontent'] = xlsx_file.getvalue()
frappe.response['type'] = 'binary'
@frappe.whitelist()
def download_template():
def download_template(file_type, template_type):
data = frappe._dict(frappe.local.form_dict)
writer = get_template(template_type)
if file_type == 'CSV':
# download csv file
frappe.response['result'] = cstr(writer.getvalue())
frappe.response['type'] = 'csv'
frappe.response['doctype'] = 'Chart of Accounts Importer'
else:
build_response_as_excel(writer)
def get_template(template_type):
fields = ["Account Name", "Parent Account", "Account Number", "Is Group", "Account Type", "Root Type"]
writer = UnicodeWriter()
writer.writerow(fields)
writer.writerow([_('Chart of Accounts Template')])
writer.writerow([_("Column Labels : ")] + fields)
writer.writerow([_("Start entering data from here : ")])
if template_type == 'Blank Template':
for root_type in get_root_types():
writer.writerow(['', '', '', 1, '', root_type])
for account in get_mandatory_group_accounts():
writer.writerow(['', '', '', 1, account, "Asset"])
for account_type in get_mandatory_account_types():
writer.writerow(['', '', '', 0, account_type.get('account_type'), account_type.get('root_type')])
else:
writer = get_sample_template(writer)
return writer
def get_sample_template(writer):
template = [
["Application Of Funds(Assets)", "", "", 1, "", "Asset"],
["Sources Of Funds(Liabilities)", "", "", 1, "", "Liability"],
["Equity", "", "", 1, "", "Equity"],
["Expenses", "", "", 1, "", "Expense"],
["Income", "", "", 1, "", "Income"],
["Bank Accounts", "Application Of Funds(Assets)", "", 1, "Bank", "Asset"],
["Cash In Hand", "Application Of Funds(Assets)", "", 1, "Cash", "Asset"],
["Stock Assets", "Application Of Funds(Assets)", "", 1, "Stock", "Asset"],
["Cost Of Goods Sold", "Expenses", "", 0, "Cost of Goods Sold", "Expense"],
["Asset Depreciation", "Expenses", "", 0, "Depreciation", "Expense"],
["Fixed Assets", "Application Of Funds(Assets)", "", 0, "Fixed Asset", "Asset"],
["Accounts Payable", "Sources Of Funds(Liabilities)", "", 0, "Payable", "Liability"],
["Accounts Receivable", "Application Of Funds(Assets)", "", 1, "Receivable", "Asset"],
["Stock Expenses", "Expenses", "", 0, "Stock Adjustment", "Expense"],
["Sample Bank", "Bank Accounts", "", 0, "Bank", "Asset"],
["Cash", "Cash In Hand", "", 0, "Cash", "Asset"],
["Stores", "Stock Assets", "", 0, "Stock", "Asset"],
]
for row in template:
writer.writerow(row)
return writer
# download csv file
frappe.response['result'] = cstr(writer.getvalue())
frappe.response['type'] = 'csv'
frappe.response['doctype'] = data.get('doctype')
@frappe.whitelist()
def validate_accounts(file_name):
accounts = generate_data_from_csv(file_name, as_dict=True)
file_doc, extension = get_file(file_name)
if extension == 'csv':
accounts = generate_data_from_csv(file_doc, as_dict=True)
else:
accounts = generate_data_from_excel(file_doc, extension, as_dict=True)
accounts_dict = {}
for account in accounts:
@@ -170,12 +300,38 @@ def validate_root(accounts):
for account in roots:
if not account.get("root_type") and account.get("account_name"):
error_messages.append("Please enter Root Type for account- {0}".format(account.get("account_name")))
elif account.get("root_type") not in ("Asset", "Liability", "Expense", "Income", "Equity") and account.get("account_name"):
elif account.get("root_type") not in get_root_types() and account.get("account_name"):
error_messages.append("Root Type for {0} must be one of the Asset, Liability, Income, Expense and Equity".format(account.get("account_name")))
if error_messages:
return "<br>".join(error_messages)
def get_root_types():
return ('Asset', 'Liability', 'Expense', 'Income', 'Equity')
def get_report_type(root_type):
if root_type in ('Asset', 'Liability', 'Equity'):
return 'Balance Sheet'
else:
return 'Profit and Loss'
def get_mandatory_group_accounts():
return ('Bank', 'Cash', 'Stock')
def get_mandatory_account_types():
return [
{'account_type': 'Cost of Goods Sold', 'root_type': 'Expense'},
{'account_type': 'Depreciation', 'root_type': 'Expense'},
{'account_type': 'Fixed Asset', 'root_type': 'Asset'},
{'account_type': 'Payable', 'root_type': 'Liability'},
{'account_type': 'Receivable', 'root_type': 'Asset'},
{'account_type': 'Stock Adjustment', 'root_type': 'Expense'},
{'account_type': 'Bank', 'root_type': 'Asset'},
{'account_type': 'Cash', 'root_type': 'Asset'},
{'account_type': 'Stock', 'root_type': 'Asset'}
]
def validate_account_types(accounts):
account_types_for_ledger = ["Cost of Goods Sold", "Depreciation", "Fixed Asset", "Payable", "Receivable", "Stock Adjustment"]
account_types = [accounts[d]["account_type"] for d in accounts if not accounts[d]['is_group'] == 1]

View File

@@ -18,7 +18,7 @@ frappe.ui.form.on('Cost Center', {
},
refresh: function(frm) {
if (!frm.is_new()) {
frm.add_custom_button(__('Update Cost Center Number'), function () {
frm.add_custom_button(__('Update Cost Center Name / Number'), function () {
frm.trigger("update_cost_center_number");
});
}
@@ -47,35 +47,45 @@ frappe.ui.form.on('Cost Center', {
},
update_cost_center_number: function(frm) {
var d = new frappe.ui.Dialog({
title: __('Update Cost Center Number'),
title: __('Update Cost Center Name / Number'),
fields: [
{
"label": 'Cost Center Number',
"label": "Cost Center Name",
"fieldname": "cost_center_name",
"fieldtype": "Data",
"reqd": 1,
"default": frm.doc.cost_center_name
},
{
"label": "Cost Center Number",
"fieldname": "cost_center_number",
"fieldtype": "Data",
"reqd": 1
"reqd": 1,
"default": frm.doc.cost_center_number
}
],
primary_action: function() {
var data = d.get_values();
if(data.cost_center_number === frm.doc.cost_center_number) {
if(data.cost_center_name === frm.doc.cost_center_name && data.cost_center_number === frm.doc.cost_center_number) {
d.hide();
return;
}
frappe.dom.freeze();
frappe.call({
method: "erpnext.accounts.utils.update_number_field",
method: "erpnext.accounts.utils.update_cost_center",
args: {
doctype_name: frm.doc.doctype,
name: frm.doc.name,
field_name: d.fields[0].fieldname,
number_value: data.cost_center_number,
docname: frm.doc.name,
cost_center_name: data.cost_center_name,
cost_center_number: data.cost_center_number,
company: frm.doc.company
},
callback: function(r) {
frappe.dom.unfreeze();
if(!r.exc) {
if(r.message) {
frappe.set_route("Form", "Cost Center", r.message);
} else {
me.frm.set_value("cost_center_name", data.cost_center_name);
me.frm.set_value("cost_center_number", data.cost_center_number);
}
d.hide();

View File

@@ -1,7 +1,7 @@
{
"actions": [],
"allow_copy": 1,
"allow_import": 1,
"allow_rename": 1,
"creation": "2013-01-23 19:57:17",
"description": "Track separate Income and Expense for product verticals or divisions.",
"doctype": "DocType",
@@ -123,10 +123,13 @@
],
"icon": "fa fa-money",
"idx": 1,
"modified": "2019-09-16 14:44:17.103548",
"is_tree": 1,
"links": [],
"modified": "2020-04-29 16:09:30.025214",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cost Center",
"nsm_parent_field": "parent_cost_center",
"owner": "Administrator",
"permissions": [
{
@@ -162,7 +165,6 @@
"role": "Purchase User"
}
],
"quick_entry": 1,
"search_fields": "parent_cost_center, is_group",
"show_name_in_global_search": 1,
"sort_field": "modified",

View File

@@ -1,5 +1,5 @@
frappe.treeview_settings["Cost Center"] = {
breadcrumbs: "Accounts",
breadcrumb: "Accounts",
get_tree_root: false,
filters: [{
fieldname: "company",

View File

@@ -18,7 +18,8 @@
"in_list_view": 1,
"label": "Invoice",
"options": "Sales Invoice",
"reqd": 1
"reqd": 1,
"search_index": 1
},
{
"fetch_from": "sales_invoice.customer",
@@ -60,7 +61,7 @@
}
],
"istable": 1,
"modified": "2019-09-26 11:05:36.016772",
"modified": "2020-02-20 16:16:20.724620",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Discounted Invoice",

View File

@@ -7,4 +7,4 @@ from __future__ import unicode_literals
from frappe.model.document import Document
class DiscountedInvoice(Document):
pass
pass

File diff suppressed because it is too large Load Diff

View File

@@ -29,7 +29,6 @@ class GLEntry(Document):
self.validate_and_set_fiscal_year()
self.pl_must_have_cost_center()
self.validate_cost_center()
self.validate_dimensions_for_pl_and_bs()
if not self.flags.from_repost:
self.check_pl_account()
@@ -39,6 +38,7 @@ class GLEntry(Document):
def on_update_with_args(self, adv_adj, update_outstanding = 'Yes', from_repost=False):
if not from_repost:
self.validate_account_details(adv_adj)
self.validate_dimensions_for_pl_and_bs()
check_freezing_date(self.posting_date, adv_adj)
validate_frozen_account(self.account, adv_adj)
@@ -115,8 +115,8 @@ class GLEntry(Document):
from tabAccount where name=%s""", self.account, as_dict=1)[0]
if ret.is_group==1:
frappe.throw(_("{0} {1}: Account {2} cannot be a Group")
.format(self.voucher_type, self.voucher_no, self.account))
frappe.throw(_('''{0} {1}: Account {2} is a Group Account and group accounts cannot be used in
transactions''').format(self.voucher_type, self.voucher_no, self.account))
if ret.docstatus==2:
frappe.throw(_("{0} {1}: Account {2} is inactive")
@@ -232,10 +232,13 @@ def update_outstanding_amt(account, party_type, party, against_voucher_type, aga
if bal < 0 and not on_cancel:
frappe.throw(_("Outstanding for {0} cannot be less than zero ({1})").format(against_voucher, fmt_money(bal)))
# Update outstanding amt on against voucher
if against_voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"]:
ref_doc = frappe.get_doc(against_voucher_type, against_voucher)
ref_doc.db_set('outstanding_amount', bal)
# Didn't use db_set for optimisation purpose
ref_doc.outstanding_amount = bal
frappe.db.set_value(against_voucher_type, against_voucher, 'outstanding_amount', bal)
ref_doc.set_status(update=True)
def validate_frozen_account(account, adv_adj=None):
@@ -274,6 +277,9 @@ def update_against_account(voucher_type, voucher_no):
if d.against != new_against:
frappe.db.set_value("GL Entry", d.name, "against", new_against)
def on_doctype_update():
frappe.db.add_index("GL Entry", ["against_voucher_type", "against_voucher"])
frappe.db.add_index("GL Entry", ["voucher_type", "voucher_no"])
def rename_gle_sle_docs():
for doctype in ["GL Entry", "Stock Ledger Entry"]:

View File

@@ -8,6 +8,7 @@ from frappe import _
from frappe.utils import flt, getdate, nowdate, add_days
from erpnext.controllers.accounts_controller import AccountsController
from erpnext.accounts.general_ledger import make_gl_entries
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions
class InvoiceDiscounting(AccountsController):
def validate(self):
@@ -81,10 +82,15 @@ class InvoiceDiscounting(AccountsController):
def make_gl_entries(self):
company_currency = frappe.get_cached_value('Company', self.company, "default_currency")
gl_entries = []
invoice_fields = ["debit_to", "party_account_currency", "conversion_rate", "cost_center"]
accounting_dimensions = get_accounting_dimensions()
invoice_fields.extend(accounting_dimensions)
for d in self.invoices:
inv = frappe.db.get_value("Sales Invoice", d.sales_invoice,
["debit_to", "party_account_currency", "conversion_rate", "cost_center"], as_dict=1)
inv = frappe.db.get_value("Sales Invoice", d.sales_invoice, invoice_fields, as_dict=1)
if d.outstanding_amount:
outstanding_in_company_currency = flt(d.outstanding_amount * inv.conversion_rate,
@@ -102,7 +108,7 @@ class InvoiceDiscounting(AccountsController):
"cost_center": inv.cost_center,
"against_voucher": d.sales_invoice,
"against_voucher_type": "Sales Invoice"
}, inv.party_account_currency))
}, inv.party_account_currency, item=inv))
gl_entries.append(self.get_gl_dict({
"account": self.accounts_receivable_credit,
@@ -115,7 +121,7 @@ class InvoiceDiscounting(AccountsController):
"cost_center": inv.cost_center,
"against_voucher": d.sales_invoice,
"against_voucher_type": "Sales Invoice"
}, ar_credit_account_currency))
}, ar_credit_account_currency, item=inv))
make_gl_entries(gl_entries, cancel=(self.docstatus == 2), update_outstanding='No')

View File

@@ -190,7 +190,6 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
if(jvd.reference_type==="Employee Advance") {
return {
filters: {
'status': ['=', 'Unpaid'],
'docstatus': 1
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,6 @@ from erpnext.controllers.accounts_controller import AccountsController
from erpnext.accounts.utils import get_balance_on, get_account_currency
from erpnext.accounts.party import get_party_account
from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
from erpnext.hr.doctype.loan.loan import update_disbursement_status, update_total_amount_paid
from erpnext.accounts.doctype.invoice_discounting.invoice_discounting import get_party_account_based_on_invoice_discounting
from six import string_types, iteritems
@@ -457,11 +456,12 @@ class JournalEntry(AccountsController):
def set_print_format_fields(self):
bank_amount = party_amount = total_amount = 0.0
currency = bank_account_currency = party_account_currency = pay_to_recd_from= None
party_type = None
for d in self.get('accounts'):
if d.party_type in ['Customer', 'Supplier'] and d.party:
party_type = d.party_type
if not pay_to_recd_from:
pay_to_recd_from = frappe.db.get_value(d.party_type, d.party,
"customer_name" if d.party_type=="Customer" else "supplier_name")
pay_to_recd_from = d.party
if pay_to_recd_from and pay_to_recd_from == d.party:
party_amount += (d.debit_in_account_currency or d.credit_in_account_currency)
@@ -471,8 +471,9 @@ class JournalEntry(AccountsController):
bank_amount += (d.debit_in_account_currency or d.credit_in_account_currency)
bank_account_currency = d.account_currency
if pay_to_recd_from:
self.pay_to_recd_from = pay_to_recd_from
if party_type and pay_to_recd_from:
self.pay_to_recd_from = frappe.db.get_value(party_type, pay_to_recd_from,
"customer_name" if party_type=="Customer" else "supplier_name")
if bank_amount:
total_amount = bank_amount
currency = bank_account_currency
@@ -560,20 +561,20 @@ class JournalEntry(AccountsController):
if self.write_off_based_on == 'Accounts Receivable':
jd1.party_type = "Customer"
jd1.credit = flt(d.outstanding_amount, self.precision("credit", "accounts"))
jd1.credit_in_account_currency = flt(d.outstanding_amount, self.precision("credit", "accounts"))
jd1.reference_type = "Sales Invoice"
jd1.reference_name = cstr(d.name)
elif self.write_off_based_on == 'Accounts Payable':
jd1.party_type = "Supplier"
jd1.debit = flt(d.outstanding_amount, self.precision("debit", "accounts"))
jd1.debit_in_account_currency = flt(d.outstanding_amount, self.precision("debit", "accounts"))
jd1.reference_type = "Purchase Invoice"
jd1.reference_name = cstr(d.name)
jd2 = self.append('accounts', {})
if self.write_off_based_on == 'Accounts Receivable':
jd2.debit = total
jd2.debit_in_account_currency = total
elif self.write_off_based_on == 'Accounts Payable':
jd2.credit = total
jd2.credit_in_account_currency = total
self.validate_total_debit_and_credit()
@@ -606,8 +607,8 @@ class JournalEntry(AccountsController):
for d in self.accounts:
if d.reference_type=="Loan" and flt(d.debit) > 0:
doc = frappe.get_doc("Loan", d.reference_name)
update_disbursement_status(doc)
update_total_amount_paid(doc)
doc.update_total_amount_paid()
doc.set_status()
def validate_expense_claim(self):
for d in self.accounts:
@@ -968,7 +969,7 @@ def get_exchange_rate(posting_date, account=None, account_currency=None, company
# The date used to retreive the exchange rate here is the date passed
# in as an argument to this function.
elif (not exchange_rate or exchange_rate==1) and account_currency and posting_date:
elif (not exchange_rate or flt(exchange_rate)==1) and account_currency and posting_date:
exchange_rate = get_exchange_rate(account_currency, company_currency, posting_date)
else:
exchange_rate = 1

View File

@@ -90,7 +90,6 @@
"fieldtype": "Column Break"
},
{
"default": "Customer",
"fieldname": "party_type",
"fieldtype": "Link",
"in_list_view": 1,
@@ -272,7 +271,7 @@
],
"idx": 1,
"istable": 1,
"modified": "2019-10-02 12:23:21.693443",
"modified": "2020-01-13 12:41:33.968025",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",

View File

@@ -41,10 +41,16 @@ def get_loyalty_program_details_with_points(customer, loyalty_program=None, expi
loyalty_program = frappe.get_doc("Loyalty Program", loyalty_program)
lp_details.update(get_loyalty_details(customer, loyalty_program.name, expiry_date, company, include_expired_entry))
tier_spent_level = sorted([d.as_dict() for d in loyalty_program.collection_rules],
key=lambda rule:rule.min_spent, reverse=True)
# sort collection rule, first item on list will be lowest min_spent
tier_spent_level = sorted(
[d.as_dict() for d in loyalty_program.collection_rules],
key=lambda rule: rule.min_spent, reverse=False,
)
# looping and apply tier from lowest min_spent
for i, d in enumerate(tier_spent_level):
if i==0 or (lp_details.total_spent+current_transaction_amount) <= d.min_spent:
# if cumulative spend more than min_spent then continue to next tier
if (lp_details.total_spent + current_transaction_amount) >= d.min_spent:
lp_details.tier_name = d.tier_name
lp_details.collection_factor = d.collection_factor
else:

View File

@@ -68,6 +68,7 @@ class TestLoyaltyProgram(unittest.TestCase):
lpe = frappe.get_doc('Loyalty Point Entry', {'sales_invoice': si_original.name, 'customer': si_original.customer})
customer.load_from_db()
self.assertEqual(si_original.get('loyalty_program'), customer.loyalty_program)
self.assertEqual(lpe.get('loyalty_program_tier'), customer.loyalty_program_tier)
self.assertEqual(lpe.loyalty_points, earned_points)

View File

@@ -11,6 +11,7 @@ class ModeofPayment(Document):
def validate(self):
self.validate_accounts()
self.validate_repeating_companies()
self.validate_pos_mode_of_payment()
def validate_repeating_companies(self):
"""Error when Same Company is entered multiple times in accounts"""
@@ -27,3 +28,15 @@ class ModeofPayment(Document):
if frappe.db.get_value("Account", entry.default_account, "company") != entry.company:
frappe.throw(_("Account {0} does not match with Company {1} in Mode of Account: {2}")
.format(entry.default_account, entry.company, self.name))
def validate_pos_mode_of_payment(self):
if not self.enabled:
pos_profiles = frappe.db.sql("""SELECT sip.parent FROM `tabSales Invoice Payment` sip
WHERE sip.parenttype = 'POS Profile' and sip.mode_of_payment = %s""", (self.name))
pos_profiles = list(map(lambda x: x[0], pos_profiles))
if pos_profiles:
message = "POS Profile " + frappe.bold(", ".join(pos_profiles)) + " contains \
Mode of Payment " + frappe.bold(str(self.name)) + ". Please remove them to disable this mode."
frappe.throw(_(message), title="Not Allowed")

View File

@@ -104,6 +104,21 @@ frappe.ui.form.on('Payment Entry', {
};
});
frm.set_query('payment_term', 'references', function(frm, cdt, cdn) {
const child = locals[cdt][cdn];
if (in_list(['Purchase Invoice', 'Sales Invoice'], child.reference_doctype) && child.reference_name) {
let payment_term_list = frappe.get_list('Payment Schedule', {'parent': child.reference_name});
payment_term_list = payment_term_list.map(pt => pt.payment_term);
return {
filters: {
'name': ['in', payment_term_list]
}
}
}
});
frm.set_query("reference_name", "references", function(doc, cdt, cdn) {
const child = locals[cdt][cdn];
const filters = {"docstatus": 1, "company": doc.company};
@@ -154,8 +169,11 @@ frappe.ui.form.on('Payment Entry', {
frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency);
frm.toggle_display("base_received_amount", (frm.doc.paid_to_account_currency != company_currency &&
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency));
frm.toggle_display("base_received_amount", (
frm.doc.paid_to_account_currency != company_currency &&
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency
&& frm.doc.base_paid_amount != frm.doc.base_received_amount
));
frm.toggle_display("received_amount", (frm.doc.payment_type=="Internal Transfer" ||
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency))
@@ -269,7 +287,7 @@ frappe.ui.form.on('Payment Entry', {
frm.set_value("contact_email", "");
frm.set_value("contact_person", "");
}
if(frm.doc.payment_type && frm.doc.party_type && frm.doc.party) {
if(frm.doc.payment_type && frm.doc.party_type && frm.doc.party && frm.doc.company) {
if(!frm.doc.posting_date) {
frappe.msgprint(__("Please select Posting Date before selecting Party"))
frm.set_value("party", "");
@@ -486,6 +504,7 @@ frappe.ui.form.on('Payment Entry', {
paid_amount: function(frm) {
frm.set_value("base_paid_amount", flt(frm.doc.paid_amount) * flt(frm.doc.source_exchange_rate));
frm.trigger("reset_received_amount");
frm.events.hide_unhide_fields(frm);
},
received_amount: function(frm) {
@@ -509,6 +528,7 @@ frappe.ui.form.on('Payment Entry', {
frm.events.set_unallocated_amount(frm);
frm.set_paid_amount_based_on_received_amount = false;
frm.events.hide_unhide_fields(frm);
},
reset_received_amount: function(frm) {
@@ -652,14 +672,16 @@ frappe.ui.form.on('Payment Entry', {
(frm.doc.payment_type=="Receive" && frm.doc.party_type=="Student")
) {
if(total_positive_outstanding > total_negative_outstanding)
frm.set_value("paid_amount",
total_positive_outstanding - total_negative_outstanding);
if (!frm.doc.paid_amount)
frm.set_value("paid_amount",
total_positive_outstanding - total_negative_outstanding);
} else if (
total_negative_outstanding &&
total_positive_outstanding < total_negative_outstanding
) {
frm.set_value("received_amount",
total_negative_outstanding - total_positive_outstanding);
if (!frm.doc.received_amount)
frm.set_value("received_amount",
total_negative_outstanding - total_positive_outstanding);
}
}
@@ -1011,4 +1033,4 @@ frappe.ui.form.on('Payment Entry', {
});
}
},
})
})

View File

@@ -60,6 +60,7 @@ class PaymentEntry(AccountsController):
self.set_remarks()
self.validate_duplicate_entry()
self.validate_allocated_amount()
self.validate_paid_invoices()
self.ensure_supplier_is_not_blocked()
self.set_status()
@@ -71,9 +72,9 @@ class PaymentEntry(AccountsController):
self.update_outstanding_amounts()
self.update_advance_paid()
self.update_expense_claim()
self.update_payment_schedule()
self.set_status()
def on_cancel(self):
self.setup_party_account_field()
self.make_gl_entries(cancel=1)
@@ -81,18 +82,24 @@ class PaymentEntry(AccountsController):
self.update_advance_paid()
self.update_expense_claim()
self.delink_advance_entry_references()
self.update_payment_schedule(cancel=1)
self.set_payment_req_status()
self.set_status()
def set_payment_req_status(self):
from erpnext.accounts.doctype.payment_request.payment_request import update_payment_req_status
update_payment_req_status(self, None)
def update_outstanding_amounts(self):
self.set_missing_ref_details(force=True)
def validate_duplicate_entry(self):
reference_names = []
for d in self.get("references"):
if (d.reference_doctype, d.reference_name) in reference_names:
if (d.reference_doctype, d.reference_name, d.payment_term) in reference_names:
frappe.throw(_("Row #{0}: Duplicate entry in References {1} {2}")
.format(d.idx, d.reference_doctype, d.reference_name))
reference_names.append((d.reference_doctype, d.reference_name))
reference_names.append((d.reference_doctype, d.reference_name, d.payment_term))
def set_bank_account_data(self):
if self.bank_account:
@@ -102,7 +109,9 @@ class PaymentEntry(AccountsController):
self.bank = bank_data.bank
self.bank_account_no = bank_data.bank_account_no
self.set(field, bank_data.account)
if not self.get(field):
self.set(field, bank_data.account)
def validate_allocated_amount(self):
for d in self.get("references"):
@@ -218,6 +227,8 @@ class PaymentEntry(AccountsController):
valid_reference_doctypes = ("Purchase Order", "Purchase Invoice", "Journal Entry")
elif self.party_type == "Employee":
valid_reference_doctypes = ("Expense Claim", "Journal Entry", "Employee Advance")
elif self.party_type == "Shareholder":
valid_reference_doctypes = ("Journal Entry")
for d in self.get("references"):
if not d.allocated_amount:
@@ -257,6 +268,25 @@ class PaymentEntry(AccountsController):
frappe.throw(_("{0} {1} must be submitted")
.format(d.reference_doctype, d.reference_name))
def validate_paid_invoices(self):
no_oustanding_refs = {}
for d in self.get("references"):
if not d.allocated_amount:
continue
if d.reference_doctype in ("Sales Invoice", "Purchase Invoice", "Fees"):
outstanding_amount, is_return = frappe.get_cached_value(d.reference_doctype, d.reference_name, ["outstanding_amount", "is_return"])
if outstanding_amount <= 0 and not is_return:
no_oustanding_refs.setdefault(d.reference_doctype, []).append(d)
for k, v in no_oustanding_refs.items():
frappe.msgprint(_("{} - {} now have {} as they had no outstanding amount left before submitting the Payment Entry.<br><br>\
If this is undesirable please cancel the corresponding Payment Entry.")
.format(k, frappe.bold(", ".join([d.reference_name for d in v])), frappe.bold("negative outstanding amount")),
title=_("Warning"), indicator="orange")
def validate_journal_entry(self):
for d in self.get("references"):
if d.allocated_amount and d.reference_doctype == "Journal Entry":
@@ -278,6 +308,38 @@ class PaymentEntry(AccountsController):
frappe.throw(_("Against Journal Entry {0} does not have any unmatched {1} entry")
.format(d.reference_name, dr_or_cr))
def update_payment_schedule(self, cancel=0):
invoice_payment_amount_map = {}
invoice_paid_amount_map = {}
for reference in self.get('references'):
if reference.payment_term and reference.reference_name:
key = (reference.payment_term, reference.reference_name)
invoice_payment_amount_map.setdefault(key, 0.0)
invoice_payment_amount_map[key] += reference.allocated_amount
if not invoice_paid_amount_map.get(key):
payment_schedule = frappe.get_all('Payment Schedule', filters={'parent': reference.reference_name},
fields=['paid_amount', 'payment_amount', 'payment_term'])
for term in payment_schedule:
invoice_key = (term.payment_term, reference.reference_name)
invoice_paid_amount_map.setdefault(invoice_key, {})
invoice_paid_amount_map[invoice_key]['outstanding'] = term.payment_amount - term.paid_amount
for key, amount in iteritems(invoice_payment_amount_map):
if cancel:
frappe.db.sql(""" UPDATE `tabPayment Schedule` SET paid_amount = `paid_amount` - %s
WHERE parent = %s and payment_term = %s""", (amount, key[1], key[0]))
else:
outstanding = flt(invoice_paid_amount_map.get(key, {}).get('outstanding'))
if amount > outstanding:
frappe.throw(_('Cannot allocate more than {0} against payment term {1}').format(outstanding, key[0]))
if amount and outstanding:
frappe.db.sql(""" UPDATE `tabPayment Schedule` SET paid_amount = `paid_amount` + %s
WHERE parent = %s and payment_term = %s""", (amount, key[1], key[0]))
def set_status(self):
if self.docstatus == 2:
self.status = 'Cancelled'
@@ -390,8 +452,6 @@ class PaymentEntry(AccountsController):
frappe.throw(_("Reference No and Reference Date is mandatory for Bank transaction"))
def set_remarks(self):
if self.remarks: return
if self.payment_type=="Internal Transfer":
remarks = [_("Amount {0} {1} transferred from {2} to {3}")
.format(self.paid_from_account_currency, self.paid_amount, self.paid_from, self.paid_to)]
@@ -445,7 +505,7 @@ class PaymentEntry(AccountsController):
"against": against_account,
"account_currency": self.party_account_currency,
"cost_center": self.cost_center
})
}, item=self)
dr_or_cr = "credit" if erpnext.get_party_account_type(self.party_type) == 'Receivable' else "debit"
@@ -489,7 +549,7 @@ class PaymentEntry(AccountsController):
"credit_in_account_currency": self.paid_amount,
"credit": self.base_paid_amount,
"cost_center": self.cost_center
})
}, item=self)
)
if self.payment_type in ("Receive", "Internal Transfer"):
gl_entries.append(
@@ -500,7 +560,7 @@ class PaymentEntry(AccountsController):
"debit_in_account_currency": self.received_amount,
"debit": self.base_received_amount,
"cost_center": self.cost_center
})
}, item=self)
)
def add_deductions_gl_entries(self, gl_entries):
@@ -911,7 +971,10 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
else:
party_account = get_party_account(party_type, doc.get(party_type.lower()), doc.company)
party_account_currency = doc.get("party_account_currency") or get_account_currency(party_account)
if dt not in ("Sales Invoice", "Purchase Invoice"):
party_account_currency = get_account_currency(party_account)
else:
party_account_currency = doc.get("party_account_currency") or get_account_currency(party_account)
# payment type
if (dt == "Sales Order" or (dt in ("Sales Invoice", "Fees") and doc.outstanding_amount > 0)) \
@@ -1002,15 +1065,22 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
if doc.doctype == "Purchase Invoice" and doc.invoice_is_blocked():
frappe.msgprint(_('{0} is on hold till {1}'.format(doc.name, doc.release_date)))
else:
pe.append("references", {
'reference_doctype': dt,
'reference_name': dn,
"bill_no": doc.get("bill_no"),
"due_date": doc.get("due_date"),
'total_amount': grand_total,
'outstanding_amount': outstanding_amount,
'allocated_amount': outstanding_amount
})
if (doc.doctype in ('Sales Invoice', 'Purchase Invoice')
and frappe.get_value('Payment Terms Template',
{'name': doc.payment_terms_template}, 'allocate_payment_based_on_payment_terms')):
for reference in get_reference_as_per_payment_terms(doc.payment_schedule, dt, dn, doc, grand_total, outstanding_amount):
pe.append('references', reference)
else:
pe.append("references", {
'reference_doctype': dt,
'reference_name': dn,
"bill_no": doc.get("bill_no"),
"due_date": doc.get("due_date"),
'total_amount': grand_total,
'outstanding_amount': outstanding_amount,
'allocated_amount': outstanding_amount
})
pe.setup_party_account_field()
pe.set_missing_values()
@@ -1019,6 +1089,25 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
pe.set_amounts()
return pe
def get_reference_as_per_payment_terms(payment_schedule, dt, dn, doc, grand_total, outstanding_amount):
references = []
for payment_term in payment_schedule:
payment_term_outstanding = flt(payment_term.payment_amount - payment_term.paid_amount,
payment_term.precision('payment_amount'))
if payment_term_outstanding:
references.append({
'reference_doctype': dt,
'reference_name': dn,
'bill_no': doc.get('bill_no'),
'due_date': doc.get('due_date'),
'total_amount': grand_total,
'outstanding_amount': outstanding_amount,
'payment_term': payment_term.payment_term,
'allocated_amount': payment_term_outstanding
})
return references
def get_paid_amount(dt, dn, party_type, party, account, due_date):
if party_type=="Customer":

View File

@@ -0,0 +1,12 @@
frappe.listview_settings['Payment Entry'] = {
onload: function(listview) {
listview.page.fields_dict.party_type.get_query = function() {
return {
"filters": {
"name": ["in", Object.keys(frappe.boot.party_account_types)],
}
};
};
}
};

View File

@@ -149,6 +149,73 @@ class TestPaymentEntry(unittest.TestCase):
outstanding_amount = flt(frappe.db.get_value("Sales Invoice", pi.name, "outstanding_amount"))
self.assertEqual(outstanding_amount, 0)
def test_payment_entry_against_payment_terms(self):
si = create_sales_invoice(do_not_save=1, qty=1, rate=200)
create_payment_terms_template()
si.payment_terms_template = 'Test Receivable Template'
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()
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
pe.submit()
si.load_from_db()
self.assertEqual(pe.references[0].payment_term, 'Basic Amount Receivable')
self.assertEqual(pe.references[1].payment_term, 'Tax Receivable')
self.assertEqual(si.payment_schedule[0].paid_amount, 200.0)
self.assertEqual(si.payment_schedule[1].paid_amount, 36.0)
def test_payment_against_sales_invoice_to_check_status(self):
si = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
currency="USD", conversion_rate=50)
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank USD - _TC")
pe.reference_no = "1"
pe.reference_date = "2016-01-01"
pe.target_exchange_rate = 50
pe.insert()
pe.submit()
outstanding_amount, status = frappe.db.get_value("Sales Invoice", si.name, ["outstanding_amount", "status"])
self.assertEqual(flt(outstanding_amount), 0)
self.assertEqual(status, 'Paid')
pe.cancel()
outstanding_amount, status = frappe.db.get_value("Sales Invoice", si.name, ["outstanding_amount", "status"])
self.assertEqual(flt(outstanding_amount), 100)
self.assertEqual(status, 'Unpaid')
def test_payment_against_purchase_invoice_to_check_status(self):
pi = make_purchase_invoice(supplier="_Test Supplier USD", debit_to="_Test Payable USD - _TC",
currency="USD", conversion_rate=50)
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank USD - _TC")
pe.reference_no = "1"
pe.reference_date = "2016-01-01"
pe.source_exchange_rate = 50
pe.insert()
pe.submit()
outstanding_amount, status = frappe.db.get_value("Purchase Invoice", pi.name, ["outstanding_amount", "status"])
self.assertEqual(flt(outstanding_amount), 0)
self.assertEqual(status, 'Paid')
pe.cancel()
outstanding_amount, status = frappe.db.get_value("Purchase Invoice", pi.name, ["outstanding_amount", "status"])
self.assertEqual(flt(outstanding_amount), 250)
self.assertEqual(status, 'Unpaid')
def test_payment_entry_against_ec(self):
payable = frappe.get_cached_value('Company', "_Test Company", 'default_payable_account')
@@ -567,3 +634,37 @@ class TestPaymentEntry(unittest.TestCase):
accounts_settings.allow_cost_center_in_entry_of_bs_account = 0
accounts_settings.save()
def create_payment_terms_template():
create_payment_term('Basic Amount Receivable')
create_payment_term('Tax Receivable')
if not frappe.db.exists('Payment Terms Template', 'Test Receivable Template'):
payment_term_template = frappe.get_doc({
'doctype': 'Payment Terms Template',
'template_name': 'Test Receivable Template',
'allocate_payment_based_on_payment_terms': 1,
'terms': [{
'doctype': 'Payment Terms Template Detail',
'payment_term': 'Basic Amount Receivable',
'invoice_portion': 84.746,
'credit_days_based_on': 'Day(s) after invoice date',
'credit_days': 1
},
{
'doctype': 'Payment Terms Template Detail',
'payment_term': 'Tax Receivable',
'invoice_portion': 15.254,
'credit_days_based_on': 'Day(s) after invoice date',
'credit_days': 2
}]
}).insert()
def create_payment_term(name):
if not frappe.db.exists('Payment Term', name):
frappe.get_doc({
'doctype': 'Payment Term',
'payment_term_name': name
}).insert()

View File

@@ -1,343 +1,107 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"actions": [],
"creation": "2016-06-01 16:55:32.196722",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"reference_doctype",
"reference_name",
"due_date",
"bill_no",
"payment_term",
"column_break_4",
"total_amount",
"outstanding_amount",
"allocated_amount",
"exchange_rate"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fetch_if_empty": 0,
"fieldname": "reference_doctype",
"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": "Type",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"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
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fetch_if_empty": 0,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Name",
"length": 0,
"no_copy": 0,
"options": "reference_doctype",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"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
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "due_date",
"fieldtype": "Date",
"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": "Due Date",
"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
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fetch_if_empty": 0,
"fieldname": "bill_no",
"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": "Supplier Invoice No",
"length": 0,
"no_copy": 1,
"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
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_4",
"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
"fieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fetch_if_empty": 0,
"fieldname": "total_amount",
"fieldtype": "Float",
"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": "Total Amount",
"length": 0,
"no_copy": 0,
"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
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fetch_if_empty": 0,
"fieldname": "outstanding_amount",
"fieldtype": "Float",
"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": "Outstanding",
"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
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fetch_if_empty": 0,
"fieldname": "allocated_amount",
"fieldtype": "Float",
"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": "Allocated",
"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
"label": "Allocated"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:(doc.reference_doctype=='Purchase Invoice')",
"fetch_if_empty": 0,
"fieldname": "exchange_rate",
"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": "Exchange Rate",
"length": 0,
"no_copy": 0,
"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
"read_only": 1
},
{
"fieldname": "payment_term",
"fieldtype": "Link",
"label": "Payment Term",
"options": "Payment Term"
}
],
"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": "2019-05-01 13:24:56.586677",
"links": [],
"modified": "2020-03-13 12:07:19.362539",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Reference",
"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
"track_changes": 1
}

View File

@@ -15,11 +15,11 @@ frappe.ui.form.on('Payment Order', {
if (frm.doc.docstatus == 0) {
frm.add_custom_button(__('Payment Request'), function() {
frm.trigger("get_from_payment_request");
}, __("Get from"));
}, __("Get Payments from"));
frm.add_custom_button(__('Payment Entry'), function() {
frm.trigger("get_from_payment_entry");
}, __("Get from"));
}, __("Get Payments from"));
frm.trigger('remove_button');
}

View File

@@ -59,7 +59,6 @@
"fieldtype": "Section Break"
},
{
"allow_bulk_edit": 1,
"fieldname": "references",
"fieldtype": "Table",
"label": "Payment Order Reference",
@@ -108,7 +107,7 @@
}
],
"is_submittable": 1,
"modified": "2019-05-14 17:12:24.912666",
"modified": "2020-04-06 18:00:56.022642",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Order",

View File

@@ -80,7 +80,7 @@ def make_journal_entry(doc, supplier, mode_of_payment=None):
paid_amt += d.amount
je.append('accounts', {
'account': doc.references[0].account,
'account': doc.account,
'credit_in_account_currency': paid_amt
})

View File

@@ -23,6 +23,8 @@ class PaymentReconciliation(Document):
if self.party_type in ["Customer", "Supplier"]:
dr_or_cr_notes = self.get_dr_or_cr_notes()
else:
dr_or_cr_notes = []
self.add_payment_entries(payment_entries + journal_entries + dr_or_cr_notes)
@@ -90,6 +92,7 @@ class PaymentReconciliation(Document):
FROM `tab{doc}`, `tabGL Entry`
WHERE
(`tab{doc}`.name = `tabGL Entry`.against_voucher or `tab{doc}`.name = `tabGL Entry`.voucher_no)
and `tab{doc}`.{party_type_field} = %(party)s
and `tab{doc}`.is_return = 1 and `tab{doc}`.return_against IS NULL
and `tabGL Entry`.against_voucher_type = %(voucher_type)s
and `tab{doc}`.docstatus = 1 and `tabGL Entry`.party = %(party)s
@@ -97,12 +100,17 @@ class PaymentReconciliation(Document):
GROUP BY `tab{doc}`.name
Having
amount > 0
""".format(doc=voucher_type, dr_or_cr=dr_or_cr, reconciled_dr_or_cr=reconciled_dr_or_cr), {
'party': self.party,
'party_type': self.party_type,
'voucher_type': voucher_type,
'account': self.receivable_payable_account
}, as_dict=1)
""".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)),
{
'party': self.party,
'party_type': self.party_type,
'voucher_type': voucher_type,
'account': self.receivable_payable_account
}, as_dict=1)
def add_payment_entries(self, entries):
self.set('payments', [])

View File

@@ -2,6 +2,16 @@ cur_frm.add_fetch("payment_gateway_account", "payment_account", "payment_account
cur_frm.add_fetch("payment_gateway_account", "payment_gateway", "payment_gateway")
cur_frm.add_fetch("payment_gateway_account", "message", "message")
frappe.ui.form.on("Payment Request", {
setup: function(frm) {
frm.set_query("party_type", function() {
return {
query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
};
});
}
})
frappe.ui.form.on("Payment Request", "onload", function(frm, dt, dn){
if (frm.doc.reference_doctype) {
frappe.call({

File diff suppressed because it is too large Load Diff

View File

@@ -66,8 +66,10 @@ class PaymentRequest(Document):
if self.payment_request_type == 'Outward':
self.db_set('status', 'Initiated')
return
elif self.payment_request_type == 'Inward':
self.db_set('status', 'Requested')
send_mail = self.payment_gateway_validation()
send_mail = self.payment_gateway_validation() if self.payment_gateway else None
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
if (hasattr(ref_doc, "order_type") and getattr(ref_doc, "order_type") == "Shopping Cart") \
@@ -88,6 +90,7 @@ class PaymentRequest(Document):
if (hasattr(ref_doc, "order_type") and getattr(ref_doc, "order_type") == "Shopping Cart"):
from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
si = make_sales_invoice(self.reference_name, ignore_permissions=True)
si.allocate_advances_automatically = True
si = si.insert(ignore_permissions=True)
si.submit()
@@ -126,12 +129,12 @@ class PaymentRequest(Document):
return controller.get_payment_url(**{
"amount": flt(self.grand_total, self.precision("grand_total")),
"title": data.company.encode("utf-8"),
"description": self.subject.encode("utf-8"),
"title": frappe.as_unicode(data.company),
"description": frappe.as_unicode(self.subject),
"reference_doctype": "Payment Request",
"reference_docname": self.name,
"payer_email": self.email_to or frappe.session.user,
"payer_name": frappe.safe_encode(data.customer_name),
"payer_name": frappe.as_unicode(data.customer_name),
"order_id": self.name,
"currency": self.currency
})
@@ -317,13 +320,13 @@ def make_payment_request(**args):
"payment_request_type": args.get("payment_request_type"),
"currency": ref_doc.currency,
"grand_total": grand_total,
"email_to": args.recipient_id or "",
"email_to": args.recipient_id or ref_doc.owner,
"subject": _("Payment Request for {0}").format(args.dn),
"message": gateway_account.get("message") or get_dummy_message(ref_doc),
"reference_doctype": args.dt,
"reference_name": args.dn,
"party_type": args.get("party_type"),
"party": args.get("party"),
"party_type": args.get("party_type") or "Customer",
"party": args.get("party") or ref_doc.get("customer"),
"bank_account": bank_account
})
@@ -350,13 +353,13 @@ def get_amount(ref_doc):
if dt in ["Sales Order", "Purchase Order"]:
grand_total = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid)
if dt in ["Sales Invoice", "Purchase Invoice"]:
elif dt in ["Sales Invoice", "Purchase Invoice"]:
if ref_doc.party_account_currency == ref_doc.currency:
grand_total = flt(ref_doc.outstanding_amount)
else:
grand_total = flt(ref_doc.outstanding_amount) / ref_doc.conversion_rate
if dt == "Fees":
elif dt == "Fees":
grand_total = ref_doc.outstanding_amount
if grand_total > 0 :
@@ -373,6 +376,7 @@ def get_existing_payment_request_amount(ref_dt, ref_dn):
reference_doctype = %s
and reference_name = %s
and docstatus = 1
and status != 'Paid'
""", (ref_dt, ref_dn))
return flt(existing_payment_request_amount[0][0]) if existing_payment_request_amount else 0
@@ -414,17 +418,31 @@ def make_payment_entry(docname):
doc = frappe.get_doc("Payment Request", docname)
return doc.create_payment_entry(submit=False).as_dict()
def make_status_as_paid(doc, method):
def update_payment_req_status(doc, method):
from erpnext.accounts.doctype.payment_entry.payment_entry import get_reference_details
for ref in doc.references:
payment_request_name = frappe.db.get_value("Payment Request",
{"reference_doctype": ref.reference_doctype, "reference_name": ref.reference_name,
"docstatus": 1})
if payment_request_name:
doc = frappe.get_doc("Payment Request", payment_request_name)
if doc.status != "Paid":
doc.db_set('status', 'Paid')
frappe.db.commit()
ref_details = get_reference_details(ref.reference_doctype, ref.reference_name, doc.party_account_currency)
pay_req_doc = frappe.get_doc('Payment Request', payment_request_name)
status = pay_req_doc.status
if status != "Paid" and not ref_details.outstanding_amount:
status = 'Paid'
elif status != "Partially Paid" and ref_details.outstanding_amount != ref_details.total_amount:
status = 'Partially Paid'
elif ref_details.outstanding_amount == ref_details.total_amount:
if pay_req_doc.payment_request_type == 'Outward':
status = 'Initiated'
elif pay_req_doc.payment_request_type == 'Inward':
status = 'Requested'
pay_req_doc.db_set('status', status)
frappe.db.commit()
def get_dummy_message(doc):
return frappe.render_template("""{% if doc.contact_person -%}
@@ -474,4 +492,4 @@ def make_payment_order(source_name, target_doc=None):
}
}, target_doc, set_missing_values)
return doclist
return doclist

View File

@@ -4,14 +4,20 @@ frappe.listview_settings['Payment Request'] = {
if(doc.status == "Draft") {
return [__("Draft"), "darkgrey", "status,=,Draft"];
}
if(doc.status == "Requested") {
return [__("Requested"), "green", "status,=,Requested"];
}
else if(doc.status == "Initiated") {
return [__("Initiated"), "green", "status,=,Initiated"];
}
else if(doc.status == "Partially Paid") {
return [__("Partially Paid"), "orange", "status,=,Partially Paid"];
}
else if(doc.status == "Paid") {
return [__("Paid"), "blue", "status,=,Paid"];
}
else if(doc.status == "Cancelled") {
return [__("Cancelled"), "orange", "status,=,Cancelled"];
return [__("Cancelled"), "red", "status,=,Cancelled"];
}
}
}

View File

@@ -101,6 +101,23 @@ class TestPaymentRequest(unittest.TestCase):
self.assertEqual(expected_gle[gle.account][2], gle.credit)
self.assertEqual(expected_gle[gle.account][3], gle.against_voucher)
def test_status(self):
si_usd = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
currency="USD", conversion_rate=50)
pr = make_payment_request(dt="Sales Invoice", dn=si_usd.name, recipient_id="saurabh@erpnext.com",
mute_email=1, payment_gateway="_Test Gateway - USD", submit_doc=1, return_doc=1)
pe = pr.create_payment_entry()
pr.load_from_db()
self.assertEqual(pr.status, 'Paid')
pe.cancel()
pr.load_from_db()
self.assertEqual(pr.status, 'Requested')
def test_multiple_payment_entries_against_sales_order(self):
# Make Sales Order, grand_total = 1000
so = make_sales_order()

View File

@@ -1,243 +1,82 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "",
"beta": 0,
"creation": "2017-08-10 15:38:00.080575",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"actions": [],
"creation": "2017-08-10 15:38:00.080575",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"payment_term",
"description",
"due_date",
"invoice_portion",
"payment_amount",
"mode_of_payment",
"paid_amount"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "payment_term",
"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": "Payment Term",
"length": 0,
"no_copy": 0,
"options": "Payment Term",
"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
},
"columns": 2,
"fieldname": "payment_term",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Payment Term",
"options": "Payment Term",
"print_hide": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fetch_from": "",
"fieldname": "description",
"fieldtype": "Small Text",
"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": "Description",
"length": 0,
"no_copy": 0,
"options": "",
"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": "description",
"fieldtype": "Small Text",
"in_list_view": 1,
"label": "Description"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "due_date",
"fieldtype": "Date",
"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": "Due Date",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"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
},
"columns": 2,
"fieldname": "due_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Due Date",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fetch_from": "",
"fieldname": "invoice_portion",
"fieldtype": "Percent",
"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": "Invoice Portion",
"length": 0,
"no_copy": 0,
"options": "",
"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
},
"columns": 2,
"fieldname": "invoice_portion",
"fieldtype": "Percent",
"in_list_view": 1,
"label": "Invoice Portion",
"print_hide": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "payment_amount",
"fieldtype": "Currency",
"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": "Payment Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"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
},
"columns": 2,
"fieldname": "payment_amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Payment Amount",
"options": "currency",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "mode_of_payment",
"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": "Mode of Payment",
"length": 0,
"no_copy": 0,
"options": "Mode of Payment",
"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": "mode_of_payment",
"fieldtype": "Link",
"label": "Mode of Payment",
"options": "Mode of Payment"
},
{
"fieldname": "paid_amount",
"fieldtype": "Currency",
"label": "Paid Amount"
}
],
"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-09-06 17:35:44.580209",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",
"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": "2020-03-13 17:58:24.729526",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}

View File

@@ -1,164 +1,84 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:template_name",
"beta": 0,
"creation": "2017-08-10 15:34:28.058054",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"actions": [],
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:template_name",
"creation": "2017-08-10 15:34:28.058054",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"template_name",
"allocate_payment_based_on_payment_terms",
"terms"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "template_name",
"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": "Template Name",
"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,
"unique": 0
},
"fieldname": "template_name",
"fieldtype": "Data",
"label": "Template Name",
"unique": 1
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "terms",
"fieldtype": "Table",
"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": "Payment Terms",
"length": 0,
"no_copy": 0,
"options": "Payment Terms Template Detail",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"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,
"unique": 0
"fieldname": "terms",
"fieldtype": "Table",
"label": "Payment Terms",
"options": "Payment Terms Template Detail",
"reqd": 1
},
{
"default": "0",
"description": "If this checkbox is checked, paid amount will be splitted and allocated as per the amounts in payment schedule against each payment term",
"fieldname": "allocate_payment_based_on_payment_terms",
"fieldtype": "Check",
"label": "Allocate Payment Based On Payment Terms"
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-01-24 11:13:31.158613",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Terms Template",
"name_case": "",
"owner": "Administrator",
],
"links": [],
"modified": "2020-04-01 15:35:18.112619",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Terms Template",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
},
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"share": 1,
"write": 1
},
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"write": 1
}
],
"quick_entry": 0,
"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
],
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}

View File

@@ -7,6 +7,8 @@ from frappe.utils import flt
from frappe import _
from erpnext.accounts.utils import get_account_currency
from erpnext.controllers.accounts_controller import AccountsController
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (get_accounting_dimensions,
get_dimension_filters)
class PeriodClosingVoucher(AccountsController):
def validate(self):
@@ -49,7 +51,15 @@ class PeriodClosingVoucher(AccountsController):
def make_gl_entries(self):
gl_entries = []
net_pl_balance = 0
pl_accounts = self.get_pl_balances()
dimension_fields = ['t1.cost_center']
accounting_dimensions = get_accounting_dimensions()
for dimension in accounting_dimensions:
dimension_fields.append('t1.{0}'.format(dimension))
dimension_filters, default_dimensions = get_dimension_filters()
pl_accounts = self.get_pl_balances(dimension_fields)
for acc in pl_accounts:
if flt(acc.balance_in_company_currency):
@@ -65,34 +75,41 @@ class PeriodClosingVoucher(AccountsController):
if flt(acc.balance_in_account_currency) > 0 else 0,
"credit": abs(flt(acc.balance_in_company_currency)) \
if flt(acc.balance_in_company_currency) > 0 else 0
}))
}, item=acc))
net_pl_balance += flt(acc.balance_in_company_currency)
if net_pl_balance:
cost_center = frappe.db.get_value("Company", self.company, "cost_center")
gl_entries.append(self.get_gl_dict({
gl_entry = self.get_gl_dict({
"account": self.closing_account_head,
"debit_in_account_currency": abs(net_pl_balance) if net_pl_balance > 0 else 0,
"debit": abs(net_pl_balance) if net_pl_balance > 0 else 0,
"credit_in_account_currency": abs(net_pl_balance) if net_pl_balance < 0 else 0,
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0,
"cost_center": cost_center
}))
})
for dimension in accounting_dimensions:
gl_entry.update({
dimension: default_dimensions.get(self.company, {}).get(dimension)
})
gl_entries.append(gl_entry)
from erpnext.accounts.general_ledger import make_gl_entries
make_gl_entries(gl_entries)
def get_pl_balances(self):
def get_pl_balances(self, dimension_fields):
"""Get balance for pl accounts"""
return frappe.db.sql("""
select
t1.account, t1.cost_center, t2.account_currency,
t1.account, t2.account_currency, {dimension_fields},
sum(t1.debit_in_account_currency) - sum(t1.credit_in_account_currency) as balance_in_account_currency,
sum(t1.debit) - sum(t1.credit) as balance_in_company_currency
from `tabGL Entry` t1, `tabAccount` t2
where t1.account = t2.name and t2.report_type = 'Profit and Loss'
and t2.docstatus < 2 and t2.company = %s
and t1.posting_date between %s and %s
group by t1.account, t1.cost_center
""", (self.company, self.get("year_start_date"), self.posting_date), as_dict=1)
group by t1.account, {dimension_fields}
""".format(dimension_fields = ', '.join(dimension_fields)), (self.company, self.get("year_start_date"), self.posting_date), as_dict=1)

View File

@@ -3,6 +3,7 @@
"autoname": "Prompt",
"creation": "2013-05-24 12:15:51",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"disabled",
"section_break_2",
@@ -50,6 +51,7 @@
"income_account",
"expense_account",
"taxes_and_charges",
"tax_category",
"apply_discount_on",
"accounting_dimensions_section",
"cost_center",
@@ -381,11 +383,17 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "tax_category",
"fieldtype": "Link",
"label": "Tax Category",
"options": "Tax Category"
}
],
"icon": "icon-cog",
"idx": 1,
"modified": "2019-05-25 22:56:30.352693",
"modified": "2020-01-24 15:52:03.797701",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",

View File

@@ -15,12 +15,12 @@ class TestPOSProfile(unittest.TestCase):
pos_profile = get_pos_profile("_Test Company") or {}
if pos_profile:
doc = frappe.get_doc("POS Profile", pos_profile.get("name"))
doc.append('item_groups', {'item_group': '_Test Item Group'})
doc.append('customer_groups', {'customer_group': '_Test Customer Group'})
doc.set('item_groups', [{'item_group': '_Test Item Group'}])
doc.set('customer_groups', [{'customer_group': '_Test Customer Group'}])
doc.save()
items = get_items_list(doc, doc.company)
customers = get_customers_list(doc)
products_count = frappe.db.sql(""" select count(name) from tabItem where item_group = '_Test Item Group'""", as_list=1)
customers_count = frappe.db.sql(""" select count(name) from tabCustomer where customer_group = '_Test Customer Group'""")

View File

@@ -389,8 +389,7 @@
"fieldname": "rate_or_discount",
"fieldtype": "Select",
"label": "Rate or Discount",
"options": "\nRate\nDiscount Percentage\nDiscount Amount",
"reqd": 1
"options": "\nRate\nDiscount Percentage\nDiscount Amount"
},
{
"default": "Grand Total",
@@ -439,19 +438,20 @@
},
{
"default": "0",
"depends_on": "eval:!doc.mixed_conditions",
"depends_on": "eval:!doc.mixed_conditions && doc.apply_on != 'Transaction'",
"fieldname": "same_item",
"fieldtype": "Check",
"label": "Same Item"
},
{
"depends_on": "eval:!doc.same_item || doc.mixed_conditions",
"depends_on": "eval:(!doc.same_item || doc.apply_on == 'Transaction') || doc.mixed_conditions",
"fieldname": "free_item",
"fieldtype": "Link",
"label": "Free Item",
"options": "Item"
},
{
"default": "0",
"fieldname": "free_qty",
"fieldtype": "Float",
"label": "Qty"
@@ -554,7 +554,7 @@
],
"icon": "fa fa-gift",
"idx": 1,
"modified": "2019-10-15 12:39:40.399792",
"modified": "2019-12-18 17:29:22.957077",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",

View File

@@ -34,6 +34,9 @@ class PricingRule(Document):
def validate_duplicate_apply_on(self):
field = apply_on_dict.get(self.apply_on)
if not field:
return False
values = [d.get(frappe.scrub(self.apply_on)) for d in self.get(field)]
if len(values) != len(set(values)):
@@ -48,6 +51,9 @@ class PricingRule(Document):
if tocheck and not self.get(tocheck):
throw(_("{0} is required").format(self.meta.get_label(tocheck)), frappe.MandatoryError)
if self.price_or_product_discount == 'Price' and not self.rate_or_discount:
throw(_("Rate or Discount is required for the price discount."), frappe.MandatoryError)
def validate_applicable_for_selling_or_buying(self):
if not self.selling and not self.buying:
throw(_("Atleast one of the Selling or Buying must be selected"))
@@ -97,7 +103,7 @@ class PricingRule(Document):
self.same_item = 1
def validate_max_discount(self):
if self.rate_or_discount == "Discount Percentage" and self.items:
if self.rate_or_discount == "Discount Percentage" and self.get("items"):
for d in self.items:
max_discount = frappe.get_cached_value("Item", d.item_code, "max_discount")
if max_discount and flt(self.discount_percentage) > flt(max_discount):
@@ -183,7 +189,7 @@ def get_serial_no_for_item(args):
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_pricing_rules,
get_applied_pricing_rules, get_pricing_rule_items)
get_applied_pricing_rules, get_pricing_rule_items, get_product_discount_rule)
if isinstance(doc, string_types):
doc = json.loads(doc)
@@ -235,6 +241,7 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
if pricing_rule.mixed_conditions or pricing_rule.apply_rule_on_other:
item_details.update({
'apply_rule_on_other_items': json.dumps(pricing_rule.apply_rule_on_other_items),
'price_or_product_discount': pricing_rule.price_or_product_discount,
'apply_rule_on': (frappe.scrub(pricing_rule.apply_rule_on_other)
if pricing_rule.apply_rule_on_other else frappe.scrub(pricing_rule.get('apply_on')))
})
@@ -242,9 +249,11 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
if pricing_rule.coupon_code_based==1 and args.coupon_code==None:
return item_details
if (not pricing_rule.validate_applied_rule and
pricing_rule.price_or_product_discount == "Price"):
apply_price_discount_pricing_rule(pricing_rule, item_details, args)
if not pricing_rule.validate_applied_rule:
if pricing_rule.price_or_product_discount == "Price":
apply_price_discount_rule(pricing_rule, item_details, args)
else:
get_product_discount_rule(pricing_rule, item_details, args, doc)
item_details.has_pricing_rule = 1
@@ -294,7 +303,7 @@ def get_pricing_rule_details(args, pricing_rule):
'child_docname': args.get('child_docname')
})
def apply_price_discount_pricing_rule(pricing_rule, item_details, args):
def apply_price_discount_rule(pricing_rule, item_details, args):
item_details.pricing_rule_for = pricing_rule.rate_or_discount
if ((pricing_rule.margin_type == 'Amount' and pricing_rule.currency == args.currency)
@@ -414,4 +423,4 @@ def get_item_uoms(doctype, txt, searchfield, start, page_len, filters):
return frappe.get_all('UOM Conversion Detail',
filters = {'parent': ('in', items), 'uom': ("like", "{0}%".format(txt))},
fields = ["distinct uom"], as_list=1)
fields = ["distinct uom"], as_list=1)

View File

@@ -9,6 +9,8 @@ from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_orde
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.stock.get_item_details import get_item_details
from frappe import MandatoryError
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.healthcare.doctype.lab_test_template.lab_test_template import make_item_price
class TestPricingRule(unittest.TestCase):
def setUp(self):
@@ -145,6 +147,52 @@ class TestPricingRule(unittest.TestCase):
self.assertEquals(details.get("margin_type"), "Percentage")
self.assertEquals(details.get("margin_rate_or_amount"), 10)
def test_mixed_conditions_for_item_group(self):
for item in ["Mixed Cond Item 1", "Mixed Cond Item 2"]:
make_item(item, {"item_group": "Products"})
make_item_price(item, "_Test Price List", 100)
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule for Item Group",
"apply_on": "Item Group",
"item_groups": [
{
"item_group": "Products",
},
{
"item_group": "Seed",
},
],
"selling": 1,
"mixed_conditions": 1,
"currency": "USD",
"rate_or_discount": "Discount Percentage",
"discount_percentage": 10,
"applicable_for": "Customer Group",
"customer_group": "All Customer Groups",
"company": "_Test Company"
}
frappe.get_doc(test_record.copy()).insert()
args = frappe._dict({
"item_code": "Mixed Cond Item 1",
"item_group": "Products",
"company": "_Test Company",
"price_list": "_Test Price List",
"currency": "_Test Currency",
"doctype": "Sales Order",
"conversion_rate": 1,
"price_list_currency": "_Test Currency",
"plc_conversion_rate": 1,
"order_type": "Sales",
"customer": "_Test Customer",
"customer_group": "_Test Customer Group",
"name": None
})
details = get_item_details(args)
self.assertEquals(details.get("discount_percentage"), 10)
def test_pricing_rule_for_variants(self):
from erpnext.stock.get_item_details import get_item_details
from frappe import MandatoryError
@@ -278,6 +326,110 @@ class TestPricingRule(unittest.TestCase):
self.assertEquals(item.discount_amount, 110)
self.assertEquals(item.rate, 990)
def test_pricing_rule_for_product_discount_on_same_item(self):
frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule')
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule",
"apply_on": "Item Code",
"currency": "USD",
"items": [{
"item_code": "_Test Item",
}],
"selling": 1,
"rate_or_discount": "Discount Percentage",
"rate": 0,
"min_qty": 0,
"max_qty": 7,
"discount_percentage": 17.5,
"price_or_product_discount": "Product",
"same_item": 1,
"free_qty": 1,
"company": "_Test Company"
}
frappe.get_doc(test_record.copy()).insert()
# With pricing rule
so = make_sales_order(item_code="_Test Item", qty=1)
so.load_from_db()
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item")
def test_pricing_rule_for_product_discount_on_different_item(self):
frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule')
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule",
"apply_on": "Item Code",
"currency": "USD",
"items": [{
"item_code": "_Test Item",
}],
"selling": 1,
"rate_or_discount": "Discount Percentage",
"rate": 0,
"min_qty": 0,
"max_qty": 7,
"discount_percentage": 17.5,
"price_or_product_discount": "Product",
"same_item": 0,
"free_item": "_Test Item 2",
"free_qty": 1,
"company": "_Test Company"
}
frappe.get_doc(test_record.copy()).insert()
# With pricing rule
so = make_sales_order(item_code="_Test Item", qty=1)
so.load_from_db()
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item 2")
def test_cumulative_pricing_rule(self):
frappe.delete_doc_if_exists('Pricing Rule', '_Test Cumulative Pricing Rule')
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Cumulative Pricing Rule",
"apply_on": "Item Code",
"currency": "USD",
"items": [{
"item_code": "_Test Item",
}],
"is_cumulative": 1,
"selling": 1,
"applicable_for": "Customer",
"customer": "_Test Customer",
"rate_or_discount": "Discount Percentage",
"rate": 0,
"min_amt": 0,
"max_amt": 10000,
"discount_percentage": 17.5,
"price_or_product_discount": "Price",
"company": "_Test Company",
"valid_from": frappe.utils.nowdate(),
"valid_upto": frappe.utils.nowdate()
}
frappe.get_doc(test_record.copy()).insert()
args = frappe._dict({
"item_code": "_Test Item",
"company": "_Test Company",
"price_list": "_Test Price List",
"currency": "_Test Currency",
"doctype": "Sales Invoice",
"conversion_rate": 1,
"price_list_currency": "_Test Currency",
"plc_conversion_rate": 1,
"order_type": "Sales",
"customer": "_Test Customer",
"name": None,
"transaction_date": frappe.utils.nowdate()
})
details = get_item_details(args)
self.assertTrue(details)
def make_pricing_rule(**args):
args = frappe._dict(args)

View File

@@ -4,13 +4,22 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, copy, json
from frappe import throw, _
import copy
import json
from six import string_types
from frappe.utils import flt, cint, get_datetime
import frappe
from erpnext.setup.doctype.item_group.item_group import get_child_item_groups
from erpnext.stock.doctype.warehouse.warehouse import get_child_warehouses
from erpnext.stock.get_item_details import get_conversion_factor
from erpnext.stock.get_item_details import get_conversion_factor, get_default_income_account
from erpnext.stock.doctype.item.item import get_item_defaults
from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults
from erpnext.setup.doctype.brand.brand import get_brand_defaults
from frappe import _, throw
from frappe.utils import cint, flt, get_datetime, get_link_to_form, getdate, today
class MultiplePricingRuleConflict(frappe.ValidationError): pass
@@ -178,7 +187,8 @@ def filter_pricing_rules(args, pricing_rules, doc=None):
if pricing_rules[0].mixed_conditions and doc:
stock_qty, amount, items = get_qty_and_rate_for_mixed_conditions(doc, pr_doc, args)
pricing_rules[0].apply_rule_on_other_items = items
for pricing_rule_args in pricing_rules:
pricing_rule_args.apply_rule_on_other_items = items
elif pricing_rules[0].is_cumulative:
items = [args.get(frappe.scrub(pr_doc.get('apply_on')))]
@@ -245,7 +255,7 @@ def filter_pricing_rules(args, pricing_rules, doc=None):
def validate_quantity_and_amount_for_suggestion(args, qty, amount, item_code, transaction_type):
fieldname, msg = '', ''
type_of_transaction = 'purcahse' if transaction_type == "buying" else "sale"
type_of_transaction = 'purchase' if transaction_type == 'buying' else 'sale'
for field, value in {'min_qty': qty, 'min_amt': amount}.items():
if (args.get(field) and value < args.get(field)
@@ -284,7 +294,7 @@ def filter_pricing_rules_for_qty_amount(qty, rate, pricing_rules, args=None):
status = True
# if user has created item price against the transaction UOM
if rule.get("uom") == args.get("uom"):
if args and rule.get("uom") == args.get("uom"):
conversion_factor = 1.0
if status and (flt(rate) >= (flt(rule.min_amt) * conversion_factor)
@@ -329,9 +339,9 @@ def get_qty_and_rate_for_mixed_conditions(doc, pr_doc, args):
if pr_doc.mixed_conditions:
amt = args.get('qty') * args.get("price_list_rate")
if args.get("item_code") != row.get("item_code"):
amt = row.get('qty') * row.get("price_list_rate")
amt = flt(row.get('qty')) * flt(row.get("price_list_rate") or args.get("rate"))
sum_qty += row.get("stock_qty") or args.get("stock_qty")
sum_qty += flt(row.get("stock_qty")) or flt(args.get("stock_qty")) or flt(args.get("qty"))
sum_amt += amt
if pr_doc.is_cumulative:
@@ -359,8 +369,7 @@ def get_qty_amount_data_for_cumulative(pr_doc, doc, items=[]):
sum_qty, sum_amt = [0, 0]
doctype = doc.get('parenttype') or doc.doctype
date_field = ('transaction_date'
if doc.get('transaction_date') else 'posting_date')
date_field = 'transaction_date' if frappe.get_meta(doctype).has_field('transaction_date') else 'posting_date'
child_doctype = '{0} Item'.format(doctype)
apply_on = frappe.scrub(pr_doc.get('apply_on'))
@@ -408,7 +417,8 @@ def apply_pricing_rule_on_transaction(doc):
conditions = get_other_conditions(conditions, values, doc)
pricing_rules = frappe.db.sql(""" Select `tabPricing Rule`.* from `tabPricing Rule`
where {conditions} """.format(conditions = conditions), values, as_dict=1)
where {conditions} and `tabPricing Rule`.disable = 0
""".format(conditions = conditions), values, as_dict=1)
if pricing_rules:
pricing_rules = filter_pricing_rules_for_qty_amount(doc.total_qty,
@@ -420,39 +430,74 @@ def apply_pricing_rule_on_transaction(doc):
doc.set('apply_discount_on', d.apply_discount_on)
for field in ['additional_discount_percentage', 'discount_amount']:
if not d.get(field): continue
pr_field = ('discount_percentage'
if field == 'additional_discount_percentage' else field)
if not d.get(pr_field): continue
if d.validate_applied_rule and doc.get(field) < d.get(pr_field):
frappe.msgprint(_("User has not applied rule on the invoice {0}")
.format(doc.name))
else:
doc.set(field, d.get(pr_field))
doc.calculate_taxes_and_totals()
elif d.price_or_product_discount == 'Product':
apply_pricing_rule_for_free_items(doc, d)
item_details = frappe._dict({'parenttype': doc.doctype})
get_product_discount_rule(d, item_details, doc=doc)
apply_pricing_rule_for_free_items(doc, item_details.free_item_data)
doc.set_missing_values()
def get_applied_pricing_rules(item_row):
return (item_row.get("pricing_rules").split(',')
if item_row.get("pricing_rules") else [])
def apply_pricing_rule_for_free_items(doc, pricing_rule):
if pricing_rule.get('free_item'):
def get_product_discount_rule(pricing_rule, item_details, args=None, doc=None):
free_item = pricing_rule.free_item
if pricing_rule.same_item:
free_item = item_details.item_code or args.item_code
if not free_item:
frappe.throw(_("Free item not set in the pricing rule {0}")
.format(get_link_to_form("Pricing Rule", pricing_rule.name)))
item_details.free_item_data = {
'item_code': free_item,
'qty': pricing_rule.free_qty or 1,
'rate': pricing_rule.free_item_rate or 0,
'price_list_rate': pricing_rule.free_item_rate or 0,
'is_free_item': 1
}
item_data = frappe.get_cached_value('Item', free_item, ['item_name',
'description', 'stock_uom'], as_dict=1)
item_details.free_item_data.update(item_data)
item_details.free_item_data['uom'] = pricing_rule.free_item_uom or item_data.stock_uom
item_details.free_item_data['conversion_factor'] = get_conversion_factor(free_item,
item_details.free_item_data['uom']).get("conversion_factor", 1)
if item_details.get("parenttype") == 'Purchase Order':
item_details.free_item_data['schedule_date'] = doc.schedule_date if doc else today()
if item_details.get("parenttype") == 'Sales Order':
item_details.free_item_data['delivery_date'] = doc.delivery_date if doc else today()
company = args.get('company') or doc.company
item_details.free_item_data['income_account'] = get_default_income_account(
args=args,
item=get_item_defaults(free_item, company),
item_group=get_item_group_defaults(free_item, company),
brand=get_brand_defaults(free_item, company),
)
def apply_pricing_rule_for_free_items(doc, pricing_rule_args, set_missing_values=False):
if pricing_rule_args.get('item_code'):
items = [d.item_code for d in doc.items
if d.item_code == (d.item_code
if pricing_rule.get('same_item') else pricing_rule.get('free_item')) and d.is_free_item]
if d.item_code == (pricing_rule_args.get("item_code")) and d.is_free_item]
if not items:
doc.append('items', {
'item_code': pricing_rule.get('free_item'),
'qty': pricing_rule.get('free_qty'),
'uom': pricing_rule.get('free_item_uom'),
'rate': pricing_rule.get('free_item_rate') or 0,
'is_free_item': 1
})
doc.set_missing_values()
doc.append('items', pricing_rule_args)
def get_pricing_rule_items(pr_doc):
apply_on_data = []
@@ -462,29 +507,27 @@ def get_pricing_rule_items(pr_doc):
for d in pr_doc.get(pricing_rule_apply_on):
if apply_on == 'item_group':
get_child_item_groups(d.get(apply_on))
apply_on_data.extend(get_child_item_groups(d.get(apply_on)))
else:
apply_on_data.append(d.get(apply_on))
if pr_doc.apply_rule_on_other:
apply_on = frappe.scrub(pr_doc.apply_rule_on_other)
apply_on_data.append(pr_doc.get(apply_on))
apply_on_data.append(pr_doc.get("other_" + apply_on))
return list(set(apply_on_data))
def validate_coupon_code(coupon_name):
from frappe.utils import today,getdate
coupon=frappe.get_doc("Coupon Code",coupon_name)
coupon = frappe.get_doc("Coupon Code", coupon_name)
if coupon.valid_from:
if coupon.valid_from > getdate(today()) :
frappe.throw(_("Sorry,coupon code validity has not started"))
if coupon.valid_from > getdate(today()):
frappe.throw(_("Sorry, this coupon code's validity has not started"))
elif coupon.valid_upto:
if coupon.valid_upto < getdate(today()) :
frappe.throw(_("Sorry,coupon code validity has expired"))
elif coupon.used>=coupon.maximum_use:
frappe.throw(_("Sorry,coupon code are exhausted"))
else:
return
if coupon.valid_upto < getdate(today()):
frappe.throw(_("Sorry, this coupon code's validity has expired"))
elif coupon.used >= coupon.maximum_use:
frappe.throw(_("Sorry, this coupon code is no longer valid"))
def update_coupon_code_count(coupon_name,transaction_type):
coupon=frappe.get_doc("Coupon Code",coupon_name)

View File

@@ -167,8 +167,16 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
make_comment_dialog_and_block_invoice: function(){
const me = this;
const title = __('Add Comment');
const title = __('Block Invoice');
const fields = [
{
fieldname: 'release_date',
read_only: 0,
fieldtype:'Date',
label: __('Release Date'),
default: me.frm.doc.release_date,
reqd: 1
},
{
fieldname: 'hold_comment',
read_only: 0,
@@ -187,7 +195,11 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
const dialog_data = me.dialog.get_values();
frappe.call({
'method': 'erpnext.accounts.doctype.purchase_invoice.purchase_invoice.block_invoice',
'args': {'name': me.frm.doc.name, 'hold_comment': dialog_data.hold_comment},
'args': {
'name': me.frm.doc.name,
'hold_comment': dialog_data.hold_comment,
'release_date': dialog_data.release_date
},
'callback': (r) => me.frm.reload_doc()
});
me.dialog.hide();
@@ -249,12 +261,25 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
price_list: this.frm.doc.buying_price_list
}, function() {
me.apply_pricing_rule();
me.frm.doc.apply_tds = me.frm.supplier_tds ? 1 : 0;
me.frm.doc.tax_withholding_category = me.frm.supplier_tds;
me.frm.set_df_property("apply_tds", "read_only", me.frm.supplier_tds ? 0 : 1);
me.frm.set_df_property("tax_withholding_category", "hidden", me.frm.supplier_tds ? 0 : 1);
})
},
apply_tds: function(frm) {
var me = this;
if (!me.frm.doc.apply_tds) {
me.frm.set_value("tax_withholding_category", '');
me.frm.set_df_property("tax_withholding_category", "hidden", 1);
} else {
me.frm.set_value("tax_withholding_category", me.frm.supplier_tds);
me.frm.set_df_property("tax_withholding_category", "hidden", 0);
}
},
credit_to: function() {
var me = this;
if(this.frm.doc.credit_to) {
@@ -330,23 +355,6 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
frm: cur_frm
})
},
item_code: function(frm, cdt, cdn) {
var row = locals[cdt][cdn];
if(row.item_code) {
frappe.call({
method: "erpnext.assets.doctype.asset_category.asset_category.get_asset_category_account",
args: {
"item": row.item_code,
"fieldname": "fixed_asset_account",
"company": frm.doc.company
},
callback: function(r, rt) {
frappe.model.set_value(cdt, cdn, "expense_account", r.message);
}
})
}
}
});
cur_frm.script_manager.make(erpnext.accounts.PurchaseInvoice);
@@ -399,21 +407,11 @@ cur_frm.fields_dict['items'].grid.get_field("item_code").get_query = function(do
cur_frm.fields_dict['credit_to'].get_query = function(doc) {
// filter on Account
if (doc.supplier) {
return {
filters: {
'account_type': 'Payable',
'is_group': 0,
'company': doc.company
}
}
} else {
return {
filters: {
'report_type': 'Balance Sheet',
'is_group': 0,
'company': doc.company
}
return {
filters: {
'account_type': 'Payable',
'is_group': 0,
'company': doc.company
}
}
}

View File

@@ -1,4 +1,5 @@
{
"actions": [],
"allow_import": 1,
"autoname": "naming_series:",
"creation": "2013-05-21 16:16:39",
@@ -15,6 +16,7 @@
"is_paid",
"is_return",
"apply_tds",
"tax_withholding_category",
"column_break1",
"company",
"posting_date",
@@ -72,9 +74,9 @@
"base_total",
"base_net_total",
"column_break_28",
"total_net_weight",
"total",
"net_total",
"total_net_weight",
"taxes_section",
"tax_category",
"column_break_49",
@@ -417,6 +419,7 @@
"fieldname": "contact_email",
"fieldtype": "Small Text",
"label": "Contact Email",
"options": "Email",
"print_hide": 1,
"read_only": 1
},
@@ -705,7 +708,7 @@
},
{
"fieldname": "other_charges_calculation",
"fieldtype": "Text",
"fieldtype": "Long Text",
"label": "Taxes and Charges Calculation",
"no_copy": 1,
"oldfieldtype": "HTML",
@@ -1282,12 +1285,21 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "tax_withholding_category",
"fieldtype": "Link",
"hidden": 1,
"label": "Tax Withholding Category",
"options": "Tax Withholding Category",
"print_hide": 1
}
],
"icon": "fa fa-file-text",
"idx": 204,
"is_submittable": 1,
"modified": "2019-09-17 22:31:42.666601",
"links": [],
"modified": "2020-04-18 13:05:25.199832",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe, erpnext
from frappe.utils import cint, cstr, formatdate, flt, getdate, nowdate
from frappe.utils import cint, cstr, formatdate, flt, getdate, nowdate, get_link_to_form
from frappe import _, throw
import frappe.defaults
@@ -146,10 +146,14 @@ class PurchaseInvoice(BuyingController):
["account_type", "report_type", "account_currency"], as_dict=True)
if account.report_type != "Balance Sheet":
frappe.throw(_("Credit To account must be a Balance Sheet account"))
frappe.throw(_("Please ensure {} account is a Balance Sheet account. \
You can change the parent account to a Balance Sheet account or select a different account.")
.format(frappe.bold("Credit To")), title=_("Invalid Account"))
if self.supplier and account.account_type != "Payable":
frappe.throw(_("Credit To account must be a Payable account"))
frappe.throw(_("Please ensure {} account is a Payable account. \
Change the account type to Payable or select a different account.")
.format(frappe.bold("Credit To")), title=_("Invalid Account"))
self.party_account_currency = account.account_currency
@@ -248,23 +252,37 @@ class PurchaseInvoice(BuyingController):
def set_against_expense_account(self):
against_accounts = []
for item in self.get("items"):
if item.expense_account not in against_accounts:
if item.expense_account and (item.expense_account not in against_accounts):
against_accounts.append(item.expense_account)
self.against_expense_account = ",".join(against_accounts)
def po_required(self):
if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes':
if frappe.get_value('Supplier', self.supplier, 'allow_purchase_invoice_creation_without_purchase_order'):
return
for d in self.get('items'):
if not d.purchase_order:
throw(_("As per the Buying Settings if Purchase Order Required == 'YES', then for creating Purchase Invoice, user need to create Purchase Order first for item {0}").format(d.item_code))
throw(_("""Purchase Order Required for item {0}
To submit the invoice without purchase order please set
{1} as {2} in {3}""").format(frappe.bold(d.item_code), frappe.bold(_('Purchase Order Required')),
frappe.bold('No'), get_link_to_form('Buying Settings', 'Buying Settings', 'Buying Settings')))
def pr_required(self):
stock_items = self.get_stock_items()
if frappe.db.get_value("Buying Settings", None, "pr_required") == 'Yes':
if frappe.get_value('Supplier', self.supplier, 'allow_purchase_invoice_creation_without_purchase_receipt'):
return
for d in self.get('items'):
if not d.purchase_receipt and d.item_code in stock_items:
throw(_("As per the Buying Settings if Purchase Reciept Required == 'YES', then for creating Purchase Invoice, user need to create Purchase Receipt first for item {0}").format(d.item_code))
throw(_("""Purchase Receipt Required for item {0}
To submit the invoice without purchase receipt please set
{1} as {2} in {3}""").format(frappe.bold(d.item_code), frappe.bold(_('Purchase Receipt Required')),
frappe.bold('No'), get_link_to_form('Buying Settings', 'Buying Settings', 'Buying Settings')))
def validate_write_off_account(self):
if self.write_off_amount and not self.write_off_account:
@@ -368,7 +386,7 @@ class PurchaseInvoice(BuyingController):
update_outstanding_amt(self.credit_to, "Supplier", self.supplier,
self.doctype, self.return_against if cint(self.is_return) and self.return_against else self.name)
if repost_future_gle and cint(self.update_stock) and self.auto_accounting_for_stock:
if (repost_future_gle or self.flags.repost_future_gle) and cint(self.update_stock) and self.auto_accounting_for_stock:
from erpnext.controllers.stock_controller import update_gl_entries_after
items, warehouses = self.get_items_and_warehouses()
update_gl_entries_after(self.posting_date, self.posting_time,
@@ -434,7 +452,7 @@ class PurchaseInvoice(BuyingController):
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center
}, self.party_account_currency)
}, self.party_account_currency, item=self)
)
def make_item_gl_entries(self, gl_entries):
@@ -784,7 +802,7 @@ class PurchaseInvoice(BuyingController):
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center
}, self.party_account_currency)
}, self.party_account_currency, item=self)
)
gl_entries.append(
@@ -795,7 +813,7 @@ class PurchaseInvoice(BuyingController):
"credit_in_account_currency": self.base_paid_amount \
if bank_account_currency==self.company_currency else self.paid_amount,
"cost_center": self.cost_center
}, bank_account_currency)
}, bank_account_currency, item=self)
)
def make_write_off_gl_entry(self, gl_entries):
@@ -816,7 +834,7 @@ class PurchaseInvoice(BuyingController):
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center
}, self.party_account_currency)
}, self.party_account_currency, item=self)
)
gl_entries.append(
self.get_gl_dict({
@@ -826,11 +844,15 @@ class PurchaseInvoice(BuyingController):
"credit_in_account_currency": self.base_write_off_amount \
if write_off_account_currency==self.company_currency else self.write_off_amount,
"cost_center": self.cost_center or self.write_off_cost_center
})
}, item=self)
)
def make_gle_for_rounding_adjustment(self, gl_entries):
if self.rounding_adjustment:
# if rounding adjustment in small and conversion rate is also small then
# base_rounding_adjustment may become zero due to small precision
# eg: rounding_adjustment = 0.01 and exchange rate = 0.05 and precision of base_rounding_adjustment is 2
# then base_rounding_adjustment becomes zero and error is thrown in GL Entry
if self.rounding_adjustment and self.base_rounding_adjustment:
round_off_account, round_off_cost_center = \
get_round_off_account_and_cost_center(self.company)
@@ -841,8 +863,7 @@ class PurchaseInvoice(BuyingController):
"debit_in_account_currency": self.rounding_adjustment,
"debit": self.base_rounding_adjustment,
"cost_center": self.cost_center or round_off_cost_center,
}
))
}, item=self))
def on_cancel(self):
super(PurchaseInvoice, self).on_cancel()
@@ -862,6 +883,7 @@ class PurchaseInvoice(BuyingController):
# because updating ordered qty in bin depends upon updated ordered qty in PO
if self.update_stock == 1:
self.update_stock_ledger()
self.delete_auto_created_batches()
self.make_gl_entries_on_cancel()
self.update_project()
@@ -923,9 +945,10 @@ class PurchaseInvoice(BuyingController):
def on_recurring(self, reference_doc, auto_repeat_doc):
self.due_date = None
def block_invoice(self, hold_comment=None):
def block_invoice(self, hold_comment=None, release_date=None):
self.db_set('on_hold', 1)
self.db_set('hold_comment', cstr(hold_comment))
self.db_set('release_date', release_date)
def unblock_invoice(self):
self.db_set('on_hold', 0)
@@ -935,7 +958,7 @@ class PurchaseInvoice(BuyingController):
if not self.apply_tds:
return
tax_withholding_details = get_party_tax_withholding_details(self)
tax_withholding_details = get_party_tax_withholding_details(self, self.tax_withholding_category)
if not tax_withholding_details:
return
@@ -957,6 +980,40 @@ class PurchaseInvoice(BuyingController):
# calculate totals again after applying TDS
self.calculate_taxes_and_totals()
def set_status(self, update=False, status=None, update_modified=True):
if self.is_new():
if self.get('amended_from'):
self.status = 'Draft'
return
precision = self.precision("outstanding_amount")
outstanding_amount = flt(self.outstanding_amount, precision)
due_date = getdate(self.due_date)
nowdate = getdate()
if not status:
if self.docstatus == 2:
status = "Cancelled"
elif self.docstatus == 1:
if outstanding_amount > 0 and due_date < nowdate:
self.status = "Overdue"
elif outstanding_amount > 0 and due_date >= nowdate:
self.status = "Unpaid"
#Check if outstanding amount is 0 due to debit note issued against invoice
elif outstanding_amount <= 0 and self.is_return == 0 and frappe.db.get_value('Purchase Invoice', {'is_return': 1, 'return_against': self.name, 'docstatus': 1}):
self.status = "Debit Note Issued"
elif self.is_return == 1:
self.status = "Return"
elif outstanding_amount<=0:
self.status = "Paid"
else:
self.status = "Submitted"
else:
self.status = "Draft"
if update:
self.db_set('status', self.status, update_modified = update_modified)
def get_list_context(context=None):
from erpnext.controllers.website_list_for_contact import get_list_context
@@ -1009,12 +1066,15 @@ def unblock_invoice(name):
@frappe.whitelist()
def block_invoice(name, hold_comment):
def block_invoice(name, release_date, hold_comment=None):
if frappe.db.exists('Purchase Invoice', name):
pi = frappe.get_doc('Purchase Invoice', name)
pi.block_invoice(hold_comment)
pi.block_invoice(hold_comment, release_date)
@frappe.whitelist()
def make_inter_company_sales_invoice(source_name, target_doc=None):
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_inter_company_transaction
return make_inter_company_transaction("Purchase Invoice", source_name, target_doc)
def on_doctype_update():
frappe.db.add_index("Purchase Invoice", ["supplier", "is_return", "return_against"])

View File

@@ -0,0 +1,3 @@
{% include "erpnext/regional/india/taxes.js" %}
erpnext.setup_auto_gst_taxation('Purchase Invoice');

View File

@@ -86,6 +86,8 @@ class TestPurchaseInvoice(unittest.TestCase):
pe.submit()
pi_doc = frappe.get_doc('Purchase Invoice', pi_doc.name)
pi_doc.load_from_db()
self.assertTrue(pi_doc.status, "Paid")
self.assertRaises(frappe.LinkExistsError, pi_doc.cancel)
unlink_payment_on_cancel_of_invoice()
@@ -203,7 +205,9 @@ class TestPurchaseInvoice(unittest.TestCase):
pi.insert()
pi.submit()
pi.load_from_db()
self.assertTrue(pi.status, "Unpaid")
self.check_gle_for_pi(pi.name)
def check_gle_for_pi(self, pi):
@@ -234,6 +238,9 @@ class TestPurchaseInvoice(unittest.TestCase):
pi = frappe.copy_doc(test_records[0])
pi.insert()
pi.load_from_db()
self.assertTrue(pi.status, "Draft")
pi.naming_series = 'TEST-'
self.assertRaises(frappe.CannotChangeConstantError, pi.save)
@@ -248,6 +255,8 @@ class TestPurchaseInvoice(unittest.TestCase):
pi.get("taxes").pop(1)
pi.insert()
pi.submit()
pi.load_from_db()
self.assertTrue(pi.status, "Unpaid")
gl_entries = frappe.db.sql("""select account, debit, credit
from `tabGL Entry` where voucher_type='Purchase Invoice' and voucher_no=%s
@@ -599,6 +608,11 @@ class TestPurchaseInvoice(unittest.TestCase):
# return entry
pi1 = make_purchase_invoice(is_return=1, return_against=pi.name, qty=-2, rate=50, update_stock=1)
pi.load_from_db()
self.assertTrue(pi.status, "Debit Note Issued")
pi1.load_from_db()
self.assertTrue(pi1.status, "Return")
actual_qty_2 = get_qty_after_transaction()
self.assertEqual(actual_qty_1 - 2, actual_qty_2)
@@ -771,6 +785,8 @@ class TestPurchaseInvoice(unittest.TestCase):
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import get_outstanding_amount
pi = make_purchase_invoice(item_code = "_Test Item", qty = (5 * -1), rate=500, is_return = 1)
pi.load_from_db()
self.assertTrue(pi.status, "Return")
outstanding_amount = get_outstanding_amount(pi.doctype,
pi.name, "Creditors - _TC", pi.supplier, "Supplier")

View File

@@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "hash",
"creation": "2013-05-22 12:43:10",
"doctype": "DocType",
@@ -197,7 +198,6 @@
"fieldtype": "Link",
"label": "UOM",
"options": "UOM",
"print_hide": 1,
"reqd": 1
},
{
@@ -507,7 +507,8 @@
"depends_on": "enable_deferred_expense",
"fieldname": "service_stop_date",
"fieldtype": "Date",
"label": "Service Stop Date"
"label": "Service Stop Date",
"no_copy": 1
},
{
"default": "0",
@@ -523,13 +524,15 @@
"depends_on": "enable_deferred_expense",
"fieldname": "service_start_date",
"fieldtype": "Date",
"label": "Service Start Date"
"label": "Service Start Date",
"no_copy": 1
},
{
"depends_on": "enable_deferred_expense",
"fieldname": "service_end_date",
"fieldtype": "Date",
"label": "Service End Date"
"label": "Service End Date",
"no_copy": 1
},
{
"fieldname": "reference",
@@ -750,14 +753,13 @@
{
"fieldname": "manufacturer_part_no",
"fieldtype": "Data",
"label": "Manufacturer Part Number",
"read_only": 1
"label": "Manufacturer Part Number"
},
{
"depends_on": "is_fixed_asset",
"fetch_from": "item_code.asset_category",
"fieldname": "asset_category",
"fieldtype": "Data",
"fieldtype": "Link",
"in_preview": 1,
"label": "Asset Category",
"options": "Asset Category",
@@ -766,7 +768,8 @@
],
"idx": 1,
"istable": 1,
"modified": "2019-11-21 16:27:52.043744",
"links": [],
"modified": "2020-04-07 18:34:35.104178",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -1,300 +1,108 @@
{
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:title",
"beta": 0,
"creation": "2013-01-10 16:34:08",
"custom": 0,
"description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"allow_import": 1,
"allow_rename": 1,
"creation": "2013-01-10 16:34:08",
"description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.",
"doctype": "DocType",
"document_type": "Setup",
"field_order": [
"title",
"is_default",
"disabled",
"column_break4",
"company",
"tax_category",
"section_break6",
"taxes"
],
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Title",
"length": 0,
"no_copy": 1,
"oldfieldname": "title",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"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,
"unique": 0
},
"fieldname": "title",
"fieldtype": "Data",
"label": "Title",
"no_copy": 1,
"oldfieldname": "title",
"oldfieldtype": "Data",
"reqd": 1
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_default",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Default",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"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,
"unique": 0
},
"default": "0",
"fieldname": "is_default",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Default"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "disabled",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Disabled",
"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,
"unique": 0
},
"default": "0",
"fieldname": "disabled",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Disabled"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break4",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"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,
"unique": 0
},
"fieldname": "column_break4",
"fieldtype": "Column Break"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Company",
"options": "Company",
"remember_last_selected_value": 1,
"reqd": 1
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break6",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"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,
"unique": 0
},
"fieldname": "section_break6",
"fieldtype": "Section Break"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Purchase Taxes and Charges",
"length": 0,
"no_copy": 0,
"oldfieldname": "purchase_tax_details",
"oldfieldtype": "Table",
"options": "Purchase Taxes and Charges",
"permlevel": 0,
"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,
"unique": 0
"fieldname": "taxes",
"fieldtype": "Table",
"label": "Purchase Taxes and Charges",
"oldfieldname": "purchase_tax_details",
"oldfieldtype": "Table",
"options": "Purchase Taxes and Charges"
},
{
"fieldname": "tax_category",
"fieldtype": "Link",
"label": "Tax Category",
"options": "Tax Category"
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-money",
"idx": 1,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-11-07 05:18:44.095798",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges Template",
"owner": "wasim@webnotestech.com",
],
"icon": "fa fa-money",
"idx": 1,
"modified": "2019-11-25 13:05:26.220275",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges Template",
"owner": "wasim@webnotestech.com",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Purchase Manager",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
},
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Purchase Manager"
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Purchase Master Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Purchase Master Manager",
"share": 1,
"write": 1
},
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "Purchase User",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
"read": 1,
"role": "Purchase User"
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_order": "DESC",
"track_seen": 0
],
"sort_order": "DESC",
"track_changes": 1
}

View File

@@ -152,8 +152,11 @@ def update_multi_mode_option(doc, pos_profile):
def get_mode_of_payment(doc):
return frappe.db.sql(""" select mpa.default_account, mpa.parent, mp.type as type from `tabMode of Payment Account` mpa, \
`tabMode of Payment` mp where mpa.parent = mp.name and mpa.company = %(company)s""", {'company': doc.company}, as_dict=1)
return frappe.db.sql("""
select mpa.default_account, mpa.parent, mp.type as type
from `tabMode of Payment Account` mpa,`tabMode of Payment` mp
where mpa.parent = mp.name and mpa.company = %(company)s and mp.enabled = 1""",
{'company': doc.company}, as_dict=1)
def update_tax_table(doc):
@@ -177,14 +180,16 @@ def get_items_list(pos_profile, company):
i.name, i.item_code, i.item_name, i.description, i.item_group, i.has_batch_no,
i.has_serial_no, i.is_stock_item, i.brand, i.stock_uom, i.image,
id.expense_account, id.selling_cost_center, id.default_warehouse,
i.sales_uom, c.conversion_factor
i.sales_uom, c.conversion_factor, it.item_tax_template, it.valid_from
from
`tabItem` i
left join `tabItem Default` id on id.parent = i.name and id.company = %s
left join `tabItem Tax` it on it.parent = i.name
left join `tabUOM Conversion Detail` c on i.name = c.parent and i.sales_uom = c.uom
where
i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1
{cond}
group by i.item_code
""".format(cond=cond), tuple([company] + args_list), as_dict=1)
@@ -204,7 +209,7 @@ def get_customers_list(pos_profile={}):
if pos_profile.get('customer_groups'):
# Get customers based on the customer groups defined in the POS profile
for d in pos_profile.get('customer_groups'):
customer_groups.extend([d.name for d in get_child_nodes('Customer Group', d.customer_group)])
customer_groups.extend([d.get('name') for d in get_child_nodes('Customer Group', d.get('customer_group'))])
cond = "customer_group in (%s)" % (', '.join(['%s'] * len(customer_groups)))
return frappe.db.sql(""" select name, customer_name, customer_group,
@@ -384,7 +389,9 @@ def get_pricing_rule_data(doc):
@frappe.whitelist()
def make_invoice(doc_list={}, email_queue_list={}, customers_list={}):
def make_invoice(pos_profile, doc_list={}, email_queue_list={}, customers_list={}):
import json
if isinstance(doc_list, string_types):
doc_list = json.loads(doc_list)
@@ -418,7 +425,11 @@ def make_invoice(doc_list={}, email_queue_list={}, customers_list={}):
name_list.append(name)
email_queue = make_email_queue(email_queue_list)
customers = get_customers_list()
if isinstance(pos_profile, string_types):
pos_profile = json.loads(pos_profile)
customers = get_customers_list(pos_profile)
return {
'invoice': name_list,
'email_queue': email_queue,

View File

@@ -1,3 +1,7 @@
{% include "erpnext/regional/india/taxes.js" %}
erpnext.setup_auto_gst_taxation('Sales Invoice');
frappe.ui.form.on("Sales Invoice", {
setup: function(frm) {
frm.set_query('transporter', function() {
@@ -21,18 +25,29 @@ frappe.ui.form.on("Sales Invoice", {
if(frm.doc.docstatus == 1 && !frm.is_dirty()
&& !frm.doc.is_return && !frm.doc.ewaybill) {
frm.add_custom_button('e-Way Bill JSON', () => {
var w = window.open(
frappe.urllib.get_full_url(
"/api/method/erpnext.regional.india.utils.generate_ewb_json?"
+ "dt=" + encodeURIComponent(frm.doc.doctype)
+ "&dn=" + encodeURIComponent(frm.doc.name)
)
);
if (!w) {
frappe.msgprint(__("Please enable pop-ups")); return;
}
}, __("Make"));
frm.add_custom_button('E-Way Bill JSON', () => {
frappe.call({
method: 'erpnext.regional.india.utils.generate_ewb_json',
args: {
'dt': frm.doc.doctype,
'dn': [frm.doc.name]
},
callback: function(r) {
if (r.message) {
const args = {
cmd: 'erpnext.regional.india.utils.download_ewb_json',
data: r.message,
docname: frm.doc.name
};
open_url_post(frappe.request.url, args);
}
}
});
}, __("Create"));
}
}
},
});

View File

@@ -16,17 +16,23 @@ frappe.listview_settings['Sales Invoice'].onload = function (doclist) {
}
}
var w = window.open(
frappe.urllib.get_full_url(
"/api/method/erpnext.regional.india.utils.generate_ewb_json?"
+ "dt=" + encodeURIComponent(doclist.doctype)
+ "&dn=" + encodeURIComponent(docnames)
)
);
if (!w) {
frappe.msgprint(__("Please enable pop-ups")); return;
}
frappe.call({
method: 'erpnext.regional.india.utils.generate_ewb_json',
args: {
'dt': doclist.doctype,
'dn': docnames
},
callback: function(r) {
if (r.message) {
const args = {
cmd: 'erpnext.regional.india.utils.download_ewb_json',
data: r.message,
docname: docnames
};
open_url_post(frappe.request.url, args);
}
}
});
};
doclist.page.add_actions_menu_item(__('Generate e-Way Bill JSON'), action, false);

View File

@@ -32,6 +32,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
me.frm.script_manager.trigger("is_pos");
me.frm.refresh_fields();
}
erpnext.queries.setup_warehouse_query(this.frm);
},
refresh: function(doc, dt, dn) {
@@ -556,22 +557,11 @@ cur_frm.cscript.cost_center = function(doc, cdt, cdn) {
}
cur_frm.set_query("debit_to", function(doc) {
// filter on Account
if (doc.customer) {
return {
filters: {
'account_type': 'Receivable',
'is_group': 0,
'company': doc.company
}
}
} else {
return {
filters: {
'report_type': 'Balance Sheet',
'is_group': 0,
'company': doc.company
}
return {
filters: {
'account_type': 'Receivable',
'is_group': 0,
'company': doc.company
}
}
});
@@ -597,7 +587,9 @@ frappe.ui.form.on('Sales Invoice', {
frm.set_query("account_for_change_amount", function() {
return {
filters: {
account_type: ['in', ["Cash", "Bank"]]
account_type: ['in', ["Cash", "Bank"]],
company: frm.doc.company,
is_group: 0
}
};
});
@@ -678,7 +670,8 @@ frappe.ui.form.on('Sales Invoice', {
frm.fields_dict["loyalty_redemption_account"].get_query = function() {
return {
filters:{
"company": frm.doc.company
"company": frm.doc.company,
"is_group": 0
}
}
};
@@ -687,7 +680,8 @@ frappe.ui.form.on('Sales Invoice', {
frm.fields_dict["loyalty_redemption_cost_center"].get_query = function() {
return {
filters:{
"company": frm.doc.company
"company": frm.doc.company,
"is_group": 0
}
}
};
@@ -697,8 +691,8 @@ frappe.ui.form.on('Sales Invoice', {
if (frm.doc.company)
{
frappe.call({
method:"frappe.contacts.doctype.address.address.get_default_address",
args:{ doctype:'Company',name:frm.doc.company},
method:"erpnext.setup.doctype.company.company.get_default_company_address",
args:{name:frm.doc.company, existing_address: frm.doc.company_address},
callback: function(r){
if (r.message){
frm.set_value("company_address",r.message)

View File

@@ -1,4 +1,5 @@
{
"actions": [],
"allow_import": 1,
"autoname": "naming_series:",
"creation": "2013-05-24 19:29:05",
@@ -74,9 +75,9 @@
"base_total",
"base_net_total",
"column_break_32",
"total_net_weight",
"total",
"net_total",
"total_net_weight",
"taxes_section",
"taxes_and_charges",
"column_break_38",
@@ -148,9 +149,9 @@
"edit_printing_settings",
"letter_head",
"group_same_items",
"language",
"column_break_84",
"select_print_heading",
"column_break_84",
"language",
"more_information",
"inter_company_invoice_reference",
"customer_group",
@@ -372,7 +373,8 @@
"no_copy": 1,
"options": "Sales Invoice",
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"fieldname": "column_break_21",
@@ -395,7 +397,7 @@
{
"allow_on_submit": 1,
"fieldname": "po_no",
"fieldtype": "Data",
"fieldtype": "Small Text",
"label": "Customer's Purchase Order",
"no_copy": 1,
"print_hide": 1
@@ -774,7 +776,7 @@
},
{
"fieldname": "other_charges_calculation",
"fieldtype": "Text",
"fieldtype": "Long Text",
"label": "Taxes and Charges Calculation",
"no_copy": 1,
"oldfieldtype": "HTML",
@@ -1567,7 +1569,8 @@
"icon": "fa fa-file-text",
"idx": 181,
"is_submittable": 1,
"modified": "2019-10-05 21:39:49.235990",
"links": [],
"modified": "2020-05-19 17:00:57.208696",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -413,6 +413,9 @@ class SalesInvoice(SellingController):
if pos:
self.allow_print_before_pay = pos.allow_print_before_pay
if not for_validate:
self.tax_category = pos.get("tax_category")
if not for_validate and not self.customer:
self.customer = pos.customer
@@ -426,13 +429,18 @@ class SalesInvoice(SellingController):
if (not for_validate) or (for_validate and not self.get(fieldname)):
self.set(fieldname, pos.get(fieldname))
customer_price_list = frappe.get_value("Customer", self.customer, 'default_price_list')
if pos.get("company_address"):
self.company_address = pos.get("company_address")
if not customer_price_list:
self.set('selling_price_list', pos.get('selling_price_list'))
if self.customer:
customer_price_list, customer_group = frappe.get_value("Customer", self.customer, ['default_price_list', 'customer_group'])
customer_group_price_list = frappe.get_value("Customer Group", customer_group, 'default_price_list')
selling_price_list = customer_price_list or customer_group_price_list or pos.get('selling_price_list')
else:
selling_price_list = pos.get('selling_price_list')
if selling_price_list:
self.set('selling_price_list', selling_price_list)
if not for_validate:
self.update_stock = cint(pos.get("update_stock"))
@@ -463,13 +471,17 @@ class SalesInvoice(SellingController):
["account_type", "report_type", "account_currency"], as_dict=True)
if not account:
frappe.throw(_("Debit To is required"))
frappe.throw(_("Debit To is required"), title=_("Account Missing"))
if account.report_type != "Balance Sheet":
frappe.throw(_("Debit To account must be a Balance Sheet account"))
frappe.throw(_("Please ensure {} account is a Balance Sheet account. \
You can change the parent account to a Balance Sheet account or select a different account.")
.format(frappe.bold("Debit To")), title=_("Invalid Account"))
if self.customer and account.account_type != "Receivable":
frappe.throw(_("Debit To account must be a Receivable account"))
frappe.throw(_("Please ensure {} account is a Receivable account. \
Change the account type to Receivable or select a different account.")
.format(frappe.bold("Debit To")), title=_("Invalid Account"))
self.party_account_currency = account.account_currency
@@ -531,14 +543,20 @@ class SalesInvoice(SellingController):
"""check in manage account if sales order / delivery note required or not."""
if self.is_return:
return
dic = {'Sales Order':['so_required', 'is_pos'],'Delivery Note':['dn_required', 'update_stock']}
for i in dic:
if frappe.db.get_single_value('Selling Settings', dic[i][0]) == 'Yes':
prev_doc_field_map = {'Sales Order': ['so_required', 'is_pos'],'Delivery Note': ['dn_required', 'update_stock']}
for key, value in iteritems(prev_doc_field_map):
if frappe.db.get_single_value('Selling Settings', value[0]) == 'Yes':
if frappe.get_value('Customer', self.customer, value[0]):
continue
for d in self.get('items'):
if not d.item_code: continue
is_stock_item = frappe.get_cached_value('Item', d.item_code, 'is_stock_item')
if (d.item_code and is_stock_item == 1\
and not d.get(i.lower().replace(' ','_')) and not self.get(dic[i][1])):
msgprint(_("{0} is mandatory for Item {1}").format(i,d.item_code), raise_exception=1)
if (d.item_code and is_stock_item ==1 and not d.get(key.lower().replace(' ', '_')) and not self.get(value[1])):
msgprint(_("{0} is mandatory for Item {1}").format(key, d.item_code), raise_exception=1)
def validate_proj_cust(self):
@@ -558,14 +576,14 @@ class SalesInvoice(SellingController):
def validate_item_code(self):
for d in self.get('items'):
if not d.item_code:
if not d.item_code and self.is_opening == "No":
msgprint(_("Item Code required at Row No {0}").format(d.idx), raise_exception=True)
def validate_warehouse(self):
super(SalesInvoice, self).validate_warehouse()
for d in self.get_item_list():
if not d.warehouse and frappe.get_cached_value("Item", d.item_code, "is_stock_item"):
if not d.warehouse and d.item_code and frappe.get_cached_value("Item", d.item_code, "is_stock_item"):
frappe.throw(_("Warehouse required for stock Item {0}").format(d.item_code))
def validate_delivery_note(self):
@@ -714,7 +732,7 @@ class SalesInvoice(SellingController):
update_outstanding_amt(self.debit_to, "Customer", self.customer,
self.doctype, self.return_against if cint(self.is_return) and self.return_against else self.name)
if repost_future_gle and cint(self.update_stock) \
if (repost_future_gle or self.flags.repost_future_gle) and cint(self.update_stock) \
and cint(auto_accounting_for_stock):
items, warehouses = self.get_items_and_warehouses()
update_gl_entries_after(self.posting_date, self.posting_time,
@@ -769,7 +787,7 @@ class SalesInvoice(SellingController):
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center
}, self.party_account_currency)
}, self.party_account_currency, item=self)
)
def make_tax_gl_entries(self, gl_entries):
@@ -786,7 +804,7 @@ class SalesInvoice(SellingController):
tax.precision("base_tax_amount_after_discount_amount")) if account_currency==self.company_currency else
flt(tax.tax_amount_after_discount_amount, tax.precision("tax_amount_after_discount_amount"))),
"cost_center": tax.cost_center
}, account_currency)
}, account_currency, item=tax)
)
def make_item_gl_entries(self, gl_entries):
@@ -806,7 +824,7 @@ class SalesInvoice(SellingController):
for gle in fixed_asset_gl_entries:
gle["against"] = self.customer
gl_entries.append(self.get_gl_dict(gle))
gl_entries.append(self.get_gl_dict(gle, item=item))
asset.db_set("disposal_date", self.posting_date)
asset.set_status("Sold" if self.docstatus==1 else None)
@@ -844,7 +862,7 @@ class SalesInvoice(SellingController):
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center
})
}, item=self)
)
gl_entries.append(
self.get_gl_dict({
@@ -853,7 +871,7 @@ class SalesInvoice(SellingController):
"against": self.customer,
"debit": self.loyalty_amount,
"remark": "Loyalty Points redeemed by the customer"
})
}, item=self)
)
def make_pos_gl_entries(self, gl_entries):
@@ -874,7 +892,7 @@ class SalesInvoice(SellingController):
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center
}, self.party_account_currency)
}, self.party_account_currency, item=self)
)
payment_mode_account_currency = get_account_currency(payment_mode.account)
@@ -887,7 +905,7 @@ class SalesInvoice(SellingController):
if payment_mode_account_currency==self.company_currency \
else payment_mode.amount,
"cost_center": self.cost_center
}, payment_mode_account_currency)
}, payment_mode_account_currency, item=self)
)
def make_gle_for_change_amount(self, gl_entries):
@@ -905,7 +923,7 @@ class SalesInvoice(SellingController):
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center
}, self.party_account_currency)
}, self.party_account_currency, item=self)
)
gl_entries.append(
@@ -914,7 +932,7 @@ class SalesInvoice(SellingController):
"against": self.customer,
"credit": self.base_change_amount,
"cost_center": self.cost_center
})
}, item=self)
)
else:
frappe.throw(_("Select change amount account"), title="Mandatory Field")
@@ -938,7 +956,7 @@ class SalesInvoice(SellingController):
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center
}, self.party_account_currency)
}, self.party_account_currency, item=self)
)
gl_entries.append(
self.get_gl_dict({
@@ -949,11 +967,11 @@ class SalesInvoice(SellingController):
self.precision("base_write_off_amount")) if write_off_account_currency==self.company_currency
else flt(self.write_off_amount, self.precision("write_off_amount"))),
"cost_center": self.cost_center or self.write_off_cost_center or default_cost_center
}, write_off_account_currency)
}, write_off_account_currency, item=self)
)
def make_gle_for_rounding_adjustment(self, gl_entries):
if flt(self.rounding_adjustment, self.precision("rounding_adjustment")):
if flt(self.rounding_adjustment, self.precision("rounding_adjustment")) and self.base_rounding_adjustment:
round_off_account, round_off_cost_center = \
get_round_off_account_and_cost_center(self.company)
@@ -966,8 +984,7 @@ class SalesInvoice(SellingController):
"credit": flt(self.base_rounding_adjustment,
self.precision("base_rounding_adjustment")),
"cost_center": self.cost_center or round_off_cost_center,
}
))
}, item=self))
def update_billing_status_in_dn(self, update_modified=True):
updated_delivery_notes = []
@@ -1048,13 +1065,18 @@ class SalesInvoice(SellingController):
continue
for serial_no in item.serial_no.split("\n"):
sales_invoice, item_code = frappe.db.get_value("Serial No", serial_no,
["sales_invoice", "item_code"])
if sales_invoice and item_code == item.item_code and self.name != sales_invoice:
sales_invoice_company = frappe.db.get_value("Sales Invoice", sales_invoice, "company")
serial_no_details = frappe.db.get_value("Serial No", serial_no,
["sales_invoice", "item_code"], as_dict=1)
if not serial_no_details:
continue
if serial_no_details.sales_invoice and serial_no_details.item_code == item.item_code \
and self.name != serial_no_details.sales_invoice:
sales_invoice_company = frappe.db.get_value("Sales Invoice", serial_no_details.sales_invoice, "company")
if sales_invoice_company == self.company:
frappe.throw(_("Serial Number: {0} is already referenced in Sales Invoice: {1}"
.format(serial_no, sales_invoice)))
.format(serial_no, serial_no_details.sales_invoice)))
def update_project(self):
if self.project:
@@ -1203,48 +1225,39 @@ class SalesInvoice(SellingController):
self.set_missing_values(for_validate = True)
def get_discounting_status(self):
status = None
if self.is_discounted:
invoice_discounting_list = frappe.db.sql("""
select status
from `tabInvoice Discounting` id, `tabDiscounted Invoice` d
where
id.name = d.parent
and d.sales_invoice=%s
and id.docstatus=1
and status in ('Disbursed', 'Settled')
""", self.name)
for d in invoice_discounting_list:
status = d[0]
if status == "Disbursed":
break
return status
def set_status(self, update=False, status=None, update_modified=True):
if self.is_new():
if self.get('amended_from'):
self.status = 'Draft'
return
precision = self.precision("outstanding_amount")
outstanding_amount = flt(self.outstanding_amount, precision)
due_date = getdate(self.due_date)
nowdate = getdate()
discounting_status = None
if self.is_discounted:
discountng_status = get_discounting_status(self.name)
if not status:
if self.docstatus == 2:
status = "Cancelled"
elif self.docstatus == 1:
if flt(self.outstanding_amount) > 0 and getdate(self.due_date) < getdate(nowdate()) and self.is_discounted and self.get_discounting_status()=='Disbursed':
if outstanding_amount > 0 and due_date < nowdate and self.is_discounted and discountng_status=='Disbursed':
self.status = "Overdue and Discounted"
elif flt(self.outstanding_amount) > 0 and getdate(self.due_date) < getdate(nowdate()):
elif outstanding_amount > 0 and due_date < nowdate:
self.status = "Overdue"
elif flt(self.outstanding_amount) > 0 and getdate(self.due_date) >= getdate(nowdate()) and self.is_discounted and self.get_discounting_status()=='Disbursed':
elif outstanding_amount > 0 and due_date >= nowdate and self.is_discounted and discountng_status=='Disbursed':
self.status = "Unpaid and Discounted"
elif flt(self.outstanding_amount) > 0 and getdate(self.due_date) >= getdate(nowdate()):
elif outstanding_amount > 0 and due_date >= nowdate:
self.status = "Unpaid"
#Check if outstanding amount is 0 due to credit note issued against invoice
elif flt(self.outstanding_amount) <= 0 and self.is_return == 0 and frappe.db.get_value('Sales Invoice', {'is_return': 1, 'return_against': self.name, 'docstatus': 1}):
elif outstanding_amount <= 0 and self.is_return == 0 and frappe.db.get_value('Sales Invoice', {'is_return': 1, 'return_against': self.name, 'docstatus': 1}):
self.status = "Credit Note Issued"
elif self.is_return == 1:
self.status = "Return"
elif flt(self.outstanding_amount)<=0:
elif outstanding_amount<=0:
self.status = "Paid"
else:
self.status = "Submitted"
@@ -1254,6 +1267,26 @@ class SalesInvoice(SellingController):
if update:
self.db_set('status', self.status, update_modified = update_modified)
def get_discounting_status(sales_invoice):
status = None
invoice_discounting_list = frappe.db.sql("""
select status
from `tabInvoice Discounting` id, `tabDiscounted Invoice` d
where
id.name = d.parent
and d.sales_invoice=%s
and id.docstatus=1
and status in ('Disbursed', 'Settled')
""", sales_invoice)
for d in invoice_discounting_list:
status = d[0]
if status == "Disbursed":
break
return status
def validate_inter_company_party(doctype, party, company, inter_company_reference):
if not party:
return
@@ -1421,6 +1454,21 @@ def get_inter_company_details(doc, doctype):
"company": company
}
def get_internal_party(parties, link_doctype, doc):
if len(parties) == 1:
party = parties[0].name
else:
# If more than one Internal Supplier/Customer, get supplier/customer on basis of address
if doc.get('company_address') or doc.get('shipping_address'):
party = frappe.db.get_value("Dynamic Link", {"parent": doc.get('company_address') or doc.get('shipping_address'),
"parenttype": "Address", "link_doctype": link_doctype}, "link_name")
if not party:
party = parties[0].name
else:
party = parties[0].name
return party
def validate_inter_company_transaction(doc, doctype):
@@ -1509,6 +1557,9 @@ def get_loyalty_programs(customer):
else:
return lp_details
def on_doctype_update():
frappe.db.add_index("Sales Invoice", ["customer", "is_return", "return_against"])
@frappe.whitelist()
def create_invoice_discounting(source_name, target_doc=None):
invoice = frappe.get_doc("Sales Invoice", source_name)

View File

@@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe
import unittest, copy, time
from frappe.utils import nowdate, flt, getdate, cint
from frappe.utils import nowdate, flt, getdate, cint, add_days
from frappe.model.dynamic_links import get_dynamic_link_map
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry, get_qty_after_transaction
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import unlink_payment_on_cancel_of_invoice
@@ -728,7 +728,7 @@ class TestSalesInvoice(unittest.TestCase):
def test_make_pos_invoice(self):
from erpnext.accounts.doctype.sales_invoice.pos import make_invoice
make_pos_profile()
pos_profile = make_pos_profile()
pr = make_purchase_receipt(company= "_Test Company with perpetual inventory",supplier_warehouse= "Work In Progress - TCP1", item_code= "_Test FG Item",warehouse= "Stores - TCP1",cost_center= "Main - TCP1")
pos = create_sales_invoice(company= "_Test Company with perpetual inventory", debit_to="Debtors - TCP1", item_code= "_Test FG Item", warehouse="Stores - TCP1", income_account = "Sales - TCP1", expense_account = "Cost of Goods Sold - TCP1", cost_center = "Main - TCP1", do_not_save=True)
@@ -744,7 +744,7 @@ class TestSalesInvoice(unittest.TestCase):
pos.append("taxes", tax)
invoice_data = [{'09052016142': pos}]
si = make_invoice(invoice_data).get('invoice')
si = make_invoice(pos_profile, invoice_data).get('invoice')
self.assertEqual(si[0], '09052016142')
sales_invoice = frappe.get_all('Sales Invoice', fields =["*"], filters = {'offline_pos_name': '09052016142', 'docstatus': 1})
@@ -762,7 +762,7 @@ class TestSalesInvoice(unittest.TestCase):
if allow_negative_stock:
frappe.db.set_value('Stock Settings', None, 'allow_negative_stock', 0)
make_pos_profile()
pos_profile = make_pos_profile()
timestamp = cint(time.time())
item = make_item("_Test POS Item")
@@ -776,7 +776,7 @@ class TestSalesInvoice(unittest.TestCase):
{'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 330}]
invoice_data = [{timestamp: pos}]
si = make_invoice(invoice_data).get('invoice')
si = make_invoice(pos_profile, invoice_data).get('invoice')
self.assertEqual(si[0], timestamp)
sales_invoice = frappe.get_all('Sales Invoice', fields =["*"], filters = {'offline_pos_name': timestamp})
@@ -785,7 +785,7 @@ class TestSalesInvoice(unittest.TestCase):
timestamp = cint(time.time())
pos["offline_pos_name"] = timestamp
invoice_data = [{timestamp: pos}]
si1 = make_invoice(invoice_data).get('invoice')
si1 = make_invoice(pos_profile, invoice_data).get('invoice')
self.assertEqual(si1[0], timestamp)
sales_invoice1 = frappe.get_all('Sales Invoice', fields =["*"], filters = {'offline_pos_name': timestamp})
@@ -1834,7 +1834,7 @@ class TestSalesInvoice(unittest.TestCase):
si.submit()
data = get_ewb_data("Sales Invoice", si.name)
data = get_ewb_data("Sales Invoice", [si.name])
self.assertEqual(data['version'], '1.0.1118')
self.assertEqual(data['billLists'][0]['fromGstin'], '27AAECE4835E1ZR')
@@ -1847,6 +1847,26 @@ class TestSalesInvoice(unittest.TestCase):
self.assertEqual(data['billLists'][0]['vehicleNo'], 'KA12KA1234')
self.assertEqual(data['billLists'][0]['itemList'][0]['taxableAmount'], 60000)
def test_item_tax_validity(self):
item = frappe.get_doc("Item", "_Test Item 2")
if item.taxes:
item.taxes = []
item.save()
item.append("taxes", {
"item_tax_template": "_Test Item Tax Template 1",
"valid_from": add_days(nowdate(), 1)
})
item.save()
sales_invoice = create_sales_invoice(item = "_Test Item 2", do_not_save=1)
sales_invoice.items[0].item_tax_template = "_Test Item Tax Template 1"
self.assertRaises(frappe.ValidationError, sales_invoice.save)
item.taxes = []
item.save()
def create_sales_invoice(**args):
si = frappe.new_doc("Sales Invoice")
@@ -1870,7 +1890,7 @@ def create_sales_invoice(**args):
"gst_hsn_code": "999800",
"warehouse": args.warehouse or "_Test Warehouse - _TC",
"qty": args.qty or 1,
"rate": args.rate or 100,
"rate": args.rate if args.get("rate") is not None else 100,
"income_account": args.income_account or "Sales - _TC",
"expense_account": args.expense_account or "Cost of Goods Sold - _TC",
"cost_center": args.cost_center or "_Test Cost Center - _TC",

View File

@@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "hash",
"creation": "2013-06-04 11:02:19",
"doctype": "DocType",
@@ -484,7 +485,8 @@
"depends_on": "enable_deferred_revenue",
"fieldname": "service_stop_date",
"fieldtype": "Date",
"label": "Service Stop Date"
"label": "Service Stop Date",
"no_copy": 1
},
{
"default": "0",
@@ -500,13 +502,15 @@
"depends_on": "enable_deferred_revenue",
"fieldname": "service_start_date",
"fieldtype": "Date",
"label": "Service Start Date"
"label": "Service Start Date",
"no_copy": 1
},
{
"depends_on": "enable_deferred_revenue",
"fieldname": "service_end_date",
"fieldtype": "Date",
"label": "Service End Date"
"label": "Service End Date",
"no_copy": 1
},
{
"collapsible": 1,
@@ -783,7 +787,8 @@
],
"idx": 1,
"istable": 1,
"modified": "2019-07-16 16:36:46.527606",
"links": [],
"modified": "2019-12-04 12:22:38.517710",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -1,299 +1,119 @@
{
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:title",
"beta": 0,
"creation": "2013-01-10 16:34:09",
"custom": 0,
"description": "Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"allow_import": 1,
"allow_rename": 1,
"creation": "2013-01-10 16:34:09",
"description": "Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.",
"doctype": "DocType",
"document_type": "Setup",
"engine": "InnoDB",
"field_order": [
"title",
"is_default",
"disabled",
"column_break_3",
"company",
"tax_category",
"section_break_5",
"taxes"
],
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Title",
"length": 0,
"no_copy": 1,
"oldfieldname": "title",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"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,
"unique": 0
},
"fieldname": "title",
"fieldtype": "Data",
"label": "Title",
"no_copy": 1,
"oldfieldname": "title",
"oldfieldtype": "Data",
"reqd": 1
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_default",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Default",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"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,
"unique": 0
},
"default": "0",
"fieldname": "is_default",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Default"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "disabled",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Disabled",
"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,
"unique": 0
},
"default": "0",
"fieldname": "disabled",
"fieldtype": "Check",
"label": "Disabled"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"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,
"unique": 0
},
"fieldname": "column_break_3",
"fieldtype": "Column Break"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"remember_last_selected_value": 1,
"reqd": 1
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_5",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"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,
"unique": 0
},
"fieldname": "section_break_5",
"fieldtype": "Section Break"
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "* Will be calculated in the transaction.",
"fieldname": "taxes",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Sales Taxes and Charges",
"length": 0,
"no_copy": 0,
"oldfieldname": "other_charges",
"oldfieldtype": "Table",
"options": "Sales Taxes and Charges",
"permlevel": 0,
"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,
"unique": 0
"description": "* Will be calculated in the transaction.",
"fieldname": "taxes",
"fieldtype": "Table",
"label": "Sales Taxes and Charges",
"oldfieldname": "other_charges",
"oldfieldtype": "Table",
"options": "Sales Taxes and Charges"
},
{
"fieldname": "tax_category",
"fieldtype": "Link",
"label": "Tax Category",
"options": "Tax Category"
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-money",
"idx": 1,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-11-07 05:18:41.743257",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges Template",
"owner": "Administrator",
],
"icon": "fa fa-money",
"idx": 1,
"modified": "2019-11-25 13:06:03.279099",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges Template",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 1,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Sales User",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
},
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Sales User"
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"write": 1
},
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Sales Master Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Sales Master Manager",
"share": 1,
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_order": "ASC",
"track_seen": 0
],
"sort_field": "modified",
"sort_order": "ASC",
"track_changes": 1
}

View File

@@ -188,7 +188,7 @@
}
],
"is_submittable": 1,
"modified": "2019-11-07 13:31:17.999744",
"modified": "2019-12-20 14:48:01.990600",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Share Transfer",
@@ -196,6 +196,7 @@
"permissions": [
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
@@ -221,6 +222,7 @@
"write": 1
},
{
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
@@ -230,6 +232,7 @@
"report": 1,
"role": "Accounts Manager",
"share": 1,
"submit": 1,
"write": 1
}
],

View File

@@ -45,7 +45,9 @@ class ShippingRule(Document):
shipping_amount = 0.0
by_value = False
self.validate_countries(doc)
if doc.get_shipping_address():
# validate country only if there is address
self.validate_countries(doc)
if self.calculate_based_on == 'Net Total':
value = doc.base_net_total
@@ -70,7 +72,7 @@ class ShippingRule(Document):
def get_shipping_amount_from_rules(self, value):
for condition in self.get("conditions"):
if not condition.to_value or (flt(condition.from_value) <= value <= flt(condition.to_value)):
if not condition.to_value or (flt(condition.from_value) <= flt(value) <= flt(condition.to_value)):
return condition.shipping_amount
return 0.0
@@ -82,7 +84,7 @@ class ShippingRule(Document):
if not shipping_country:
frappe.throw(_('Shipping Address does not have country, which is required for this Shipping Rule'))
if shipping_country not in [d.country for d in self.countries]:
frappe.throw(_('Shipping rule not applicable for country {0}'.format(shipping_country)))
frappe.throw(_('Shipping rule not applicable for country {0} in Shipping Address').format(shipping_country))
def add_shipping_rule_to_tax_table(self, doc, shipping_amount):
shipping_charge = {

View File

@@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "ACC-SUB-.YYYY.-.#####",
"creation": "2017-07-18 17:50:43.967266",
"doctype": "DocType",
@@ -155,7 +156,7 @@
"fieldname": "apply_additional_discount",
"fieldtype": "Select",
"label": "Apply Additional Discount On",
"options": "\nGrand Total\nNet total"
"options": "\nGrand Total\nNet Total"
},
{
"fieldname": "cb_2",
@@ -196,7 +197,8 @@
"fieldtype": "Column Break"
}
],
"modified": "2019-07-25 18:45:38.579579",
"links": [],
"modified": "2020-01-27 14:37:32.845173",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Subscription",

View File

@@ -280,7 +280,7 @@ class Subscription(Document):
if self.additional_discount_percentage or self.additional_discount_amount:
discount_on = self.apply_additional_discount
invoice.apply_additional_discount = discount_on if discount_on else 'Grand Total'
invoice.apply_discount_on = discount_on if discount_on else 'Grand Total'
# Subscription period
invoice.from_date = self.current_invoice_start
@@ -338,6 +338,16 @@ class Subscription(Document):
# Check invoice dates and make sure it doesn't have outstanding invoices
return getdate(nowdate()) >= getdate(self.current_invoice_start) and not self.has_outstanding_invoice()
def is_current_invoice_paid(self):
if self.is_new_subscription():
return False
last_invoice = frappe.get_doc('Sales Invoice', self.invoices[-1].invoice)
if getdate(last_invoice.posting_date) == getdate(self.current_invoice_start) and last_invoice.status == 'Paid':
return True
return False
def process_for_active(self):
"""
@@ -348,7 +358,7 @@ class Subscription(Document):
2. Change the `Subscription` status to 'Past Due Date'
3. Change the `Subscription` status to 'Cancelled'
"""
if self.is_postpaid_to_invoice() or self.is_prepaid_to_invoice():
if not self.is_current_invoice_paid() and (self.is_postpaid_to_invoice() or self.is_prepaid_to_invoice()):
self.generate_invoice()
if self.current_invoice_is_past_due():
self.status = 'Past Due Date'

View File

@@ -1,134 +1,134 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:title",
"beta": 0,
"creation": "2018-11-22 23:38:39.668804",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:title",
"beta": 0,
"creation": "2018-11-22 23:38:39.668804",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title",
"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": "Title",
"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,
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title",
"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": "Title",
"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": 1
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-11-22 23:38:39.668804",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Category",
"name_case": "",
"owner": "Administrator",
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2020-01-15 17:14:28.951793",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Category",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
},
},
{
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
},
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 0
}
],
"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,
],
"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
}
}

View File

@@ -6,23 +6,42 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt
from frappe.utils import flt, getdate
from erpnext.accounts.utils import get_fiscal_year
class TaxWithholdingCategory(Document):
pass
def get_party_tax_withholding_details(ref_doc):
tax_withholding_category = frappe.db.get_value('Supplier', ref_doc.supplier, 'tax_withholding_category')
def get_party_tax_withholding_details(ref_doc, tax_withholding_category=None):
pan_no = ''
suppliers = []
if not tax_withholding_category:
tax_withholding_category, pan_no = frappe.db.get_value('Supplier', ref_doc.supplier, ['tax_withholding_category', 'pan'])
if not tax_withholding_category:
return
if not pan_no:
pan_no = frappe.db.get_value('Supplier', ref_doc.supplier, 'pan')
# Get others suppliers with the same PAN No
if pan_no:
suppliers = [d.name for d in frappe.get_all('Supplier', fields=['name'], filters={'pan': pan_no})]
if not suppliers:
suppliers.append(ref_doc.supplier)
fy = get_fiscal_year(ref_doc.posting_date, company=ref_doc.company)
tax_details = get_tax_withholding_details(tax_withholding_category, fy[0], ref_doc.company)
if not tax_details:
frappe.throw(_('Please set associated account in Tax Withholding Category {0} against Company {1}')
.format(tax_withholding_category, ref_doc.company))
tds_amount = get_tds_amount(ref_doc, tax_details, fy)
tds_amount = get_tds_amount(suppliers, ref_doc.net_total, ref_doc.company,
tax_details, fy, ref_doc.posting_date, pan_no)
tax_row = get_tax_row(tax_details, tds_amount)
return tax_row
@@ -39,7 +58,7 @@ def get_tax_withholding_details(tax_withholding_category, fiscal_year, company):
"rate": tax_rate_detail.tax_withholding_rate,
"threshold": tax_rate_detail.single_threshold,
"cumulative_threshold": tax_rate_detail.cumulative_threshold,
"description": tax_withholding.category_name
"description": tax_withholding.category_name if tax_withholding.category_name else tax_withholding_category
})
def get_tax_withholding_rates(tax_withholding, fiscal_year):
@@ -51,6 +70,7 @@ def get_tax_withholding_rates(tax_withholding, fiscal_year):
frappe.throw(_("No Tax Withholding data found for the current Fiscal Year."))
def get_tax_row(tax_details, tds_amount):
return {
"category": "Total",
"add_deduct_tax": "Deduct",
@@ -60,25 +80,36 @@ def get_tax_row(tax_details, tds_amount):
"tax_amount": tds_amount
}
def get_tds_amount(ref_doc, tax_details, fiscal_year_details):
def get_tds_amount(suppliers, net_total, company, tax_details, fiscal_year_details, posting_date, pan_no=None):
fiscal_year, year_start_date, year_end_date = fiscal_year_details
tds_amount = 0
tds_deducted = 0
def _get_tds(amount):
def _get_tds(amount, rate):
if amount <= 0:
return 0
return amount * tax_details.rate / 100
return amount * rate / 100
ldc_name = frappe.db.get_value('Lower Deduction Certificate',
{
'pan_no': pan_no,
'fiscal_year': fiscal_year
}, 'name')
ldc = ''
if ldc_name:
ldc = frappe.get_doc('Lower Deduction Certificate', ldc_name)
entries = frappe.db.sql("""
select voucher_no, credit
from `tabGL Entry`
where party=%s and fiscal_year=%s and credit > 0
""", (ref_doc.supplier, fiscal_year), as_dict=1)
where company = %s and
party in %s and fiscal_year=%s and credit > 0
""", (company, tuple(suppliers), fiscal_year), as_dict=1)
vouchers = [d.voucher_no for d in entries]
advance_vouchers = get_advance_vouchers(ref_doc.supplier, fiscal_year)
advance_vouchers = get_advance_vouchers(suppliers, fiscal_year=fiscal_year, company=company)
tds_vouchers = vouchers + advance_vouchers
@@ -93,7 +124,20 @@ def get_tds_amount(ref_doc, tax_details, fiscal_year_details):
tds_deducted = tds_deducted[0][0] if tds_deducted and tds_deducted[0][0] else 0
if tds_deducted:
tds_amount = _get_tds(ref_doc.net_total)
if ldc:
limit_consumed = frappe.db.get_value('Purchase Invoice',
{
'supplier': ('in', suppliers),
'apply_tds': 1,
'docstatus': 1
}, 'sum(net_total)')
if ldc and is_valid_certificate(ldc.valid_from, ldc.valid_upto, posting_date, limit_consumed, net_total,
ldc.certificate_limit):
tds_amount = get_ltds_amount(net_total, limit_consumed, ldc.certificate_limit, ldc.rate, tax_details)
else:
tds_amount = _get_tds(net_total, tax_details.rate)
else:
supplier_credit_amount = frappe.get_all('Purchase Invoice Item',
fields = ['sum(net_amount)'],
@@ -106,43 +150,79 @@ def get_tds_amount(ref_doc, tax_details, fiscal_year_details):
fields = ['sum(credit_in_account_currency)'],
filters = {
'parent': ('in', vouchers), 'docstatus': 1,
'party': ref_doc.supplier,
'party': ('in', suppliers),
'reference_type': ('not in', ['Purchase Invoice'])
}, as_list=1)
supplier_credit_amount += (jv_supplier_credit_amt[0][0]
if jv_supplier_credit_amt and jv_supplier_credit_amt[0][0] else 0)
supplier_credit_amount += ref_doc.net_total
supplier_credit_amount += net_total
debit_note_amount = get_debit_note_amount(ref_doc.supplier, year_start_date, year_end_date)
debit_note_amount = get_debit_note_amount(suppliers, year_start_date, year_end_date)
supplier_credit_amount -= debit_note_amount
if ((tax_details.get('threshold', 0) and supplier_credit_amount >= tax_details.threshold)
or (tax_details.get('cumulative_threshold', 0) and supplier_credit_amount >= tax_details.cumulative_threshold)):
tds_amount = _get_tds(supplier_credit_amount)
if ldc and is_valid_certificate(ldc.valid_from, ldc.valid_upto, posting_date, tds_deducted, net_total,
ldc.certificate_limit):
tds_amount = get_ltds_amount(supplier_credit_amount, 0, ldc.certificate_limit, ldc.rate,
tax_details)
else:
tds_amount = _get_tds(supplier_credit_amount, tax_details.rate)
return tds_amount
def get_advance_vouchers(supplier, fiscal_year=None, company=None, from_date=None, to_date=None):
def get_advance_vouchers(suppliers, fiscal_year=None, company=None, from_date=None, to_date=None):
condition = "fiscal_year=%s" % fiscal_year
if company:
condition += "and company =%s" % (company)
if from_date and to_date:
condition = "company=%s and posting_date between %s and %s" % (company, from_date, to_date)
condition += "and posting_date between %s and %s" % (from_date, to_date)
## Appending the same supplier again if length of suppliers list is 1
## since tuple of single element list contains None, For example ('Test Supplier 1', )
## and the below query fails
if len(suppliers) == 1:
suppliers.append(suppliers[0])
return frappe.db.sql_list("""
select distinct voucher_no
from `tabGL Entry`
where party=%s and %s and debit > 0
""", (supplier, condition)) or []
where party in %s and %s and debit > 0
""", (tuple(suppliers), condition)) or []
def get_debit_note_amount(supplier, year_start_date, year_end_date, company=None):
condition = ""
def get_debit_note_amount(suppliers, year_start_date, year_end_date, company=None):
condition = "and 1=1"
if company:
condition = " and company=%s " % company
if len(suppliers) == 1:
suppliers.append(suppliers[0])
return flt(frappe.db.sql("""
select abs(sum(net_total))
from `tabPurchase Invoice`
where supplier=%s %s and is_return=1 and docstatus=1
and posting_date between %s and %s
""", (supplier, condition, year_start_date, year_end_date)))
where supplier in %s and is_return=1 and docstatus=1
and posting_date between %s and %s %s
""", (tuple(suppliers), year_start_date, year_end_date, condition)))
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
else:
ltds_amount = (certificate_limit - deducted_amount)
tds_amount = current_amount - ltds_amount
return ltds_amount * rate/100 + tds_amount * tax_details.rate/100
def is_valid_certificate(valid_from, valid_upto, posting_date, deducted_amount, current_amount, certificate_limit):
valid = False
if ((getdate(valid_from) <= getdate(posting_date) <= getdate(valid_upto)) and
certificate_limit > deducted_amount):
valid = True
return valid

View File

@@ -90,8 +90,12 @@ def merge_similar_entries(gl_map):
else:
merged_gl_map.append(entry)
company = gl_map[0].company if gl_map else erpnext.get_default_company()
company_currency = erpnext.get_company_currency(company)
precision = get_field_precision(frappe.get_meta("GL Entry").get_field("debit"), company_currency)
# filter zero debit and credit entries
merged_gl_map = filter(lambda x: flt(x.debit, 9)!=0 or flt(x.credit, 9)!=0, merged_gl_map)
merged_gl_map = filter(lambda x: flt(x.debit, precision)!=0 or flt(x.credit, precision)!=0, merged_gl_map)
merged_gl_map = list(merged_gl_map)
return merged_gl_map
@@ -132,12 +136,14 @@ def save_entries(gl_map, adv_adj, update_outstanding, from_repost=False):
def make_entry(args, adv_adj, update_outstanding, from_repost=False):
args.update({"doctype": "GL Entry"})
gle = frappe.get_doc(args)
gle = frappe.new_doc("GL Entry")
gle.update(args)
gle.flags.ignore_permissions = 1
gle.flags.from_repost = from_repost
gle.insert()
gle.validate()
gle.db_insert()
gle.run_method("on_update_with_args", adv_adj, update_outstanding, from_repost)
gle.flags.ignore_validate = True
gle.submit()
def validate_account_for_perpetual_inventory(gl_map):
@@ -162,33 +168,34 @@ def validate_account_for_perpetual_inventory(gl_map):
frappe.throw(_("Account: {0} can only be updated via Stock Transactions")
.format(account), StockAccountInvalidTransaction)
elif account_bal != stock_bal:
precision = get_field_precision(frappe.get_meta("GL Entry").get_field("debit"),
currency=frappe.get_cached_value('Company', gl_map[0].company, "default_currency"))
# This has been comment for a temporary, will add this code again on release of immutable ledger
# elif account_bal != stock_bal:
# precision = get_field_precision(frappe.get_meta("GL Entry").get_field("debit"),
# currency=frappe.get_cached_value('Company', gl_map[0].company, "default_currency"))
diff = flt(stock_bal - account_bal, precision)
error_reason = _("Stock Value ({0}) and Account Balance ({1}) are out of sync for account {2} and it's linked warehouses.").format(
stock_bal, account_bal, frappe.bold(account))
error_resolution = _("Please create adjustment Journal Entry for amount {0} ").format(frappe.bold(diff))
stock_adjustment_account = frappe.db.get_value("Company",gl_map[0].company,"stock_adjustment_account")
# diff = flt(stock_bal - account_bal, precision)
# error_reason = _("Stock Value ({0}) and Account Balance ({1}) are out of sync for account {2} and it's linked warehouses.").format(
# stock_bal, account_bal, frappe.bold(account))
# error_resolution = _("Please create adjustment Journal Entry for amount {0} ").format(frappe.bold(diff))
# stock_adjustment_account = frappe.db.get_value("Company",gl_map[0].company,"stock_adjustment_account")
db_or_cr_warehouse_account =('credit_in_account_currency' if diff < 0 else 'debit_in_account_currency')
db_or_cr_stock_adjustment_account = ('debit_in_account_currency' if diff < 0 else 'credit_in_account_currency')
# db_or_cr_warehouse_account =('credit_in_account_currency' if diff < 0 else 'debit_in_account_currency')
# db_or_cr_stock_adjustment_account = ('debit_in_account_currency' if diff < 0 else 'credit_in_account_currency')
journal_entry_args = {
'accounts':[
{'account': account, db_or_cr_warehouse_account : abs(diff)},
{'account': stock_adjustment_account, db_or_cr_stock_adjustment_account : abs(diff) }]
}
# journal_entry_args = {
# 'accounts':[
# {'account': account, db_or_cr_warehouse_account : abs(diff)},
# {'account': stock_adjustment_account, db_or_cr_stock_adjustment_account : abs(diff) }]
# }
frappe.msgprint(msg="""{0}<br></br>{1}<br></br>""".format(error_reason, error_resolution),
raise_exception=StockValueAndAccountBalanceOutOfSync,
title=_('Values Out Of Sync'),
primary_action={
'label': _('Make Journal Entry'),
'client_action': 'erpnext.route_to_adjustment_jv',
'args': journal_entry_args
})
# frappe.msgprint(msg="""{0}<br></br>{1}<br></br>""".format(error_reason, error_resolution),
# raise_exception=StockValueAndAccountBalanceOutOfSync,
# title=_('Values Out Of Sync'),
# primary_action={
# 'label': _('Make Journal Entry'),
# 'client_action': 'erpnext.route_to_adjustment_jv',
# 'args': journal_entry_args
# })
def validate_cwip_accounts(gl_map):
cwip_enabled = any([cint(ac.enable_cwip_accounting) for ac in frappe.db.get_all("Asset Category","enable_cwip_accounting")])

View File

@@ -1458,7 +1458,40 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.child.batch_no = this.item_batch_no[this.child.item_code];
this.child.serial_no = (this.item_serial_no[this.child.item_code]
? this.item_serial_no[this.child.item_code][0] : '');
this.child.item_tax_rate = JSON.stringify(this.tax_data[this.child.item_code]);
const tax_template_is_valid = true;
if (this.items && this.items[0].valid_from) {
tax_template_is_valid = frappe.datetime.get_diff(frappe.datetime.now_date(),
this.items[0].valid_from) > 0;
}
this.child.item_tax_template = tax_template_is_valid ? this.items[0].item_tax_template : '';
this.child.item_tax_rate = JSON.stringify(this.tax_data[this.child.item_tax_template]);
if (this.child.item_tax_rate) {
this.add_taxes_from_item_tax_template(this.child.item_tax_rate);
}
},
add_taxes_from_item_tax_template: function(item_tax_map) {
let me = this;
if(item_tax_map && cint(frappe.defaults.get_default("add_taxes_from_item_tax_template"))) {
if(typeof (item_tax_map) == "string") {
item_tax_map = JSON.parse(item_tax_map);
}
$.each(item_tax_map, function(tax, rate) {
let found = (me.frm.doc.taxes || []).find(d => d.account_head === tax);
if(!found) {
let child = frappe.model.add_child(me.frm.doc, "taxes");
child.charge_type = "On Net Total";
child.account_head = tax;
child.description = String(tax);
child.rate = rate;
}
});
}
},
update_paid_amount_status: function (update_paid_amount) {
@@ -1769,6 +1802,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
method: "erpnext.accounts.doctype.sales_invoice.pos.make_invoice",
freeze: true,
args: {
pos_profile: me.pos_profile_data,
doc_list: me.si_docs,
email_queue_list: me.email_queue_list,
customers_list: me.customers_list

View File

@@ -23,7 +23,7 @@ class DuplicatePartyAccountError(frappe.ValidationError): pass
@frappe.whitelist()
def get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True,
party_address=None, shipping_address=None, pos_profile=None):
party_address=None, company_address=None, shipping_address=None, pos_profile=None):
if not party:
return {}
@@ -31,14 +31,14 @@ def get_party_details(party=None, account=None, party_type="Customer", company=N
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
return _get_party_details(party, account, party_type,
company, posting_date, bill_date, price_list, currency, doctype, ignore_permissions,
fetch_payment_terms_template, party_address, shipping_address, pos_profile)
fetch_payment_terms_template, party_address, company_address, shipping_address, pos_profile)
def _get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False,
fetch_payment_terms_template=True, party_address=None, shipping_address=None, pos_profile=None):
fetch_payment_terms_template=True, party_address=None, company_address=None,shipping_address=None, pos_profile=None):
out = frappe._dict(set_account_and_due_date(party, account, party_type, company, posting_date, bill_date, doctype))
party = out[party_type.lower()]
party_details = frappe._dict(set_account_and_due_date(party, account, party_type, company, posting_date, bill_date, doctype))
party = party_details[party_type.lower()]
if not ignore_permissions and not frappe.has_permission(party_type, "read", party):
frappe.throw(_("Not permitted for {0}").format(party), frappe.PermissionError)
@@ -46,76 +46,81 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
party = frappe.get_doc(party_type, party)
currency = party.default_currency if party.get("default_currency") else get_company_currency(company)
party_address, shipping_address = set_address_details(out, party, party_type, doctype, company, party_address, shipping_address)
set_contact_details(out, party, party_type)
set_other_values(out, party, party_type)
set_price_list(out, party, party_type, price_list, pos_profile)
party_address, shipping_address = set_address_details(party_details, party, party_type, doctype, company, party_address, company_address, shipping_address)
set_contact_details(party_details, party, party_type)
set_other_values(party_details, party, party_type)
set_price_list(party_details, party, party_type, price_list, pos_profile)
out["tax_category"] = get_address_tax_category(party.get("tax_category"),
party_details["tax_category"] = get_address_tax_category(party.get("tax_category"),
party_address, shipping_address if party_type != "Supplier" else party_address)
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company,
customer_group=out.customer_group, supplier_group=out.supplier_group, tax_category=out.tax_category,
billing_address=party_address, shipping_address=shipping_address)
if not party_details.get("taxes_and_charges"):
party_details["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company,
customer_group=party_details.customer_group, supplier_group=party_details.supplier_group, tax_category=party_details.tax_category,
billing_address=party_address, shipping_address=shipping_address)
if fetch_payment_terms_template:
out["payment_terms_template"] = get_pyt_term_template(party.name, party_type, company)
party_details["payment_terms_template"] = get_pyt_term_template(party.name, party_type, company)
if not out.get("currency"):
out["currency"] = currency
if not party_details.get("currency"):
party_details["currency"] = currency
# sales team
if party_type=="Customer":
out["sales_team"] = [{
party_details["sales_team"] = [{
"sales_person": d.sales_person,
"allocated_percentage": d.allocated_percentage or None
} for d in party.get("sales_team")]
# supplier tax withholding category
if party_type == "Supplier" and party:
out["supplier_tds"] = frappe.get_value(party_type, party.name, "tax_withholding_category")
party_details["supplier_tds"] = frappe.get_value(party_type, party.name, "tax_withholding_category")
return out
return party_details
def set_address_details(out, party, party_type, doctype=None, company=None, party_address=None, shipping_address=None):
def set_address_details(party_details, party, party_type, doctype=None, company=None, party_address=None, company_address=None, shipping_address=None):
billing_address_field = "customer_address" if party_type == "Lead" \
else party_type.lower() + "_address"
out[billing_address_field] = party_address or get_default_address(party_type, party.name)
party_details[billing_address_field] = party_address or get_default_address(party_type, party.name)
if doctype:
out.update(get_fetch_values(doctype, billing_address_field, out[billing_address_field]))
party_details.update(get_fetch_values(doctype, billing_address_field, party_details[billing_address_field]))
# address display
out.address_display = get_address_display(out[billing_address_field])
party_details.address_display = get_address_display(party_details[billing_address_field])
# shipping address
if party_type in ["Customer", "Lead"]:
out.shipping_address_name = shipping_address or get_party_shipping_address(party_type, party.name)
out.shipping_address = get_address_display(out["shipping_address_name"])
party_details.shipping_address_name = shipping_address or get_party_shipping_address(party_type, party.name)
party_details.shipping_address = get_address_display(party_details["shipping_address_name"])
if doctype:
out.update(get_fetch_values(doctype, 'shipping_address_name', out.shipping_address_name))
party_details.update(get_fetch_values(doctype, 'shipping_address_name', party_details.shipping_address_name))
if doctype and doctype in ['Delivery Note', 'Sales Invoice']:
out.update(get_company_address(company))
if out.company_address:
out.update(get_fetch_values(doctype, 'company_address', out.company_address))
get_regional_address_details(out, doctype, company)
if company_address:
party_details.update({'company_address': company_address})
else:
party_details.update(get_company_address(company))
elif doctype and doctype == "Purchase Invoice":
out.update(get_company_address(company))
if out.company_address:
out["shipping_address"] = shipping_address or out["company_address"]
out.shipping_address_display = get_address_display(out["shipping_address"])
out.update(get_fetch_values(doctype, 'shipping_address', out.shipping_address))
get_regional_address_details(out, doctype, company)
if doctype and doctype in ['Delivery Note', 'Sales Invoice', 'Sales Order']:
if party_details.company_address:
party_details.update(get_fetch_values(doctype, 'company_address', party_details.company_address))
get_regional_address_details(party_details, doctype, company)
return out.get(billing_address_field), out.shipping_address_name
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"])
party_details.update(get_fetch_values(doctype, 'shipping_address', party_details.shipping_address))
get_regional_address_details(party_details, doctype, company)
return party_details.get(billing_address_field), party_details.shipping_address_name
@erpnext.allow_regional
def get_regional_address_details(out, doctype, company):
def get_regional_address_details(party_details, doctype, company):
pass
def set_contact_details(out, party, party_type):
out.contact_person = get_default_contact(party_type, party.name)
def set_contact_details(party_details, party, party_type):
party_details.contact_person = get_default_contact(party_type, party.name)
if not out.contact_person:
out.update({
if not party_details.contact_person:
party_details.update({
"contact_person": None,
"contact_display": None,
"contact_email": None,
@@ -125,22 +130,22 @@ def set_contact_details(out, party, party_type):
"contact_department": None
})
else:
out.update(get_contact_details(out.contact_person))
party_details.update(get_contact_details(party_details.contact_person))
def set_other_values(out, party, party_type):
def set_other_values(party_details, party, party_type):
# copy
if party_type=="Customer":
to_copy = ["customer_name", "customer_group", "territory", "language"]
else:
to_copy = ["supplier_name", "supplier_group", "language"]
for f in to_copy:
out[f] = party.get(f)
party_details[f] = party.get(f)
# fields prepended with default in Customer doctype
for f in ['currency'] \
+ (['sales_partner', 'commission_rate'] if party_type=="Customer" else []):
if party.get("default_" + f):
out[f] = party.get("default_" + f)
party_details[f] = party.get("default_" + f)
def get_default_price_list(party):
"""Return default price list for party (Document object)"""
@@ -155,11 +160,12 @@ def get_default_price_list(party):
return None
def set_price_list(out, party, party_type, given_price_list, pos=None):
def set_price_list(party_details, party, party_type, given_price_list, pos=None):
# price list
price_list = get_permitted_documents('Price List')
if price_list:
# if there is only one permitted document based on user permissions, set it
if price_list and len(price_list) == 1:
price_list = price_list[0]
elif pos and party_type == 'Customer':
customer_price_list = frappe.get_value('Customer', party.name, 'default_price_list')
@@ -173,9 +179,9 @@ def set_price_list(out, party, party_type, given_price_list, pos=None):
price_list = get_default_price_list(party) or given_price_list
if price_list:
out.price_list_currency = frappe.db.get_value("Price List", price_list, "currency", cache=True)
party_details.price_list_currency = frappe.db.get_value("Price List", price_list, "currency", cache=True)
out["selling_price_list" if party.doctype=="Customer" else "buying_price_list"] = price_list
party_details["selling_price_list" if party.doctype=="Customer" else "buying_price_list"] = price_list
def set_account_and_due_date(party, account, party_type, company, posting_date, bill_date, doctype):
@@ -462,23 +468,25 @@ def get_timeline_data(doctype, name):
from frappe.desk.form.load import get_communication_data
out = {}
fields = 'date(creation), count(name)'
fields = 'creation, count(*)'
after = add_years(None, -1).strftime('%Y-%m-%d')
group_by='group by date(creation)'
group_by='group by Date(creation)'
data = get_communication_data(doctype, name, after=after, group_by='group by date(creation)',
fields='date(C.creation) as creation, count(C.name)',as_dict=False)
data = get_communication_data(doctype, name, after=after, group_by='group by creation',
fields='C.creation as creation, count(C.name)',as_dict=False)
# fetch and append data from Activity Log
data += frappe.db.sql("""select {fields}
from `tabActivity Log`
where (reference_doctype="{doctype}" and reference_name="{name}")
or (timeline_doctype in ("{doctype}") and timeline_name="{name}")
or (reference_doctype in ("Quotation", "Opportunity") and timeline_name="{name}")
where (reference_doctype=%(doctype)s and reference_name=%(name)s)
or (timeline_doctype in (%(doctype)s) and timeline_name=%(name)s)
or (reference_doctype in ("Quotation", "Opportunity") and timeline_name=%(name)s)
and status!='Success' and creation > {after}
{group_by} order by creation desc
""".format(doctype=frappe.db.escape(doctype), name=frappe.db.escape(name), fields=fields,
group_by=group_by, after=after), as_dict=False)
""".format(fields=fields, group_by=group_by, after=after), {
"doctype": doctype,
"name": name
}, as_dict=False)
timeline_items = dict(data)
@@ -597,10 +605,16 @@ def get_party_shipping_address(doctype, name):
else:
return ''
def get_partywise_advanced_payment_amount(party_type, posting_date = None):
def get_partywise_advanced_payment_amount(party_type, posting_date = None, future_payment=0, company=None):
cond = "1=1"
if posting_date:
cond = "posting_date <= '{0}'".format(posting_date)
if future_payment:
cond = "posting_date <= '{0}' OR DATE(creation) <= '{0}' """.format(posting_date)
else:
cond = "posting_date <= '{0}'".format(posting_date)
if company:
cond += "and company = '{0}'".format(company)
data = frappe.db.sql(""" SELECT party, sum({0}) as amount
FROM `tabGL Entry`

View File

@@ -49,7 +49,7 @@
{% endfor %}
<tr>
<td class="right" colspan="3" ><strong>Total (debit) </strong></td>
<td class="left" >{{ gl | sum(attribute='debit') }}</td>
<td class="left" >{{ frappe.format((gl | sum(attribute="debit")), {fieldtype: "Currency"}) }}</td>
</tr>
<tr>
<td class="top-bottom" colspan="5"><strong>Credit</strong></td>
@@ -69,7 +69,7 @@
{% endfor %}
<tr>
<td class="right" colspan="3"><strong>Total (credit) </strong></td>
<td class="left" >{{ gl | sum(attribute='credit') }}</td>
<td class="left" >{{ frappe.format((gl | sum(attribute="credit")), {fieldtype: "Currency"}) }}</td>
</tr>
</table>
<div>

View File

@@ -100,6 +100,16 @@ frappe.query_reports["Accounts Payable"] = {
"fieldtype": "Link",
"options": "Supplier Group"
},
{
"fieldname": "group_by_party",
"label": __("Group By Supplier"),
"fieldtype": "Check"
},
{
"fieldname":"based_on_payment_terms",
"label": __("Based On Payment Terms"),
"fieldtype": "Check",
},
{
"fieldname":"tax_id",
"label": __("Tax Id"),
@@ -107,6 +117,16 @@ frappe.query_reports["Accounts Payable"] = {
"hidden": 1
}
],
"formatter": function(value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (data && data.bold) {
value = value.bold();
}
return value;
},
onload: function(report) {
report.page.add_inner_button(__("Accounts Payable Summary"), function() {
var filters = report.get_values();
@@ -115,12 +135,5 @@ frappe.query_reports["Accounts Payable"] = {
}
}
erpnext.dimension_filters.forEach((dimension) => {
frappe.query_reports["Accounts Payable"].filters.splice(9, 0 ,{
"fieldname": dimension["fieldname"],
"label": __(dimension["label"]),
"fieldtype": "Link",
"options": dimension["document_type"]
});
});
erpnext.utils.add_dimensions('Accounts Payable', 9);

View File

@@ -88,6 +88,11 @@ frappe.query_reports["Accounts Payable Summary"] = {
"label": __("Supplier Group"),
"fieldtype": "Link",
"options": "Supplier Group"
},
{
"fieldname":"based_on_payment_terms",
"label": __("Based On Payment Terms"),
"fieldtype": "Check",
}
],
@@ -99,12 +104,5 @@ frappe.query_reports["Accounts Payable Summary"] = {
}
}
erpnext.dimension_filters.forEach((dimension) => {
frappe.query_reports["Accounts Payable Summary"].filters.splice(9, 0 ,{
"fieldname": dimension["fieldname"],
"label": __(dimension["label"]),
"fieldtype": "Link",
"options": dimension["document_type"]
});
});
erpnext.utils.add_dimensions('Accounts Payable Summary', 9);

View File

@@ -218,15 +218,15 @@
<td></td>
<td style="text-align: right"><b>{%= __("Total") %}</b></td>
<td style="text-align: right">
{%= format_currency(data[i]["invoiced"], data[i]["currency"] ) %}</td>
{%= format_currency(data[i]["invoiced"], data[0]["currency"] ) %}</td>
{% if(!filters.show_future_payments) { %}
<td style="text-align: right">
{%= format_currency(data[i]["paid"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["credit_note"], data[i]["currency"]) %} </td>
{%= format_currency(data[i]["paid"], data[0]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["credit_note"], data[0]["currency"]) %} </td>
{% } %}
<td style="text-align: right">
{%= format_currency(data[i]["outstanding"], data[i]["currency"]) %}</td>
{%= format_currency(data[i]["outstanding"], data[0]["currency"]) %}</td>
{% if(filters.show_future_payments) { %}
{% if(report.report_name === "Accounts Receivable") { %}
@@ -234,8 +234,8 @@
{%= data[i]["po_no"] %}</td>
{% } %}
<td style="text-align: right">{%= data[i]["future_ref"] %}</td>
<td style="text-align: right">{%= format_currency(data[i]["future_amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["remaining_balance"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["future_amount"], data[0]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["remaining_balance"], data[0]["currency"]) %}</td>
{% } %}
{% } %}
{% } else { %}
@@ -256,10 +256,10 @@
{% } else { %}
<td><b>{%= __("Total") %}</b></td>
{% } %}
<td style="text-align: right">{%= format_currency(data[i]["invoiced"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["paid"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["credit_note"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["outstanding"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["invoiced"], data[0]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["paid"], data[0]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["credit_note"], data[0]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["outstanding"], data[0]["currency"]) %}</td>
{% } %}
{% } %}
</tr>

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