Compare commits

...

788 Commits

Author SHA1 Message Date
mergify[bot]
8be179c860 chore: correct license text for GPLv3 (backport #32170) (#32173)
* chore: correct license text for GPLv3 (#32170)

[skip ci]
2022-09-12 14:01:29 +05:30
RJPvT
0b36799e8f fix: Exception handling in Plaid Integration
fix: Exception handling in Plaid Integration
2022-09-12 09:23:23 +05:30
Marica
1ee62a8342 Merge pull request #31280 from RJPvT/patch-2
fix: locale Currency and Float setting in update_employee
2022-06-09 18:29:56 +05:30
RJPvT
74748c03e2 fix: locale Currency and Float setting in update_employee
In fieldtypes locale settings (example NL) . and , changes whereby the field is inproperly filled
2022-06-08 10:55:15 +02:00
mergify[bot]
73484ef1bc fix(india): e-invoice eligibility if company gstin is not configured (#31276) 2022-06-08 12:55:16 +05:30
mergify[bot]
1c25d7c6f2 fix(india): error while parsing e-invoice (backport #31053) (#31224) 2022-06-06 14:28:40 +05:30
mergify[bot]
432210d13d fix(india): minor e-invoicing fixes (backport #30553) (#31067) 2022-05-19 14:26:38 +05:30
mergify[bot]
836bfc603a fix(stock_ledger): round off values near to zero (#30803)
(cherry picked from commit 6a014d12c1)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2022-04-26 10:16:06 +05:30
mergify[bot]
2d7c678a9d fix: warehouse naming when suffix is present (#30621) (#30768)
(cherry picked from commit be04eaf723)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-04-21 12:04:25 +05:30
Ankush Menat
a92c53dd2b chore: disable coverage
coverage adds overhead which isn't necessary on v12 branch now

[skip ci]
2022-04-21 11:41:08 +05:30
mergify[bot]
68fd8a1dcf fix(india): transporter name is null while generating e-way bill (backport #30736) 2022-04-20 19:48:22 +05:30
mergify[bot]
5b2b76c4a7 fix: dont fetch entire barcode table in get_item_details (#30131) (#30666)
(cherry picked from commit 64905188c4)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-04-10 11:52:35 +05:30
Saqib Ansari
c8780b0062 Merge pull request #30401 from nextchamp-saqib/add-client-cred-fields-einvoicing
feat: add client id & client secret fields in e invoice settings
2022-03-25 10:28:57 +05:30
Saqib Ansari
f531d1a69b feat: add client id & client secret fields in e invoice settings 2022-03-24 17:50:05 +05:30
Rucha Mahabal
51aa55f3b0 fix: salary slip amount rounding errors (#30250) 2022-03-15 12:23:48 +05:30
Saqib Ansari
db0e3d3fbe Merge pull request #30088 from frappe/mergify/bp/version-12-hotfix/pr-30084
fix(e-invoicing): remove batch no from e-invoices (backport #30084)
2022-03-07 11:57:29 +05:30
Saqib Ansari
ccffcf2596 fix(e-invoicing): remove batch no from e-invoices
(cherry picked from commit 031a0dd703)
2022-03-07 06:25:43 +00:00
Saqib Ansari
c74a6f1827 Merge pull request #29291 from GangaManoj/prevent-depr-of-sold-assets
fix: Display 'Make Depreciation Entry' only for submitted or partially depreciated Assets
2022-01-14 18:49:13 +05:30
GangaManoj
73243c8ac3 fix: Hide Make Depreciation Entry if the Asset is not in the Submitted or Partially Depreciated state 2022-01-14 17:40:59 +05:30
GangaManoj
1800ce2780 fix: Only allow posting of Depreciation Entries if the Asset is in the Submitted or Partially Depreciated state 2022-01-14 15:33:16 +05:30
Ankush Menat
e5ea16a6dd fix: loosen dependencies for pandas 2022-01-10 18:12:50 +05:30
rohitwaghchaure
753adf3ce4 Merge pull request #29063 from rohitwaghchaure/fixed-backport-issue
fix: travis failing
2021-12-29 23:27:46 +05:30
Rohit Waghchaure
fbbf29e829 fix: travis failing 2021-12-29 15:46:14 +05:30
Ganga Manoj
ce2aa767b2 fix: Use depreciation cost center for creating credit entries in JEs (#28908) 2021-12-23 12:04:15 +05:30
Ankush Menat
c9927efcae test: dynamic fiscal year creation in tests (#28667)
(cherry picked from commit fdffa037b5)

fix: resolve conflict

fix
2021-12-14 22:50:26 +05:30
Rucha Mahabal
e9dbb46a06 fix: incorrect amount based on payment days in timesheet salary slip (#28884) 2021-12-14 20:04:37 +05:30
mergify[bot]
39125a78e0 fix!: dont allow renaming warehouse primary key (backport #28712)
* fix!: dont allow renaming warehouse primary key

(cherry picked from commit 72dbc3d6b8)

* fix: remove autocommit from item rename

(cherry picked from commit 5caf411be3)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2021-12-14 17:45:08 +05:30
Saqib
2a00164059 Merge pull request #28848 from frappe/mergify/bp/version-12-hotfix/pr-28797
fix: validate if asset account is set against company (backport #28797)
2021-12-13 22:41:15 +05:30
Saqib
7d1953bb3b fix: validate if asset account is set against company
(cherry picked from commit c3e0de28b1)
2021-12-13 14:44:48 +00:00
Deepesh Garg
33eeb64fec Merge pull request #28463 from frappe/mergify/bp/version-12-hotfix/pr-28459
fix(India): GST category not getting auto updated (backport #28459)
2021-12-03 09:39:09 +05:30
mergify[bot]
abb4d99ca8 fix: actual tax conversion in case of multicurrency invoices (#28687) 2021-12-02 15:01:06 +05:30
Deepesh Garg
67f17c7a0c fix: Remove tests 2021-11-29 18:05:36 +05:30
Ankush Menat
24c004b537 fix: use get_all instead of get_list for child tables
(cherry picked from commit f862339024)
2021-11-29 16:28:04 +05:30
Ankush Menat
1fce25180c chore: correct docstrings
(cherry picked from commit c7701ace80)
2021-11-29 16:28:04 +05:30
Saqib
23946cea2e fix: debit & credit currency in bank transaction (#28574) 2021-11-29 15:13:22 +05:30
mergify[bot]
1b78c501a1 fix: incorrect balance for warehouses (#28583) (#28585)
(cherry picked from commit 7ff30a4b2b)

Co-authored-by: Noah Jacob <noahjacobkurian@gmail.com>
2021-11-26 17:36:16 +05:30
Deepesh Garg
d09ed0a578 fix: Conflicts 2021-11-19 13:11:07 +05:30
Deepesh Garg
9b83e3856a fix: Add test for gst category check
(cherry picked from commit cdbc991e3f)

# Conflicts:
#	erpnext/regional/doctype/gstr_3b_report/test_gstr_3b_report.py
2021-11-19 06:52:43 +00:00
Deepesh Garg
656686f2b1 fix(India): GST category not getting auto updated
(cherry picked from commit f8a26a9fac)
2021-11-19 06:52:42 +00:00
mergify[bot]
8e7ee953c1 chore: remove woocommerce package (#25736) (#28424)
This is not used anywhere. It was added in this commit
df83148d7c
even there it isn't being used.

(cherry picked from commit e1ab290911)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-11-17 09:50:18 +05:30
mergify[bot]
d2af2b31e5 fix: validate hmac unconditionally (#28375)
(cherry picked from commit c0f06bc8e3)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2021-11-12 14:53:51 +05:30
mergify[bot]
f79651c54d fix(WooCommerce): always expect signature in webhook requests (#28371)
(cherry picked from commit 24b048925b)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-11-12 14:10:49 +05:30
mergify[bot]
80ba0cf978 fix: specify fields to be set in Lead (backport #28288)
* fix: specify fields to be set in Lead (#28288)

(cherry picked from commit da22744e0f)

# Conflicts:
#	erpnext/shopping_cart/cart.py

* fix: merge conflict

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-11-09 16:05:37 +05:30
Deepesh Garg
30c1a7bb20 Merge pull request #28279 from frappe/mergify/bp/version-12-hotfix/pr-28065
fix(minor): check if gst_category exists while validating GSTIN (backport #28065)
2021-11-09 13:48:29 +05:30
Anuja Pawar
d119b4321d fix: sider
(cherry picked from commit f2fbcc8124)
2021-11-08 18:37:03 +00:00
Anuja Pawar
4b1befb691 fix: update set_value query
(cherry picked from commit dd3cadd46b)
2021-11-08 18:37:01 +00:00
Anuja Pawar
fa5e018330 fix: re-writing sql query with ORM methods
(cherry picked from commit bc1e7bc15f)
2021-11-08 18:36:58 +00:00
Anuja Pawar
8c84d6a1d9 fix: sider
(cherry picked from commit 6a3bd882b4)
2021-11-08 18:36:56 +00:00
Anuja Pawar
f76139dceb fix: sider
(cherry picked from commit 4f53837624)
2021-11-08 18:36:54 +00:00
Anuja Pawar
97544e2bbc fix: check if gst_category exist
(cherry picked from commit 59c31bb124)
2021-11-08 18:36:53 +00:00
mergify[bot]
117718d410 fix: ignore unsupported methods while resyncing (#28210) (#28211)
(cherry picked from commit 72a050fb0b)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2021-11-02 23:09:44 +05:30
Marica
bcb0683be1 Merge pull request #28198 from frappe/mergify/bp/version-12-hotfix/pr-28195
fix: (ux) Remove warehouse filter on Batch field for Material Receipt (backport #28195)
2021-11-02 17:04:23 +05:30
marination
bf5f0a226e chore: Add comment above fix for future reference
(cherry picked from commit 48886ee705)
2021-11-02 10:41:16 +00:00
marination
55aaefb53c fix: Remove warehouse filter on Batch field for Material Receipt
(cherry picked from commit 048210a8f6)
2021-11-02 10:41:15 +00:00
Ankush Menat
ba537b0b93 fix: py2 string formatting 2021-10-29 15:41:55 +05:30
mergify[bot]
89b0e5023a fix: Skip empty rows while updating unsaved BOM cost (#28136) (#28141)
- Dont try to get valuation rate if row has no item code
- Dont try to add exploded items if row has no item code

(cherry picked from commit 292419bc9e)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-10-29 15:40:14 +05:30
Saqib
14602178e7 Merge pull request #28076 from GangaManoj/gross-profit-backport
feat: Make Gross Profit Report more readable
2021-10-27 15:07:23 +05:30
GangaManoj
5f2819c9b1 fix: Add column names 2021-10-25 02:24:19 +05:30
GangaManoj
5bc7d63646 fix: Get Bundle Items 2021-10-25 02:22:27 +05:30
GangaManoj
94162e0139 fix: Get Bundle Items 2021-10-25 02:15:56 +05:30
GangaManoj
e2e751e26f fix: Remove comments 2021-10-25 02:15:31 +05:30
GangaManoj
70244cee89 fix: Get data when grouped by invoice and otherwise 2021-10-25 02:15:03 +05:30
GangaManoj
ae6e69ebd4 fix: Display only the Invoice rows in bold 2021-10-25 02:14:32 +05:30
GangaManoj
6fdf4dd03e fix: Remove base_rate and buying_rate for Invoice rows 2021-10-25 02:12:21 +05:30
GangaManoj
4aede0ea3f fix: Calculate total buying_amount for each invoice 2021-10-25 02:11:14 +05:30
GangaManoj
de660bf9c4 fix: Fetch bundle item details 2021-10-25 02:11:10 +05:30
GangaManoj
391bf86e0a fix: Fetch base_net_total for each Invoice 2021-10-25 02:10:43 +05:30
GangaManoj
452c613974 fix: Calculate total buying_amount and gross profit for each invoice 2021-10-25 02:08:40 +05:30
GangaManoj
dd7b02ad7d fix: Remove Item Code and Item Name columns 2021-10-25 02:08:39 +05:30
GangaManoj
7cc02bf861 fix: Display Items in the format Item Code: Item Name 2021-10-25 02:08:36 +05:30
GangaManoj
678960209c fix: Add items belonging to Product Bundles as children 2021-10-25 02:08:12 +05:30
GangaManoj
e4995dc9ed fix: Set initial_depth to 3 2021-10-25 02:08:12 +05:30
GangaManoj
7cf5dc7dab fix: Assign indent and parent_invoice 2021-10-25 02:08:08 +05:30
GangaManoj
e676a09c18 fix: Make Invoice row bold 2021-10-25 02:04:03 +05:30
GangaManoj
6431243ce3 fix: Display items as descendants of invoices 2021-10-25 02:04:00 +05:30
GangaManoj
49f93b347c fix: Display data in tree form 2021-10-25 02:02:02 +05:30
mergify[bot]
27e9e47ba8 chore: warning for shopify integration deprecation (backport #26701) (#28062)
* chore: warning for shopify integration deprecation (#26701)

* chore: warning for shopify integration deprecation

* fix: warn deprecation during patch for sysadmins

(cherry picked from commit e43bdf76a5)

# Conflicts:
#	erpnext/patches.txt

* fix: resolve conflicts

Co-authored-by: Ankush <ankush@iwebnotes.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2021-10-22 12:16:55 +05:30
Jannat Patel
c9f51d3cec Merge pull request #28017 from frappe/mergify/bp/version-12-hotfix/pr-27728
fix: Employee Leave Balance report should only consider ledgers of transaction type Leave Allocation (backport #27728)
2021-10-20 14:57:52 +05:30
Jannat Patel
9ae3f26dbf fix: conflicts 2021-10-20 12:34:04 +05:30
Goh Yan Chang
ad736f1789 Update employee_leave_balance.py
fix: Employee Leave Balance report showing wrong figures
(cherry picked from commit 632f7848a3)

# Conflicts:
#	erpnext/hr/report/employee_leave_balance/employee_leave_balance.py
2021-10-20 06:58:37 +00:00
Ankush Menat
16ece12516 fix: py2 compatible string formatting 2021-10-09 18:12:07 +05:30
Gavin D'souza
c9e75d2ab5 fix(patch): Handle NULL values from fieldtype change 2021-10-09 18:08:46 +05:30
mergify[bot]
985fdade7e fix(asset): expected value after useful life validation (#27791) 2021-10-05 14:14:52 +05:30
Saqib
10c34da174 fix: unexpected keyword argument 'as_dict' (#27799) 2021-10-05 13:13:20 +05:30
mergify[bot]
d1480be596 fix: set item uom as stock_uom if it isn't set (backport #27623) (#27781)
* fix: set item uom as stock_uom if it isn't set (#27623)

* fix: set item uom as stock_uom if it isn't set

(cherry picked from commit 5c372202d5)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/stock_entry.js

* fix: resolve conflicts

[skip ci]

Co-authored-by: Alan <2.alan.tom@gmail.com>
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-10-04 22:50:11 +05:30
Noah Jacob
93a744dc12 fix: empty row on new maintenance visit. (#27626)
* fix: empty row on new maintenance visit.

* fix: check if rows exist
2021-09-30 15:40:37 +05:30
Saqib
a2b98bb80c fix: cannot delete a project if linked with sales order (#27690) 2021-09-28 19:47:08 +05:30
Frappe PR Bot
4fdff12242 fix: set item.qty as mandatory (#27681)
* fix: set item.qty as mandatory in picklist (#27680)

(cherry picked from commit b91333afdd)

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

* fix: resolve conflicts

Co-authored-by: Alan <2.alan.tom@gmail.com>
2021-09-28 07:48:37 +00:00
Jannat Patel
9c9cde48ad Merge pull request #27679 from pateljannat/revert-27037-salary-component-account-filter
Revert "fix: salary component account filter"
2021-09-28 11:44:34 +05:30
pateljannat
999a3f1305 Revert 'fix: salary component account filter' 2021-09-28 10:32:33 +05:30
mergify[bot]
8139672c7a fix: Validate if item exists on uploading items in stock reco (#27538) (#27593)
* fix: Validate if item exists on uploading items in stock reco

- Uploading non existent item in stock reco and then changing warehouse or batch gave an error
- Check for non existent item

* chore: translation

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-09-20 18:19:14 +05:30
Frappe PR Bot
7169a4c113 fix(plaid): query to check if bank account exists (#27594) 2021-09-20 16:41:26 +05:30
Frappe PR Bot
efddcbe42e fix: no validation on item defaults (#27548)
* fix: no validation on item defaults (#27393)

* fix: no validation on item defaults

* fix: cache value while validating

* test: item default company relation

* fix: reorder validations

* refactor: add guard conditions on update_defaults

* test: add default warehouse for item group

* fix: validate item defaults for item groups

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
(cherry picked from commit 5eba1ccd51)

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

* fix: resolve conflict and remove typehints for py2

Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-09-16 19:55:43 +05:30
Rucha Mahabal
6f6e390863 fix: link to navigate to item template from variant (#27440) 2021-09-11 22:01:22 +05:30
Frappe PR Bot
7843c3d51a fix: set production plan to completed even on over production (#27027) (#27434)
(cherry picked from commit 09f34e558e)

Co-authored-by: Alan <2.alan.tom@gmail.com>
2021-09-11 13:21:46 +05:30
Frappe PR Bot
8871bd4bfb fix: document naming rule not working for subscription invoices (#27394) 2021-09-08 19:11:29 +05:30
Marica
d0a7141e35 Merge pull request #27333 from marination/subcontr-serial-no
fix: Prematurely referenced variable in buying controller for subcontracting
2021-09-03 20:56:02 +05:30
marination
6fe28e83e2 fix: Prematurely referenced variable in buying controller for subcontracting 2021-09-03 20:11:40 +05:30
Frappe PR Bot
abf353a286 Revert "fix: add child item groups into the filters (#26997)" (#27266) (#27267)
This reverts commit c60d5523bc.

(cherry picked from commit 763450dcf8)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-31 19:13:25 +05:30
Dany Robert
cef6a8434a fix: remove unwanted serial numbers from fifo_queue (bp #27228)
fifo_queue.remove(serial_no) causes shift in index of the list and thereby not looping through every object in the list.
2021-08-31 10:51:43 +05:30
Frappe PR Bot
dc76094a9f fix: fetch from more than one sales order in Maintenance Visit (#27186)
* fix: fetch from more than one sales order in Maintenance Visit (#26924)

* [fix] #26336

* fix(ux): make customer field reqd for fetching SO

# Conflicts:
#	erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.js

* fix: resolve conflicts

Co-authored-by: Pawan Mehta <mehtapawan007@gmail.com>
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>

(cherry picked from commit db69d1dc00)
2021-08-26 23:05:45 +05:30
Frappe PR Bot
1e428f9531 fix: don't allow BOM's item code at any level of child items (#27175)
* fix: don't allow BOM's item code at any level of child items (#27157)

* refactor: bom recursion checking

* fix: dont allow bom recursion

if same item_code is added in child items at any level, it shouldn't be allowed.

* test: add test for bom recursion

* test: fix broken prodplan test using recursive bom

* test: fix recursive bom in tests

(cherry picked from commit c07dce940e)

# Conflicts:
#	erpnext/manufacturing/doctype/bom/test_bom.py
#	erpnext/manufacturing/doctype/production_plan/test_production_plan.py
#	erpnext/manufacturing/doctype/work_order/test_work_order.py

* fix: resolve conflicts

[skip ci]

* fix: conflicts

[skip ci]

* fix: resolve conflicts

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-26 19:28:12 +05:30
Raffael Meyer
710c1c1786 feat: add total_billing_hours to Sales Invoice (#26652)
* feat: add `total_billing_hours` to Sales Invoice

* refactor: sider fixes

* style: use double quotes
2021-08-26 12:34:09 +05:30
Nabin Hait
aa358b021e Merge pull request #24844 from dj12djdjs/fix-margin-calculation
fix: multiple price rules margin.
2021-08-24 21:15:28 +05:30
Frappe PR Bot
8bc37da20d fix: calculation of gross profit percentage in Gross Profit Report (#27045) (#27107)
(cherry picked from commit ad06fb2179)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-24 20:07:06 +05:30
Frappe PR Bot
914709099f fix: discard empty rows from update items (#27021) (#27094)
(cherry picked from commit 6de7b8ea93)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-24 12:21:18 +05:30
rohitwaghchaure
87dddbe868 Merge branch 'version-12-hotfix' into fix-margin-calculation 2021-08-24 11:08:04 +05:30
Srikant Kedia
ca42b16d3a fix: Price list rate not fetched for return sales invoice fixed (#26593) 2021-08-23 15:38:08 +05:30
Frappe PR Bot
d5e89d98c2 fix: add child item groups into the filters (#26997) (#27034)
* fix: add child item groups into the filters

* fix: appending values to proper variable

* fix: refactor the loop

(cherry picked from commit c60d5523bc)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-19 17:09:21 +05:30
Frappe PR Bot
f8fa3860d9 fix: equality check instead of assignment (#27029)
* Merge pull request #27026 from ankush/eq_assign

fix: equality check instead of assignment

[skip ci]

(cherry picked from commit 993b0532f8)

* fix: equality check instead of assignment in cart

port of https://github.com/frappe/erpnext/pull/25372

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-19 15:48:51 +05:30
Türker Tunalı
d8a7abcd02 fix: date_unchanged calculation in "Update Items" (#26992)
Branch corrected https://github.com/frappe/erpnext/pull/26058

  ERPNext generates "Cannot set quantity less than delivered quantity" error even the delivered qty is zero when user clicks "Update Items".
  "date_unchanged" variable gets false value because of new_date is string. 
  
  "getdate(new_date)" corrects the date comparison.
  
  ![ERPNext_PR](https://user-images.githubusercontent.com/710051/121928377-c0263180-cd48-11eb-8cd9-eda7dace09d6.gif)
2021-08-18 17:43:58 +05:30
Ankush Menat
5bb9de8614 ci: backport action on v12 (#27009)
[skip ci]
2021-08-18 17:00:07 +05:30
Ankush Menat
0fd50e0426 fix(deps): pin plaid-python to 7.2.x (#26996)
* fix(deps): pin plaid-python to 7.2.x

Old requirement.txt was allowing next major version which has breaking
changes and causes failure in installation.

* fix(deps): remove frappe from requirements.txt
2021-08-18 08:02:22 +00:00
HENRY Florian
bdfc300896 fix: item name is missing into job card (#26956) 2021-08-17 15:33:26 +05:30
Sagar Vora
14292456cf Merge pull request #26978 from frappe-pr-bot/backport/version-12-hotfix/26976
fix: Incorrect `modified` time in documents that inherit from `StatusUpdater`
2021-08-17 13:21:16 +05:30
Sagar Vora
24d67c35b7 Merge pull request #26976 from resilient-tech/fix-incorrect-modified
fix: Incorrect `modified` time in documents that inherit from `StatusUpdater`
(cherry picked from commit d932cba38a)
2021-08-17 07:48:25 +00:00
Frappe PR Bot
8d71fcb948 fix: fix Payment references from disappearing on adding Cost Center in Payment Entry (#26939)
* fix: payment references from disappearing on selecting cost center (#24831)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
(cherry picked from commit 9bf1083d9e)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js

* fix: conflicts

* fix: conflicts

Co-authored-by: Anuja Pawar <60467153+Anuja-pawar@users.noreply.github.com>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-13 17:45:16 +05:30
Frappe PR Bot
2945e604aa fix: remove limit from stock balance report (bp #26773)
(cherry picked from commit b3740e9afc)

Co-authored-by: Ankush <ankush@iwebnotes.com>
2021-08-13 15:44:13 +05:30
Deepesh Garg
ea085b3a76 Merge pull request #26674 from deepeshgarg007/gl_entry_deadlock
fix: Deadlock while doing payment reconciliation
2021-08-12 11:29:34 +05:30
Saqib
611966c139 fix(e-invoicing): cannot cancel invoice if IRN cancelled on portal (#26880) 2021-08-10 17:19:24 +05:30
Raffael Meyer
d650b55f52 Merge branch 'version-12-hotfix' into fix-margin-calculation 2021-08-09 13:21:40 +02:00
Ahmad
8eca908365 perf: speed up validate_account_for_perpetual_inventory (#26730) 2021-08-09 12:17:11 +05:30
Anupam Kumar
09d5ddc42b fix: bank remittance report issue (#26398) (#26767) 2021-08-04 14:03:01 +05:30
Nabin Hait
abd53b114c Merge pull request #25722 from rtdany10/patch-3
feat: Increase number of supported currency exchanges
2021-07-31 11:33:49 +05:30
Ankush
b1e932a6f8 fix: remove incorrect condition in GLE comparison (#26713) 2021-07-29 19:56:36 +05:30
Dany Robert
e6a3e6beb7 Merge branch 'version-12-hotfix' into patch-3 2021-07-29 16:48:12 +05:30
Dany Robert
239974c73e fix issue with cache.setex 2021-07-29 16:00:35 +05:30
Deepesh Garg
27ecb54b8c fix: Deadlock while doing payment reconciliation 2021-07-27 17:49:48 +05:30
Deepesh Garg
6b4b80a4a4 Merge pull request #26629 from deepeshgarg007/exchange_rate_reval_fixes_v12
fix: Exchange rate revaluation posting date and precision fixes
2021-07-27 16:40:11 +05:30
Jannat Patel
68225bbcad Merge pull request #25995 from hasnain2808/fix-issue-priorirty
fix: do not translate issue priority
2021-07-26 10:56:22 +05:30
Deepesh Garg
b549287b94 fix: Convert null values to empty string on grouping 2021-07-25 21:28:40 +05:30
Deepesh Garg
12c3e5dfd6 fix: Remove unintended changes 2021-07-25 21:27:56 +05:30
Deepesh Garg
c908add82e fix: Exchange rate revaluation posting date and precision fixes 2021-07-25 20:03:12 +05:30
Jannat Patel
c74f0f3530 Merge branch 'version-12-hotfix' into fix-issue-priorirty 2021-07-24 18:28:02 +05:30
pateljannat
2e5a358e96 fix: salary component account filter 2021-07-23 13:06:57 +05:30
Subin Tom
01f8833bd1 fix: Fixed clearing issue of payment references on setting cost center (#26548)
Co-authored-by: Subin Tom <subin-home@Subins-MacBook-Air.local>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-07-20 21:04:10 +05:30
Nabin Hait
c5a0c22352 Merge branch 'version-12' into version-12-hotfix 2021-07-16 16:10:30 +05:30
Nabin Hait
5e37949411 Merge branch 'v12-pre-release' into version-12 2021-07-16 16:10:30 +05:30
Nabin Hait
fc0459fba9 bumped to version 12.23.0 2021-07-16 16:30:30 +05:50
Nabin Hait
9a1caddacc chore: added change log for v12.23.0 2021-07-16 16:08:40 +05:30
Noah Jacob
b22cbb3122 fix: validation check when no conversion_factor (#26528) 2021-07-16 15:01:14 +05:30
rohitwaghchaure
f4a9e52cbe Merge pull request #26501 from rohitwaghchaure/fixed-taxes-not-working
fix: taxes not set correctly when items pulled from PO to PI
2021-07-16 11:40:56 +05:30
Rohit Waghchaure
24e1786e49 fix: taxes not set correctly when items pulled from PO to PI 2021-07-14 22:52:40 +05:30
Jannat Patel
5399891b25 fix: task status loop (#26007) 2021-07-14 14:43:59 +05:30
Jannat Patel
1b8670b263 fix: Removed company filter for Loan Type (#26463) 2021-07-13 15:29:58 +05:30
Jannat Patel
23db6a8e3a fix: added company filter while fetching loans (#26296)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-07-12 13:17:27 +05:30
Saqib
4c58fb40a8 fix: omit item discount amount for e-invoicing (#26408) 2021-07-12 11:05:37 +05:30
rohitwaghchaure
df045a61ed Merge pull request #26423 from rohitwaghchaure/fixed-serial-no-in-purchase-receipt
fix: serial no issue in subcontract purchase receipt
2021-07-11 10:25:51 +05:30
Rohit Waghchaure
6f7410073f fix: serial no issue in purchase receipt 2021-07-10 22:54:15 +05:30
Saqib
0ecf8f5d66 fix(e-invoicing): allow export invoice even if no taxes applied (#26406) 2021-07-09 15:33:40 +05:30
Jannat Patel
dfc68950c1 fix: lms progress issue (#26254)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-07-02 13:08:38 +05:30
Mohammed Yusuf Shaikh
ee7de6b107 fix: half day to be accounted in its leave type (#26267) 2021-07-02 12:31:59 +05:30
Mohammed Yusuf Shaikh
b2a090f073 fix: Added Permissions for employee to book an appointment (#26246)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-07-02 12:28:43 +05:30
Saqib
704f7b57b8 fix(plaid): cannot reset plaid link for a bank account (#26282) 2021-07-02 11:18:55 +05:30
meike289
8070d76450 feat: add check field for subscription invoice (#25560)
Co-authored-by: Meike Nedwidek <nedwidek@kk-software.de>
2021-06-28 18:35:03 +05:30
Noah Jacob
266563a99a fix: fixed rounding off ordered percent to 100 in condition (#26153) 2021-06-24 21:21:22 +05:30
Saqib
7270b89133 fix: invoices can alter profit and loss of a closed year (#26161) 2021-06-23 19:00:10 +05:30
Jannat Patel
57a68c317e fix: Staffing plan vacancies data type issue (#25940)
* fix: staffing plan vacancies data type issue

* fix: translation issue

* fix: removed greater than 0 condition

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-06-23 14:38:18 +05:30
Jannat Patel
fc44712976 fix: job applicant link issue (#25935)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-06-23 12:30:30 +05:30
Saqib
a80d9d81c8 fix(e-invoicing): service item check (#26141) 2021-06-22 14:25:53 +05:30
rohitwaghchaure
6a30025209 Merge pull request #26117 from rohitwaghchaure/fixed-linking-between-mr-and-sq-v12
fix: material request and supplier quotation not linked if supplier quotation created from supplier portal
2021-06-20 19:43:13 +05:30
Rohit Waghchaure
b9fb2349d6 fix: material request and supplier quotation not linked if sq created from supplier portal against rfq 2021-06-20 15:18:35 +05:30
Nabin Hait
2c30ad9465 Merge pull request #26089 from pateljannat/material-request-status-issue-backport
fix: material request status issue
2021-06-18 17:19:41 +05:30
Nabin Hait
67f80216fa Merge branch 'v12-pre-release' into version-12 2021-06-17 19:00:32 +05:30
Nabin Hait
2a8b3841bf Merge branch 'version-12' into version-12-hotfix 2021-06-17 19:00:32 +05:30
Nabin Hait
83b6746cd1 bumped to version 12.22.0 2021-06-17 19:20:32 +05:50
Nabin Hait
94f0aae625 chore: Added change log for v12.22.0 2021-06-17 18:56:13 +05:30
Deepesh Garg
0c4f67b884 Merge pull request #26091 from deepeshgarg007/cash_flow_position
fix: Update positions in default cashflow mappers
2021-06-17 17:17:22 +05:30
Deepesh Garg
fe1d985432 fix: Update positions in default cashflow mappers 2021-06-17 17:15:05 +05:30
pateljannat
57832fc9f8 fix: material request status issue 2021-06-17 10:53:45 +05:30
gavin
56a21343f4 Merge pull request #26001 from frappe/gavindsouza-patch-1
ci: Use only compatible version of bench CLI
2021-06-10 13:33:29 +05:30
gavin
bda432303c ci: Use only compatible version of bench CLI
bench CLI has dropped support for < PY3.6
2021-06-10 13:25:44 +05:30
hasnain2808
371d124a0e fix: do not translate issue priority 2021-06-09 18:40:15 +05:30
Anuja Pawar
3c5b33c241 fix: update cost center in SI (#25972) 2021-06-07 21:15:27 +05:30
Rucha Mahabal
85dca013ee fix: update employee field on renaming employee (#25958) 2021-06-07 15:02:49 +05:30
Saqib
d789dd3897 fix: wrong round off gl entry posted in case of purchase invoice (#25952) 2021-06-06 10:56:01 +05:30
Rucha Mahabal
a1a3f674a2 fix: invalid 'depends_on' expression in opportunity (#25954) 2021-06-04 11:15:55 +05:30
Saqib
7bb95f0a80 feat: cost-center wise period closing entry (#25930) 2021-06-03 17:33:00 +05:30
Ankush Menat
5c450cd13f fix: sync shopify customer addresses (#25937) 2021-06-03 16:48:08 +05:30
Ankush Menat
1c3c2b3006 fix: update shopify api version (#25939) 2021-06-03 16:46:30 +05:30
Deepesh Garg
688a5ac048 Merge pull request #25913 from deepeshgarg007/gst_freight_taxable_value
fix: Backward compatibility for GSTR-1 report
2021-06-02 11:30:57 +05:30
Deepesh Garg
21c15b89ab fix: Add taxable value in Purchase Invoice Item 2021-06-01 21:03:33 +05:30
Deepesh Garg
6a1ccf94a2 fix: Taxable value in GSTR-1 report 2021-06-01 21:02:50 +05:30
Dany Robert
3302ed4658 Merge branch 'version-12-hotfix' into patch-3 2021-05-26 15:51:43 +05:30
Anupam Kumar
fa3ca02557 fix: student invalid password reset link (#25827) 2021-05-26 12:16:25 +05:30
Deepesh Garg
1853f5da80 Merge pull request #25739 from deepeshgarg007/cash_flow_mapper_fix
fix: Cashlfow mapper not showing data
2021-05-24 20:39:59 +05:30
Deepesh Garg
dd82bbf78d Merge branch 'version-12-hotfix' into cash_flow_mapper_fix 2021-05-24 19:56:08 +05:30
Dany Robert
5271ce36de fix: Update test values 2021-05-22 11:22:02 +05:30
Dany Robert
88bab1e3ad fix: update test suite 2021-05-21 23:02:55 +05:30
Dany Robert
6ec804d77f fix: Update hard coded exchange rate values for testing 2021-05-21 18:16:21 +05:30
Nabin Hait
7fa3132a66 Merge branch 'v12-pre-release' into version-12 2021-05-20 18:51:42 +05:30
Nabin Hait
3d3ee778ed Merge branch 'version-12' into version-12-hotfix 2021-05-20 18:51:42 +05:30
Nabin Hait
65b7b57c70 bumped to version 12.21.0 2021-05-20 19:11:42 +05:50
Nabin Hait
4d9c9db295 chore: Added change log for v12.21.0 2021-05-20 18:49:42 +05:30
Deepesh Garg
13927e35cf Merge pull request #25662 from CaseSolvedUK/plaid-24675-v12
fix: plaid NoneType error
2021-05-20 17:03:02 +05:30
Deepesh Garg
18913756eb Merge pull request #25715 from deepeshgarg007/ignore_rouding_diff
fix: Ignore rounding diff while importing JV using data import
2021-05-19 18:26:11 +05:30
Nabin Hait
ccbdf25d44 Merge branch 'version-12-hotfix' into v12-pre-release 2021-05-18 20:30:46 +05:30
Deepesh Garg
ad1f1e000b fix: Cashlfow mapper not showing data 2021-05-18 08:38:49 +05:30
Dany Robert
5cced71ce4 fix: Get the exchange rate based on date. 2021-05-16 12:43:57 +05:30
Dany Robert
aea8773503 feat: Increase number of supported currency exchanges
Switch from frankfurter.app to exchangerate.host to accomodate more currency usage.
Closes #25603
2021-05-15 12:23:05 +05:30
Deepesh Garg
df51aa3087 fix: Ignore rounding diff while importig JV using data import 2021-05-14 21:31:22 +05:30
rohitwaghchaure
2ded94c338 Merge pull request #25693 from rohitwaghchaure/fixed-warehouse-tree-time-out-error
fix: timeout error while loading warehouse tree
2021-05-13 17:21:41 +05:30
Rohit Waghchaure
0b45d5e1ec fix: timeout error while loading warehouse tree 2021-05-13 15:51:39 +05:30
casesolved-co-uk
5946c2f28e fix: plaid NoneType error #24675 2021-05-11 12:36:07 +00:00
rohitwaghchaure
cb2f2d9e73 Merge pull request #25589 from 18alantom/backport-fix-check-schedule-date
fix: check for None in item.schedule_date before setting
2021-05-09 16:57:39 +05:30
Anuja Pawar
39bbc7a245 fix: update item level cost center from POS profile (#25612) 2021-05-08 14:11:06 +05:30
18alantom
062520f1b9 fix: check for None in item.schedule_date before setting 2021-05-05 12:07:18 +05:30
Rucha Mahabal
f644f6feba fix: Employee Separation (#25504)
* fix: Employee Separation

- add ignore_mandatory flag for project creation

- form clean-up

* fix: Employee Separation test
2021-05-03 18:37:13 +05:30
rohitwaghchaure
9de5fe2105 Merge pull request #25552 from rohitwaghchaure/fixed-total-stock-summary-report-12-hotfix
fix: total stock summary report not working
2021-05-03 10:24:34 +05:30
Rohit Waghchaure
e163cb89bf fix: total stock summary report not working 2021-05-02 18:03:29 +05:30
Deepesh Garg
9d38a0eede Merge pull request #25422 from finbyz/patch-2
fix: state code for Other Territory
2021-04-30 11:11:50 +05:30
rohitwaghchaure
c0b66b8203 Merge pull request #25443 from rohitwaghchaure/fixed-incorrect-qty-calculated-for-sub-contracted-raw-materials
fix: incorrect qty calculated for sub-contracted raw materials in purchase receipt
2021-04-27 15:14:03 +05:30
Saqib
96c099c609 fix: remove invalid changes added due to merge conflicts (#25404)
* fix: merge conflicts

* fix: merge conflict

* fix: recover lost method
2021-04-26 15:40:29 +05:30
Jannat Patel
b5be828f3a fix: issue in project custom status (#25453) 2021-04-26 15:36:01 +05:30
Saqib
059b8b567e feat(italy): add document type field for e-invoicing (#25420) 2021-04-26 13:09:04 +05:30
Deepesh Garg
cfdaf7c4aa Merge pull request #25419 from deepeshgarg007/composition_v12_hotfix
fix: Purchase from registered composition dealer
2021-04-24 17:24:18 +05:30
Rohit Waghchaure
5b80679ede fix: incorrect qty calculated for sub-contracted raw materials in purchase receipt 2021-04-22 17:03:02 +05:30
Saqib
a0783de232 fix: remove invalid changes added due to merge conflict (#25405)
* fix: merge conflict

* fix: recover lost method
2021-04-22 14:31:46 +05:30
Saqib
98d90f4e36 fix: remove invalid changes added due to merge conflict (#25437)
* fix: merge conflicts

* fix: recover lost method
2021-04-22 14:14:48 +05:30
Alan
c843da04a4 fix: filter using purpose, make requested changes (#25388)
backported from https://github.com/frappe/erpnext/pull/25352
2021-04-21 21:40:39 +05:30
Alan
34f1d3a88e fix: change subcontracted item display (#25426) 2021-04-21 21:04:28 +05:30
FinByz Tech Pvt. Ltd
bd4461b8cb Update __init__.py
Other Territory state code should be 97.

It's already corrected in version-13 but missed in version-12
2021-04-21 15:46:58 +05:30
Deepesh Garg
06063f7aa6 fix: Test case for GSTR 3b report 2021-04-21 14:14:55 +05:30
Deepesh Garg
472c9e534a fix: Purchase from registered composition dealer 2021-04-21 14:14:45 +05:30
Deepesh Garg
54c9704fe2 Merge pull request #25410 from deepeshgarg007/rcm_rounding_precision
fix: RCM rounding precision
2021-04-20 18:51:24 +05:30
Deepesh Garg
673dcb855d fix: RCM rounding precision 2021-04-20 18:48:50 +05:30
Alan
e3ebe4b33b fix: can't multiply sequence by non-int of type 'float' (#25385)
Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2021-04-19 15:30:34 +05:30
Saqib
baefc6fd26 fix(e-invoicing): variable scoping (#25368) 2021-04-16 16:22:40 +05:30
Nabin Hait
b95b4e8064 fix: merge conflict 2021-04-16 12:55:46 +05:30
Nabin Hait
08399f9015 bumped to version 12.20.0 2021-04-16 13:11:07 +05:50
Nabin Hait
4481d4e965 chore: added change log 2021-04-16 12:48:27 +05:30
Nabin Hait
3f459c500f Merge branch 'version-12-hotfix' into v12-pre-release 2021-04-16 12:42:36 +05:30
Saqib
e787d05f66 fix(e-invoicing): validations & tax calculation fixes (#25315)
* fix: GST on freight charge in e-invoicing

* fix: cannot fetch e invoice settings

* fix: address validations & cancel eway bill dialog

* fix: except einvoice loading error seperately

* fix: sider

* fix: import format_date

* fix: imports

* fix: test

* fix: test

* fix: test

* fix: validate total condition

* feat: add company link to e-invoice settings

* fix: remove extra condition

* fix: test

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2021-04-15 18:57:08 +05:30
Deepesh Garg
4eab67347f Merge pull request #25318 from deepeshgarg007/zero_ref_doc_billing_v12
fix: Zero amount completed delivery notes being shown in Sales Invoice get items
2021-04-14 15:28:49 +05:30
Deepesh Garg
cfe20cf610 Merge pull request #25226 from deepeshgarg007/rcm_total_calculation_fix_v12
fix: RCM tax calculation
2021-04-13 20:07:35 +05:30
Ankush Menat
73a7bb88fb fix: remove gst name validation for purch Invoice (#25236)
Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2021-04-13 19:00:38 +05:30
Ankush Menat
d2d025b586 fix: round total quantity in job card (#25246)
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-04-13 18:58:42 +05:30
Ankush Menat
061c82a5cf fix: patch fixes for property setter (#25313)
partial backport of #25220
2021-04-13 18:58:19 +05:30
Ankush Menat
e6eab3b5f8 fix: incorrect status creating PR from PO after creating PI (#25203)
* test: add tests for PO->PI, PO->PR workflow

Add failing test cases for PR status and PR percent billed.

* fix: update PR status in database

* fix: do not copy percent billed from PO to PR

* fix: patch for purchase receipt status

* fix: remove logging in patch for v12 compatibility
2021-04-13 18:57:03 +05:30
Deepesh Garg
16c3a76c49 fix: Applly single transaction threshold on net_total instead of supplier credit amount (#25208) 2021-04-13 18:54:42 +05:30
Shariq Ansari
dd78ffb176 fix: Assignment Rule Unassign Condition doesn't work (#24890) 2021-04-13 18:52:37 +05:30
Shariq Ansari
583a8bf580 fix: Added parent task expected end date validation (#24889) 2021-04-13 18:51:46 +05:30
Jannat Patel
2c63f833b6 fix: serial no refresh issue (#25130)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-04-13 18:51:05 +05:30
Deepesh Garg
d5d7ef7349 fix: Zero amount completed delivery notes being shown in Sales Invocie get items 2021-04-13 18:45:40 +05:30
Deepesh Garg
ad2d74576b Merge pull request #25165 from KaviyaPeriyasamy/version-12-hotfix-error-log-issue
fix: object referencing same memory address issue
2021-04-13 15:41:15 +05:30
Deepesh Garg
4ced989169 Merge pull request #25204 from ankush/invoice-name-12
fix(India): create property setters for shorter naming series (#25134)
2021-04-13 15:40:14 +05:30
Mohammad Hasnain Mohsin Rajan
a59523970b chore: add sider config (#24892)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-04-13 11:06:01 +05:30
Deepesh Garg
9f2b5ba565 Merge branch 'version-12-hotfix' into rcm_total_calculation_fix_v12 2021-04-12 18:59:30 +05:30
Anupam Kumar
878b10eff5 fix: don't delete mode of payment account details while deleting company transactions (#25218) 2021-04-12 10:37:12 +05:30
Deepesh Garg
83df26197b fix: Rounding adjustment for RCM 2021-04-11 18:45:22 +05:30
Rucha Mahabal
fb87ed3f62 Merge pull request #25216 from anupamvs/hr-compensatory-leave-request-err-msg-v12
fix: error message compensatory leave request
2021-04-08 09:52:24 +05:30
Deepesh Garg
2541ab178a fix: RCM tax calculation 2021-04-06 23:40:46 +05:30
Anupam
ac58e05bbb fix: error message compensatory leave request 2021-04-06 11:40:21 +05:30
Abdullah Abouzekry
34b6f9389c fix: sales order not saving due type mismatch in promo scheme (#24748) (#25056)
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-04-06 10:14:51 +05:30
Sagar Vora
6678450ba0 fix(India): create property setters for shorter naming series (#25134) 2021-04-05 16:09:41 +05:30
Saqib
fa98c4b8d7 fix(e-invoice): mandatory pincode field not set in e-invoice (#25201) 2021-04-05 14:45:21 +05:30
Saqib
79c7be770c fix(india): critical e-invoicing fixes (#25166)
Co-authored-by: bhavesh95863 <34086262+bhavesh95863@users.noreply.github.com>
2021-04-05 11:01:46 +05:30
rohitwaghchaure
8acc3fbbf4 Merge pull request #25169 from rohitwaghchaure/fixed-incorrect-batch-selected-in-purchase-rceipt
fix: incorrect batch picked in subcontracted purchase receipt
2021-04-03 14:25:10 +05:30
Rohit Waghchaure
2e04026fd6 fix: incorrect batch picked in subcontracted purchase receipt 2021-04-03 14:20:30 +05:30
Kaviya Periyasamy
3707b004c4 fix: object referencing same memory address issue 2021-04-03 12:18:19 +05:30
Saqib
f8dcd06dad fix: santize_for_json is not defined (#25157) 2021-04-02 16:47:50 +05:30
bhavesh95863
15af590482 fix(regional): remove shipping address GSTIN validation for e-invoice (#25133)
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
2021-04-02 15:05:07 +05:30
Marica
9cc129c400 Merge pull request #25110 from ankush/mr_stopped_validation_v12
fix: do not fetch stopped MR in production plan
2021-04-02 13:16:13 +05:30
Marica
35c4a7a05d Merge branch 'version-12-hotfix' into mr_stopped_validation_v12 2021-04-02 13:15:11 +05:30
Saqib
883598890d fix: place of supply of e-invoicing (#25149) 2021-04-02 12:16:09 +05:30
Afshan
2479e070c4 fix: validation msg for TransDocNo e-invoicing (#25120) 2021-04-01 19:27:41 +05:30
Ankush Menat
8d31d21b88 fix: do not fetch stopped MR in production plan
- Ignore stopped MR while using fetch button
- Add filter on field inside child table.

Related issue: ISS-20-21-10757
2021-03-31 21:21:13 +05:30
Rohan
53a32fecdb fix: commit individual SLE rename for large datasets (#25085) 2021-03-31 15:23:04 +05:30
Sagar Vora
b904304268 fix: revert removed field; not standard in v12 2021-03-29 21:26:53 +05:30
Sagar Vora
bd742d7ad9 fix(Italy): setup, validations, optimisations 2021-03-29 21:21:19 +05:30
Marica
2a1365a278 Merge pull request #24986 from ankush/allow_zero_valuation_SR_v12
fix: Allow zero valuation in stock reconciliation
2021-03-26 12:52:52 +05:30
Deepesh Garg
56531908aa Merge pull request #24974 from deepeshgarg007/tds_check_fix_v12
fix: TDS check getting checked after reload
2021-03-26 12:37:06 +05:30
Marica
f2bede6275 Merge branch 'version-12-hotfix' into allow_zero_valuation_SR_v12 2021-03-25 20:06:51 +05:30
Jannat Patel
a52ea48a21 fix: serial no trim issue (#24950)
* fix: serial no trim issue

* fix: valid serial nos
2021-03-25 15:23:19 +05:30
Anupam Kumar
5bd58ef85c fix: opportunity-quotation mapping order status (#25002) 2021-03-25 11:46:20 +05:30
Devin Slauenwhite
a0cfe449df fix sider errors. 2021-03-23 16:28:54 -04:00
Ankush Menat
19193e8f1c fix: set valuation rate for customer items to zero
- In stock reconciliation always set valuation rate of customer provided
items to zero during validation.
- Let user know the valuation has been changed.
2021-03-23 14:29:12 +05:30
Ankush Menat
ebd230e748 test: customer item in stock reconciliation 2021-03-23 14:26:41 +05:30
Ankush Menat
bf91ee9b99 fix: Allow zero valuation in stock reconciliation
Stock reconciliation can not be done for customer provided item as they
have zero valuation. This change adds a checkbox in item table to allow
such items.

Related issue: ISS-20-21-10248
2021-03-23 14:24:54 +05:30
Deepesh Garg
bb3c44dbb3 fix: TDS check getting checked after reload 2021-03-22 19:42:02 +05:30
Marica
7a61696a25 Merge pull request #24935 from ankush/alt_tags_item_image_v12
feat: allow Item image alt
2021-03-22 11:43:46 +05:30
Marica
28432128be Merge branch 'version-12-hotfix' into alt_tags_item_image_v12 2021-03-22 11:28:50 +05:30
Raffael Meyer
b135569ca6 Merge branch 'version-12-hotfix' into fix-margin-calculation 2021-03-19 16:31:29 +01:00
Saurabh
ce3a680324 Merge branch 'v12-pre-release' into version-12 2021-03-19 19:24:51 +05:30
Saurabh
786d78bce2 bumped to version 12.19.0 2021-03-19 19:44:51 +05:50
rohitwaghchaure
9e3e09f701 Merge pull request #24955 from rohitwaghchaure/revert-stock-balance-value-calculation-pre
fix: revert stock balance value calculation
2021-03-19 16:22:35 +05:30
Rohit Waghchaure
c2e2cf4933 fix: revert stock balance value calculation 2021-03-19 16:07:48 +05:30
rohitwaghchaure
ea50ab8696 Merge pull request #24868 from rohitwaghchaure/revert-stock-balance-value-calculation
fix: revert stock balance value calculation
2021-03-19 16:06:48 +05:30
Deepesh Garg
c22785877d Merge pull request #24952 from nextchamp-saqib/e-invoice-valdiation-fix
fix: NoneType object has no attribute len()
2021-03-19 12:55:30 +05:30
Saqib Ansari
14eeee5592 fix: NoneType object has no attribute len() 2021-03-19 12:51:15 +05:30
Deepesh Garg
4f4f60942c Merge pull request #24919 from deepeshgarg007/nil_exempt_gstr_3b_v12
fix(India): Incorrect Nil Exempt and Non GST amount in GSTR3B report
2021-03-18 21:02:12 +05:30
Shivam Mishra
437c771701 refactor: update confusing label 2021-03-18 12:39:42 +05:30
Shivam Mishra
f29cdb39a1 feat: add alt value in product page 2021-03-18 12:39:00 +05:30
Shivam Mishra
063ab520d3 feat: add image alt argument for product_image macros 2021-03-18 12:38:38 +05:30
Shivam Mishra
b2ae422ed7 feat: add image alt field in items 2021-03-18 12:37:59 +05:30
Deepesh Garg
6da7f65848 fix: Remove print statement 2021-03-17 18:15:24 +05:30
Deepesh Garg
4c6d068a73 fix: Group nil exempted and non gst items separately 2021-03-17 18:15:15 +05:30
Deepesh Garg
ef09599a9f fix(India): Incorrect Nil Exempt and Non GST amount in GSTR3B report 2021-03-17 16:16:33 +05:30
Marica
a1104f040d Merge pull request #24887 from shariquerik/item-attribute-fix-backport
fix: item attributes not editable until refresh
2021-03-16 15:39:36 +05:30
Anurag Mishra
c6a1e3b450 Merge pull request #24228 from YogendrasinhChavda/erpnext_fix_v12
[IMP][version-12] Improved code by adding operator to check condition.
2021-03-16 13:28:31 +05:30
Nabin Hait
238df8b3ec Merge branch 'version-12-hotfix' into v12-pre-release 2021-03-16 11:03:25 +05:30
shariquerik
4db8d13900 fix: item attributes not editable until refresh 2021-03-15 19:10:43 +05:30
Deepesh Garg
6cf37d58f1 fix: Unequal debit and credit issue on RCM Invoice (#24839)
* fix: Unequal debit and credit issue on RCM Invoice

* fix: Travis
2021-03-15 18:04:22 +05:30
Prssanna Desai
386b7fd2c3 fix: use method name as title in error log (#24880) 2021-03-15 18:03:03 +05:30
Ankush
f9f10ed743 fix: Add warning for invalid GST invoice numbers (#24837)
* fix: Add warning for invalid GST invoice numbers

GST Invoice numbers should be 16 characters alphanumeric with dash(/) or
slash(-) only. Add check for doc.name before saving and warn about
naming series.

* refactor: move regex patterns to global variables

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2021-03-15 17:58:17 +05:30
Devin Slauenwhite
2e2f3f9578 fix: stock move dialog duplicate submit actions (#24859)
* fix: duplicate submit actions

* fix sider errors.
2021-03-15 17:57:37 +05:30
HENRY Florian
55d45532b4 fix: UOM length unit in global setup list is empty (#24853)
* When ERPNext is installed in localized language the category of UOM Conversion Factor is tranlasted into installed languaes. Filter must be locallized

* fix

* fix
2021-03-15 17:54:50 +05:30
Deepesh Garg
07e7f73488 Merge pull request #24874 from GangaManoj/filter-bank-reconciliation-v12
fix(Bank Reconciliation): Filter Bank Account drop-down list
2021-03-15 10:20:05 +05:30
Ganga Manoj
017d168b03 fix(Bank Reconciliation): Filter Bank Account drop-down list 2021-03-13 23:38:30 +05:30
Rohit Waghchaure
a9d48e5fbf fix: revert stock balance value calculation 2021-03-13 12:48:14 +05:30
Ankush Menat
5ae40871d8 fix: do not update PE title during data import (#24835)
* fix: do not update PE title during data import

Related issue: ISS-20-21-10132

* fix: make title field read only
2021-03-11 16:08:40 +05:30
Ankush Menat
86a163fce5 fix: use account_name only in consolidated report (#24834)
Don't use account_number and only rely on account_name for preparing
consolidated financial statement.

Related issue: ISS-20-21-10217
2021-03-11 16:07:35 +05:30
Devin Slauenwhite
266f24bb74 fix: multiple price rules margin. 2021-03-10 18:46:18 -05:00
Rohan
aa90dc6aa3 fix: do not send emails to disabled users from Employee Onboarding (#24796) 2021-03-09 21:02:57 +05:30
HENRY Florian
5eb8eb8aa7 fix: Add french chart accounts with account number (#24763)
* add new franch account chart with numbers

* add new franch account chart with numbers

* add chart of account with code

* change name chart of accounte

* fix json unicode

* account format

* feat: add french accounting chart with account number

* remove debug
2021-03-09 20:32:30 +05:30
Marica
a69b8aa18d Merge pull request #24790 from ankush/track_settings_v12
fix: track setting changes
2021-03-09 13:30:28 +05:30
Marica
4450a075bd Merge branch 'version-12-hotfix' into track_settings_v12 2021-03-09 11:56:06 +05:30
rohitwaghchaure
3aede7da61 Merge pull request #24709 from rohitwaghchaure/fixed-stock-reco-incorrect-serial-no-issue
fix: incorrect serial no issue in the stock reco
2021-03-07 14:29:02 +05:30
Ankush Menat
2e8b06cf9f fix: track setting changes 2021-03-02 18:20:47 +05:30
Saqib
27f120bc7c fix(india): inflated item tax rate for e-invoicing (#24766)
* fix(india): inflated item tax rate for e-invoicing

* fix: credit note discount on net total
2021-03-01 10:46:17 +05:30
Ankush Menat
5feb20d94b feat: track changes to HR settings (#24740)
related issue: FR-ISS-259927
2021-02-25 19:05:25 +05:30
Afshan
27fbfbf34e fix: reference variable in pricing rule (#24714) 2021-02-25 19:01:58 +05:30
Ankush Menat
d389261230 fix(india): escape for special characters in JSON (bp #24695) (#24705) 2021-02-25 18:04:58 +05:30
Deepesh Garg
e9f8e5814a Merge pull request #24736 from ankush/opening_round_gl12
fix: make round off GLE always non-opening (bp #24723)
2021-02-25 15:17:55 +05:30
Ankush Menat
16193a614e fix: make round off GLE always non-opening
Opening GL entries can not be for profit and loss accounts. Round off
accounts are by default P&L account. Hence when making opening entry,
make round off entries as non-opening.

Related issue: ISS-20-21-09677
2021-02-25 10:22:49 +05:30
Afshan
2b2e205b74 fix: check if customer provided item while setting opening stock (#24633) 2021-02-24 19:05:29 +05:30
Afshan
9272ea838f fix: show custom button for saved projects (#24732)
* fix: show custom button for saved projects

* fix: slider
2021-02-24 18:13:29 +05:30
Afshan
80d9576bb9 fix: currency symbol in update items (#24727) 2021-02-24 16:51:35 +05:30
Afshan
c18a8c58dd fix: column names (#24713) 2021-02-24 14:39:00 +05:30
Rucha Mahabal
473fb55724 Merge pull request #24717 from pateljannat/issue-custom-button-v12
fix: custom buttons in issue
2021-02-24 11:48:06 +05:30
pateljannat
05a3c5a6bc fix: custom buttons in issue 2021-02-23 18:15:50 +05:30
Rohit Waghchaure
c39e206fc7 fix: incorrect serial no issue in the stock reco 2021-02-23 14:26:55 +05:30
Afshan
33539d49f1 fix: error message when making reverse journal entry (#24666) 2021-02-22 19:26:02 +05:30
Deepesh Garg
91a929df84 Merge pull request #24668 from pateljannat/gstr-1-unidentified-accounts-issue-v12
fix: excluding unidentified accounts from gstr-1
2021-02-20 17:28:13 +05:30
Saurabh
19a27d3f46 Merge branch 'v12-pre-release' into version-12 2021-02-19 12:44:24 +05:30
Saurabh
d5fa3a2b8f bumped to version 12.18.0 2021-02-19 13:04:23 +05:50
Deepesh Garg
e34f73c60b Merge pull request #24670 from deepeshgarg007/transaction_delete_fix_v12
fix: Do not delete GST Accounts from GST Settings on clearing transactions from Company Master
2021-02-19 10:58:13 +05:30
Deepesh Garg
a49ea67f16 fix: Do not delete GST Accounts from GST Settings on clearing transactions from Company Master 2021-02-19 10:56:54 +05:30
Nabin Hait
d7bf38842b core: Added change log 2021-02-18 20:14:31 +05:30
pateljannat
4f0c5e2cc7 fix: excluding unidentified accounts from gstr-1 2021-02-18 19:31:11 +05:30
Deepesh Garg
be65ae7c86 fix: Prorata factor fixes in subscription (#24638)
* fix: Prorata factor fixes in subscription

* fix: Test Case
2021-02-16 07:50:05 +05:30
Deepesh Garg
b0e53230bd fix: Prorata factor fixes in subscription (#24637)
* fix: Prorata factor fixes in subscription

* fix: Test Case
2021-02-16 07:49:59 +05:30
Deepesh Garg
f452ab56c6 Merge pull request #24635 from ankush/ladakh_gst_addition-v12pr
fix(India): Add GST state code for Ladakh
2021-02-15 21:12:39 +05:30
Deepesh Garg
1eb3d16667 Merge pull request #24634 from ankush/ladakh_gst_addition-v12hf
fix(India): Add GST state code for Ladakh
2021-02-15 21:12:14 +05:30
Ankush Menat
c1c8bb6d98 fix(India): Add GST state code for Ladakh 2021-02-15 15:35:32 +05:30
Ankush Menat
211a4cb833 fix(India): Add GST state code for Ladakh 2021-02-15 15:30:20 +05:30
rohitwaghchaure
472bad352d Merge pull request #24620 from rohitwaghchaure/fixed-incorrect-incoming-rate-for-sales-return-pre
fix: incorrect incoming rate for the sales return
2021-02-12 14:22:37 +05:30
Rohit Waghchaure
eea1ec42f4 fix: incorrect incoming rate for the sales return 2021-02-12 14:21:51 +05:30
rohitwaghchaure
b96c7e0a0f Merge pull request #24618 from rohitwaghchaure/fixed-incorrect-incoming-rate-for-sales-return
fix: incorrect incoming rate for the sales return
2021-02-12 14:20:02 +05:30
Rohit Waghchaure
37604c8d99 fix: incorrect incoming rate for the sales return 2021-02-12 13:17:10 +05:30
Afshan
edfbb5d3be fix: NoneType object has no attribute len() (#24617) 2021-02-12 12:40:52 +05:30
Nabin Hait
ddd85334a3 Removed debug flag 2021-02-12 09:54:04 +05:30
Nabin Hait
81ae1f363c Removed debug flag 2021-02-12 09:53:30 +05:30
Nabin Hait
2f20ef0f4c Merge branch 'version-12-hotfix' into v12-pre-release 2021-02-11 21:59:04 +05:30
Jannat Patel
e8935457a0 Item group on update items v12 (#24535)
* fix: item_group on update items

* fix: code cleanup

* Update accounts_controller.py

* Update accounts_controller.py

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-02-11 21:56:48 +05:30
Nabin Hait
64ec1728ab fix: merge conflict 2021-02-11 21:48:49 +05:30
Tropicalrambler (Alain Berger)
dbb6721412 fix: remove max 5 file attachment limit in task (#24056)
Co-authored-by: alain <fogliasana@gmail.com>
2021-02-11 20:14:14 +05:30
Afshan
afbbdcb802 fix: calculate discount amount (#24511) 2021-02-11 20:11:30 +05:30
Jannat Patel
37adbe5a85 fix: Dynamic Links for reports (#24461)
* fix: dynamic links in reports

* fix: reverting changes for payment period report

* fix: link fields
2021-02-11 20:09:49 +05:30
Rucha Mahabal
d7a5853587 fix: Issues with packing items (#24606) 2021-02-11 20:08:22 +05:30
Saqib
6b799dbef0 fix: validate cancellation only if irn generated (#24609) 2021-02-11 17:51:41 +05:30
Marica
be8ecdf3d6 Merge pull request #24486 from frappe/rfq-contact-email-set-v12
fix: Rfq contact email set v12
2021-02-11 13:50:06 +05:30
Wolfram Schmidt
85f1561e5e Update question.json (#24487)
according to: https://github.com/frappe/erpnext/pull/23402
2021-02-11 13:39:23 +05:30
Richard Case
2bf8610698 fix: plaid client version to support latest API (#24532) 2021-02-11 13:29:59 +05:30
Marica
23364b374e Merge pull request #24546 from pateljannat/validation-for-disabled-warehouse-v12
Validation for disabled warehouse v12
2021-02-11 13:09:29 +05:30
Marica
82c162dfe7 Merge branch 'version-12-hotfix' into validation-for-disabled-warehouse-v12 2021-02-11 13:04:49 +05:30
Saqib
7fea8a95e6 fix: NoneType has no len() (#24604) 2021-02-11 11:57:05 +05:30
rohitwaghchaure
85a2d27736 fix: Consolidated Financial Statement report not works if child company account not present in parent company (#24580) 2021-02-11 11:07:59 +05:30
Ankush Menat
106e0f885a fix: Update total in words after updating items (#24592)
* fix: Update total in words after Updating items

Update total in words after Updating items in sales/purchase orders.

Closes ISS-20-21-09425

* test: Add test for total & words after update item

Add test for total & words after updating items in sales order.
2021-02-11 11:05:08 +05:30
Anuja Pawar
c37ce8b8d3 fix: fix filters for IRS 1099 report (#24597) 2021-02-11 11:02:13 +05:30
pateljannat
5ac5d86d84 fix: vadd validation in stock ledger entry 2021-02-10 18:44:38 +05:30
Marica
a180d2baa8 Merge pull request #24400 from pateljannat/item-wise-purchase-register-item-name-error-v-12
fix: Item wise purchase register item name error v12
2021-02-10 12:04:40 +05:30
pateljannat
14717eeac6 fix: better function name 2021-02-09 14:12:20 +05:30
Deepesh Garg
179d82615f Merge pull request #24579 from marination/acc-dimension-update-hotfix
fix: Avoid changing Ref. Doctype in Accounting Dimension after creation
2021-02-09 06:52:45 +05:30
Saqib
1618c92142 fix: fetching of standalone cr/dr notes for reconciliation (#24576) 2021-02-08 20:19:18 +05:30
marination
1118949867 fix: frm.doc instead of doc 2021-02-08 17:55:26 +05:30
marination
31cd9dcee1 fix: Avoid changing Ref. Doctype in Accounting Dimension after creation 2021-02-08 17:37:14 +05:30
Saqib
e42e75178a fix(e-invoice): skip e-invoice generation for non-taxable invoices (#24568) (#24569) 2021-02-08 11:43:29 +05:30
Saqib
078e154966 fix(e-invoice): do not validate gstin for exports (#24564) 2021-02-07 18:58:25 +05:30
Anuja Pawar
3365f01963 fix: fixing item_code not found error (#24484) 2021-02-05 23:35:42 +05:30
pateljannat
469827da85 fix: validation for disabled warehouse 2021-02-03 15:34:57 +05:30
pateljannat
d3240f9510 Merge branch 'version-12-hotfix' of https://github.com/frappe/erpnext into version-12-hotfix 2021-02-03 12:05:12 +05:30
Rohan
2341f47631 fix: use supplied year for IRS 1099 forms (#24425)
* fix: use supplied year for IRS 1099 forms

* fix: don't use f-strings

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-02-01 11:55:40 +05:30
Saqib
b57a523dfe fix: discount amount calculation on net total (#24498) 2021-01-29 14:24:18 +05:30
pateljannat
8d101d362d fix: rfq contact email set 2021-01-28 15:01:25 +05:30
pateljannat
a9cfe1cfa4 Merge branch 'version-12-hotfix' of https://github.com/frappe/erpnext into version-12-hotfix 2021-01-28 14:49:19 +05:30
Afshan
dccd2ca69f fix: validate tax template for tax category (#24403)
* fix: validate tax template for tax category

* Update erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.py

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

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-01-28 12:23:08 +05:30
Anuja Pawar
314e151f1d fix: adding UOM in update items (#24479)
* fix: adding UOM in update items

* fix: sider fixes
2021-01-28 12:19:03 +05:30
Kaviya Periyasamy
c002465903 fix(einvoice): QRCode generation and eway bill live url (#24459) 2021-01-27 19:43:41 +05:30
Saqib
859a5f4dbe fix: e_invoice print format not showing other charges (#24473) 2021-01-27 12:33:59 +05:30
Saurabh
58d7fb5c94 Merge branch 'v12-pre-release' into version-12 2021-01-27 09:42:08 +05:30
Saurabh
744a7b1bad bumped to version 12.17.0 2021-01-27 10:02:08 +05:50
Saqib
d9719fe41d fix: einvoice test (#24463) 2021-01-26 19:19:51 +05:30
Saqib
50c1d24ee9 fix: einvoice test (#24435) 2021-01-25 17:59:52 +05:30
Suraj Shetty
ea221f7e63 chore: Add release notes for v12.17.0 (#24450)
* chore: Add release notes for v12.17.0

* Chore: Fix formatting

* chore: Fix links
2021-01-25 15:36:43 +05:30
David Angulo
3799c1a662 feat: Make patient age translateable (#24416)
* feat: Make patient age translateable

* Make patient age translatable in patient encounter

* Translate all occurrences of age calculation

* Comply to uniform translation syntax
2021-01-22 08:29:16 +05:30
rohitwaghchaure
56a8b90598 Merge pull request #24438 from AfshanKhan/fix-stock-ageing-v12
fix: stock ageing should not take cancelled stock entries.
2021-01-21 23:10:50 +05:30
Afshan
044ad91481 fix: stock ageing should not take cancelled stock entries. 2021-01-21 18:29:43 +05:30
Anuja Pawar
39a5e5abd1 fix: missing asset id in the Fixed Asset Register (#24429) 2021-01-21 15:14:24 +05:30
Saqib
407b351d55 fix: (e-invoicing) qrcode image generation (#24422) 2021-01-20 13:24:49 +05:30
Saqib
6f64ec3574 fix: (e-invoicing) qrcode image generation (#24421) 2021-01-20 13:22:58 +05:30
Prssanna Desai
e17ad9e620 Merge pull request #24419 from prssanna/chart-imports-v12
fix: function imports in accounts dashboard
2021-01-20 11:21:38 +05:30
Prssanna Desai
505b69f6b2 Merge pull request #24380 from prssanna/chart-imports
fix: function imports in accounts dashboard
2021-01-20 11:18:31 +05:30
prssanna
485ef74c58 fix: function imports in accounts dashboard 2021-01-20 11:18:10 +05:30
Anuja Pawar
5cf9fbc27b fix: missing asset id in the report (#24391) 2021-01-18 17:05:01 +05:30
Saqib
4ef49eab66 fix: add check for allowing access to european region (#24393) 2021-01-18 16:40:28 +05:30
Saqib
f6d61f2dec fix: add check for allowing access to european region (#24394) 2021-01-18 16:40:10 +05:30
pateljannat
7aaf3a71e8 fix: item wise purchase register item_name error 2021-01-18 16:15:01 +05:30
Jannat Patel
c51ac1c68b Merge pull request #5 from frappe/version-12-hotfix
Version 12 hotfix
2021-01-18 15:58:26 +05:30
rohitwaghchaure
04b106a515 Merge pull request #24384 from rohitwaghchaure/donot-check-previous-qty-for-batch-pre-release
fix: stock ledger entry was not created against stock reco
2021-01-16 15:03:08 +05:30
Rohit Waghchaure
e79f3e67ed fix: stock ledger entry was not created against stock reco 2021-01-16 15:01:14 +05:30
rohitwaghchaure
f8d24b803c Merge pull request #24382 from rohitwaghchaure/donot-check-previous-qty-for-batch
fix: stock ledger entry was not created against stock reco
2021-01-15 21:25:00 +05:30
Rohit Waghchaure
c516fc7ca4 fix: stock ledger entry was not created against stock reco 2021-01-15 18:18:17 +05:30
prssanna
c9b8423007 fix: function imports in accounts dashboard 2021-01-15 18:05:19 +05:30
Nabin Hait
42675929fa fix:merge conflict 2021-01-15 17:09:43 +05:30
Anuja Pawar
a8de2321a5 fix: Payment Period based on invoice date report fix/refactor (#24377)
* fix: Payment Period based on invoice date report fix/refactor

* fix: minor
2021-01-14 21:21:12 +05:30
Saqib
748f8145b6 feat: show transporter address in sales invoice (#23731)
* feat: show transporter address in sales invoice

* feat: multiple transporter address

* fix: update all eway-bill fields

* fix: travis

* fix: travis

* fix: travis

* fix: travis

* fix: travis

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-01-14 19:53:51 +05:30
Jannat Patel
7a40a2b2e2 fix: subscription prepaid date validation (#24373) 2021-01-14 19:46:19 +05:30
Deepesh Garg
35c2d2324d fix: Ignore group cost center validation for period closing voucher (#24374) 2021-01-14 19:45:13 +05:30
Anuja Pawar
f2b5f3a842 fix: for not having fiscal year while creating new company (#24161)
* fix: Fiscal year fix while creating new company

* minor fix

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-01-14 19:25:40 +05:30
Mohammad Hasnain Mohsin Rajan
d2442da6f2 fix: last purchase rate not updating when voucher cancelled if only one voucher is present - v12 (#24323)
* fix: update last purchase rate

* chore: use orm for update

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-01-14 19:22:47 +05:30
Anuja Pawar
32bdb691df fix: bom stock report UoM correction (#24363) 2021-01-14 19:21:27 +05:30
rohitwaghchaure
5050541401 Merge pull request #24188 from iRaySpace/loyalty-program-fix
fix: loyalty program
2021-01-14 17:11:20 +05:30
rohitwaghchaure
87f0ed6477 Merge pull request #24364 from rohitwaghchaure/fixed-extra-trasnferred_qty_issue
fix: extra transferred qty has not consumed against work order
2021-01-14 16:36:24 +05:30
Marica
6df18856db Merge pull request #24295 from marination/mr-se-warehouse-validation-hotfix
fix: Dont validate warehouse values between MR to Stock Entry
2021-01-14 16:34:26 +05:30
Marica
288b384ab5 Merge pull request #24368 from marination/qc-back-update-se-hotfix
fix: Back Update from QC based on Batch No
2021-01-14 15:14:06 +05:30
Marica
cffcbf7c47 Merge pull request #24367 from marination/bom-rm-rate-company-based-hotfix
fix: Company Wise Valuation Rate for RM in BOM
2021-01-14 15:13:35 +05:30
Marica
c69fda4440 Merge branch 'version-12-hotfix' into mr-se-warehouse-validation-hotfix 2021-01-14 15:10:01 +05:30
Anurag Mishra
507ec2184c fix: calculation of remaining_sub_periods if relieving date before month start date
fix: calculation of remaining_sub_periods if relieving date before the month start date
2021-01-14 14:51:13 +05:30
Afshan
75cfbe132b fix: calculation of remaining_sub_periods if relieving date before month start date 2021-01-14 13:51:01 +05:30
marination
f88e908598 fix: Remove QI link on cancel wherever same QI name exists 2021-01-14 13:05:40 +05:30
marination
8791d11359 fix: Back Update from QC based on Batch No 2021-01-14 13:03:32 +05:30
marination
bbec5ccc83 fix: Company Wise Valuation Rate for RM in BOM 2021-01-14 12:53:57 +05:30
Saqib
8862166223 fix(e-invoicing): minor ux fixes (#24366) 2021-01-14 12:22:23 +05:30
marination
2eea0f003f fix: test for raising MR-SE mismatch error
- Make test add mismatched item code instead of warehouse, since warehouse can be different.
2021-01-14 12:20:39 +05:30
Rohit Waghchaure
a250d415aa fix: extra transferred qty has not consumed against work order 2021-01-14 11:47:57 +05:30
Jannat Patel
4d83564188 fix: check for tax_rate (#24348) 2021-01-13 20:57:15 +05:30
rohitwaghchaure
7e01cacf8c Merge pull request #24353 from rohitwaghchaure/fixed-incorrect-key-in-subcontract
fix: incorrect serial no in the subcontracted purchase receipt
2021-01-13 09:21:57 +05:30
Rohit Waghchaure
830626d86a fix: incorrect key 2021-01-13 00:05:29 +05:30
Marica
78e413aaaa Merge branch 'version-12-hotfix' into mr-se-warehouse-validation-hotfix 2021-01-12 20:17:41 +05:30
rohitwaghchaure
f9da40e9af Merge pull request #24331 from rohitwaghchaure/fixed-payment-entry-multi-currency-issue
fix: payment entry multi-currency issue
2021-01-11 12:32:30 +05:30
Rucha Mahabal
e6a8e1a23b Merge pull request #24333 from ruchamahabal/fix-item-details-in-reports-v12
feat(reports): get item details from Item document instead of the Transactions
2021-01-08 15:25:02 +05:30
Rucha Mahabal
e0e5783b3e fix: import statement 2021-01-08 14:37:23 +05:30
Rucha Mahabal
0abed806a3 feat(reports): get item details from Item doctype instead of the Transaction 2021-01-08 14:37:07 +05:30
Rohit Waghchaure
79e3700499 fix: payment entry multi-currency issue 2021-01-08 12:36:51 +05:30
Saqib
e898ce1f20 refactor: fetch & validate address from erpnext rather than gst portal (#24305) 2021-01-06 10:49:50 +05:30
Saqib
3ddebae3fb refactor: fetch & validate address from erpnext rather than gst portal (#24299) 2021-01-06 10:49:27 +05:30
Nabin Hait
d5abab4208 fix: tax calculation on salary slip for the first month (#24272) (#24309)
* fix: tax calculation on salary slip for the first month

* fix: net pay precision issue

* fix: net pay precision issue

Co-authored-by: Anurag Mishra <32095923+Anurag810@users.noreply.github.com>

Co-authored-by: Anurag Mishra <32095923+Anurag810@users.noreply.github.com>
2021-01-06 09:34:44 +05:30
Nabin Hait
00a40c95ea Merge branch 'version-12-hotfix' into mr-se-warehouse-validation-hotfix 2021-01-06 09:33:56 +05:30
rohitwaghchaure
750da2f946 Merge pull request #24302 from rohitwaghchaure/allow-to-set-basic-rate-manually-for-manufacture-entry
fix: 'Set Basic Rate Manually' field is now available for Manufacture type stock entry
2021-01-05 17:01:27 +05:30
Rohit Waghchaure
ff524e676f fix: 'Set Basic Rate Manually' field is now available for Manufacure type stock entry 2021-01-05 15:09:54 +05:30
rohitwaghchaure
d8fc6ec471 Merge pull request #24301 from rohitwaghchaure/fixed-allow-to-override-basic-rate-for-fg
fix: allow to override the basic rate for the finished good
2021-01-05 14:55:42 +05:30
Rohit Waghchaure
4e12c70897 fix: allow to override the basic rate for the finished good 2021-01-05 14:54:52 +05:30
Saqib
7e97138beb fix(e-invoicing): minor calculation fixes (#24284) 2021-01-05 13:32:56 +05:30
Saqib
00865b9af3 fix(e-invoicing): minor calculation fixes (#24283) 2021-01-05 13:32:46 +05:30
Deepesh Garg
7d1a431d9c Merge pull request #23963 from vorasmit/remarks-fix-v12
fix: add remarks to sales invoice
2021-01-05 09:57:58 +05:30
Deepesh Garg
fe9e2ec008 Merge branch 'version-12-hotfix' of https://github.com/frappe/erpnext into remarks-fix-v12 2021-01-05 09:56:58 +05:30
Nabin Hait
ca4c12b44e Merge branch 'version-12-hotfix' into mr-se-warehouse-validation-hotfix 2021-01-05 09:30:09 +05:30
Nabin Hait
cdd950dee5 fix: Ignore customer and supplier while deleting company transactions (#24280) 2021-01-05 09:25:50 +05:30
rohitwaghchaure
21b17cf407 Merge pull request #24289 from rohitwaghchaure/fixed-source-warehouse-if-material-transfer-is-skip
fix: incorrect source warehouse in stock entry
2021-01-05 09:01:39 +05:30
rohitwaghchaure
6324cc238e Merge pull request #24288 from rohitwaghchaure/fixed-pricing-rule-not-working-in-offline-pos
fix: pricing rule not working for offline POS
2021-01-05 09:01:05 +05:30
marination
cdc0b8e435 fix: Dont validate warehouse values between MR to Stock Entry
- Remove validation that checks if warehouse in Stock Entry is the same as MR that it was pulled from
2021-01-04 18:59:48 +05:30
Prssanna Desai
7049cca855 Merge pull request #24290 from frappe/revert-24097-chart-imports
Revert "fix: function imports in account_balance_timeline.py"
2021-01-04 17:16:48 +05:30
Prssanna Desai
ba95d32876 Revert "fix: function imports in account_balance_timeline.py" 2021-01-04 17:14:50 +05:30
Rohit Waghchaure
bf1e0139e2 fix: incorrect source warehouse in stock entry 2021-01-04 16:23:14 +05:30
Rohit Waghchaure
bf490c3a27 fix: pricing rule not working for offline POS 2021-01-04 15:32:13 +05:30
Saqib
40b37f09fd fix: cannot save asset category withouut depr posting date 2021-01-04 11:48:45 +05:30
vorasmit
04e0b35154 Update patches.txt 2021-01-01 17:14:14 +05:30
vorasmit
82b4749166 Update patches.txt 2021-01-01 10:49:48 +05:30
vorasmit
ef06f3288f Delete update_sales_invoice_remarks.py 2021-01-01 10:48:44 +05:30
Saqib
945c0e86de fix: cannot submit e-invoice if legal name not found 2020-12-31 13:17:59 +05:30
Saqib
2cae3d7b38 fix: cannot submit e-invoice if legal name not found 2020-12-31 13:16:59 +05:30
Saurabh
03933f8461 Merge branch 'v12-pre-release' into version-12 2020-12-31 11:20:28 +05:30
Saurabh
ba398bc779 bumped to version 12.16.2 2020-12-31 11:40:28 +05:50
Saqib
022a46fdcd fix: item value & invoice value calculations (#24241) 2020-12-31 11:17:27 +05:30
Deepesh Garg
d092b6c25a Merge pull request #24244 from deepeshgarg007/template_company_filter
fix: Add company filter in tax template query
2020-12-31 11:06:25 +05:30
Karthikeyan S
5add3ea210 fix(GST E Invoice): update live URLs for adaequare GSP (#24249) 2020-12-30 19:21:40 +05:30
Deepesh Garg
909346f222 fix: Add company filter in tax template query 2020-12-30 18:05:52 +05:30
Saurabh
d9a0e0c708 Merge branch 'v12-pre-release' into version-12 2020-12-30 17:45:38 +05:30
Saurabh
839edaf613 bumped to version 12.16.1 2020-12-30 18:05:38 +05:50
Deepesh Garg
11f2da72b1 fix: Error on submitting sales invoice (#24243)
* fix: Error on submitting sales invoice

* fix: remove return_taxes
2020-12-30 17:44:23 +05:30
Saurabh
61298c3489 Merge branch 'v12-pre-release' into version-12 2020-12-30 13:12:30 +05:30
Saurabh
2cf2697e74 bumped to version 12.16.0 2020-12-30 13:32:29 +05:50
rohitwaghchaure
1b0870a440 Merge pull request #24240 from saurabh6790/v12_16_change_log
feat: change log for version 12.16.0
2020-12-30 13:09:39 +05:30
Saurabh
5c107b99bd feat: change log for version 12.16.0 2020-12-30 13:07:05 +05:30
Saqib Ansari
edec82bb9e fix: unit rate & gross amount calculation 2020-12-30 11:57:16 +05:30
Saqib Ansari
45dbfaa7f9 fix: invoice value set to zero if rounded total disabled 2020-12-30 11:57:16 +05:30
Rohit Waghchaure
7d666ccfb4 fix: do not override the manually added valuation rate in stock entry 2020-12-30 11:57:16 +05:30
Saqib Ansari
246ef881a0 fix: e invoice request log permissions 2020-12-30 11:57:16 +05:30
Saqib Ansari
5f3635fbaf fix: travis 2020-12-30 11:57:16 +05:30
Rohit Waghchaure
ec59c6cebc fix: do not manufacture same serial no multiple times 2020-12-30 11:57:16 +05:30
Saqib Ansari
be58194678 fix: sider issues 2020-12-30 11:57:16 +05:30
Saqib Ansari
00306d8fd0 chore: code cleanup 2020-12-30 11:57:16 +05:30
Saqib Ansari
da83ec0f0d fix: cannot cancel irn without submitting sales invoice 2020-12-30 11:57:16 +05:30
Saqib Ansari
709d50ad21 fix: remove test pincode 2020-12-30 11:57:16 +05:30
Saqib Ansari
7f69820f04 fix: uncomment test condition 2020-12-30 11:57:16 +05:30
Saqib Ansari
a0c8106342 feat: multiple gstins for e invoicing 2020-12-30 11:57:16 +05:30
Saqib Ansari
8c8ab4140e fix: remove test supplier pincode 2020-12-30 11:57:16 +05:30
pateljannat
2274162107 fix: modified 2020-12-30 11:57:16 +05:30
Shivam Mishra
6f2a34f6d4 fix: replace pin code with postal code 2020-12-30 11:57:16 +05:30
pateljannat
e512118320 fix: indentation 2020-12-30 11:57:16 +05:30
pateljannat
aa2a7abe4e fix: linter issue for translation syntax 2020-12-30 11:57:16 +05:30
pateljannat
79ff4d0e8f fix: reversing previous commits and adding condition in regional controller 2020-12-30 11:56:50 +05:30
pateljannat
37a64b6485 fix: place of supply change on address change 2020-12-30 11:56:50 +05:30
Deepesh Garg
9f848fe65c fix: Tax template update on supplier 2020-12-30 11:56:50 +05:30
Marica
65680ada87 Revert "fix: po_not retaining on save" 2020-12-30 11:56:09 +05:30
Mohammad Hasnain
a8cda3f013 fix: po_no not cleaned up on save 2020-12-30 11:56:09 +05:30
Mohammad Hasnain
c51b4d0416 fix: po_no getting removed on save 2020-12-30 11:56:09 +05:30
Rucha Mahabal
67cfb6c370 fix(Asset): set current asset value before calculating difference amount (#24119) 2020-12-30 11:56:09 +05:30
Saqib Ansari
54e9063215 feat: add docs link to e invoice settings 2020-12-30 11:56:09 +05:30
Saqib Ansari
554ce04e0d fix: error handling 2020-12-30 11:56:09 +05:30
Saqib Ansari
08f082089e fix: dialog is undefined 2020-12-30 11:56:09 +05:30
Saqib Ansari
d22279ba38 fix: minor ux issues 2020-12-30 11:56:09 +05:30
Saqib Ansari
d01cae95d9 feat: show e-invoice preview before IRN generation 2020-12-30 11:56:09 +05:30
Saqib Ansari
b510d20805 fix: adjust qr code image size 2020-12-30 11:56:09 +05:30
Saqib Ansari
b1054a3ddc fix: sider issues 2020-12-30 11:56:09 +05:30
Saqib Ansari
f454ab4ce2 chore: add ack date and ack no field for print formats 2020-12-30 11:56:09 +05:30
Saqib Ansari
5c68fe4d86 feat: log e-invocing requests 2020-12-30 11:56:09 +05:30
Saqib Ansari
68e476c7fe fix: returning condition 2020-12-30 11:56:08 +05:30
Saqib Ansari
8f5425d99b chore: add tests 2020-12-30 11:56:08 +05:30
Saqib Ansari
6af53a645a fix: ewaybill mandatory conditions 2020-12-30 11:56:08 +05:30
Saqib Ansari
b9cbdeaa95 fix: eway bill test 2020-12-30 11:56:08 +05:30
Saqib Ansari
0ce03cc36d fix: exclude intra company transactions 2020-12-30 11:56:08 +05:30
pateljannat
4ee433a51c fix: indentation 2020-12-30 11:56:08 +05:30
Anuja P
e33179d130 fix: Added TDS account number and an error message 2020-12-30 11:56:08 +05:30
barredterra
53bcf704b3 feat: separate equity tree in CoA SKR04 2020-12-30 11:56:08 +05:30
pateljannat
f4f05dd5ad fix: enabling track changes for stock settings 2020-12-30 11:56:08 +05:30
pateljannat
5b554a5e20 fix: enabling track changes for stock settings 2020-12-30 11:56:08 +05:30
pateljannat
79ac9dc486 fix: enabling track changes for stock settings 2020-12-30 11:56:08 +05:30
pateljannat
f0d591351b fix: enabling track changes for stock settings 2020-12-30 11:56:08 +05:30
Saqib Ansari
c6143c4542 fix: qrcode image size 2020-12-30 11:56:08 +05:30
Saqib Ansari
5a56b63eed feat: update timeline on einvoice actions 2020-12-30 11:56:08 +05:30
Saqib Ansari
5d92e2481d fix: ewaybill could be modified after ewaybill generation 2020-12-30 11:56:08 +05:30
Saqib Ansari
ac603a895d fix: error handling 2020-12-30 11:56:08 +05:30
Saqib Ansari
9f0d567ea5 fix: imports 2020-12-30 11:56:08 +05:30
Saqib Ansari
4ea03c23a4 fix: import format_date 2020-12-30 11:56:08 +05:30
Saqib Ansari
209aa447f7 chore: remove fetch token from e invocie settings 2020-12-30 11:56:08 +05:30
Saqib Ansari
eabaa16f13 feat: cess non advolem on einvoice item 2020-12-30 11:56:08 +05:30
Saqib Ansari
27b68be854 fix: patch 2020-12-30 11:56:08 +05:30
Saqib Ansari
85cc1d68f0 fix: invalid syntax 2020-12-30 11:56:08 +05:30
Saqib Ansari
61e6760a6b fix: invalid syntax 2020-12-30 11:56:08 +05:30
Saqib Ansari
16e879bc1a chore: remove test pincode 2020-12-30 11:56:08 +05:30
Saqib Ansari
8866801932 feat: header & footer in GST E Invoice 2020-12-30 11:56:08 +05:30
Saqib Ansari
4965af2321 chore: error logging 2020-12-30 11:56:08 +05:30
Saqib Ansari
fb65644026 chore: remove unwanted imports 2020-12-30 11:56:08 +05:30
Saqib Ansari
2e1f56e117 feat: generate eway bill from IRN 2020-12-30 11:56:08 +05:30
Saqib Ansari
3b62e05a5c fix: valiations 2020-12-30 11:56:08 +05:30
Saqib Ansari
988fd97625 fix: show/hide eway bill fields 2020-12-30 11:56:08 +05:30
Saqib Ansari
628dcb1ff9 fix: generate & cancel IRN 2020-12-30 11:56:08 +05:30
Saqib Ansari
e6cd9ccea0 fix: attach qrcode on irn generation 2020-12-30 11:56:08 +05:30
Saqib Ansari
ac2fc8470b chore: clean up einvoice actions 2020-12-30 11:56:08 +05:30
Saqib Ansari
6dcf334199 chore: remove unwanted fuctions 2020-12-30 11:56:08 +05:30
Saqib Ansari
5822cfb454 feat: cancel eway bill 2020-12-30 11:56:08 +05:30
Saqib Ansari
a15c02ec71 feat: generate & cancel IRN 2020-12-30 11:56:08 +05:30
Saqib Ansari
0938db8730 feat: fetch and cache GSTIN details 2020-12-30 11:56:08 +05:30
Saqib Ansari
537a236dc9 fix: qr code generation 2020-12-30 11:56:08 +05:30
Saqib Ansari
68d2a1f02b chore: remove unwanted fields 2020-12-30 11:56:08 +05:30
Saqib Ansari
4dad6742e1 feat: initialize GSP connector 2020-12-30 11:56:08 +05:30
Saqib Ansari
44877d5a60 fix: qr code image string 2020-12-30 11:56:08 +05:30
Saqib Ansari
05589e9651 chore: improve document name validation message 2020-12-30 11:56:08 +05:30
Saqib Ansari
9958639a9a fix: other charges calculation 2020-12-30 11:56:08 +05:30
Saqib Ansari
df1686611b fix: invoice totals calculation 2020-12-30 11:56:07 +05:30
Saqib Ansari
1041aef097 fix: patch 2020-12-30 11:56:07 +05:30
Saqib Ansari
0e00bff182 fix: einvoice field validation 2020-12-30 11:56:07 +05:30
Saqib Ansari
160585321d fix: rename e_invoice_utils.py 2020-12-30 11:56:07 +05:30
Saqib Ansari
965bc9bb80 fix: add missing package 2020-12-30 11:56:07 +05:30
Saqib Ansari
bfb68e4e80 fix: e_invoice module not found 2020-12-30 11:56:07 +05:30
Saqib Ansari
3d7f833899 fix: error logging 2020-12-30 11:56:07 +05:30
Saqib Ansari
1866965508 fix: validations 2020-12-30 11:56:07 +05:30
Saqib Ansari
a874587156 fix: credit note einvoice 2020-12-30 11:56:07 +05:30
Saqib Ansari
e7ea94ae6f fix: return date 2020-12-30 11:56:07 +05:30
Saqib Ansari
7015609f7f fix: validate document name 2020-12-30 11:56:07 +05:30
Saqib Ansari
53b05c2850 feat: add patch 2020-12-30 11:56:07 +05:30
Saqib Ansari
e14bb5e978 fix: add permissions on regional setup 2020-12-30 11:56:07 +05:30
Saqib Ansari
4db3ff1673 fix: validations 2020-12-30 11:56:07 +05:30
Saqib Ansari
03cd4135d2 fix: print format 2020-12-30 11:56:07 +05:30
Saqib Ansari
e984632221 fix: download & upload e-invoice 2020-12-30 11:56:07 +05:30
Saqib Ansari
65289334e3 chore: clean up e invoice actions 2020-12-30 11:56:07 +05:30
Saqib Ansari
2e38f73732 chore: code cleanup 2020-12-30 11:56:07 +05:30
Saqib Ansari
52b983eb8f fix: invalid syntax 2020-12-30 11:56:07 +05:30
Saqib Ansari
2e16dcc8fa fix: bug 2020-12-30 11:56:07 +05:30
Saqib Ansari
4e12466bef feat: QRCode Image and E-Invoice Print Format 2020-12-30 11:56:07 +05:30
Saqib Ansari
e0ea4265a8 chore: move einvoicing stuff to seperate folder 2020-12-30 11:56:07 +05:30
Saqib Ansari
233cad9e02 fix: fetch token if not valid 2020-12-30 11:56:07 +05:30
Saqib Ansari
718e517144 chore: save signed invoice and qrcode after uplaoding irn 2020-12-30 11:56:07 +05:30
Saqib Ansari
4f3f935a7a fix: fn name 2020-12-30 11:56:07 +05:30
Saqib Ansari
94db0bba44 chore: group e-invoicing actions 2020-12-30 11:56:07 +05:30
Saqib Ansari
acc79f739b feat: manual download / upload json 2020-12-30 11:56:07 +05:30
Saqib Ansari
bdf4bfe98f feat: cancel e-way bill before cancelling IRN 2020-12-30 11:56:07 +05:30
Saqib Ansari
9e5388ac53 chore: no copy on e invoice custom fields 2020-12-30 11:56:07 +05:30
Saqib Ansari
a6666dbf97 fix: save e-way bill no on irn generation 2020-12-30 11:56:07 +05:30
Saqib Ansari
4b969a5b9b feat: e-way bill details in e-invoice 2020-12-30 11:56:07 +05:30
Saqib Ansari
b6faadab8d chore: show irn field for proper gst_category 2020-12-30 11:56:07 +05:30
Saqib Ansari
38f06a1a26 fix: update irn_cancelled after cancelling irn 2020-12-30 11:56:07 +05:30
Saqib Ansari
b54df979c4 fix: do not show generate irn for invalid supply type 2020-12-30 11:56:07 +05:30
Saqib Ansari
1b969ff140 fix: validation if e invoicing is disabled 2020-12-30 11:56:07 +05:30
Saqib Ansari
bf2b4bc6f7 fix: cannot find attached key file 2020-12-30 11:56:07 +05:30
Saqib Ansari
9d805272be fix: public key is required on validate 2020-12-30 11:56:07 +05:30
Saqib Ansari
d4255d77f4 fix: hide cancel irn dialog on error 2020-12-30 11:56:07 +05:30
Saqib Ansari
13467e42f3 chore: show irn cancelled check after cancellation 2020-12-30 11:56:07 +05:30
Saqib Ansari
1679b0adbb fix: item discount 2020-12-30 11:56:07 +05:30
Saqib Ansari
e7a129dde8 chore: minor fixes 2020-12-30 11:56:07 +05:30
Saqib Ansari
b12d08a85b feat: Generate & Cancel IRN from Sales Invoice 2020-12-30 11:56:07 +05:30
Saqib Ansari
fe054511c8 feat: make IRN field on regional setup 2020-12-30 11:56:07 +05:30
Saqib Ansari
c3e0ff93d7 chore: rename schema to template & js cleanup 2020-12-30 11:56:07 +05:30
Saqib Ansari
4d15506791 chore: split einvoice settings and operations 2020-12-30 11:56:07 +05:30
Saqib Ansari
a367cc5c99 chore: move e-invoice settings to regional 2020-12-30 11:56:07 +05:30
Saqib Ansari
9599420878 feat: complete e-invoice schema 2020-12-30 11:56:07 +05:30
Saqib Ansari
c9b6db27cf feat: cancel IRN 2020-12-30 11:56:06 +05:30
Saqib Ansari
d72d2367ab chore: validations 2020-12-30 11:56:06 +05:30
Saqib Ansari
d9e4ebc00c feat: decode signed json and QR code 2020-12-30 11:56:06 +05:30
Saqib Ansari
a4bd8ba6f9 feat: generate IRN 2020-12-30 11:56:06 +05:30
Saqib Ansari
6f5a9c8049 feat: make e invoice from erpnext sales invoice 2020-12-30 11:56:06 +05:30
Saqib Ansari
48449e6d0a feat: decrypt json data with SEK 2020-12-30 11:56:06 +05:30
Saqib Ansari
31596228ff feat: AES decryption of SEK with appkey 2020-12-30 11:56:06 +05:30
Saqib Ansari
017543d59d chore: handle error response 2020-12-30 11:56:06 +05:30
Saqib Ansari
cca0eaaa29 feat: save token and sek from auth request 2020-12-30 11:56:06 +05:30
Saqib Ansari
b52a9283bb feat: rsa encryption with public key 2020-12-30 11:56:06 +05:30
Saqib Ansari
39dabe7381 feat: read public key file 2020-12-30 11:56:06 +05:30
Saqib Ansari
1c213a3dbb feat: init e-invoice settings 2020-12-30 11:56:06 +05:30
rohitwaghchaure
e7eb9d4e20 Merge pull request #24184 from nextchamp-saqib/e-invoicing-version-12
feat: GST E-Invoicing
2020-12-30 11:15:37 +05:30
Saqib Ansari
d94a97b6ad fix: unit rate & gross amount calculation 2020-12-29 17:56:14 +05:30
Saqib Ansari
d819330443 fix: invoice value set to zero if rounded total disabled 2020-12-29 17:56:08 +05:30
Yogendrasinh Chavda
eb88b63ddd [IMP][version-12] Improved code by adding operator to check condition. 2020-12-28 17:40:52 +05:30
rohitwaghchaure
86bbb3e9a0 Merge pull request #24221 from rohitwaghchaure/donot-override-valuation-rate
fix: do not override the manually added valuation rate in stock entry
2020-12-28 16:43:49 +05:30
Rohit Waghchaure
b9d62d7f8e fix: do not override the manually added valuation rate in stock entry 2020-12-28 15:20:23 +05:30
rohitwaghchaure
44dd9f6fe5 Merge pull request #24163 from rohitwaghchaure/do-not-manufacture-same-serial-no-two
fix: do not manufacture same serial no multiple times
2020-12-24 22:54:30 +05:30
Saqib Ansari
a683b14c64 fix: e invoice request log permissions 2020-12-24 21:12:13 +05:30
Saqib Ansari
becae59af0 fix: travis 2020-12-24 21:12:06 +05:30
Rohit Waghchaure
e6d300e35c fix: do not manufacture same serial no multiple times 2020-12-24 17:47:48 +05:30
Saqib Ansari
c2a41371d2 fix: sider issues 2020-12-24 10:39:41 +05:30
Saqib Ansari
6d3fc0d020 chore: code cleanup 2020-12-23 15:43:51 +05:30
Saqib Ansari
81cbd0dc50 fix: cannot cancel irn without submitting sales invoice 2020-12-23 15:43:31 +05:30
Saqib Ansari
1bbda81c9f fix: remove test pincode 2020-12-23 15:19:51 +05:30
Saqib Ansari
21461823f1 fix: uncomment test condition 2020-12-23 14:36:40 +05:30
Rohit Waghchaure
e9b580aba6 fix: pos not working 2020-12-22 19:03:39 +08:00
Sun Howwrongbum
7f794e5bb6 fix(pos): loyalty details not rendering in cart area 2020-12-22 19:02:08 +08:00
Saqib Ansari
6db07c0278 feat: multiple gstins for e invoicing 2020-12-22 15:56:18 +05:30
Saqib Ansari
c28379075a fix: remove test supplier pincode 2020-12-21 18:41:40 +05:30
Marica
64f4f86948 Merge pull request #23983 from pateljannat/track-changes-for-stock-settings-v12
fix: enabling track changes for stock settings
2020-12-19 16:25:54 +05:30
pateljannat
983df4463a fix: modified 2020-12-18 20:18:17 +05:30
Shivam Mishra
b9c71e59e0 Merge pull request #24180 from scmmishra/chore-rename-pin-code 2020-12-18 13:32:34 +05:30
Shivam Mishra
8427dd2ca8 fix: replace pin code with postal code 2020-12-18 13:30:25 +05:30
Deepesh Garg
105a9fdff1 Merge pull request #24174 from deepeshgarg007/tax_category_typo_v12
fix: Typo in tax category doctype query
2020-12-17 19:01:01 +05:30
Deepesh Garg
bd0cb9d2ed Typo in tax category doctype query 2020-12-17 18:59:42 +05:30
pateljannat
ffbb767072 Merge branch 'track-changes-for-stock-settings-v12' of https://github.com/pateljannat/erpnext into track-changes-for-stock-settings-v12 2020-12-17 13:26:21 +05:30
pateljannat
723e4f2a22 fix: indentation 2020-12-17 13:26:11 +05:30
Deepesh Garg
a738e8ca87 Merge pull request #24128 from ruchamahabal/fix-asset-value-adjustment-v12
fix(Asset): set current asset value before calculating difference amount
2020-12-17 12:36:35 +05:30
Deepesh Garg
b0b36d2caa Merge pull request #24094 from frappe/skr04_equity
feat: separate equity tree in CoA SKR04
2020-12-17 09:15:11 +05:30
Deepesh Garg
0de091a749 Merge pull request #24159 from deepeshgarg007/template_update_v12
fix(India): Taxation fixes
2020-12-17 09:11:20 +05:30
Deepesh Garg
2d073016ee Merge branch 'version-12-hotfix' of https://github.com/frappe/erpnext into template_update_v12 2020-12-16 20:43:11 +05:30
Deepesh Garg
12f95c41b9 fix: Tax template update on customer address change 2020-12-16 20:38:54 +05:30
pateljannat
7fb22fd652 fix: removing return_taxes condition 2020-12-16 20:13:22 +05:30
pateljannat
284a19c99d fix: company filter added again 2020-12-16 20:12:38 +05:30
pateljannat
1a401b1427 fix: linter issue for translation syntax 2020-12-16 20:12:24 +05:30
pateljannat
b2db8031d5 fix: reversing previous commits and adding condition in regional controller 2020-12-16 20:12:04 +05:30
pateljannat
58fae20ff9 fix: place of supply change on address change 2020-12-16 20:10:16 +05:30
pateljannat
2cf9cc02e1 fix: place of supply change when address changes 2020-12-16 20:10:06 +05:30
Deepesh Garg
9b893643c0 fix: Tax template update on supplier 2020-12-16 20:09:39 +05:30
Marica
126de4d0e5 Merge pull request #24156 from frappe/revert-24131-version-12-hotfix
fix: Revert "fix: po_not retaining on save"
2020-12-16 18:13:16 +05:30
Marica
18635e4dd1 Revert "fix: po_not retaining on save" 2020-12-16 17:02:41 +05:30
Marica
4b75d528c9 Merge pull request #24131 from hasnain2808/version-12-hotfix
fix: po_not retaining on save
2020-12-16 16:42:57 +05:30
Mohammad Hasnain Mohsin Rajan
5220e9201b Merge branch 'version-12-hotfix' into version-12-hotfix 2020-12-16 15:29:53 +05:30
Anurag Mishra
ee7bcc0350 fix: Added TDS Payable account number and an error message
fix: Added TDS Payable account number and an error message
2020-12-16 13:49:41 +05:30
Mohammad Hasnain
1f2ec25493 fix: po_no not cleaned up on save 2020-12-15 14:48:44 +05:30
Mohammad Hasnain
e46a72b101 fix: po_no getting removed on save 2020-12-15 14:41:35 +05:30
Rucha Mahabal
b4dfba54b6 fix(Asset): set current asset value before calculating difference amount (#24119) 2020-12-15 12:50:15 +05:30
Saqib Ansari
9daf4418ea feat: add docs link to e invoice settings 2020-12-14 19:14:43 +05:30
Saqib Ansari
695e551972 fix: error handling 2020-12-14 18:59:01 +05:30
Saqib Ansari
e6a07d5508 fix: dialog is undefined 2020-12-14 17:31:31 +05:30
Saqib Ansari
d67affdfae fix: minor ux issues 2020-12-14 17:15:36 +05:30
Saqib Ansari
cde452add7 feat: show e-invoice preview before IRN generation 2020-12-14 16:51:25 +05:30
Saqib Ansari
5c74cdd0d2 fix: adjust qr code image size 2020-12-14 16:40:23 +05:30
Marica
58b1e3b866 Merge branch 'version-12-hotfix' into track-changes-for-stock-settings-v12 2020-12-14 13:14:05 +05:30
Anurag Mishra
b16d625b4f Merge pull request #24118 from deepeshgarg007/unique_tax_category_v12
fix: Validation for duplicate Tax Category
2020-12-14 12:39:08 +05:30
Saqib Ansari
96f0b0e30a Merge branch 'version-12-hotfix' into e-invoicing-version-12 2020-12-14 12:25:00 +05:30
Saqib Ansari
390cac2160 fix: sider issues 2020-12-14 12:19:30 +05:30
Saqib Ansari
64e9275c4a chore: add ack date and ack no field for print formats 2020-12-14 12:19:24 +05:30
Saqib Ansari
42b028a3ba feat: log e-invocing requests 2020-12-14 12:19:19 +05:30
Saqib Ansari
5327637b37 fix: returning condition 2020-12-14 12:19:12 +05:30
Saqib Ansari
5d6849ac7f chore: add tests 2020-12-14 12:19:06 +05:30
Saqib Ansari
57e6759088 fix: ewaybill mandatory conditions 2020-12-14 12:18:54 +05:30
Saqib Ansari
9760eb9d57 fix: eway bill test 2020-12-14 12:15:04 +05:30
Saqib Ansari
ee0b08ae9c fix: exclude intra company transactions 2020-12-14 12:14:55 +05:30
Nabin Hait
22e770353f fix: Translation issue 2020-12-14 11:00:59 +05:30
Deepesh Garg
bbce16e00c fix: Validation for duplicate Tax Category 2020-12-14 10:57:29 +05:30
pateljannat
3dbf88ba6f fix: indentation 2020-12-11 10:25:08 +05:30
Anuja P
1cd57a324c fix: Added TDS account number and an error message 2020-12-10 22:05:09 +05:30
Raffael Meyer
e8f4eb02be Merge branch 'version-12-hotfix' into skr04_equity 2020-12-10 10:52:26 +01:00
barredterra
f76b0dea44 feat: separate equity tree in CoA SKR04 2020-12-09 17:45:00 +01:00
pateljannat
3252d9d943 fix: enabling track changes for stock settings 2020-11-23 16:41:51 +05:30
pateljannat
9655edabd9 fix: enabling track changes for stock settings 2020-11-23 16:37:00 +05:30
pateljannat
2704327029 fix: enabling track changes for stock settings 2020-11-23 16:34:40 +05:30
pateljannat
3e526b8ca8 fix: enabling track changes for stock settings 2020-11-23 16:19:50 +05:30
Smit Vora
c630be6781 fix: remove unused imports 2020-11-19 19:13:06 +05:30
Smit Vora
51a153d8c2 fix: removed unused code 2020-11-19 19:03:22 +05:30
Smit Vora
707b630851 fix: add remarks to sales invoice 2020-11-19 18:42:39 +05:30
Saqib Ansari
c82c955bc2 fix: qrcode image size 2020-11-08 13:03:00 +05:30
Saqib Ansari
dc4b0921f6 feat: update timeline on einvoice actions 2020-11-07 21:15:19 +05:30
Saqib Ansari
72ed0fbbb4 fix: ewaybill could be modified after ewaybill generation 2020-11-07 21:00:38 +05:30
Saqib Ansari
020e6e980a fix: error handling 2020-11-07 19:44:37 +05:30
Saqib Ansari
70e0711893 fix: imports 2020-11-07 19:43:47 +05:30
Saqib Ansari
8693ac81a2 fix: import format_date 2020-11-07 17:53:22 +05:30
Saqib Ansari
56116f28af Merge branch 'version-12-hotfix' into e-invoicing-version-12 2020-11-07 17:49:44 +05:30
Saqib Ansari
eeb99d1b98 chore: remove fetch token from e invocie settings 2020-11-07 17:47:34 +05:30
Saqib Ansari
5d23c0ce8e feat: cess non advolem on einvoice item 2020-11-07 17:47:28 +05:30
Saqib Ansari
91580258d7 fix: patch 2020-11-05 13:56:04 +05:30
Saqib Ansari
51ddf376da fix: invalid syntax 2020-11-05 13:51:11 +05:30
Saqib Ansari
db4fec0314 fix: invalid syntax 2020-11-05 13:48:12 +05:30
Saqib Ansari
6d63a1e90a chore: remove test pincode 2020-11-05 13:18:26 +05:30
Saqib Ansari
589a49a38a feat: header & footer in GST E Invoice 2020-11-05 13:18:25 +05:30
Saqib Ansari
464fc1f087 chore: error logging 2020-11-05 13:18:25 +05:30
Saqib Ansari
e3c2f0a221 chore: remove unwanted imports 2020-11-05 13:18:25 +05:30
Saqib Ansari
77b8ced4a4 feat: generate eway bill from IRN 2020-11-05 13:18:24 +05:30
Saqib Ansari
fb9dde38f6 fix: valiations 2020-11-05 13:18:24 +05:30
Saqib Ansari
ca944316b4 fix: show/hide eway bill fields 2020-11-05 13:18:20 +05:30
Saqib Ansari
6d5a8aea9a fix: generate & cancel IRN 2020-11-05 13:17:59 +05:30
Saqib Ansari
eb9f216b40 fix: attach qrcode on irn generation 2020-11-05 13:17:59 +05:30
Saqib Ansari
63bfa30bc1 chore: clean up einvoice actions 2020-11-05 13:17:59 +05:30
Saqib Ansari
778141c569 chore: remove unwanted fuctions 2020-11-05 13:17:58 +05:30
Saqib Ansari
b7ee2a44a0 feat: cancel eway bill 2020-11-05 13:17:58 +05:30
Saqib Ansari
3f9390c077 feat: generate & cancel IRN 2020-11-05 13:17:58 +05:30
Saqib Ansari
495ac7ba6b feat: fetch and cache GSTIN details 2020-11-05 13:17:57 +05:30
Saqib Ansari
ad19268b4c fix: qr code generation 2020-11-05 13:17:57 +05:30
Saqib Ansari
54405a4b64 chore: remove unwanted fields 2020-11-05 13:17:57 +05:30
Saqib Ansari
86f87e9b53 feat: initialize GSP connector 2020-11-05 13:17:57 +05:30
Saqib Ansari
049836dff8 fix: qr code image string 2020-11-05 13:17:56 +05:30
Saqib Ansari
c313f05a8e chore: improve document name validation message 2020-11-05 13:17:56 +05:30
Saqib Ansari
b77375c72b fix: other charges calculation 2020-11-05 13:17:56 +05:30
Saqib Ansari
6c064a1f95 fix: invoice totals calculation 2020-11-05 13:17:55 +05:30
Saqib Ansari
9182c2e09d fix: patch 2020-11-05 13:17:55 +05:30
Saqib Ansari
271f35fef5 fix: einvoice field validation 2020-11-05 13:17:55 +05:30
Saqib Ansari
37e4c91ec2 fix: rename e_invoice_utils.py 2020-11-05 13:17:54 +05:30
Saqib Ansari
12d9bc3787 fix: add missing package 2020-11-05 13:17:54 +05:30
Saqib Ansari
5eb430fe51 fix: e_invoice module not found 2020-11-05 13:17:54 +05:30
Saqib Ansari
31ee8b4011 fix: error logging 2020-11-05 13:17:53 +05:30
Saqib Ansari
9363725342 fix: validations 2020-11-05 13:17:53 +05:30
Saqib Ansari
e1e3dbcae2 fix: credit note einvoice 2020-11-05 13:17:53 +05:30
Saqib Ansari
8616684c24 fix: return date 2020-11-05 13:17:52 +05:30
Saqib Ansari
90a57c1f8c fix: validate document name 2020-11-05 13:17:52 +05:30
Saqib Ansari
ba1cd74189 feat: add patch 2020-11-05 13:17:46 +05:30
Saqib Ansari
c3719b46b2 fix: add permissions on regional setup 2020-11-05 13:17:14 +05:30
Saqib Ansari
e50804fb9d fix: validations 2020-11-05 13:17:14 +05:30
Saqib Ansari
cc704044bd fix: print format 2020-11-05 13:17:14 +05:30
Saqib Ansari
e6646efef3 fix: download & upload e-invoice 2020-11-05 13:17:13 +05:30
Saqib Ansari
57dd4689e0 chore: clean up e invoice actions 2020-11-05 13:17:13 +05:30
Saqib Ansari
08b4736ee0 chore: code cleanup 2020-11-05 13:17:13 +05:30
Saqib Ansari
662a0fcfe9 fix: invalid syntax 2020-11-05 13:17:12 +05:30
Saqib Ansari
d6f3be0fc1 fix: bug 2020-11-05 13:17:12 +05:30
Saqib Ansari
154c433a86 feat: QRCode Image and E-Invoice Print Format 2020-11-05 13:17:12 +05:30
Saqib Ansari
d3a6b9ed81 chore: move einvoicing stuff to seperate folder 2020-11-05 13:17:12 +05:30
Saqib Ansari
9c00b22703 fix: fetch token if not valid 2020-11-05 13:17:11 +05:30
Saqib Ansari
b3e0f482ac chore: save signed invoice and qrcode after uplaoding irn 2020-11-05 13:17:11 +05:30
Saqib Ansari
61824d3735 fix: fn name 2020-11-05 13:17:11 +05:30
Saqib Ansari
ada41295bb chore: group e-invoicing actions 2020-11-05 13:17:11 +05:30
Saqib Ansari
08e89b88f4 feat: manual download / upload json 2020-11-05 13:17:10 +05:30
Saqib Ansari
cc43805f25 feat: cancel e-way bill before cancelling IRN 2020-11-05 13:17:10 +05:30
Saqib Ansari
ec28262988 chore: no copy on e invoice custom fields 2020-11-05 13:17:10 +05:30
Saqib Ansari
22754a9c58 fix: save e-way bill no on irn generation 2020-11-05 13:17:10 +05:30
Saqib Ansari
6a9af076e5 feat: e-way bill details in e-invoice 2020-11-05 13:17:10 +05:30
Saqib Ansari
816235e99c chore: show irn field for proper gst_category 2020-11-05 13:17:09 +05:30
Saqib Ansari
dfbdd0b2ee fix: update irn_cancelled after cancelling irn 2020-11-05 13:17:09 +05:30
Saqib Ansari
59a757b3e3 fix: do not show generate irn for invalid supply type 2020-11-05 13:17:09 +05:30
Saqib Ansari
389610fb45 fix: validation if e invoicing is disabled 2020-11-05 13:17:09 +05:30
Saqib Ansari
175b26e6e8 fix: cannot find attached key file 2020-11-05 13:17:08 +05:30
Saqib Ansari
cea1a15dcd fix: public key is required on validate 2020-11-05 13:17:08 +05:30
Saqib Ansari
7a40ad340f fix: hide cancel irn dialog on error 2020-11-05 13:17:08 +05:30
Saqib Ansari
db13eb56c4 chore: show irn cancelled check after cancellation 2020-11-05 13:17:08 +05:30
Saqib Ansari
cf2ebc0d6f fix: item discount 2020-11-05 13:17:07 +05:30
Saqib Ansari
9003718481 chore: minor fixes 2020-11-05 13:17:07 +05:30
Saqib Ansari
18666b6a74 feat: Generate & Cancel IRN from Sales Invoice 2020-11-05 13:17:07 +05:30
Saqib Ansari
395ecf2392 feat: make IRN field on regional setup 2020-11-05 13:17:07 +05:30
Saqib Ansari
221e5993a8 chore: rename schema to template & js cleanup 2020-11-05 13:17:06 +05:30
Saqib Ansari
8eda5aca09 chore: split einvoice settings and operations 2020-11-05 13:17:06 +05:30
Saqib Ansari
bdfd30760a chore: move e-invoice settings to regional 2020-11-05 13:17:06 +05:30
Saqib Ansari
418818f0ec feat: complete e-invoice schema 2020-11-05 13:17:05 +05:30
Saqib Ansari
d971917ecf feat: cancel IRN 2020-11-05 13:17:05 +05:30
Saqib Ansari
dda44bb1f5 chore: validations 2020-11-05 13:17:05 +05:30
Saqib Ansari
448ab6e3df feat: decode signed json and QR code 2020-11-05 13:17:04 +05:30
Saqib Ansari
cc3e0bf806 feat: generate IRN 2020-11-05 13:17:04 +05:30
Saqib Ansari
93b3c2ce06 feat: make e invoice from erpnext sales invoice 2020-11-05 13:17:04 +05:30
Saqib Ansari
7c427aa890 feat: decrypt json data with SEK 2020-11-05 13:17:03 +05:30
Saqib Ansari
b6509ead64 feat: AES decryption of SEK with appkey 2020-11-05 13:17:03 +05:30
Saqib Ansari
f8346ce62f chore: handle error response 2020-11-05 13:17:03 +05:30
Saqib Ansari
e73a9deb42 feat: save token and sek from auth request 2020-11-05 13:17:02 +05:30
Saqib Ansari
5669a5f618 feat: rsa encryption with public key 2020-11-05 13:17:02 +05:30
Saqib Ansari
18afbc0617 feat: read public key file 2020-11-05 13:17:02 +05:30
Saqib Ansari
f396b35622 feat: init e-invoice settings 2020-11-05 13:17:02 +05:30
266 changed files with 10638 additions and 3163 deletions

32
.flake8 Normal file
View File

@@ -0,0 +1,32 @@
[flake8]
ignore =
E121,
E126,
E127,
E128,
E203,
E225,
E226,
E231,
E241,
E251,
E261,
E265,
E302,
E303,
E305,
E402,
E501,
E741,
W291,
W292,
W293,
W391,
W503,
W504,
F403,
B007,
B950,
W191,
max-line-length = 200

26
.github/workflows/backport.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Backport
on:
pull_request_target:
types:
- closed
- labeled
jobs:
main:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout Actions
uses: actions/checkout@v2
with:
repository: "frappe/backport"
path: ./actions
ref: develop
- name: Install Actions
run: npm install --production --prefix ./actions
- name: Run backport
uses: ./actions/backport
with:
token: ${{secrets.BACKPORT_BOT_TOKEN}}
labelsToAdd: "backport"
title: "{{originalTitle}}"

View File

@@ -16,11 +16,11 @@ jobs:
include:
- name: "Python 2.7 Server Side Test"
python: 2.7
script: bench --site test_site run-tests --app erpnext --coverage
script: bench --site test_site run-tests --app erpnext
- name: "Python 3.6 Server Side Test"
python: 3.6
script: bench --site test_site run-tests --app erpnext --coverage
script: bench --site test_site run-tests --app erpnext
- name: "Python 2.7 Patch Test"
python: 2.7
@@ -40,8 +40,7 @@ install:
- cd ~
- nvm install 10
- git clone https://github.com/frappe/bench --depth 1
- pip install -e ./bench
- pip install -U frappe-bench --only-binary='all'
- git clone https://github.com/frappe/frappe --branch $TRAVIS_BRANCH --depth 1
- bench init --skip-assets --frappe-path ~/frappe --python $(which python) frappe-bench
@@ -75,8 +74,3 @@ install:
- bench get-app erpnext $TRAVIS_BUILD_DIR
- bench start &
- 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

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

View File

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

View File

@@ -910,75 +910,8 @@
},
"is_group": 1
},
"Passiva": {
"Passiva - Verbindlichkeiten": {
"root_type": "Liability",
"A - Eigenkapital": {
"account_type": "Equity",
"is_group": 1,
"I - Gezeichnetes Kapital": {
"account_type": "Equity",
"is_group": 1
},
"II - Kapitalr\u00fccklage": {
"account_type": "Equity",
"is_group": 1
},
"III - Gewinnr\u00fccklagen": {
"account_type": "Equity",
"1 - gesetzliche R\u00fccklage": {
"account_type": "Equity",
"is_group": 1
},
"2 - R\u00fccklage f. Anteile an einem herrschenden oder mehrheitlich beteiligten Unternehmen": {
"account_type": "Equity",
"is_group": 1
},
"3 - satzungsm\u00e4\u00dfige R\u00fccklagen": {
"account_type": "Equity",
"is_group": 1
},
"4 - andere Gewinnr\u00fccklagen": {
"account_type": "Equity",
"is_group": 1,
"Gewinnr\u00fccklagen aus den \u00dcbergangsvorschriften BilMoG": {
"is_group": 1,
"Gewinnr\u00fccklagen (BilMoG)": {
"account_number": "2963"
},
"Gewinnr\u00fccklagen aus Zuschreibung Sachanlageverm\u00f6gen (BilMoG)": {
"account_number": "2964"
},
"Gewinnr\u00fccklagen aus Zuschreibung Finanzanlageverm\u00f6gen (BilMoG)": {
"account_number": "2965"
},
"Gewinnr\u00fccklagen aus Aufl\u00f6sung der Sonderposten mit R\u00fccklageanteil (BilMoG)": {
"account_number": "2966"
}
},
"Latente Steuern (Gewinnr\u00fccklage Haben) aus erfolgsneutralen Verrechnungen": {
"account_number": "2967"
},
"Latente Steuern (Gewinnr\u00fccklage Soll) aus erfolgsneutralen Verrechnungen": {
"account_number": "2968"
},
"Rechnungsabgrenzungsposten (Gewinnr\u00fccklage Soll) aus erfolgsneutralen Verrechnungen": {
"account_number": "2969"
}
},
"is_group": 1
},
"IV - Gewinnvortrag/Verlustvortrag": {
"account_type": "Equity",
"is_group": 1
},
"V - Jahres\u00fcberschu\u00df/Jahresfehlbetrag": {
"account_type": "Equity",
"is_group": 1
},
"Einlagen stiller Gesellschafter": {
"account_number": "9295"
}
},
"B - R\u00fcckstellungen": {
"is_group": 1,
"1 - R\u00fcckstellungen f. Pensionen und \u00e4hnliche Verplicht.": {
@@ -1595,6 +1528,143 @@
},
"is_group": 1
},
"Passiva - Eigenkapital": {
"root_type": "Equity",
"A - Eigenkapital": {
"account_type": "Equity",
"is_group": 1,
"I - Gezeichnetes Kapital": {
"account_type": "Equity",
"is_group": 1,
"Gezeichnetes Kapital": {
"account_number": "2900",
"account_type": "Equity"
},
"Gesch\u00e4ftsguthaben der verbleibenden Mitglieder": {
"account_number": "2901"
},
"Gesch\u00e4ftsguthaben der ausscheidenden Mitglieder": {
"account_number": "2902"
},
"Gesch\u00e4ftsguthaben aus gek\u00fcndigten Gesch\u00e4ftsanteilen": {
"account_number": "2903"
},
"R\u00fcckst\u00e4ndige f\u00e4llige Einzahlungen auf Gesch\u00e4ftsanteile, vermerkt": {
"account_number": "2906"
},
"Gegenkonto R\u00fcckst\u00e4ndige f\u00e4llige Einzahlungen auf Gesch\u00e4ftsanteile, vermerkt": {
"account_number": "2907"
},
"Kapitalerh\u00f6hung aus Gesellschaftsmitteln": {
"account_number": "2908"
},
"Ausstehende Einlagen auf das gezeichnete Kapital, nicht eingefordert": {
"account_number": "2910"
}
},
"II - Kapitalr\u00fccklage": {
"account_type": "Equity",
"is_group": 1,
"Kapitalr\u00fccklage": {
"account_number": "2920"
},
"Kapitalr\u00fccklage durch Ausgabe von Anteilen \u00fcber Nennbetrag": {
"account_number": "2925"
},
"Kapitalr\u00fccklage durch Ausgabe von Schuldverschreibungen": {
"account_number": "2926"
},
"Kapitalr\u00fccklage durch Zuzahlungen gegen Gew\u00e4hrung eines Vorzugs": {
"account_number": "2927"
},
"Kapitalr\u00fccklage durch Zuzahlungen in das Eigenkapital": {
"account_number": "2928"
},
"Nachschusskapital (Gegenkonto 1299)": {
"account_number": "2929"
}
},
"III - Gewinnr\u00fccklagen": {
"account_type": "Equity",
"1 - gesetzliche R\u00fccklage": {
"account_type": "Equity",
"is_group": 1,
"Gesetzliche R\u00fccklage": {
"account_number": "2930"
}
},
"2 - R\u00fccklage f. Anteile an einem herrschenden oder mehrheitlich beteiligten Unternehmen": {
"account_type": "Equity",
"is_group": 1,
"R\u00fccklage f. Anteile an einem herrschenden oder mehrheitlich beteiligten Unternehmen": {
"account_number": "2935"
}
},
"3 - satzungsm\u00e4\u00dfige R\u00fccklagen": {
"account_type": "Equity",
"is_group": 1,
"Satzungsm\u00e4\u00dfige R\u00fccklagen": {
"account_number": "2950"
}
},
"4 - andere Gewinnr\u00fccklagen": {
"account_type": "Equity",
"is_group": 1,
"Andere Gewinnr\u00fccklagen": {
"account_number": "2960"
},
"Andere Gewinnr\u00fccklagen aus dem Erwerb eigener Anteile": {
"account_number": "2961"
},
"Eigenkapitalanteil von Wertaufholungen": {
"account_number": "2962"
},
"Gewinnr\u00fccklagen aus den \u00dcbergangsvorschriften BilMoG": {
"is_group": 1,
"Gewinnr\u00fccklagen (BilMoG)": {
"account_number": "2963"
},
"Gewinnr\u00fccklagen aus Zuschreibung Sachanlageverm\u00f6gen (BilMoG)": {
"account_number": "2964"
},
"Gewinnr\u00fccklagen aus Zuschreibung Finanzanlageverm\u00f6gen (BilMoG)": {
"account_number": "2965"
},
"Gewinnr\u00fccklagen aus Aufl\u00f6sung der Sonderposten mit R\u00fccklageanteil (BilMoG)": {
"account_number": "2966"
}
},
"Latente Steuern (Gewinnr\u00fccklage Haben) aus erfolgsneutralen Verrechnungen": {
"account_number": "2967"
},
"Latente Steuern (Gewinnr\u00fccklage Soll) aus erfolgsneutralen Verrechnungen": {
"account_number": "2968"
},
"Rechnungsabgrenzungsposten (Gewinnr\u00fccklage Soll) aus erfolgsneutralen Verrechnungen": {
"account_number": "2969"
}
},
"is_group": 1
},
"IV - Gewinnvortrag/Verlustvortrag": {
"account_type": "Equity",
"is_group": 1,
"Gewinnvortrag vor Verwendung": {
"account_number": "2970"
},
"Verlustvortrag vor Verwendung": {
"account_number": "2978"
}
},
"V - Jahres\u00fcberschu\u00df/Jahresfehlbetrag": {
"account_type": "Equity",
"is_group": 1
},
"Einlagen stiller Gesellschafter": {
"account_number": "9295"
}
}
},
"1 - Umsatzerl\u00f6se": {
"root_type": "Income",
"is_group": 1,

View File

@@ -72,16 +72,14 @@
"138-Autres subventions d'investissement (m\u00eame ventilation que celle du compte 131)": {},
"139-Subventions d'investissement inscrites au compte de r\u00e9sultat": {
"1391-Subventions d'\u00e9quipement": {
"13911-Subventions d'\u00e9quipement": {
"13911-Etat": {},
"13912-R\u00e9gions": {},
"13913-D\u00e9partements": {},
"13914-Communes": {},
"13915-Collectivit\u00e9s publiques": {},
"13916-Entreprises publiques": {},
"13917-Entreprises et organismes priv\u00e9s": {},
"13918-Autres": {}
}
"13911-Etat": {},
"13912-R\u00e9gions": {},
"13913-D\u00e9partements": {},
"13914-Communes": {},
"13915-Collectivit\u00e9s publiques": {},
"13916-Entreprises publiques": {},
"13917-Entreprises et organismes priv\u00e9s": {},
"13918-Autres": {}
},
"1398-Autres subventions d'investissement (m\u00eame ventilation que celle du compte 1391)": {}
}
@@ -536,8 +534,8 @@
"3312-Produits en cours P2": {}
},
"335-Travaux en cours": {
"Travaux en cours T1": {},
"Travaux en cours T2": {}
"3351-Travaux en cours T1": {},
"3352-Travaux en cours T2": {}
}
},
"34-En-cours de production de services": {
@@ -595,7 +593,9 @@
"371-Marchandises (ou groupe) A": {},
"372-Marchandises (ou groupe) B": {}
},
"38-Stocks en voie d'acheminement, mis en d\u00e9p\u00f4t ou donn\u00e9s en consignation (en cas d'inventaire permanent en comptabilit\u00e9 g\u00e9n\u00e9rale)": {},
"38-Stocks en voie d'acheminement, mis en d\u00e9p\u00f4t ou donn\u00e9s en consignation (en cas d'inventaire permanent en comptabilit\u00e9 g\u00e9n\u00e9rale)": {
"account_type": "Stock"
},
"39-D\u00e9pr\u00e9ciations des stocks et en-cours": {
"391-D\u00e9pr\u00e9ciations des mati\u00e8res premi\u00e8res (et fournitures)": {
"3911-Mati\u00e8res (ou groupe) A": {},

View File

@@ -245,6 +245,9 @@ def get():
"account_number": "2200"
},
_("Duties and Taxes"): {
_("TDS Payable"): {
"account_number": "2310"
},
"account_type": "Tax",
"is_group": 1,
"account_number": "2300"

View File

@@ -41,6 +41,8 @@ frappe.ui.form.on('Accounting Dimension', {
});
});
}
frm.toggle_enable('document_type', frm.doc.__islocal);
},
document_type: function(frm) {

View File

@@ -29,6 +29,16 @@ class AccountingDimension(Document):
if exists and self.is_new():
frappe.throw("Document Type already used as a dimension")
if not self.is_new():
self.validate_document_type_change()
def validate_document_type_change(self):
doctype_before_save = frappe.db.get_value("Accounting Dimension", self.name, "document_type")
if doctype_before_save != self.document_type:
message = _("Cannot change Reference Document Type.")
message += _("Please create a new Accounting Dimension if required.")
frappe.throw(message)
def after_insert(self):
if frappe.flags.in_test:
make_dimension_in_accounting_doctypes(doc=self)

View File

@@ -109,5 +109,4 @@ erpnext.integrations.refreshPlaidLink = class refreshPlaidLink {
plaid_success(token, response) {
frappe.show_alert({ message: __('Plaid Link Updated'), indicator: 'green' });
}
};
};

View File

@@ -21,6 +21,14 @@ frappe.ui.form.on("Bank Reconciliation", {
};
});
frm.set_query("bank_account", function() {
return {
"filters": {
"is_company_account": 1
}
};
});
frm.set_value("from_date", frappe.datetime.month_start());
frm.set_value("to_date", frappe.datetime.month_end());
},

View File

@@ -271,6 +271,7 @@
"label": "Debit",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -304,6 +305,7 @@
"label": "Credit",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -632,6 +634,7 @@
"label": "Allocated Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -731,6 +734,7 @@
"label": "Unallocated Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -755,7 +759,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2019-05-11 05:27:55.244721",
"modified": "2021-11-26 12:44:55.244721",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Transaction",

View File

@@ -7,19 +7,19 @@ DEFAULT_MAPPERS = [
'section_header': 'Cash flows from operating activities',
'section_leader': 'Adjustments for',
'section_name': 'Operating Activities',
'position': 0,
'position': 1,
'section_subtotal': 'Cash generated from operations',
},
{
'doctype': 'Cash Flow Mapper',
'position': 1,
'position': 2,
'section_footer': 'Net cash used in investing activities',
'section_header': 'Cash flows from investing activities',
'section_name': 'Investing Activities'
},
{
'doctype': 'Cash Flow Mapper',
'position': 2,
'position': 3,
'section_footer': 'Net cash used in financing activites',
'section_header': 'Cash flows from financing activities',
'section_name': 'Financing Activities',

View File

@@ -81,10 +81,11 @@ class ExchangeRateRevaluation(Document):
sum(debit) - sum(credit) as balance
from `tabGL Entry`
where account in (%s)
group by account, party_type, party
and posting_date <= %s
group by account, NULLIF(party_type,''), NULLIF(party,'')
having sum(debit) != sum(credit)
order by account
""" % ', '.join(['%s']*len(accounts)), tuple(accounts), as_dict=1)
""" % (', '.join(['%s']*len(accounts)), '%s'), tuple(accounts + [self.posting_date]), as_dict=1)
return account_details
@@ -124,9 +125,9 @@ class ExchangeRateRevaluation(Document):
"party_type": d.get("party_type"),
"party": d.get("party"),
"account_currency": d.get("account_currency"),
"balance": d.get("balance_in_account_currency"),
dr_or_cr: abs(d.get("balance_in_account_currency")),
"exchange_rate":d.get("new_exchange_rate"),
"balance": flt(d.get("balance_in_account_currency"), d.precision("balance_in_account_currency")),
dr_or_cr: flt(abs(d.get("balance_in_account_currency")), d.precision("balance_in_account_currency")),
"exchange_rate": flt(d.get("new_exchange_rate"), d.precision("new_exchange_rate")),
"reference_type": "Exchange Rate Revaluation",
"reference_name": self.name,
})
@@ -135,9 +136,9 @@ class ExchangeRateRevaluation(Document):
"party_type": d.get("party_type"),
"party": d.get("party"),
"account_currency": d.get("account_currency"),
"balance": d.get("balance_in_account_currency"),
reverse_dr_or_cr: abs(d.get("balance_in_account_currency")),
"exchange_rate": d.get("current_exchange_rate"),
"balance": flt(d.get("balance_in_account_currency"), d.precision("balance_in_account_currency")),
reverse_dr_or_cr: flt(abs(d.get("balance_in_account_currency")), d.precision("balance_in_account_currency")),
"exchange_rate": flt(d.get("current_exchange_rate"), d.precision("current_exchange_rate")),
"reference_type": "Exchange Rate Revaluation",
"reference_name": self.name
})
@@ -166,9 +167,9 @@ def get_account_details(account, company, posting_date, party_type=None, party=N
account_details = {}
company_currency = erpnext.get_company_currency(company)
balance = get_balance_on(account, party_type=party_type, party=party, in_account_currency=False)
balance = get_balance_on(account, date=posting_date, party_type=party_type, party=party, in_account_currency=False)
if balance:
balance_in_account_currency = get_balance_on(account, party_type=party_type, party=party)
balance_in_account_currency = get_balance_on(account, date=posting_date, party_type=party_type, party=party)
current_exchange_rate = balance / balance_in_account_currency if balance_in_account_currency else 0
new_exchange_rate = get_exchange_rate(account_currency, company_currency, posting_date)
new_balance_in_base_currency = balance_in_account_currency * new_exchange_rate

View File

@@ -3,11 +3,13 @@
from __future__ import unicode_literals
import frappe, unittest
import unittest
import frappe
from frappe.utils import now_datetime
from erpnext.accounts.doctype.fiscal_year.fiscal_year import FiscalYearIncorrectDate
test_records = frappe.get_test_records('Fiscal Year')
test_ignore = ["Company"]
class TestFiscalYear(unittest.TestCase):
@@ -23,3 +25,29 @@ class TestFiscalYear(unittest.TestCase):
})
self.assertRaises(FiscalYearIncorrectDate, fy.insert)
def test_record_generator():
test_records = [
{
"doctype": "Fiscal Year",
"year": "_Test Short Fiscal Year 2011",
"is_short_year": 1,
"year_end_date": "2011-04-01",
"year_start_date": "2011-12-31"
}
]
start = 2012
end = now_datetime().year + 5
for year in range(start, end):
test_records.append({
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year {}".format(year),
"year_start_date": "{}-01-01".format(year),
"year_end_date": "{}-12-31".format(year)
})
return test_records
test_records = test_record_generator()

View File

@@ -1,69 +0,0 @@
[
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2012",
"year_end_date": "2012-12-31",
"year_start_date": "2012-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2013",
"year_end_date": "2013-12-31",
"year_start_date": "2013-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2014",
"year_end_date": "2014-12-31",
"year_start_date": "2014-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2015",
"year_end_date": "2015-12-31",
"year_start_date": "2015-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2016",
"year_end_date": "2016-12-31",
"year_start_date": "2016-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2017",
"year_end_date": "2017-12-31",
"year_start_date": "2017-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2018",
"year_end_date": "2018-12-31",
"year_start_date": "2018-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2019",
"year_end_date": "2019-12-31",
"year_start_date": "2019-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2020",
"year_end_date": "2020-12-31",
"year_start_date": "2020-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2021",
"year_end_date": "2021-12-31",
"year_start_date": "2021-01-01"
},
{
"doctype": "Fiscal Year",
"year": "_Test Short Fiscal Year 2021",
"is_short_year": 1,
"year_end_date": "2021-12-31",
"year_start_date": "2021-04-01"
}
]

View File

@@ -97,8 +97,7 @@ class GLEntry(Document):
def check_pl_account(self):
if self.is_opening=='Yes' and \
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss" and \
self.voucher_type not in ['Purchase Invoice', 'Sales Invoice']:
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss":
frappe.throw(_("{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry")
.format(self.voucher_type, self.voucher_no, self.account))
@@ -138,7 +137,8 @@ class GLEntry(Document):
frappe.throw(_("{0} {1}: Cost Center {2} does not belong to Company {3}")
.format(self.voucher_type, self.voucher_no, self.cost_center, self.company))
if not self.flags.from_repost and self.cost_center and _check_is_group():
if not self.flags.from_repost and not self.voucher_type == 'Period Closing Voucher' \
and self.cost_center and _check_is_group():
frappe.throw(_("""{0} {1}: Cost Center {2} is a group cost center and group cost centers cannot
be used in transactions""").format(self.voucher_type, self.voucher_no, frappe.bold(self.cost_center)))
@@ -293,4 +293,8 @@ def rename_temporarily_named_docs(doctype):
oldname = doc.name
set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc)
newname = doc.name
frappe.db.sql("""UPDATE `tab{}` SET name = %s, to_rename = 0 where name = %s""".format(doctype), (newname, oldname))
frappe.db.sql(
"UPDATE `tab{}` SET name = %s, to_rename = 0 where name = %s".format(doctype),
(newname, oldname),
auto_commit=True
)

View File

@@ -29,7 +29,11 @@ class JournalEntry(AccountsController):
self.validate_entries_for_advance()
self.validate_multi_currency()
self.set_amounts_in_company_currency()
self.validate_total_debit_and_credit()
# Do not validate while importing via data import
if not frappe.flags.in_import:
self.validate_total_debit_and_credit()
self.validate_against_jv()
self.validate_reference_doc()
self.set_against_account()
@@ -207,11 +211,11 @@ class JournalEntry(AccountsController):
if d.reference_type=="Journal Entry":
account_root_type = frappe.db.get_value("Account", d.account, "root_type")
if account_root_type == "Asset" and flt(d.debit) > 0:
frappe.throw(_("For {0}, only credit accounts can be linked against another debit entry")
.format(d.account))
frappe.throw(_("Row #{0}: For {1}, you can select reference document only if account gets credited")
.format(d.idx, d.account))
elif account_root_type == "Liability" and flt(d.credit) > 0:
frappe.throw(_("For {0}, only debit accounts can be linked against another credit entry")
.format(d.account))
frappe.throw(_("Row #{0}: For {1}, you can select reference document only if account gets debited")
.format(d.idx, d.account))
if d.reference_name == self.name:
frappe.throw(_("You can not enter current voucher in 'Against Journal Entry' column"))
@@ -1047,4 +1051,4 @@ def make_reverse_journal_entry(source_name, target_doc=None):
},
}, target_doc)
return doclist
return doclist

View File

@@ -38,7 +38,10 @@ def get_loyalty_details(customer, loyalty_program, expiry_date=None, company=Non
@frappe.whitelist()
def get_loyalty_program_details_with_points(customer, loyalty_program=None, expiry_date=None, company=None, silent=False, include_expired_entry=False, current_transaction_amount=0):
lp_details = get_loyalty_program_details(customer, loyalty_program, company=company, silent=silent)
loyalty_program = frappe.get_doc("Loyalty Program", loyalty_program)
loyalty_program_name = loyalty_program or lp_details.loyalty_program
if not loyalty_program_name: return
loyalty_program = frappe.get_doc("Loyalty Program", loyalty_program_name)
lp_details.update(get_loyalty_details(customer, loyalty_program.name, expiry_date, company, include_expired_entry))
# sort collection rule, first item on list will be lowest min_spent

View File

@@ -187,7 +187,7 @@ frappe.ui.form.on('Payment Entry', {
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.paid_from_account_currency != frm.doc.paid_to_account_currency
&& frm.doc.base_paid_amount != frm.doc.base_received_amount
));
@@ -386,6 +386,8 @@ frappe.ui.form.on('Payment Entry', {
set_account_currency_and_balance: function(frm, account, currency_field,
balance_field, callback_function) {
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
if (frm.doc.posting_date && account) {
frappe.call({
method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_account_details",
@@ -412,6 +414,14 @@ frappe.ui.form.on('Payment Entry', {
if(!frm.doc.paid_amount && frm.doc.received_amount)
frm.events.received_amount(frm);
if (frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency
&& frm.doc.paid_amount != frm.doc.received_amount) {
if (company_currency != frm.doc.paid_from_account_currency &&
frm.doc.payment_type == "Pay") {
frm.doc.paid_amount = frm.doc.received_amount;
}
}
}
},
() => {
@@ -583,12 +593,22 @@ frappe.ui.form.on('Payment Entry', {
{fieldtype:"Column Break"},
{fieldtype:"Float", label: __("Less Than Amount"), fieldname:"outstanding_amt_less_than"},
{fieldtype:"Section Break"},
{fieldtype:"Link", label:__("Cost Center"), fieldname:"cost_center", options:"Cost Center",
"get_query": function() {
return {
"filters": {"company": frm.doc.company}
}
}
},
{fieldtype:"Column Break"},
{fieldtype:"Section Break"},
{fieldtype:"Check", label: __("Allocate Payment Amount"), fieldname:"allocate_payment_amount", default:1},
];
frappe.prompt(fields, function(filters){
frappe.flags.allocate_payment_amount = true;
frm.events.validate_filters_data(frm, filters);
frm.doc.cost_center = filters.cost_center;
frm.events.get_outstanding_documents(frm, filters);
}, __("Filters"), __("Get Outstanding Documents"));
},
@@ -1031,18 +1051,10 @@ frappe.ui.form.on('Payment Entry', {
},
callback: function(r, rt) {
if(r.message) {
frappe.run_serially([
() => {
frm.set_value("paid_from_account_balance", r.message.paid_from_account_balance);
frm.set_value("paid_to_account_balance", r.message.paid_to_account_balance);
frm.set_value("party_balance", r.message.party_balance);
},
() => {
if(frm.doc.payment_type != "Internal") {
frm.clear_table("references");
}
}
]);
}
}

View File

@@ -531,7 +531,8 @@
"fieldtype": "Data",
"hidden": 1,
"label": "Title",
"print_hide": 1
"print_hide": 1,
"read_only": 1
},
{
"depends_on": "party",
@@ -575,7 +576,7 @@
}
],
"is_submittable": 1,
"modified": "2019-11-06 12:59:43.151721",
"modified": "2021-03-10 13:05:16.958866",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",
@@ -619,4 +620,4 @@
"sort_order": "DESC",
"title_field": "title",
"track_changes": 1
}
}

View File

@@ -441,6 +441,10 @@ class PaymentEntry(AccountsController):
.format(total_negative_outstanding), InvalidPaymentEntry)
def set_title(self):
if frappe.flags.in_import and self.title:
# do not set title dynamically if title exists during data import.
return
if self.payment_type in ("Receive", "Pay"):
self.title = self.party
else:

View File

@@ -88,18 +88,18 @@ class PaymentReconciliation(Document):
voucher_type = ('Sales Invoice'
if self.party_type == 'Customer' else "Purchase Invoice")
return frappe.db.sql(""" SELECT `tab{doc}`.name as reference_name, %(voucher_type)s as reference_type,
(sum(`tabGL Entry`.{dr_or_cr}) - sum(`tabGL Entry`.{reconciled_dr_or_cr})) as amount,
return frappe.db.sql(""" SELECT doc.name as reference_name, %(voucher_type)s as reference_type,
(sum(gl.{dr_or_cr}) - sum(gl.{reconciled_dr_or_cr})) as amount,
account_currency as currency
FROM `tab{doc}`, `tabGL Entry`
FROM `tab{doc}` doc, `tabGL Entry` gl
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
and `tabGL Entry`.party_type = %(party_type)s and `tabGL Entry`.account = %(account)s
GROUP BY `tab{doc}`.name
(doc.name = gl.against_voucher or doc.name = gl.voucher_no)
and doc.{party_type_field} = %(party)s
and doc.is_return = 1 and ifnull(doc.return_against, "") = ""
and gl.against_voucher_type = %(voucher_type)s
and doc.docstatus = 1 and gl.party = %(party)s
and gl.party_type = %(party_type)s and gl.account = %(account)s
GROUP BY doc.name
Having
amount > 0
""".format(
@@ -303,4 +303,4 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
]
})
jv.submit()
jv.submit()

View File

@@ -1,283 +1,95 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "ACC-PCV-.YYYY.-.#####",
"beta": 0,
"creation": "2013-01-10 16:34:07",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 0,
"engine": "InnoDB",
"actions": [],
"autoname": "ACC-PCV-.YYYY.-.#####",
"creation": "2013-01-10 16:34:07",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"transaction_date",
"posting_date",
"fiscal_year",
"amended_from",
"company",
"cost_center_wise_pnl",
"column_break1",
"closing_account_head",
"remarks"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "transaction_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": "Transaction Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "transaction_date",
"oldfieldtype": "Date",
"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,
"translatable": 0,
"unique": 0
},
"fieldname": "transaction_date",
"fieldtype": "Date",
"label": "Transaction Date",
"oldfieldname": "transaction_date",
"oldfieldtype": "Date"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "posting_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": "Posting Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "posting_date",
"oldfieldtype": "Date",
"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,
"translatable": 0,
"unique": 0
},
"fieldname": "posting_date",
"fieldtype": "Date",
"label": "Posting Date",
"oldfieldname": "posting_date",
"oldfieldtype": "Date",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "fiscal_year",
"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": 1,
"label": "Closing Fiscal Year",
"length": 0,
"no_copy": 0,
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
"options": "Fiscal Year",
"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,
"translatable": 0,
"unique": 0
},
"fieldname": "fiscal_year",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Closing Fiscal Year",
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
"options": "Fiscal Year",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Amended From",
"length": 0,
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"options": "Period Closing Voucher",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "amended_from",
"fieldtype": "Link",
"ignore_user_permissions": 1,
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"options": "Period Closing Voucher",
"read_only": 1
},
{
"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": 0,
"in_standard_filter": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"oldfieldname": "company",
"oldfieldtype": "Select",
"options": "Company",
"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,
"translatable": 0,
"unique": 0
},
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Select",
"options": "Company",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break1",
"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,
"oldfieldtype": "Column Break",
"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,
"translatable": 0,
"unique": 0
},
"fieldname": "column_break1",
"fieldtype": "Column Break",
"oldfieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "The account head under Liability or Equity, in which Profit/Loss will be booked",
"fieldname": "closing_account_head",
"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": "Closing Account Head",
"length": 0,
"no_copy": 0,
"oldfieldname": "closing_account_head",
"oldfieldtype": "Link",
"options": "Account",
"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,
"translatable": 0,
"unique": 0
},
"description": "The account head under Liability or Equity, in which Profit/Loss will be booked",
"fieldname": "closing_account_head",
"fieldtype": "Link",
"label": "Closing Account Head",
"oldfieldname": "closing_account_head",
"oldfieldtype": "Link",
"options": "Account",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "remarks",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Remarks",
"length": 0,
"no_copy": 0,
"oldfieldname": "remarks",
"oldfieldtype": "Small Text",
"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,
"translatable": 0,
"unique": 0
"fieldname": "remarks",
"fieldtype": "Small Text",
"label": "Remarks",
"oldfieldname": "remarks",
"oldfieldtype": "Small Text",
"reqd": 1
},
{
"default": "0",
"fieldname": "cost_center_wise_pnl",
"fieldtype": "Check",
"label": "Book Cost Center-Wise Profit/Loss"
}
],
"has_web_view": 0,
@@ -291,60 +103,43 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-21 16:15:49.089450",
"modified": "2021-05-20 15:27:37.210458",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Period Closing Voucher",
"owner": "jai@webnotestech.com",
"permissions": [
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"submit": 1,
"write": 1
},
},
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"submit": 1,
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "posting_date, fiscal_year",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "closing_account_head",
"track_changes": 0,
"track_seen": 0,
"track_views": 0
],
"search_fields": "posting_date, fiscal_year",
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "closing_account_head"
}

View File

@@ -50,63 +50,96 @@ class PeriodClosingVoucher(AccountsController):
def make_gl_entries(self):
gl_entries = []
net_pl_balance = 0
dimension_fields = ['t1.cost_center']
net_pl_balance = 0
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)
pl_accounts = self.get_pl_balances()
for acc in pl_accounts:
if flt(acc.balance_in_company_currency):
if flt(acc.bal_in_company_currency):
gl_entries.append(self.get_gl_dict({
"account": acc.account,
"cost_center": acc.cost_center,
"account_currency": acc.account_currency,
"debit_in_account_currency": abs(flt(acc.balance_in_account_currency)) \
if flt(acc.balance_in_account_currency) < 0 else 0,
"debit": abs(flt(acc.balance_in_company_currency)) \
if flt(acc.balance_in_company_currency) < 0 else 0,
"credit_in_account_currency": abs(flt(acc.balance_in_account_currency)) \
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
"debit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) < 0 else 0,
"debit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) < 0 else 0,
"credit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) > 0 else 0,
"credit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) > 0 else 0
}, item=acc))
net_pl_balance += flt(acc.balance_in_company_currency)
net_pl_balance += flt(acc.bal_in_company_currency)
if net_pl_balance:
cost_center = frappe.db.get_value("Company", self.company, "cost_center")
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)
if self.cost_center_wise_pnl:
costcenter_wise_gl_entries = self.get_costcenter_wise_pnl_gl_entries(pl_accounts)
gl_entries += costcenter_wise_gl_entries
else:
gl_entry = self.get_pnl_gl_entry(net_pl_balance)
gl_entries.append(gl_entry)
from erpnext.accounts.general_ledger import make_gl_entries
make_gl_entries(gl_entries)
def get_pnl_gl_entry(self, net_pl_balance):
cost_center = frappe.db.get_value("Company", self.company, "cost_center")
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
})
self.update_default_dimensions(gl_entry)
return gl_entry
def get_costcenter_wise_pnl_gl_entries(self, pl_accounts):
company_cost_center = frappe.db.get_value("Company", self.company, "cost_center")
gl_entries = []
for acc in pl_accounts:
if flt(acc.bal_in_company_currency):
gl_entry = self.get_gl_dict({
"account": self.closing_account_head,
"cost_center": acc.cost_center or company_cost_center,
"account_currency": acc.account_currency,
"debit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) > 0 else 0,
"debit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) > 0 else 0,
"credit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) < 0 else 0,
"credit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) < 0 else 0
}, item=acc)
self.update_default_dimensions(gl_entry)
gl_entries.append(gl_entry)
return gl_entries
def update_default_dimensions(self, gl_entry):
if not self.accounting_dimensions:
self.accounting_dimensions = get_accounting_dimensions()
_, default_dimensions = get_dimension_filters()
for dimension in self.accounting_dimensions:
gl_entry.update({
dimension: default_dimensions.get(self.company, {}).get(dimension)
})
def get_pl_balances(self):
"""Get balance for dimension-wise pl accounts"""
dimension_fields = ['t1.cost_center']
self.accounting_dimensions = get_accounting_dimensions()
for dimension in self.accounting_dimensions:
dimension_fields.append('t1.{0}'.format(dimension))
def get_pl_balances(self, dimension_fields):
"""Get balance for pl accounts"""
return frappe.db.sql("""
select
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
sum(t1.debit_in_account_currency) - sum(t1.credit_in_account_currency) as bal_in_account_currency,
sum(t1.debit) - sum(t1.credit) as bal_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

View File

@@ -8,6 +8,7 @@ import frappe
from frappe.utils import flt, today
from erpnext.accounts.utils import get_fiscal_year, now
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
class TestPeriodClosingVoucher(unittest.TestCase):
def test_closing_entry(self):
@@ -65,6 +66,58 @@ class TestPeriodClosingVoucher(unittest.TestCase):
self.assertEqual(gle_for_random_expense_account[0].amount_in_account_currency,
-1*random_expense_account[0].balance_in_account_currency)
def test_cost_center_wise_posting(self):
frappe.db.sql("delete from `tabGL Entry` where company='Test PCV Company'")
company = create_company()
surplus_account = create_account()
cost_center1 = create_cost_center("Test Cost Center 1")
cost_center2 = create_cost_center("Test Cost Center 2")
create_sales_invoice(
company=company,
cost_center=cost_center1,
income_account="Sales - TPC",
expense_account="Cost of Goods Sold - TPC",
rate=400,
debit_to="Debtors - TPC"
)
create_sales_invoice(
company=company,
cost_center=cost_center2,
income_account="Sales - TPC",
expense_account="Cost of Goods Sold - TPC",
rate=200,
debit_to="Debtors - TPC"
)
pcv = frappe.get_doc({
"transaction_date": today(),
"posting_date": today(),
"fiscal_year": get_fiscal_year(today())[0],
"company": "Test PCV Company",
"cost_center_wise_pnl": 1,
"closing_account_head": surplus_account,
"remarks": "Test",
"doctype": "Period Closing Voucher"
})
pcv.insert()
pcv.submit()
expected_gle = (
('Sales - TPC', 200.0, 0.0, cost_center2),
(surplus_account, 0.0, 200.0, cost_center2),
('Sales - TPC', 400.0, 0.0, cost_center1),
(surplus_account, 0.0, 400.0, cost_center1)
)
pcv_gle = frappe.db.sql("""
select account, debit, credit, cost_center from `tabGL Entry` where voucher_no=%s
""", (pcv.name))
self.assertTrue(pcv_gle, expected_gle)
def make_period_closing_voucher(self):
pcv = frappe.get_doc({
"doctype": "Period Closing Voucher",
@@ -80,6 +133,38 @@ class TestPeriodClosingVoucher(unittest.TestCase):
return pcv
def create_company():
company = frappe.get_doc({
'doctype': 'Company',
'company_name': "Test PCV Company",
'country': 'United States',
'default_currency': 'USD'
})
company.insert(ignore_if_duplicate = True)
return company.name
def create_account():
account = frappe.get_doc({
"account_name": "Reserve and Surplus",
"is_group": 0,
"company": "Test PCV Company",
"root_type": "Liability",
"report_type": "Balance Sheet",
"account_currency": "USD",
"parent_account": "Current Liabilities - TPC",
"doctype": "Account"
}).insert(ignore_if_duplicate = True)
return account.name
def create_cost_center(cc_name):
costcenter = frappe.get_doc({
"company": "Test PCV Company",
"cost_center_name": cc_name,
"doctype": "Cost Center",
"parent_cost_center": "Test PCV Company - TPC"
})
costcenter.insert(ignore_if_duplicate = True)
return costcenter.name
test_dependencies = ["Customer", "Cost Center"]
test_records = frappe.get_test_records("Period Closing Voucher")

View File

@@ -131,7 +131,7 @@ class PricingRule(Document):
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):
throw(_("Max discount allowed for item: {0} is {1}%").format(self.item_code, max_discount))
throw(_("Max discount allowed for item: {0} is {1}%").format(d.item_code, max_discount))
def validate_price_list_with_currency(self):
if self.currency and self.for_price_list:
@@ -330,13 +330,17 @@ def get_pricing_rule_details(args, pricing_rule):
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)
or (pricing_rule.margin_type == 'Percentage')):
item_details.margin_type = pricing_rule.margin_type
item_details.margin_rate_or_amount = pricing_rule.margin_rate_or_amount
else:
item_details.margin_type = None
item_details.margin_rate_or_amount = 0.0
for apply_on in ['Percentage', 'Amount']:
if pricing_rule.margin_type != apply_on:
continue
field = 'margin_rate_or_amount'
if field not in item_details:
item_details.setdefault(field, 0)
item_details.setdefault('margin_type', apply_on)
item_details[field] += (pricing_rule.get(field, 0)
if pricing_rule else args.get(field, 0))
if pricing_rule.rate_or_discount == 'Rate':
pricing_rule_rate = 0.0

View File

@@ -467,7 +467,7 @@ def apply_pricing_rule_on_transaction(doc):
if not d.get(pr_field): continue
if d.validate_applied_rule and doc.get(field) < d.get(pr_field):
if d.validate_applied_rule and doc.get(field) is not None and doc.get(field) < d.get(pr_field):
frappe.msgprint(_("User has not applied rule on the invoice {0}")
.format(doc.name))
else:

View File

@@ -509,7 +509,7 @@ frappe.ui.form.on("Purchase Invoice", {
},
onload: function(frm) {
if(frm.doc.__onload) {
if(frm.doc.__onload && frm.is_new()) {
if(frm.doc.supplier) {
frm.doc.apply_tds = frm.doc.__onload.supplier_tds ? 1 : 0;
}

View File

@@ -247,8 +247,15 @@ class PurchaseInvoice(BuyingController):
else:
item.expense_account = stock_not_billed_account
elif item.is_fixed_asset and not is_cwip_accounting_enabled(asset_category):
item.expense_account = get_asset_category_account('fixed_asset_account', item=item.item_code,
asset_category_account = get_asset_category_account('fixed_asset_account', item=item.item_code,
company = self.company)
if not asset_category_account:
form_link = get_link_to_form('Asset Category', asset_category)
throw(
_("Please set Fixed Asset Account in {} against {}.").format(form_link, self.company),
title=_("Missing Account")
)
item.expense_account = asset_category_account
elif item.is_fixed_asset and item.pr_detail:
item.expense_account = asset_received_but_not_billed
elif not item.expense_account and for_validate:

View File

@@ -43,7 +43,7 @@
}
],
"grand_total": 0,
"naming_series": "_T-BILL",
"naming_series": "T-PINV-",
"taxes": [
{
"account_head": "_Test Account Shipping Charges - _TC",
@@ -168,7 +168,7 @@
}
],
"grand_total": 0,
"naming_series": "_T-Purchase Invoice-",
"naming_series": "T-PINV-",
"taxes": [
{
"account_head": "_Test Account Shipping Charges - _TC",

View File

@@ -153,8 +153,8 @@ 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
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)
@@ -394,6 +394,14 @@ def get_pricing_rule_data(doc):
between ifnull(valid_from, '2000-01-01') and ifnull(valid_upto, '2500-12-31')
order by priority desc, name desc""",
{'company': doc.company, 'price_list': doc.selling_price_list, 'date': nowdate()}, as_dict=1)
for row in pricing_rules:
if row.apply_on:
doctype = "Pricing Rule " + row.apply_on
apply_on = frappe.scrub(row.apply_on)
row[apply_on] = [d.get(apply_on) for d in frappe.get_all(doctype,
filters = {"parent": row.name}, fields = [apply_on])]
return pricing_rules
@@ -434,10 +442,10 @@ def make_invoice(pos_profile, doc_list={}, email_queue_list={}, customers_list={
name_list.append(name)
email_queue = make_email_queue(email_queue_list)
if isinstance(pos_profile, string_types):
pos_profile = json.loads(pos_profile)
customers = get_customers_list(pos_profile)
return {
'invoice': name_list,

View File

@@ -1,6 +1,8 @@
{% include "erpnext/regional/india/taxes.js" %}
{% include "erpnext/regional/india/e_invoice/einvoice.js" %}
erpnext.setup_auto_gst_taxation('Sales Invoice');
erpnext.setup_einvoice_actions('Sales Invoice')
frappe.ui.form.on("Sales Invoice", {
setup: function(frm) {
@@ -12,6 +14,16 @@ frappe.ui.form.on("Sales Invoice", {
};
});
frm.set_query('transporter_address', function (doc) {
return {
query: 'frappe.contacts.doctype.address.address.address_query',
filters: {
link_doctype: 'Supplier',
link_name: doc.transporter
}
}
});
frm.set_query('driver', function(doc) {
return {
filters: {

View File

@@ -825,45 +825,43 @@ frappe.ui.form.on('Sales Invoice', {
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.create_invoice_discounting",
frm: frm
});
}
})
},
frappe.ui.form.on('Sales Invoice Timesheet', {
calculate_timesheet_totals: function(frm) {
frm.set_value("total_billing_amount",
frm.doc.timesheets.reduce((a, b) => a + (b["billing_amount"] || 0.0), 0.0));
frm.set_value("total_billing_hours",
frm.doc.timesheets.reduce((a, b) => a + (b["billing_hours"] || 0.0), 0.0));
}
});
frappe.ui.form.on("Sales Invoice Timesheet", {
time_sheet: function(frm, cdt, cdn){
var d = locals[cdt][cdn];
if(d.time_sheet) {
frappe.call({
method: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet_data",
args: {
'name': d.time_sheet,
'project': frm.doc.project || null
"name": d.time_sheet,
"project": frm.doc.project || null
},
callback: function(r, rt) {
callback: function(r) {
if(r.message){
data = r.message;
frappe.model.set_value(cdt, cdn, "billing_hours", data.billing_hours);
frappe.model.set_value(cdt, cdn, "billing_amount", data.billing_amount);
frappe.model.set_value(cdt, cdn, "timesheet_detail", data.timesheet_detail);
calculate_total_billing_amount(frm)
frappe.model.set_value(cdt, cdn, "billing_hours", r.message.billing_hours);
frappe.model.set_value(cdt, cdn, "billing_amount", r.message.billing_amount);
frappe.model.set_value(cdt, cdn, "timesheet_detail", r.message.timesheet_detail);
frm.trigger("calculate_timesheet_totals");
}
}
})
});
}
},
timesheets_remove: function(frm, cdt, cdn) {
frm.trigger("calculate_timesheet_totals");
}
})
});
var calculate_total_billing_amount = function(frm) {
var doc = frm.doc;
doc.total_billing_amount = 0.0
if(doc.timesheets) {
$.each(doc.timesheets, function(index, data){
doc.total_billing_amount += data.billing_amount
})
}
refresh_field('total_billing_amount')
}
var select_loyalty_program = function(frm, loyalty_programs) {
var dialog = new frappe.ui.Dialog({

View File

@@ -69,6 +69,7 @@
"time_sheet_list",
"timesheets",
"total_billing_amount",
"total_billing_hours",
"section_break_30",
"total_qty",
"base_total",
@@ -1564,12 +1565,20 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"default": "0",
"fieldname": "total_billing_hours",
"fieldtype": "Float",
"label": "Total Billing Hours",
"print_hide": 1,
"read_only": 1
}
],
"icon": "fa fa-file-text",
"idx": 181,
"is_submittable": 1,
"modified": "2020-07-01 12:41:29.484813",
"modified": "2021-07-26 14:01:34.605644",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe, erpnext
import frappe.defaults
from frappe.utils import cint, flt, add_months, today, date_diff, getdate, add_days, cstr, nowdate
from frappe.utils import cint, flt, getdate, add_days, cstr, nowdate, formatdate
from frappe import _, msgprint, throw
from erpnext.accounts.party import get_party_account, get_due_date
from erpnext.controllers.stock_controller import update_gl_entries_after
@@ -225,9 +225,9 @@ class SalesInvoice(SellingController):
frappe.throw(_("At least one mode of payment is required for POS invoice."))
def before_cancel(self):
super(SalesInvoice, self).before_cancel()
self.update_time_sheet(None)
def on_cancel(self):
super(SalesInvoice, self).on_cancel()
@@ -450,7 +450,7 @@ class SalesInvoice(SellingController):
# set pos values in items
for item in self.get("items"):
if item.get('item_code'):
profile_details = get_pos_profile_item_details(pos, frappe._dict(item.as_dict()), pos)
profile_details = get_pos_profile_item_details(pos, frappe._dict(item.as_dict()), pos, update_data=True)
for fname, val in iteritems(profile_details):
if (not for_validate) or (for_validate and not item.get(fname)):
item.set(fname, val)
@@ -537,7 +537,12 @@ class SalesInvoice(SellingController):
self.against_income_account = ','.join(against_acc)
def add_remarks(self):
if not self.remarks: self.remarks = 'No Remarks'
if not self.remarks:
if self.po_no and self.po_date:
self.remarks = _("Against Customer Order {0} dated {1}").format(self.po_no,
formatdate(self.po_date))
else:
self.remarks = _("No Remarks")
def validate_auto_set_posting_time(self):
# Don't auto set the posting date and time if invoice is amended
@@ -678,12 +683,11 @@ class SalesInvoice(SellingController):
self.calculate_billing_amount_for_timesheet()
def calculate_billing_amount_for_timesheet(self):
total_billing_amount = 0.0
for data in self.timesheets:
if data.billing_amount:
total_billing_amount += data.billing_amount
def timesheet_sum(field):
return sum((ts.get(field) or 0.0) for ts in self.timesheets)
self.total_billing_amount = total_billing_amount
self.total_billing_amount = timesheet_sum("billing_amount")
self.total_billing_hours = timesheet_sum("billing_hours")
def get_warehouse(self):
user_pos_profile = frappe.db.sql("""select name, warehouse from `tabPOS Profile`

View File

@@ -30,7 +30,7 @@
"base_grand_total": 561.8,
"grand_total": 561.8,
"is_pos": 0,
"naming_series": "_T-Sales Invoice-",
"naming_series": "T-SINV-",
"base_net_total": 500.0,
"taxes": [
{
@@ -103,7 +103,7 @@
"base_grand_total": 630.0,
"grand_total": 630.0,
"is_pos": 0,
"naming_series": "_T-Sales Invoice-",
"naming_series": "T-SINV-",
"base_net_total": 500.0,
"taxes": [
{
@@ -174,7 +174,7 @@
],
"grand_total": 0,
"is_pos": 0,
"naming_series": "_T-Sales Invoice-",
"naming_series": "T-SINV-",
"taxes": [
{
"account_head": "_Test Account Shipping Charges - _TC",
@@ -300,7 +300,7 @@
],
"grand_total": 0,
"is_pos": 0,
"naming_series": "_T-Sales Invoice-",
"naming_series": "T-SINV-",
"taxes": [
{
"account_head": "_Test Account Excise Duty - _TC",

View File

@@ -1841,93 +1841,7 @@ class TestSalesInvoice(unittest.TestCase):
self.assertEqual(target_doc.supplier, "_Test Internal Supplier")
def test_eway_bill_json(self):
if not frappe.db.exists('Address', '_Test Address for Eway bill-Billing'):
address = frappe.get_doc({
"address_line1": "_Test Address Line 1",
"address_title": "_Test Address for Eway bill",
"address_type": "Billing",
"city": "_Test City",
"state": "Test State",
"country": "India",
"doctype": "Address",
"is_primary_address": 1,
"phone": "+91 0000000000",
"gstin": "27AAECE4835E1ZR",
"gst_state": "Maharashtra",
"gst_state_number": "27",
"pincode": "401108"
}).insert()
address.append("links", {
"link_doctype": "Company",
"link_name": "_Test Company"
})
address.save()
if not frappe.db.exists('Address', '_Test Customer-Address for Eway bill-Shipping'):
address = frappe.get_doc({
"address_line1": "_Test Address Line 1",
"address_title": "_Test Customer-Address for Eway bill",
"address_type": "Shipping",
"city": "_Test City",
"state": "Test State",
"country": "India",
"doctype": "Address",
"is_primary_address": 1,
"phone": "+91 0000000000",
"gst_state": "Maharashtra",
"gst_state_number": "27",
"pincode": "410038"
}).insert()
address.append("links", {
"link_doctype": "Customer",
"link_name": "_Test Customer"
})
address.save()
gst_settings = frappe.get_doc("GST Settings")
gst_account = frappe.get_all(
"GST Account",
fields=["cgst_account", "sgst_account", "igst_account"],
filters = {"company": "_Test Company"})
if not gst_account:
gst_settings.append("gst_accounts", {
"company": "_Test Company",
"cgst_account": "CGST - _TC",
"sgst_account": "SGST - _TC",
"igst_account": "IGST - _TC",
})
gst_settings.save()
si = create_sales_invoice(do_not_save =1, rate = '60000')
si.distance = 2000
si.company_address = "_Test Address for Eway bill-Billing"
si.customer_address = "_Test Customer-Address for Eway bill-Shipping"
si.vehicle_no = "KA12KA1234"
si.gst_category = "Registered Regular"
si.append("taxes", {
"charge_type": "On Net Total",
"account_head": "CGST - _TC",
"cost_center": "Main - _TC",
"description": "CGST @ 9.0",
"rate": 9
})
si.append("taxes", {
"charge_type": "On Net Total",
"account_head": "SGST - _TC",
"cost_center": "Main - _TC",
"description": "SGST @ 9.0",
"rate": 9
})
si = make_sales_invoice_for_ewaybill()
si.submit()
@@ -1943,27 +1857,206 @@ class TestSalesInvoice(unittest.TestCase):
self.assertEqual(data['billLists'][0]['sgstValue'], 5400)
self.assertEqual(data['billLists'][0]['vehicleNo'], 'KA12KA1234')
self.assertEqual(data['billLists'][0]['itemList'][0]['taxableAmount'], 60000)
def test_einvoice_submission_without_irn(self):
# init
einvoice_settings = frappe.get_doc('E Invoice Settings')
einvoice_settings.enable = 1
einvoice_settings.applicable_from = nowdate()
einvoice_settings.append('credentials', {
'company': '_Test Company',
'gstin': '27AAECE4835E1ZR',
'username': 'test',
'password': 'test'
})
einvoice_settings.save()
def test_item_tax_validity(self):
item = frappe.get_doc("Item", "_Test Item 2")
country = frappe.flags.country
frappe.flags.country = 'India'
if item.taxes:
item.taxes = []
item.save()
si = make_sales_invoice_for_ewaybill()
self.assertRaises(frappe.ValidationError, si.submit)
item.append("taxes", {
"item_tax_template": "_Test Item Tax Template 1",
"valid_from": add_days(nowdate(), 1)
si.irn = 'test_irn'
si.submit()
# reset
einvoice_settings = frappe.get_doc('E Invoice Settings')
einvoice_settings.enable = 0
frappe.flags.country = country
def test_einvoice_json(self):
from erpnext.regional.india.e_invoice.utils import make_einvoice
si = make_sales_invoice_for_ewaybill()
si.naming_series = 'INV-2020-.#####'
si.items = []
si.append("items", {
"item_code": "_Test Item",
"uom": "Nos",
"warehouse": "_Test Warehouse - _TC",
"qty": 2000,
"rate": 12,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
})
si.append("items", {
"item_code": "_Test Item 2",
"uom": "Nos",
"warehouse": "_Test Warehouse - _TC",
"qty": 420,
"rate": 15,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
})
si.discount_amount = 100
si.save()
einvoice = make_einvoice(si)
total_item_ass_value = 0
total_item_cgst_value = 0
total_item_sgst_value = 0
total_item_igst_value = 0
total_item_value = 0
for item in einvoice['ItemList']:
total_item_ass_value += item['AssAmt']
total_item_cgst_value += item['CgstAmt']
total_item_sgst_value += item['SgstAmt']
total_item_igst_value += item['IgstAmt']
total_item_value += item['TotItemVal']
self.assertTrue(item['AssAmt'], item['TotAmt'] - item['Discount'])
self.assertTrue(item['TotItemVal'], item['AssAmt'] + item['CgstAmt'] + item['SgstAmt'] + item['IgstAmt'])
value_details = einvoice['ValDtls']
self.assertEqual(einvoice['Version'], '1.1')
self.assertTrue(abs(value_details['AssVal'] - total_item_ass_value) <= 1)
self.assertTrue(abs(value_details['CgstVal'] - total_item_cgst_value) <= 1)
self.assertTrue(abs(value_details['SgstVal'] - total_item_sgst_value) <= 1)
self.assertTrue(abs(value_details['IgstVal'] - total_item_igst_value) <= 1)
calculated_invoice_value = \
value_details['AssVal'] + value_details['CgstVal'] \
+ value_details['SgstVal'] + value_details['IgstVal'] \
+ value_details['OthChrg'] - value_details['Discount']
self.assertTrue(abs(value_details['TotInvVal'] - calculated_invoice_value) <= 1)
self.assertTrue(einvoice['EwbDtls'])
def make_test_address_for_ewaybill():
if not frappe.db.exists('Address', '_Test Address for Eway bill-Billing'):
address = frappe.get_doc({
"address_line1": "_Test Address Line 1",
"address_title": "_Test Address for Eway bill",
"address_type": "Billing",
"city": "_Test City",
"state": "Test State",
"country": "India",
"doctype": "Address",
"is_primary_address": 1,
"phone": "+910000000000",
"gstin": "27AAECE4835E1ZR",
"gst_state": "Maharashtra",
"gst_state_number": "27",
"pincode": "401108"
}).insert()
address.append("links", {
"link_doctype": "Company",
"link_name": "_Test Company"
})
item.save()
address.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)
if not frappe.db.exists('Address', '_Test Customer-Address for Eway bill-Shipping'):
address = frappe.get_doc({
"address_line1": "_Test Address Line 1",
"address_title": "_Test Customer-Address for Eway bill",
"address_type": "Shipping",
"city": "_Test City",
"state": "Test State",
"country": "India",
"doctype": "Address",
"is_primary_address": 1,
"phone": "+910000000000",
"gstin": "27AACCM7806M1Z3",
"gst_state": "Maharashtra",
"gst_state_number": "27",
"pincode": "410038"
}).insert()
item.taxes = []
item.save()
address.append("links", {
"link_doctype": "Customer",
"link_name": "_Test Customer"
})
address.save()
def make_test_transporter_for_ewaybill():
if not frappe.db.exists('Supplier', '_Test Transporter'):
frappe.get_doc({
"doctype": "Supplier",
"supplier_name": "_Test Transporter",
"country": "India",
"supplier_group": "_Test Supplier Group",
"supplier_type": "Company",
"is_transporter": 1
}).insert()
def make_sales_invoice_for_ewaybill():
make_test_address_for_ewaybill()
make_test_transporter_for_ewaybill()
gst_settings = frappe.get_doc("GST Settings")
gst_account = frappe.get_all(
"GST Account",
fields=["cgst_account", "sgst_account", "igst_account"],
filters = {"company": "_Test Company"}
)
if not gst_account:
gst_settings.append("gst_accounts", {
"company": "_Test Company",
"cgst_account": "CGST - _TC",
"sgst_account": "SGST - _TC",
"igst_account": "IGST - _TC",
})
gst_settings.save()
si = create_sales_invoice(do_not_save=1, rate='60000')
si.distance = 2000
si.company_address = "_Test Address for Eway bill-Billing"
si.customer_address = "_Test Customer-Address for Eway bill-Shipping"
si.vehicle_no = "KA12KA1234"
si.gst_category = "Registered Regular"
si.mode_of_transport = 'Road'
si.transporter = '_Test Transporter'
si.append("taxes", {
"charge_type": "On Net Total",
"account_head": "CGST - _TC",
"cost_center": "Main - _TC",
"description": "CGST @ 9.0",
"rate": 9
})
si.append("taxes", {
"charge_type": "On Net Total",
"account_head": "SGST - _TC",
"cost_center": "Main - _TC",
"description": "SGST @ 9.0",
"rate": 9
})
return si
def create_sales_invoice(**args):
si = frappe.new_doc("Sales Invoice")
@@ -1981,6 +2074,7 @@ def create_sales_invoice(**args):
si.return_against = args.return_against
si.currency=args.currency or "INR"
si.conversion_rate = args.conversion_rate or 1
si.naming_series = args.naming_series or "T-SINV-"
si.append("items", {
"item_code": args.item or args.item_code or "_Test Item",

View File

@@ -34,6 +34,9 @@ def valdiate_taxes_and_charges_template(doc):
validate_disabled(doc)
# Validate with existing taxes and charges template for unique tax category
validate_for_tax_category(doc)
for tax in doc.get("taxes"):
validate_taxes_and_charges(tax)
validate_inclusive_tax(tax, doc)
@@ -41,3 +44,7 @@ def valdiate_taxes_and_charges_template(doc):
def validate_disabled(doc):
if doc.is_default and doc.disabled:
frappe.throw(_("Disabled template must not be default template"))
def validate_for_tax_category(doc):
if frappe.db.exists(doc.doctype, {"company": doc.company, "tax_category": doc.tax_category, "disabled": 0}):
frappe.throw(_("A template with tax category {0} already exists. Only one template is allowed with each tax category").format(frappe.bold(doc.tax_category)))

View File

@@ -169,7 +169,7 @@ class ShareTransfer(Document):
def folio_no_validation(self):
shareholders = ['from_shareholder', 'to_shareholder']
shareholders = [shareholder for shareholder in shareholders if self.get(shareholder) is not '']
shareholders = [shareholder for shareholder in shareholders if self.get(shareholder) != '']
for shareholder in shareholders:
doc = self.get_shareholder_doc(self.get(shareholder))
if doc.company != self.company:

View File

@@ -30,6 +30,7 @@
"additional_discount_percentage",
"additional_discount_amount",
"sb_3",
"submit_invoice",
"invoices",
"accounting_dimensions_section",
"dimension_col_break"
@@ -202,9 +203,15 @@
"fieldname": "generate_new_invoices_past_due_date",
"fieldtype": "Check",
"label": "Generate New Invoices Past Due Date"
},
{
"default": "1",
"fieldname": "submit_invoice",
"fieldtype": "Check",
"label": "Submit Invoice Automatically"
}
],
"modified": "2020-11-29 22:46:14.879289",
"modified": "2021-05-03 13:35:21.422940",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Subscription",

View File

@@ -288,8 +288,11 @@ class Subscription(Document):
invoice.to_date = self.current_invoice_end
invoice.flags.ignore_mandatory = True
invoice.set_missing_values()
invoice.save()
invoice.submit()
if self.submit_invoice:
invoice.submit()
return invoice
@@ -298,7 +301,8 @@ class Subscription(Document):
Returns the `Item`s linked to `Subscription Plan`
"""
if prorate:
prorate_factor = get_prorata_factor(self.current_invoice_end, self.current_invoice_start)
prorate_factor = get_prorata_factor(self.current_invoice_end, self.current_invoice_start,
self.generate_invoice_at_period_start)
items = []
customer = self.customer
@@ -333,7 +337,7 @@ class Subscription(Document):
if not self.generate_invoice_at_period_start:
return False
if self.is_new_subscription():
if self.is_new_subscription() and getdate(nowdate()) >= getdate(self.current_invoice_start):
return True
# Check invoice dates and make sure it doesn't have outstanding invoices
@@ -468,11 +472,13 @@ class Subscription(Document):
if invoice:
return invoice.precision('grand_total')
def get_prorata_factor(period_end, period_start):
diff = flt(date_diff(nowdate(), period_start) + 1)
plan_days = flt(date_diff(period_end, period_start) + 1)
prorate_factor = diff / plan_days
def get_prorata_factor(period_end, period_start, is_prepaid):
if is_prepaid:
prorate_factor = 1
else:
diff = flt(date_diff(nowdate(), period_start) + 1)
plan_days = flt(date_diff(period_end, period_start) + 1)
prorate_factor = diff / plan_days
return prorate_factor

View File

@@ -291,7 +291,8 @@ class TestSubscription(unittest.TestCase):
self.assertEqual(
flt(
get_prorata_factor(subscription.current_invoice_end, subscription.current_invoice_start),
get_prorata_factor(subscription.current_invoice_end, subscription.current_invoice_start,
subscription.generate_invoice_at_period_start),
2),
flt(prorate_factor, 2)
)
@@ -528,9 +529,7 @@ class TestSubscription(unittest.TestCase):
current_inv = subscription.get_current_invoice()
self.assertEqual(current_inv.status, "Unpaid")
diff = flt(date_diff(nowdate(), subscription.current_invoice_start) + 1)
plan_days = flt(date_diff(subscription.current_invoice_end, subscription.current_invoice_start) + 1)
prorate_factor = flt(diff / plan_days)
prorate_factor = 1
self.assertEqual(flt(current_inv.grand_total, 2), flt(prorate_factor * 900, 2))

View File

@@ -163,7 +163,7 @@ def get_tds_amount(suppliers, net_total, company, tax_details, fiscal_year_detai
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)
if ((tax_details.get('threshold', 0) and net_total >= tax_details.threshold)
or (tax_details.get('cumulative_threshold', 0) and supplier_credit_amount >= tax_details.cumulative_threshold)):
if ldc and is_valid_certificate(ldc.valid_from, ldc.valid_upto, posting_date, tds_deducted, net_total,

View File

@@ -83,47 +83,6 @@ class TestTaxWithholdingCategory(unittest.TestCase):
for d in invoices:
d.cancel()
def test_single_threshold_tds_with_previous_vouchers(self):
invoices = []
frappe.db.set_value("Supplier", "Test TDS Supplier2", "tax_withholding_category", "Single Threshold TDS")
pi = create_purchase_invoice(supplier="Test TDS Supplier2")
pi.submit()
invoices.append(pi)
pi = create_purchase_invoice(supplier="Test TDS Supplier2")
pi.submit()
invoices.append(pi)
self.assertEqual(pi.taxes_and_charges_deducted, 2000)
self.assertEqual(pi.grand_total, 8000)
# delete invoices to avoid clashing
for d in invoices:
d.cancel()
def test_single_threshold_tds_with_previous_vouchers_and_no_tds(self):
invoices = []
frappe.db.set_value("Supplier", "Test TDS Supplier2", "tax_withholding_category", "Single Threshold TDS")
pi = create_purchase_invoice(supplier="Test TDS Supplier2")
pi.submit()
invoices.append(pi)
# TDS not applied
pi = create_purchase_invoice(supplier="Test TDS Supplier2", do_not_apply_tds=True)
pi.submit()
invoices.append(pi)
pi = create_purchase_invoice(supplier="Test TDS Supplier2")
pi.submit()
invoices.append(pi)
self.assertEqual(pi.taxes_and_charges_deducted, 2000)
self.assertEqual(pi.grand_total, 8000)
# delete invoices to avoid clashing
for d in invoices:
d.cancel()
def create_purchase_invoice(**args):
# return sales invoice doc object
item = frappe.get_doc('Item', {'item_name': 'TDS Item'})

View File

@@ -147,7 +147,7 @@ def make_entry(args, adv_adj, update_outstanding, from_repost=False):
gle.submit()
def validate_account_for_perpetual_inventory(gl_map):
if cint(erpnext.is_perpetual_inventory_enabled(gl_map[0].company)):
if cint(erpnext.is_perpetual_inventory_enabled(gl_map[0].company)) and gl_map[0].voucher_type=="Journal Entry":
account_list = [gl_entries.account for gl_entries in gl_map]
aii_accounts = [d.name for d in frappe.get_all("Account",
@@ -160,13 +160,12 @@ def validate_account_for_perpetual_inventory(gl_map):
account_bal, stock_bal, warehouse_list = get_stock_and_account_balance(account,
gl_map[0].posting_date, gl_map[0].company)
if gl_map[0].voucher_type=="Journal Entry":
# In case of Journal Entry, there are no corresponding SL entries,
# hence deducting currency amount
account_bal -= flt(gl_map[0].debit) - flt(gl_map[0].credit)
if account_bal == stock_bal:
frappe.throw(_("Account: {0} can only be updated via Stock Transactions")
.format(account), StockAccountInvalidTransaction)
# In case of Journal Entry, there are no corresponding SL entries,
# hence deducting currency amount
account_bal -= flt(gl_map[0].debit) - flt(gl_map[0].credit)
if account_bal == stock_bal:
frappe.throw(_("Account: {0} can only be updated via Stock Transactions")
.format(account), StockAccountInvalidTransaction)
# This has been comment for a temporary, will add this code again on release of immutable ledger
# elif account_bal != stock_bal:
@@ -240,10 +239,10 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
for d in gl_map:
if d.account == round_off_account:
round_off_gle = d
if d.debit_in_account_currency:
debit_credit_diff -= flt(d.debit_in_account_currency)
if d.debit:
debit_credit_diff -= flt(d.debit)
else:
debit_credit_diff += flt(d.credit_in_account_currency)
debit_credit_diff += flt(d.credit)
round_off_account_exists = True
if round_off_account_exists and abs(debit_credit_diff) <= (1.0 / (10**precision)):
@@ -252,7 +251,7 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
if not round_off_gle:
for k in ["voucher_type", "voucher_no", "company",
"posting_date", "remarks", "is_opening"]:
"posting_date", "remarks"]:
round_off_gle[k] = gl_map[0][k]
round_off_gle.update({
@@ -264,6 +263,7 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
"cost_center": round_off_cost_center,
"party_type": None,
"party": None,
"is_opening": "No",
"against_voucher_type": None,
"against_voucher": None
})
@@ -293,7 +293,8 @@ def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None,
select account, posting_date, party_type, party, cost_center, fiscal_year,voucher_type,
voucher_no, against_voucher_type, against_voucher, cost_center, company
from `tabGL Entry`
where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no), as_dict=True)
where voucher_type=%s and voucher_no=%s
for update""", (voucher_type, voucher_no), as_dict=True)
if gl_entries:
validate_accounting_period(gl_entries)

View File

@@ -2018,34 +2018,57 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
apply_pricing_rule: function () {
var me = this;
var remove_item = false;
$.each(this.frm.doc["items"], function (n, item) {
var pricing_rule = me.get_pricing_rule(item)
me.validate_pricing_rule(pricing_rule)
if (pricing_rule.length) {
item.pricing_rule = pricing_rule[0].name;
item.margin_type = pricing_rule[0].margin_type;
item.price_list_rate = pricing_rule[0].price || item.price_list_rate;
item.margin_rate_or_amount = pricing_rule[0].margin_rate_or_amount;
item.discount_percentage = pricing_rule[0].discount_percentage || 0.0;
me.apply_pricing_rule_on_item(item)
if (pricing_rule[0].price_or_product_discount == "Price") {
item.pricing_rule = pricing_rule[0].name;
item.margin_type = pricing_rule[0].margin_type;
item.price_list_rate = pricing_rule[0].price || item.price_list_rate;
item.margin_rate_or_amount = pricing_rule[0].margin_rate_or_amount;
item.discount_percentage = pricing_rule[0].discount_percentage || 0.0;
me.apply_pricing_rule_on_item(item)
} else {
me.child = frappe.model.add_child(me.frm.doc, me.frm.doc.doctype + " Item", "items");
me.child.item_code = pricing_rule[0].same_item ? item.item_code : pricing_rule[0].free_item;
me.child.item_name = pricing_rule[0].same_item ? item.item_name : pricing_rule[0].free_item;
me.child.stock_uom = pricing_rule[0].same_item ? item.stock_uom : pricing_rule[0].free_item_uom;
me.child.uom = pricing_rule[0].same_item ? item.uom : pricing_rule[0].free_item_uom;
me.child.conversion_factor = 1;
me.child.qty = pricing_rule.qty || 1;
me.child.is_free_item = 1;
me.child.brand = pricing_rule[0].same_item ? item.brand : "";
me.child.description = pricing_rule[0].same_item ? item.description : pricing_rule[0].free_item;
}
} else if (item.pricing_rule) {
item.price_list_rate = me.price_list_data[item.item_code]
item.margin_rate_or_amount = 0.0;
item.discount_percentage = 0.0;
item.pricing_rule = null;
me.apply_pricing_rule_on_item(item)
} else if (item.is_free_item) {
remove_item = true;
item.qty = 0
}
if(item.discount_percentage > 0) {
me.apply_pricing_rule_on_item(item)
}
})
});
if (remove_item) {
this.remove_zero_qty_items_from_cart();
}
},
get_pricing_rule: function (item) {
var me = this;
return $.grep(this.pricing_rules, function (data) {
if (item.qty >= data.min_qty && (item.qty <= (data.max_qty ? data.max_qty : item.qty))) {
me.get_mixed_min_max_qty_and_amt(data, item);
if (data.mixed_qty >= data.min_qty && (data.mixed_qty <= (data.max_qty ? data.max_qty : data.mixed_qty))) {
if (me.validate_item_condition(data, item)) {
if (in_list(['Customer', 'Customer Group', 'Territory', 'Campaign'], data.applicable_for)) {
return me.validate_condition(data)
@@ -2057,11 +2080,26 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
})
},
get_mixed_min_max_qty_and_amt: function(data, item) {
var apply_on = frappe.model.scrub(data.apply_on);
data.mixed_qty = 0.0
if (data.mixed_conditions && in_list(data[apply_on], item[apply_on])) {
this.frm.doc.items.forEach(d => {
if (in_list(data[apply_on], d[apply_on])) {
data.mixed_qty += d.qty;
data.mixed_amt += d.amount;
}
});
} else {
data.mixed_qty = item.qty;
data.mixed_amt = item.amount;
}
},
validate_item_condition: function (data, item) {
var apply_on = frappe.model.scrub(data.apply_on);
return (data.apply_on == 'Item Group')
? this.validate_item_group(data.item_group, item.item_group) : (data[apply_on] == item[apply_on]);
return in_list(data[apply_on], item[apply_on]);
},
validate_item_group: function (pr_item_group, cart_item_group) {

View File

@@ -0,0 +1,173 @@
{%- from "templates/print_formats/standard_macros.html" import add_header, render_field, print_value -%}
<div class="page-break">
{% if doc.signed_einvoice %}
{%- set einvoice = json.loads(doc.signed_einvoice) -%}
<div {% if print_settings.repeat_header_footer %} id="header-html" class="hidden-pdf" {% endif %}>
{% if letter_head and not no_letterhead %}
<div class="letter-head">{{ letter_head }}</div>
{% endif %}
<div class="print-heading">
<h2>E Invoice<br><small>{{ doc.name }}</small></h2>
</div>
</div>
{% if print_settings.repeat_header_footer %}
<div id="footer-html" class="visible-pdf">
{% if not no_letterhead and footer %}
<div class="letter-head-footer">
{{ footer }}
</div>
{% endif %}
<p class="text-center small page-number visible-pdf">
{{ _("Page {0} of {1}").format('<span class="page"></span>', '<span class="topage"></span>') }}
</p>
</div>
{% endif %}
<div class="row section-break" style="border-bottom: 1px solid #d1d8dd; padding-bottom: 10px;">
<h5 class="font-bold" style="margin-left: 15px; margin-top: 0px;">1. Transaction Details</h5>
<div class="col-xs-7 column-break">
<div class="row data-field">
<div class="col-xs-4"><label>IRN</label></div>
<div class="col-xs-8 value">{{ einvoice.Irn }}</div>
</div>
<div class="row data-field">
<div class="col-xs-4"><label>Ack. No</label></div>
<div class="col-xs-8 value">{{ einvoice.AckNo }}</div>
</div>
<div class="row data-field">
<div class="col-xs-4"><label>Ack. Date</label></div>
<div class="col-xs-8 value">{{ frappe.utils.format_datetime(einvoice.AckDt, "dd/MM/yyyy hh:mm:ss") }}</div>
</div>
<div class="row data-field">
<div class="col-xs-4"><label>Category</label></div>
<div class="col-xs-8 value">{{ einvoice.TranDtls.SupTyp }}</div>
</div>
<div class="row data-field">
<div class="col-xs-4"><label>Document Type</label></div>
<div class="col-xs-8 value">{{ einvoice.DocDtls.Typ }}</div>
</div>
<div class="row data-field">
<div class="col-xs-4"><label>Document No</label></div>
<div class="col-xs-8 value">{{ einvoice.DocDtls.No }}</div>
</div>
</div>
<div class="col-xs-5 column-break">
<img src="{{ doc.qrcode_image }}" alt="QRCode Image" style="
width: 175px; height: 175px;
float: right; border: 1px solid gray;
display: flex; align-items: center; justify-content: center;
">
</div>
</div>
<div class="row section-break" style="border-bottom: 1px solid #d1d8dd; padding-bottom: 10px;">
<h5 class="font-bold" style="margin-left: 15px; margin-bottom: 0px;">2. Party Details</h5>
{%- set seller = einvoice.SellerDtls -%}
<div class="col-xs-6 column-break">
<h5 style="margin-bottom: 5px;">Seller</h5>
<p>{{ seller.Gstin }}</p>
<p>{{ seller.LglNm }}</p>
<p>{{ seller.Addr1 }}</p>
{%- if seller.Addr2 -%} <p>{{ seller.Addr2 }}</p> {% endif %}
<p>{{ seller.Loc }}</p>
<p>{{ frappe.db.get_value("Address", doc.company_address, "gst_state") }} - {{ seller.Pin }}</p>
{%- if einvoice.ShipDtls -%}
{%- set shipping = einvoice.ShipDtls -%}
<h5 style="margin-bottom: 5px;">Shipping</h5>
<p>{{ shipping.Gstin }}</p>
<p>{{ shipping.LglNm }}</p>
<p>{{ shipping.Addr1 }}</p>
{%- if shipping.Addr2 -%} <p>{{ shipping.Addr2 }}</p> {% endif %}
<p>{{ shipping.Loc }}</p>
<p>{{ frappe.db.get_value("Address", doc.shipping_address_name, "gst_state") }} - {{ shipping.Pin }}</p>
{% endif %}
</div>
{%- set buyer = einvoice.BuyerDtls -%}
<div class="col-xs-6 column-break">
<h5 style="margin-bottom: 5px;">Buyer</h5>
<p>{{ buyer.Gstin }}</p>
<p>{{ buyer.LglNm }}</p>
<p>{{ buyer.Addr1 }}</p>
{%- if buyer.Addr2 -%} <p>{{ buyer.Addr2 }}</p> {% endif %}
<p>{{ buyer.Loc }}</p>
<p>{{ frappe.db.get_value("Address", doc.customer_address, "gst_state") }} - {{ buyer.Pin }}</p>
</div>
</div>
<div style="overflow-x: auto;">
<h5 class="font-bold" style="margin-bottom: 0px;">3. Item Details</h5>
<table class="table table-bordered">
<thead>
<tr>
<th class="text-left" style="width: 3%;">Sr. No.</th>
<th class="text-left">Item</th>
<th class="text-left" style="width: 10%;">HSN Code</th>
<th class="text-left" style="width: 5%;">Qty</th>
<th class="text-left" style="width: 5%;">UOM</th>
<th class="text-left">Rate</th>
<th class="text-left" style="width: 5%;">Discount</th>
<th class="text-left">Taxable Amount</th>
<th class="text-left" style="width: 7%;">Tax Rate</th>
<th class="text-left" style="width: 5%;">Other Charges</th>
<th class="text-left">Total</th>
</tr>
</thead>
<tbody>
{% for item in einvoice.ItemList %}
<tr>
<td class="text-left" style="width: 3%;">{{ item.SlNo }}</td>
<td class="text-left">{{ item.PrdDesc }}</td>
<td class="text-left" style="width: 10%;">{{ item.HsnCd }}</td>
<td class="text-right" style="width: 5%;">{{ item.Qty }}</td>
<td class="text-left" style="width: 5%;">{{ item.Unit }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(item.UnitPrice, None, "INR") }}</td>
<td class="text-right" style="width: 5%;">{{ frappe.utils.fmt_money(item.Discount, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(item.AssAmt, None, "INR") }}</td>
<td class="text-right" style="width: 7%;">{{ item.GstRt + item.CesRt }} %</td>
<td class="text-right" style="width: 5%;">{{ frappe.utils.fmt_money(0, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(item.TotItemVal, None, "INR") }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div style="overflow-x: auto;">
<h5 class="font-bold" style="margin-bottom: 0px;">4. Value Details</h5>
<table class="table table-bordered">
<thead>
<tr>
<th class="text-left">Taxable Amount</th>
<th class="text-left">CGST</th>
<th class="text-left"">SGST</th>
<th class="text-left">IGST</th>
<th class="text-left">CESS</th>
<th class="text-left" style="width: 10%;">State CESS</th>
<th class="text-left">Discount</th>
<th class="text-left" style="width: 10%;">Other Charges</th>
<th class="text-left" style="width: 10%;">Round Off</th>
<th class="text-left">Total Value</th>
</tr>
</thead>
<tbody>
{%- set value_details = einvoice.ValDtls -%}
<tr>
<td class="text-right">{{ frappe.utils.fmt_money(value_details.AssVal, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(value_details.CgstVal, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(value_details.SgstVal, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(value_details.IgstVal, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(value_details.CesVal, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(0, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(value_details.Discount, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(value_details.OthChrg, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(value_details.RndOffAmt, None, "INR") }}</td>
<td class="text-right">{{ frappe.utils.fmt_money(value_details.TotInvVal, None, "INR") }}</td>
</tr>
</tbody>
</table>
</div>
{% else %}
<div class="text-center" style="color: #98A1A9; font-size: 14px;">
You must generate IRN before you can preview GST E-Invoice.
</div>
{% endif %}
</div>

View File

@@ -0,0 +1,24 @@
{
"align_labels_right": 1,
"creation": "2020-10-10 18:01:21.032914",
"custom_format": 0,
"default_print_language": "en-US",
"disabled": 1,
"doc_type": "Sales Invoice",
"docstatus": 0,
"doctype": "Print Format",
"font": "Default",
"html": "",
"idx": 0,
"line_breaks": 1,
"modified": "2020-10-23 19:54:40.634936",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GST E-Invoice",
"owner": "Administrator",
"print_format_builder": 0,
"print_format_type": "Jinja",
"raw_printing": 0,
"show_section_headings": 1,
"standard": "Yes"
}

View File

@@ -15,15 +15,51 @@ def execute(filters=None):
return columns, data
def get_columns():
return [
_("Payment Document") + "::130",
_("Payment Entry") + ":Dynamic Link/"+_("Payment Document")+":110",
_("Posting Date") + ":Date:100",
_("Cheque/Reference No") + "::120",
_("Clearance Date") + ":Date:100",
_("Against Account") + ":Link/Account:170",
_("Amount") + ":Currency:120"
]
columns = [{
"label": _("Payment Document Type"),
"fieldname": "payment_document_type",
"fieldtype": "Link",
"options": "Doctype",
"width": 130
},
{
"label": _("Payment Entry"),
"fieldname": "payment_entry",
"fieldtype": "Dynamic Link",
"options": "payment_document_type",
"width": 140
},
{
"label": _("Posting Date"),
"fieldname": "posting_date",
"fieldtype": "Date",
"width": 100
},
{
"label": _("Cheque/Reference No"),
"fieldname": "cheque_no",
"width": 120
},
{
"label": _("Clearance Date"),
"fieldname": "clearance_date",
"fieldtype": "Date",
"width": 100
},
{
"label": _("Against Account"),
"fieldname": "against",
"fieldtype": "Link",
"options": "Account",
"width": 170
},
{
"label": _("Amount"),
"fieldname": "amount",
"width": 120
}]
return columns
def get_conditions(filters):
conditions = ""

View File

@@ -165,7 +165,7 @@ def add_data_for_operating_activities(
if profit_data:
profit_data.update({
"indent": 1,
"parent_account": get_mapper_for(light_mappers, position=0)['section_header']
"parent_account": get_mapper_for(light_mappers, position=1)['section_header']
})
data.append(profit_data)
section_data.append(profit_data)
@@ -312,10 +312,10 @@ def add_data_for_other_activities(
def compute_data(filters, company_currency, profit_data, period_list, light_mappers, full_mapper):
data = []
operating_activities_mapper = get_mapper_for(light_mappers, position=0)
operating_activities_mapper = get_mapper_for(light_mappers, position=1)
other_mappers = [
get_mapper_for(light_mappers, position=1),
get_mapper_for(light_mappers, position=2)
get_mapper_for(light_mappers, position=2),
get_mapper_for(light_mappers, position=3)
]
if operating_activities_mapper:
@@ -396,7 +396,7 @@ def _get_account_type_based_data(filters, account_names, period_list, accumulate
gl_sum = frappe.db.sql_list("""
select sum(credit) - sum(debit)
from `tabGL Entry`
where company=%s and posting_date >= %s and posting_date <= %s
where company=%s and posting_date >= %s and posting_date <= %s
and voucher_type != 'Period Closing Voucher'
and account in ( SELECT name FROM tabAccount WHERE name IN (%s)
OR parent_account IN (%s))
@@ -405,7 +405,7 @@ def _get_account_type_based_data(filters, account_names, period_list, accumulate
gl_sum = frappe.db.sql_list("""
select sum(credit) - sum(debit)
from `tabGL Entry`
where company=%s and posting_date >= %s and posting_date <= %s
where company=%s and posting_date >= %s and posting_date <= %s
and voucher_type != 'Period Closing Voucher'
and account in ( SELECT name FROM tabAccount WHERE name IN (%s)
OR parent_account IN (%s))

View File

@@ -206,7 +206,7 @@ def get_data(companies, root_type, balance_must_be, fiscal_year, filters=None, i
set_gl_entries_by_account(fiscal_year.year_start_date,
fiscal_year.year_end_date, root.lft, root.rgt, filters,
gl_entries_by_account, accounts_by_name, ignore_closing_entries=False)
gl_entries_by_account, accounts_by_name, accounts, ignore_closing_entries=False)
calculate_values(accounts_by_name, gl_entries_by_account, companies, fiscal_year, filters)
accumulate_values_into_parents(accounts, accounts_by_name, companies)
@@ -224,8 +224,7 @@ def get_company_currency(filters=None):
def calculate_values(accounts_by_name, gl_entries_by_account, companies, fiscal_year, filters):
for entries in gl_entries_by_account.values():
for entry in entries:
key = entry.account_number or entry.account_name
d = accounts_by_name.get(key)
d = accounts_by_name.get(entry.account_name)
if d:
for company in companies:
# check if posting date is within the period
@@ -240,7 +239,8 @@ def accumulate_values_into_parents(accounts, accounts_by_name, companies):
"""accumulate children's values in parent accounts"""
for d in reversed(accounts):
if d.parent_account:
account = d.parent_account.split('-')[0].strip()
account = d.parent_account_name
if not accounts_by_name.get(account):
continue
@@ -251,16 +251,34 @@ def accumulate_values_into_parents(accounts, accounts_by_name, companies):
accounts_by_name[account]["opening_balance"] = \
accounts_by_name[account].get("opening_balance", 0.0) + d.get("opening_balance", 0.0)
def get_account_heads(root_type, companies, filters):
accounts = get_accounts(root_type, filters)
if not accounts:
return None, None
accounts = update_parent_account_names(accounts)
accounts, accounts_by_name, parent_children_map = filter_accounts(accounts)
return accounts, accounts_by_name
def update_parent_account_names(accounts):
"""Update parent_account_name in accounts list.
parent_name is `name` of parent account which could have other prefix
of account_number and suffix of company abbr. This function adds key called
`parent_account_name` which does not have such prefix/suffix.
"""
name_to_account_map = { d.name : d.account_name for d in accounts }
for account in accounts:
if account.parent_account:
account["parent_account_name"] = name_to_account_map[account.parent_account]
return accounts
def get_companies(filters):
companies = {}
all_companies = get_subsidiary_companies(filters.get('company'))
@@ -325,7 +343,7 @@ def prepare_data(accounts, fiscal_year, balance_must_be, companies, company_curr
return data
def set_gl_entries_by_account(from_date, to_date, root_lft, root_rgt, filters, gl_entries_by_account,
accounts_by_name, ignore_closing_entries=False):
accounts_by_name, accounts, ignore_closing_entries=False):
"""Returns a dict like { "account": [gl entries], ... }"""
company_lft, company_rgt = frappe.get_cached_value('Company',
@@ -367,16 +385,32 @@ def set_gl_entries_by_account(from_date, to_date, root_lft, root_rgt, filters, g
convert_to_presentation_currency(gl_entries, currency_info)
for entry in gl_entries:
key = entry.account_number or entry.account_name
validate_entries(key, entry, accounts_by_name)
gl_entries_by_account.setdefault(key, []).append(entry)
account_name = entry.account_name
validate_entries(account_name, entry, accounts_by_name, accounts)
gl_entries_by_account.setdefault(account_name, []).append(entry)
return gl_entries_by_account
def validate_entries(key, entry, accounts_by_name):
def get_account_details(account):
return frappe.get_cached_value('Account', account, ['name', 'report_type', 'root_type', 'company',
'is_group', 'account_name', 'account_number', 'parent_account', 'lft', 'rgt'], as_dict=1)
def validate_entries(key, entry, accounts_by_name, accounts):
if key not in accounts_by_name:
field = "Account number" if entry.account_number else "Account name"
frappe.throw(_("{0} {1} is not present in the parent company").format(field, key))
args = get_account_details(entry.account)
if args.parent_account:
parent_args = get_account_details(args.parent_account)
args.update({
'lft': parent_args.lft + 1,
'rgt': parent_args.rgt - 1,
'root_type': parent_args.root_type,
'report_type': parent_args.report_type
})
accounts_by_name.setdefault(key, args)
accounts.append(args)
def get_additional_conditions(from_date, ignore_closing_entries, filters):
additional_conditions = []
@@ -422,8 +456,7 @@ def filter_accounts(accounts, depth=10):
parent_children_map = {}
accounts_by_name = {}
for d in accounts:
key = d.account_number or d.account_name
accounts_by_name[key] = d
accounts_by_name[d.account_name] = d
parent_children_map.setdefault(d.parent_account or None, []).append(d)
filtered_accounts = []

View File

@@ -36,5 +36,20 @@ frappe.query_reports["Gross Profit"] = {
"options": "Invoice\nItem Code\nItem Group\nBrand\nWarehouse\nCustomer\nCustomer Group\nTerritory\nSales Person\nProject",
"default": "Invoice"
},
]
],
"tree": true,
"name_field": "parent",
"parent_field": "parent_invoice",
"initial_depth": 3,
"formatter": function(value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (data && data.indent == 0.0) {
value = $(`<span>${value}</span>`);
var $value = $(value).css("font-weight", "bold");
value = $value.wrap("<p></p>").parent().html();
}
return value;
},
}

View File

@@ -1,16 +1,20 @@
{
"add_total_row": 1,
"add_total_row": 0,
"columns": [],
"creation": "2013-02-25 17:03:34",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 3,
"is_standard": "Yes",
"modified": "2020-08-13 11:26:39.112352",
"modified": "2021-08-19 18:57:07.468202",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Gross Profit",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Sales Invoice",
"report_name": "Gross Profit",
"report_type": "Script Report",

View File

@@ -41,16 +41,44 @@ def execute(filters=None):
columns = get_columns(group_wise_columns, filters)
for src in gross_profit_data.grouped_data:
if filters.group_by == 'Invoice':
get_data_when_grouped_by_invoice(columns, gross_profit_data, filters, group_wise_columns, data)
else:
get_data_when_not_grouped_by_invoice(gross_profit_data, filters, group_wise_columns, data)
return columns, data
def get_data_when_grouped_by_invoice(columns, gross_profit_data, filters, group_wise_columns, data):
column_names = get_column_names()
# to display item as Item Code: Item Name
columns[0] = 'Sales Invoice:Link/Item:300'
# removing Item Code and Item Name columns
del columns[4:6]
for src in gross_profit_data.si_list:
row = frappe._dict()
row.indent = src.indent
row.parent_invoice = src.parent_invoice
row.currency = filters.currency
for col in group_wise_columns.get(scrub(filters.group_by)):
row[column_names[col]] = src.get(col)
data.append(row)
def get_data_when_not_grouped_by_invoice(gross_profit_data, filters, group_wise_columns, data):
for idx, src in enumerate(gross_profit_data.grouped_data):
row = []
for col in group_wise_columns.get(scrub(filters.group_by)):
row.append(src.get(col))
row.append(filters.currency)
if idx == len(gross_profit_data.grouped_data)-1:
row[0] = frappe.bold("Total")
data.append(row)
return columns, data
def get_columns(group_wise_columns, filters):
columns = []
column_map = frappe._dict({
@@ -91,12 +119,38 @@ def get_columns(group_wise_columns, filters):
return columns
def get_column_names():
return frappe._dict({
'parent': 'sales_invoice',
'customer': 'customer',
'customer_group': 'customer_group',
'posting_date': 'posting_date',
'item_code': 'item_code',
'item_name': 'item_name',
'item_group': 'item_group',
'brand': 'brand',
'description': 'description',
'warehouse': 'warehouse',
'qty': 'qty',
'base_rate': 'avg._selling_rate',
'buying_rate': 'valuation_rate',
'base_amount': 'selling_amount',
'buying_amount': 'buying_amount',
'gross_profit': 'gross_profit',
'gross_profit_percent': 'gross_profit_%',
'project': 'project'
})
class GrossProfitGenerator(object):
def __init__(self, filters=None):
self.data = []
self.average_buying_rate = {}
self.filters = frappe._dict(filters)
self.load_invoice_items()
if filters.group_by == 'Invoice':
self.group_items_by_invoice()
self.load_stock_ledger_entries()
self.load_product_bundle()
self.load_non_stock_items()
@@ -110,7 +164,12 @@ class GrossProfitGenerator(object):
self.currency_precision = cint(frappe.db.get_default("currency_precision")) or 3
self.float_precision = cint(frappe.db.get_default("float_precision")) or 2
for row in self.si_list:
grouped_by_invoice = True if self.filters.get("group_by") == "Invoice" else False
if grouped_by_invoice:
buying_amount = 0
for row in reversed(self.si_list):
if self.skip_row(row, self.product_bundles):
continue
@@ -132,12 +191,20 @@ class GrossProfitGenerator(object):
row.buying_amount = flt(self.get_buying_amount(row, row.item_code),
self.currency_precision)
if grouped_by_invoice:
if row.indent == 1.0:
buying_amount += row.buying_amount
elif row.indent == 0.0:
row.buying_amount = buying_amount
buying_amount = 0
# get buying rate
if row.qty:
row.buying_rate = flt(row.buying_amount / row.qty, self.float_precision)
row.base_rate = flt(row.base_amount / row.qty, self.float_precision)
else:
row.buying_rate, row.base_rate = 0.0, 0.0
if self.is_not_invoice_row(row):
row.buying_rate, row.base_rate = 0.0, 0.0
# calculate gross profit
row.gross_profit = flt(row.base_amount - row.buying_amount, self.currency_precision)
@@ -154,6 +221,15 @@ class GrossProfitGenerator(object):
def get_average_rate_based_on_group_by(self):
# sum buying / selling totals for group
self.totals = frappe._dict(
qty=0,
base_amount=0,
buying_amount=0,
gross_profit=0,
gross_profit_percent=0,
base_rate=0,
buying_rate=0
)
for key in list(self.grouped):
if self.filters.get("group_by") != "Invoice":
for i, row in enumerate(self.grouped[key]):
@@ -165,6 +241,7 @@ class GrossProfitGenerator(object):
new_row.base_amount += flt(row.base_amount, self.currency_precision)
new_row = self.set_average_rate(new_row)
self.grouped_data.append(new_row)
self.add_to_totals(new_row)
else:
for i, row in enumerate(self.grouped[key]):
if row.parent in self.returned_invoices \
@@ -173,19 +250,32 @@ class GrossProfitGenerator(object):
for returned_item_row in returned_item_rows:
row.qty += returned_item_row.qty
row.base_amount += flt(returned_item_row.base_amount, self.currency_precision)
row.buying_amount = flt(row.qty * row.buying_rate, self.currency_precision)
if row.qty or row.base_amount:
row.buying_amount = flt(flt(row.qty) * flt(row.buying_rate), self.currency_precision)
if (flt(row.qty) or row.base_amount) and self.is_not_invoice_row(row):
row = self.set_average_rate(row)
self.grouped_data.append(row)
self.add_to_totals(row)
self.set_average_gross_profit(self.totals)
self.grouped_data.append(self.totals)
def is_not_invoice_row(self, row):
return (self.filters.get("group_by") == "Invoice" and row.indent != 0.0) or self.filters.get("group_by") != "Invoice"
def set_average_rate(self, new_row):
self.set_average_gross_profit(new_row)
new_row.buying_rate = flt(new_row.buying_amount / new_row.qty, self.float_precision) if new_row.qty else 0
new_row.base_rate = flt(new_row.base_amount / new_row.qty, self.float_precision) if new_row.qty else 0
return new_row
def set_average_gross_profit(self, new_row):
new_row.gross_profit = flt(new_row.base_amount - new_row.buying_amount, self.currency_precision)
new_row.gross_profit_percent = flt(((new_row.gross_profit / new_row.base_amount) * 100.0), self.currency_precision) \
if new_row.base_amount else 0
new_row.buying_rate = flt(new_row.buying_amount / new_row.qty, self.float_precision) if new_row.qty else 0
new_row.base_rate = flt(new_row.base_amount / new_row.qty, self.float_precision) if new_row.qty else 0
return new_row
def add_to_totals(self, new_row):
for key in self.totals:
if new_row.get(key):
self.totals[key] += new_row[key]
def get_returned_invoice_items(self):
returned_invoices = frappe.db.sql("""
@@ -334,6 +424,109 @@ class GrossProfitGenerator(object):
.format(conditions=conditions, sales_person_cols=sales_person_cols,
sales_team_table=sales_team_table, match_cond = get_match_cond('Sales Invoice')), self.filters, as_dict=1)
def group_items_by_invoice(self):
"""
Turns list of Sales Invoice Items to a tree of Sales Invoices with their Items as children.
"""
parents = []
for row in self.si_list:
if row.parent not in parents:
parents.append(row.parent)
parents_index = 0
for index, row in enumerate(self.si_list):
if parents_index < len(parents) and row.parent == parents[parents_index]:
invoice = self.get_invoice_row(row)
self.si_list.insert(index, invoice)
parents_index += 1
else:
# skipping the bundle items rows
if not row.indent:
row.indent = 1.0
row.parent_invoice = row.parent
row.parent = row.item_code
if frappe.db.exists('Product Bundle', row.item_code):
self.add_bundle_items(row, index)
def get_invoice_row(self, row):
return frappe._dict({
'parent_invoice': "",
'indent': 0.0,
'parent': row.parent,
'posting_date': row.posting_date,
'posting_time': row.posting_time,
'project': row.project,
'update_stock': row.update_stock,
'customer': row.customer,
'customer_group': row.customer_group,
'item_code': None,
'item_name': None,
'description': None,
'warehouse': None,
'item_group': None,
'brand': None,
'dn_detail': None,
'delivery_note': None,
'qty': None,
'item_row': None,
'is_return': row.is_return,
'cost_center': row.cost_center,
'base_net_amount': frappe.db.get_value('Sales Invoice', row.parent, 'base_net_total')
})
def add_bundle_items(self, product_bundle, index):
bundle_items = self.get_bundle_items(product_bundle)
for i, item in enumerate(bundle_items):
bundle_item = self.get_bundle_item_row(product_bundle, item)
self.si_list.insert((index+i+1), bundle_item)
def get_bundle_items(self, product_bundle):
return frappe.get_all(
'Product Bundle Item',
filters = {
'parent': product_bundle.item_code
},
fields = ['item_code', 'qty']
)
def get_bundle_item_row(self, product_bundle, item):
item_name, description, item_group, brand = self.get_bundle_item_details(item.item_code)
return frappe._dict({
'parent_invoice': product_bundle.item_code,
'indent': product_bundle.indent + 1,
'parent': item.item_code,
'posting_date': product_bundle.posting_date,
'posting_time': product_bundle.posting_time,
'project': product_bundle.project,
'customer': product_bundle.customer,
'customer_group': product_bundle.customer_group,
'item_code': item.item_code,
'item_name': item_name,
'description': description,
'warehouse': product_bundle.warehouse,
'item_group': item_group,
'brand': brand,
'dn_detail': product_bundle.dn_detail,
'delivery_note': product_bundle.delivery_note,
'qty': (flt(product_bundle.qty) * flt(item.qty)),
'item_row': None,
'is_return': product_bundle.is_return,
'cost_center': product_bundle.cost_center
})
def get_bundle_item_details(self, item_code):
return frappe.db.get_value(
'Item',
item_code,
['item_name', 'description', 'item_group', 'brand']
)
def load_stock_ledger_entries(self):
res = frappe.db.sql("""select item_code, voucher_type, voucher_no,
voucher_detail_no, stock_value, warehouse, actual_qty as qty

View File

@@ -8,6 +8,7 @@ from frappe.utils import flt
from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import (get_tax_accounts,
get_grand_total, add_total_row, get_display_value, get_group_by_and_display_fields, add_sub_total_row,
get_group_by_conditions)
from erpnext.selling.report.item_wise_sales_history.item_wise_sales_history import get_item_details
def execute(filters=None):
return _execute(filters)
@@ -23,7 +24,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
aii_account_map = get_aii_accounts()
if item_list:
itemised_tax, tax_columns = get_tax_accounts(item_list, columns, company_currency,
doctype="Purchase Invoice", tax_doctype="Purchase Taxes and Charges")
doctype='Purchase Invoice', tax_doctype='Purchase Taxes and Charges')
po_pr_map = get_purchase_receipts_against_purchase_order(item_list)
@@ -35,10 +36,14 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
if filters.get('group_by'):
grand_total = get_grand_total(filters, 'Purchase Invoice')
item_details = get_item_details()
for d in item_list:
if not d.stock_qty:
continue
item_record = item_details.get(d.item_code)
purchase_receipt = None
if d.purchase_receipt:
purchase_receipt = d.purchase_receipt
@@ -49,8 +54,8 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
row = {
'item_code': d.item_code,
'item_name': d.item_name,
'item_group': d.item_group,
'item_name': item_record.item_name if item_record else d.item_name,
'item_group': item_record.item_group if item_record else d.item_group,
'description': d.description,
'invoice': d.parent,
'posting_date': d.posting_date,
@@ -82,10 +87,10 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
for tax in tax_columns:
item_tax = itemised_tax.get(d.name, {}).get(tax, {})
row.update({
frappe.scrub(tax + ' Rate'): item_tax.get("tax_rate", 0),
frappe.scrub(tax + ' Amount'): item_tax.get("tax_amount", 0),
frappe.scrub(tax + ' Rate'): item_tax.get('tax_rate', 0),
frappe.scrub(tax + ' Amount'): item_tax.get('tax_amount', 0),
})
total_tax += flt(item_tax.get("tax_amount"))
total_tax += flt(item_tax.get('tax_amount'))
row.update({
'total_tax': total_tax,
@@ -317,8 +322,9 @@ def get_items(filters, additional_query_columns):
select
`tabPurchase Invoice Item`.`name`, `tabPurchase Invoice Item`.`parent`,
`tabPurchase Invoice`.posting_date, `tabPurchase Invoice`.credit_to, `tabPurchase Invoice`.company,
`tabPurchase Invoice`.supplier, `tabPurchase Invoice`.remarks, `tabPurchase Invoice`.base_net_total, `tabPurchase Invoice Item`.`item_code`,
`tabPurchase Invoice Item`.`item_name`, `tabPurchase Invoice Item`.`item_group`, `tabPurchase Invoice Item`.description,
`tabPurchase Invoice`.supplier, `tabPurchase Invoice`.remarks, `tabPurchase Invoice`.base_net_total,
`tabPurchase Invoice Item`.`item_code`, `tabPurchase Invoice Item`.description,
`tabPurchase Invoice Item`.`item_name`, `tabPurchase Invoice Item`.`item_group`,
`tabPurchase Invoice Item`.`project`, `tabPurchase Invoice Item`.`purchase_order`,
`tabPurchase Invoice Item`.`purchase_receipt`, `tabPurchase Invoice Item`.`po_detail`,
`tabPurchase Invoice Item`.`expense_account`, `tabPurchase Invoice Item`.`stock_qty`,

View File

@@ -8,6 +8,7 @@ from frappe.utils import flt, cstr
from frappe.model.meta import get_field_precision
from frappe.utils.xlsxutils import handle_html
from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments
from erpnext.selling.report.item_wise_sales_history.item_wise_sales_history import get_item_details, get_customer_details
def execute(filters=None):
return _execute(filters)
@@ -17,7 +18,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
filters.update({"from_date": filters.get("date_range") and filters.get("date_range")[0], "to_date": filters.get("date_range") and filters.get("date_range")[1]})
columns = get_columns(additional_table_columns, filters)
company_currency = frappe.get_cached_value('Company', filters.get("company"), "default_currency")
company_currency = frappe.get_cached_value('Company', filters.get('company'), 'default_currency')
item_list = get_items(filters, additional_query_columns)
if item_list:
@@ -34,7 +35,13 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
if filters.get('group_by'):
grand_total = get_grand_total(filters, 'Sales Invoice')
customer_details = get_customer_details()
item_details = get_item_details()
for d in item_list:
customer_record = customer_details.get(d.customer)
item_record = item_details.get(d.item_code)
delivery_note = None
if d.delivery_note:
delivery_note = d.delivery_note
@@ -46,14 +53,14 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
row = {
'item_code': d.item_code,
'item_name': d.item_name,
'item_group': d.item_group,
'item_name': item_record.item_name if item_record else d.item_name,
'item_group': item_record.item_group if item_record else d.item_group,
'description': d.description,
'invoice': d.parent,
'posting_date': d.posting_date,
'customer': d.customer,
'customer_name': d.customer_name,
'customer_group': d.customer_group,
'customer_name': customer_record.customer_name,
'customer_group': customer_record.customer_group,
}
if additional_query_columns:
@@ -91,10 +98,10 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
for tax in tax_columns:
item_tax = itemised_tax.get(d.name, {}).get(tax, {})
row.update({
frappe.scrub(tax + ' Rate'): item_tax.get("tax_rate", 0),
frappe.scrub(tax + ' Amount'): item_tax.get("tax_amount", 0),
frappe.scrub(tax + ' Rate'): item_tax.get('tax_rate', 0),
frappe.scrub(tax + ' Amount'): item_tax.get('tax_amount', 0),
})
total_tax += flt(item_tax.get("tax_amount"))
total_tax += flt(item_tax.get('tax_amount'))
row.update({
'total_tax': total_tax,
@@ -227,7 +234,7 @@ def get_columns(additional_table_columns, filters):
if filters.get('group_by') != 'Terriotory':
columns.extend([
{
'label': _("Territory"),
'label': _('Territory'),
'fieldname': 'territory',
'fieldtype': 'Link',
'options': 'Territory',
@@ -382,13 +389,13 @@ def get_items(filters, additional_query_columns):
`tabSales Invoice`.posting_date, `tabSales Invoice`.debit_to,
`tabSales Invoice`.project, `tabSales Invoice`.customer, `tabSales Invoice`.remarks,
`tabSales Invoice`.territory, `tabSales Invoice`.company, `tabSales Invoice`.base_net_total,
`tabSales Invoice Item`.item_code, `tabSales Invoice Item`.item_name,
`tabSales Invoice Item`.item_group, `tabSales Invoice Item`.description, `tabSales Invoice Item`.sales_order,
`tabSales Invoice Item`.delivery_note, `tabSales Invoice Item`.income_account,
`tabSales Invoice Item`.cost_center, `tabSales Invoice Item`.stock_qty,
`tabSales Invoice Item`.stock_uom, `tabSales Invoice Item`.base_net_rate,
`tabSales Invoice Item`.base_net_amount, `tabSales Invoice`.customer_name,
`tabSales Invoice`.customer_group, `tabSales Invoice Item`.so_detail,
`tabSales Invoice Item`.item_code, `tabSales Invoice Item`.description,
`tabSales Invoice Item`.`item_name`, `tabSales Invoice Item`.`item_group`,
`tabSales Invoice Item`.sales_order, `tabSales Invoice Item`.delivery_note,
`tabSales Invoice Item`.income_account, `tabSales Invoice Item`.cost_center,
`tabSales Invoice Item`.stock_qty, `tabSales Invoice Item`.stock_uom,
`tabSales Invoice Item`.base_net_rate, `tabSales Invoice Item`.base_net_amount,
`tabSales Invoice`.customer_name, `tabSales Invoice`.customer_group, `tabSales Invoice Item`.so_detail,
`tabSales Invoice`.update_stock, `tabSales Invoice Item`.uom, `tabSales Invoice Item`.qty {0}
from `tabSales Invoice`, `tabSales Invoice Item`
where `tabSales Invoice`.name = `tabSales Invoice Item`.parent
@@ -425,14 +432,14 @@ def get_deducted_taxes():
return frappe.db.sql_list("select name from `tabPurchase Taxes and Charges` where add_deduct_tax = 'Deduct'")
def get_tax_accounts(item_list, columns, company_currency,
doctype="Sales Invoice", tax_doctype="Sales Taxes and Charges"):
doctype='Sales Invoice', tax_doctype='Sales Taxes and Charges'):
import json
item_row_map = {}
tax_columns = []
invoice_item_row = {}
itemised_tax = {}
tax_amount_precision = get_field_precision(frappe.get_meta(tax_doctype).get_field("tax_amount"),
tax_amount_precision = get_field_precision(frappe.get_meta(tax_doctype).get_field('tax_amount'),
currency=company_currency) or 2
for d in item_list:
@@ -477,8 +484,8 @@ def get_tax_accounts(item_list, columns, company_currency,
tax_rate = tax_data
tax_amount = 0
if charge_type == "Actual" and not tax_rate:
tax_rate = "NA"
if charge_type == 'Actual' and not tax_rate:
tax_rate = 'NA'
item_net_amount = sum([flt(d.base_net_amount)
for d in item_row_map.get(parent, {}).get(item_code, [])])
@@ -492,17 +499,17 @@ def get_tax_accounts(item_list, columns, company_currency,
if (doctype == 'Purchase Invoice' and name in deducted_tax) else tax_value)
itemised_tax.setdefault(d.name, {})[description] = frappe._dict({
"tax_rate": tax_rate,
"tax_amount": tax_value
'tax_rate': tax_rate,
'tax_amount': tax_value
})
except ValueError:
continue
elif charge_type == "Actual" and tax_amount:
elif charge_type == 'Actual' and tax_amount:
for d in invoice_item_row.get(parent, []):
itemised_tax.setdefault(d.name, {})[description] = frappe._dict({
"tax_rate": "NA",
"tax_amount": flt((tax_amount * d.base_net_amount) / d.base_net_total,
'tax_rate': 'NA',
'tax_amount': flt((tax_amount * d.base_net_amount) / d.base_net_total,
tax_amount_precision)
})
@@ -564,7 +571,7 @@ def add_total_row(data, filters, prev_group_by_value, item, total_row_map,
})
total_row_map.setdefault('total_row', {
subtotal_display_field: "Total",
subtotal_display_field: 'Total',
'stock_qty': 0.0,
'amount': 0.0,
'bold': 1,

View File

@@ -59,23 +59,111 @@ def validate_filters(filters):
def get_columns(filters):
return [
_("Payment Document") + ":: 100",
_("Payment Entry") + ":Dynamic Link/"+_("Payment Document")+":140",
_("Party Type") + "::100",
_("Party") + ":Dynamic Link/Party Type:140",
_("Posting Date") + ":Date:100",
_("Invoice") + (":Link/Purchase Invoice:130" if filters.get("payment_type") == _("Outgoing") else ":Link/Sales Invoice:130"),
_("Invoice Posting Date") + ":Date:130",
_("Payment Due Date") + ":Date:130",
_("Debit") + ":Currency:120",
_("Credit") + ":Currency:120",
_("Remarks") + "::150",
_("Age") +":Int:40",
"0-30:Currency:100",
"30-60:Currency:100",
"60-90:Currency:100",
_("90-Above") + ":Currency:100",
_("Delay in payment (Days)") + "::150"
{
"fieldname": "payment_document",
"label": _("Payment Document Type"),
"fieldtype": "Data",
"width": 100
},
{
"fieldname": "payment_entry",
"label": _("Payment Document"),
"fieldtype": "Dynamic Link",
"options": "payment_document",
"width": 160
},
{
"fieldname": "party_type",
"label": _("Party Type"),
"fieldtype": "Data",
"width": 100
},
{
"fieldname": "party",
"label": _("Party"),
"fieldtype": "Dynamic Link",
"options": "party_type",
"width": 160
},
{
"fieldname": "posting_date",
"label": _("Posting Date"),
"fieldtype": "Date",
"width": 100
},
{
"fieldname": "invoice",
"label": _("Invoice"),
"fieldtype": "Link",
"options": "Purchase Invoice" if filters.get("payment_type") == _("Outgoing") else "Sales Invoice",
"width": 160
},
{
"fieldname": "invoice_posting_date",
"label": _("Invoice Posting Date"),
"fieldtype": "Date",
"width": 100
},
{
"fieldname": "due_date",
"label": _("Payment Due Date"),
"fieldtype": "Date",
"width": 100
},
{
"fieldname": "debit",
"label": _("Debit"),
"fieldtype": "Currency",
"width": 140
},
{
"fieldname": "credit",
"label": _("Credit"),
"fieldtype": "Currency",
"width": 140
},
{
"fieldname": "remarks",
"label": _("Remarks"),
"fieldtype": "Data",
"width": 200
},
{
"fieldname": "age",
"label": _("Age"),
"fieldtype": "Int",
"width": 50
},
{
"fieldname": "range1",
"label": _("0-30"),
"fieldtype": "Currency",
"width": 140
},
{
"fieldname": "range2",
"label": _("30-60"),
"fieldtype": "Currency",
"width": 140
},
{
"fieldname": "range3",
"label": _("60-90"),
"fieldtype": "Currency",
"width": 140
},
{
"fieldname": "range4",
"label": _("90 Above"),
"fieldtype": "Currency",
"width": 140
},
{
"fieldname": "delay_in_payment",
"label": _("Delay in payment (Days)"),
"fieldtype": "Int",
"width": 100
}
]
def get_conditions(filters):

View File

@@ -75,7 +75,10 @@ def get_fiscal_years(transaction_date=None, fiscal_year=None, label="Date", verb
else:
return ((fy.name, fy.year_start_date, fy.year_end_date),)
error_msg = _("""{0} {1} not in any active Fiscal Year.""").format(label, formatdate(transaction_date))
error_msg = _("""{0} {1} is not in any active Fiscal Year""").format(label, formatdate(transaction_date))
if company:
error_msg = _("""{0} for {1}""").format(error_msg, frappe.bold(company))
if verbose==1: frappe.msgprint(error_msg)
raise FiscalYearError(error_msg)

View File

@@ -78,6 +78,7 @@ frappe.ui.form.on('Asset', {
frappe.ui.form.trigger("Asset", "is_existing_asset");
frm.toggle_display("next_depreciation_date", frm.doc.docstatus < 1);
frm.events.make_schedules_editable(frm);
frm.trigger("toggle_make_depreciation_entry");
if (frm.doc.docstatus==1) {
if (in_list(["Submitted", "Partially Depreciated", "Fully Depreciated"], frm.doc.status)) {
@@ -136,6 +137,20 @@ frappe.ui.form.on('Asset', {
if (frm.doc.docstatus == 0) {
frm.toggle_reqd("finance_books", frm.doc.calculate_depreciation);
frm.set_df_property('depreciation_start_date', 'reqd', 1, frm.doc.name, 'finance_books');
frm.refresh_field('finance_books');
}
},
toggle_make_depreciation_entry: function(frm) {
if (frm.doc.calculate_depreciation){
if (in_list(["Submitted", "Partially Depreciated"], frm.doc.status)){
frm.fields_dict['schedules'].grid.set_column_disp('make_depreciation_entry', true);
} else {
frm.fields_dict['schedules'].grid.set_column_disp('make_depreciation_entry', false);
}
frm.refresh_field('schedules');
}
},

View File

@@ -122,11 +122,6 @@ class Asset(AccountsController):
if self.is_existing_asset:
return
docname = self.purchase_receipt or self.purchase_invoice
if docname:
doctype = 'Purchase Receipt' if self.purchase_receipt else 'Purchase Invoice'
date = frappe.db.get_value(doctype, docname, 'posting_date')
if self.available_for_use_date and getdate(self.available_for_use_date) < getdate(self.purchase_date):
frappe.throw(_("Available-for-use Date should be after purchase date"))
@@ -404,9 +399,10 @@ class Asset(AccountsController):
if accumulated_depreciation_after_full_schedule:
accumulated_depreciation_after_full_schedule = max(accumulated_depreciation_after_full_schedule)
asset_value_after_full_schedule = flt(flt(self.gross_purchase_amount) -
flt(accumulated_depreciation_after_full_schedule),
self.precision('gross_purchase_amount'))
asset_value_after_full_schedule = flt(
flt(self.gross_purchase_amount) -
flt(self.opening_accumulated_depreciation) -
flt(accumulated_depreciation_after_full_schedule), self.precision('gross_purchase_amount'))
if (row.expected_value_after_useful_life and
row.expected_value_after_useful_life < asset_value_after_full_schedule):

View File

@@ -34,6 +34,8 @@ def make_depreciation_entry(asset_name, date=None):
date = today()
asset = frappe.get_doc("Asset", asset_name)
validate_asset(asset)
fixed_asset_account, accumulated_depreciation_account, depreciation_expense_account = \
get_depreciation_accounts(asset)
@@ -59,7 +61,7 @@ def make_depreciation_entry(asset_name, date=None):
"credit_in_account_currency": d.depreciation_amount,
"reference_type": "Asset",
"reference_name": asset.name,
"cost_center": ""
"cost_center": depreciation_cost_center
}
debit_entry = {
@@ -101,6 +103,10 @@ def make_depreciation_entry(asset_name, date=None):
return asset
def validate_asset(asset):
if asset.status not in ['Submitted', 'Partially Depreciated']:
frappe.throw(_("Cannot depreciate {0} Asset").format(asset.status))
def get_depreciation_accounts(asset):
fixed_asset_account = accumulated_depreciation_account = depreciation_expense_account = None

View File

@@ -50,6 +50,5 @@ frappe.ui.form.on('Asset Category', {
}
};
});
}
});

View File

@@ -1,5 +1,4 @@
{
"actions": [],
"creation": "2018-05-08 14:44:37.095570",
"doctype": "DocType",
"editable_grid": 1,
@@ -54,9 +53,7 @@
"fieldname": "depreciation_start_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Depreciation Posting Date",
"mandatory_depends_on": "eval:parent.doctype == 'Asset'",
"reqd": 1
"label": "Depreciation Posting Date"
},
{
"default": "0",
@@ -84,10 +81,8 @@
"label": "Rate of Depreciation"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2020-10-30 15:22:29.119868",
"modified": "2020-12-30 15:43:03.188256",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset Finance Book",

View File

@@ -12,8 +12,8 @@ from frappe.model.document import Document
class AssetValueAdjustment(Document):
def validate(self):
self.validate_date()
self.set_difference_amount()
self.set_current_asset_value()
self.set_difference_amount()
def on_submit(self):
self.make_depreciation_entry()

View File

@@ -141,7 +141,7 @@ def get_data(filters):
assets_record = frappe.db.get_all("Asset",
filters=conditions,
fields=["name", "asset_name", "department", "cost_center", "purchase_receipt",
fields=["name as asset_id", "asset_name", "department", "cost_center", "purchase_receipt",
"asset_category", "purchase_date", "gross_purchase_amount", "location",
"available_for_use_date", "status", "purchase_invoice", "opening_accumulated_depreciation"])

View File

@@ -3,6 +3,7 @@
"description": "Settings for Buying Module",
"doctype": "DocType",
"document_type": "Other",
"engine": "InnoDB",
"field_order": [
"supp_master_name",
"supplier_group",
@@ -92,7 +93,7 @@
"icon": "fa fa-cog",
"idx": 1,
"issingle": 1,
"modified": "2019-08-20 13:13:09.055189",
"modified": "2021-03-02 18:16:03.947813",
"modified_by": "Administrator",
"module": "Buying",
"name": "Buying Settings",
@@ -107,5 +108,8 @@
"share": 1,
"write": 1
}
]
],
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}

View File

@@ -355,7 +355,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
material_request_type: "Purchase",
docstatus: 1,
status: ["!=", "Stopped"],
per_ordered: ["<", 99.99],
per_ordered: ["<", 100],
}
})
}, __("Get items from"));

View File

@@ -1056,7 +1056,7 @@
"idx": 105,
"is_submittable": 1,
"links": [],
"modified": "2020-09-14 14:36:12.418690",
"modified": "2021-01-22 20:27:11.418690",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",

View File

@@ -366,7 +366,6 @@ def make_purchase_receipt(source_name, target_doc=None):
"Purchase Order": {
"doctype": "Purchase Receipt",
"field_map": {
"per_billed": "per_billed",
"supplier_warehouse":"supplier_warehouse"
},
"validation": {

View File

@@ -89,7 +89,7 @@ class TestPurchaseOrder(unittest.TestCase):
frappe.db.set_value("Accounts Settings", None, "over_billing_allowance", 0)
def test_update_child_qty_rate(self):
def test_update_child(self):
mr = make_material_request(qty=10)
po = make_purchase_order(mr.name)
po.supplier = "_Test Supplier"
@@ -119,7 +119,7 @@ class TestPurchaseOrder(unittest.TestCase):
self.assertEqual(get_ordered_qty(), existing_ordered_qty + 3)
def test_add_new_item_in_update_child_qty_rate(self):
def test_update_child_adding_new_item(self):
po = create_purchase_order(do_not_save=1)
po.items[0].qty = 4
po.save()
@@ -145,7 +145,7 @@ class TestPurchaseOrder(unittest.TestCase):
self.assertEqual(po.status, 'To Receive and Bill')
def test_remove_item_in_update_child_qty_rate(self):
def test_update_child_removing_item(self):
po = create_purchase_order(do_not_save=1)
po.items[0].qty = 4
po.save()
@@ -185,7 +185,7 @@ class TestPurchaseOrder(unittest.TestCase):
self.assertEquals(len(po.get('items')), 1)
self.assertEqual(po.status, 'To Receive and Bill')
def test_update_child_qty_rate_perm(self):
def test_update_child_perm(self):
po = create_purchase_order(item_code= "_Test Item", qty=4)
user = 'test@example.com'

View File

@@ -271,7 +271,7 @@ erpnext.buying.RequestforQuotationController = erpnext.buying.BuyingController.e
material_request_type: "Purchase",
docstatus: 1,
status: ["!=", "Stopped"],
per_ordered: ["<", 99.99]
per_ordered: ["<", 100]
}
})
}, __("Get items from"));
@@ -316,7 +316,7 @@ erpnext.buying.RequestforQuotationController = erpnext.buying.BuyingController.e
material_request_type: "Purchase",
docstatus: 1,
status: ["!=", "Stopped"],
per_ordered: ["<", 99.99]
per_ordered: ["<", 100]
}
});
$(btn).done_working();

View File

@@ -108,6 +108,10 @@ class RequestforQuotation(BuyingController):
'link_doctype': 'Supplier',
'link_name': rfq_supplier.supplier
})
contact.append('email_ids', {
'email_id': user.name,
'is_primary': 1
})
if not contact.email_id and not contact.user:
contact.email_id = user.name
@@ -275,19 +279,21 @@ def add_items(sq_doc, supplier, items):
create_rfq_items(sq_doc, supplier, data)
def create_rfq_items(sq_doc, supplier, data):
sq_doc.append('items', {
"item_code": data.item_code,
"item_name": data.item_name,
"description": data.description,
"qty": data.qty,
"rate": data.rate,
"conversion_factor": data.conversion_factor if data.conversion_factor else None,
"supplier_part_no": frappe.db.get_value("Item Supplier", {'parent': data.item_code, 'supplier': supplier}, "supplier_part_no"),
"warehouse": data.warehouse or '',
args = {}
for field in ['item_code', 'item_name', 'description', 'qty', 'rate', 'conversion_factor',
'warehouse', 'material_request', 'material_request_item', 'stock_qty']:
args[field] = data.get(field)
args.update({
"request_for_quotation_item": data.name,
"request_for_quotation": data.parent
"request_for_quotation": data.parent,
"supplier_part_no": frappe.db.get_value("Item Supplier",
{'parent': data.item_code, 'supplier': supplier}, "supplier_part_no")
})
sq_doc.append('items', args)
@frappe.whitelist()
def get_pdf(doctype, name, supplier_idx):
doc = get_rfq_doc(doctype, name, supplier_idx)

View File

@@ -46,7 +46,7 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext
material_request_type: "Purchase",
docstatus: 1,
status: ["!=", "Stopped"],
per_ordered: ["<", 99.99]
per_ordered: ["<", 100]
}
})
}, __("Get items from"));

View File

@@ -35,9 +35,7 @@ def update_last_purchase_rate(doc, is_submit):
frappe.throw(_("UOM Conversion factor is required in row {0}").format(d.idx))
# update last purchsae rate
if last_purchase_rate:
frappe.db.sql("""update `tabItem` set last_purchase_rate = %s where name = %s""",
(flt(last_purchase_rate), d.item_code))
frappe.db.set_value('Item', d.item_code, 'last_purchase_rate', flt(last_purchase_rate))
def validate_for_items(doc):
items = []

View File

@@ -0,0 +1,11 @@
## ERPNext v12.16.0 Release Note
### Feature
- GST E-invoicing for India ([#24184](https://github.com/frappe/erpnext/pull/24184))
### Fixes
- Do not override the manually added valuation rate in stock entry ([#24221](https://github.com/frappe/erpnext/pull/24221))
- Do not manufacture same serial no multiple times ([#24163](https://github.com/frappe/erpnext/pull/24163))

View File

@@ -0,0 +1,24 @@
## ERPNext v12.17.0 Release Notes
### Features
- Separated equity tree in COA SKR04 ([#24094](https://github.com/frappe/erpnext/pull/24094))
- Display transporter address in sales invoice ([#23731](https://github.com/frappe/erpnext/pull/23731))
- Introduced GST E-Invoicing ([#24184](https://github.com/frappe/erpnext/pull/24184))
### Fixes
- Fixed Payment Entry multi-currency issue ([#24331](https://github.com/frappe/erpnext/pull/24331))
- Fixed an issue where user could have manufactured same serial no multiple times ([#24163](https://github.com/frappe/erpnext/pull/24163))
- Back Update from QC based on Batch No ([#24368](https://github.com/frappe/erpnext/pull/24368))
- Fixed tax calculation on salary slip for the first month ([#24309](https://github.com/frappe/erpnext/pull/24309)) ([#24272](https://github.com/frappe/erpnext/pull/24272))
- Fixed issues related to e-invoicing ([#24366](https://github.com/frappe/erpnext/pull/24366)) ([#24421](https://github.com/frappe/erpnext/pull/24421)) ([#24284](https://github.com/frappe/erpnext/pull/24284))
- Added a validation to restrict manual overriding of valuation rate in Stock Entry ([#24221](https://github.com/frappe/erpnext/pull/24221))
- Fixed incorrect serial no. in the subcontracted Purchase Receipt ([#24353](https://github.com/frappe/erpnext/pull/24353))
- Fixed an issue where Stock Ledger entry was not getting created against Stock Reconciliation ([#24384](https://github.com/frappe/erpnext/pull/24384))
- Fixed company wise Valuation Rate for raw material in BOM ([#24367](https://github.com/frappe/erpnext/pull/24367))
- Fixed Taxation related issue ([#24159](https://github.com/frappe/erpnext/pull/24159))
- Allowed to override the basic rate for the finished good ([#24301](https://github.com/frappe/erpnext/pull/24301))
- Fixed Loyalty Program related issues ([#24188](https://github.com/frappe/erpnext/pull/24188))
- Fixed an issue where last purchase rate was not getting updated on canceling last voucher ([#24323](https://github.com/frappe/erpnext/pull/24323))
- Fixed issue with pricing rule for offline POS ([#24288](https://github.com/frappe/erpnext/pull/24288))

View File

@@ -0,0 +1,37 @@
## ERPNext v12.18.0 Release Notes
### Enhancements
- Make patient age translatable ([#24416](https://github.com/frappe/erpnext/pull/24416))
- Adding UOM, Item Group via Update Items ([#24479](https://github.com/frappe/erpnext/pull/24479))
### Fixes
- Incorrect incoming rate for the sales return ([#24620](https://github.com/frappe/erpnext/pull/24620))
- Prorata factor fixes in subscription ([#24638](https://github.com/frappe/erpnext/pull/24638))
- QR code image generation for e-invoicing ([#24422](https://github.com/frappe/erpnext/pull/24422))
- Validation for disabled warehouse ([#24546](https://github.com/frappe/erpnext/pull/24546))
- Update total in words after updating items ([#24592](https://github.com/frappe/erpnext/pull/24592))
- Set contact email in RFQ ([#24486](https://github.com/frappe/erpnext/pull/24486))
- Plaid client version to support latest API ([#24532](https://github.com/frappe/erpnext/pull/24532))
- Dynamic Links for reports ([#24461](https://github.com/frappe/erpnext/pull/24461))
- Use supplied year for IRS 1099 forms ([#24425](https://github.com/frappe/erpnext/pull/24425))
- Add check for allowing access to european region ([#24393](https://github.com/frappe/erpnext/pull/24393))
- Item-wise Sales Register item_name error ([#24484](https://github.com/frappe/erpnext/pull/24484))
- Skip e-invoice generation for non-taxable invoices (India) ([#24569](https://github.com/frappe/erpnext/pull/24569))
- Issues with packing items ([#24606](https://github.com/frappe/erpnext/pull/24606))
- Remove max 5 file attachment limit in task ([#24056](https://github.com/frappe/erpnext/pull/24056))
- Calculate discount amount ([#24511](https://github.com/frappe/erpnext/pull/24511))
- Validate tax template for tax category ([#24403](https://github.com/frappe/erpnext/pull/24403))
- Do not validate gstin for exports (India) ([#24564](https://github.com/frappe/erpnext/pull/24564))
- Stock ageing should not take cancelled stock entries. ([#24438](https://github.com/frappe/erpnext/pull/24438))
- Discount amount calculation on net total ([#24498](https://github.com/frappe/erpnext/pull/24498))
- Fetching of standalone cr/dr notes for reconciliation ([#24576](https://github.com/frappe/erpnext/pull/24576))
- Avoid changing Ref. Doctype in Accounting Dimension after creation ([#24579](https://github.com/frappe/erpnext/pull/24579))
- Add GST state code for Ladakh (India) ([#24635](https://github.com/frappe/erpnext/pull/24635))
- Consolidated Financial Statement report not works if child company accounts not present in the parent company ([#24580](https://github.com/frappe/erpnext/pull/24580))
- Missing Asset Id in the Fixed Asset Register Report ([#24391](https://github.com/frappe/erpnext/pull/24391))
- e_invoice print format not showing other charges ([#24473](https://github.com/frappe/erpnext/pull/24473))
- Fix filters for report IRS 1099 ([#24597](https://github.com/frappe/erpnext/pull/24597))
- Stock ledger entry was not created against stock reconciliation ([#24382](https://github.com/frappe/erpnext/pull/24382))
- Validate cancellation only if irn generated (India) ([#24609](https://github.com/frappe/erpnext/pull/24609))

View File

@@ -0,0 +1,34 @@
## Version 12.20.0 Release Notes
### Fixes & Enhancements
- E-invoicing - Validations & tax calculation fixes ([#25315](https://github.com/frappe/erpnext/pull/25315))
- Allow zero valuation in stock reconciliation ([#24986](https://github.com/frappe/erpnext/pull/24986))
- Remove shipping address GSTIN validation for e-invoice ([#25133](https://github.com/frappe/erpnext/pull/25133))
- Allow Item image alt ([#24935](https://github.com/frappe/erpnext/pull/24935))
- Added parent task expected end date validation ([#24889](https://github.com/frappe/erpnext/pull/24889))
- Incorrect Nil Exempt and Non GST amount in GSTR3B report ([#24919](https://github.com/frappe/erpnext/pull/24919))
- Item attributes not editable until refresh ([#24887](https://github.com/frappe/erpnext/pull/24887))
- Create property setters for shorter naming series ([#25134](https://github.com/frappe/erpnext/pull/25134))
- Serial no refresh issue ([#25130](https://github.com/frappe/erpnext/pull/25130))
- Sales Order not saving due type mismatch in promo scheme (#24748) ([#25056](https://github.com/frappe/erpnext/pull/25056))
- TDS check getting checked after reload ([#24974](https://github.com/frappe/erpnext/pull/24974))
- Round total quantity in job card ([#25246](https://github.com/frappe/erpnext/pull/25246))
- santize_for_json is not defined ([#25157](https://github.com/frappe/erpnext/pull/25157))
- Apply single transaction threshold on net_total instead of supplier credit amount ([#25208](https://github.com/frappe/erpnext/pull/25208))
- Zero amount completed delivery notes being shown in Sales Invoice get items ([#25318](https://github.com/frappe/erpnext/pull/25318))
- Error message compensatory leave request ([#25216](https://github.com/frappe/erpnext/pull/25216))
- RCM tax calculation ([#25226](https://github.com/frappe/erpnext/pull/25226))
- Don't delete mode of payment account details while deleting comp… ([#25218](https://github.com/frappe/erpnext/pull/25218))
- Opportunity-quotation mapping order status ([#25002](https://github.com/frappe/erpnext/pull/25002))
- Object referencing same memory address issue ([#25165](https://github.com/frappe/erpnext/pull/25165))
- Validation msg for TransDocNo e-invoicing ([#25120](https://github.com/frappe/erpnext/pull/25120))
- Do not fetch stopped MR in production plan ([#25110](https://github.com/frappe/erpnext/pull/25110))
- Incorrect status creating PR from PO after creating PI ([#25203](https://github.com/frappe/erpnext/pull/25203))
- Remove gst name validation for purchase Invoice ([#25236](https://github.com/frappe/erpnext/pull/25236))
- Assignment Rule Unassign Condition doesn't work ([#24890](https://github.com/frappe/erpnext/pull/24890))
- Place of supply for e-invoicing ([#25149](https://github.com/frappe/erpnext/pull/25149))
- Serial no trim issue ([#24950](https://github.com/frappe/erpnext/pull/24950))
- Commit individual SLE rename for large datasets (v12) ([#25085](https://github.com/frappe/erpnext/pull/25085))
- Incorrect batch picked in subcontracted purchase receipt ([#25169](https://github.com/frappe/erpnext/pull/25169))

View File

@@ -0,0 +1,21 @@
## Version 12.21.0 Release Notes
### Fixes & Enhancements
- Incorrect qty calculated for sub-contracted raw materials in purchase receipt ([#25443](https://github.com/frappe/erpnext/pull/25443))
- Update cost center in the item table fetched from POS Profile in v12 ([#25612](https://github.com/frappe/erpnext/pull/25612))
- Total stock summary report not working ([#25552](https://github.com/frappe/erpnext/pull/25552))
- Timeout error while loading warehouse tree ([#25693](https://github.com/frappe/erpnext/pull/25693))
- RCM rounding precision ([#25410](https://github.com/frappe/erpnext/pull/25410))
- Change subcontracted item display ([#25426](https://github.com/frappe/erpnext/pull/25426))
- Remove invalid changes added due to merge conflict ([#25437](https://github.com/frappe/erpnext/pull/25437))
- Add document type field for e-invoicing (Italy) ([#25420](https://github.com/frappe/erpnext/pull/25420))
- Issue in project custom status ([#25453](https://github.com/frappe/erpnext/pull/25453))
- Employee Separation ([#25504](https://github.com/frappe/erpnext/pull/25504))
- State code for Other Territory ([#25422](https://github.com/frappe/erpnext/pull/25422))
- Remove invalid changes added due to merge conflict ([#25405](https://github.com/frappe/erpnext/pull/25405))
- Check for None in item.schedule_date before setting ([#25589](https://github.com/frappe/erpnext/pull/25589))
- Can't multiply sequence by non-int of type 'float' ([#25385](https://github.com/frappe/erpnext/pull/25385))
- Filter using purpose, make requested changes ([#25388](https://github.com/frappe/erpnext/pull/25388))
- Purchase from registered composition dealer ([#25419](https://github.com/frappe/erpnext/pull/25419))

View File

@@ -0,0 +1,16 @@
## Version 12.22.0 Release Notes
### Fixes & Enhancements
- Cost-center wise period closing entry ([#25930](https://github.com/frappe/erpnext/pull/25930))
- Wrong round off gl entry posted in case of purchase invoice ([#25952](https://github.com/frappe/erpnext/pull/25952))
- Sync shopify customer addresses (#25481) ([#25937](https://github.com/frappe/erpnext/pull/25937))
- Plaid NoneType error ([#25662](https://github.com/frappe/erpnext/pull/25662))
- Cashlfow mapper not showing data ([#25739](https://github.com/frappe/erpnext/pull/25739))
- Update shopify api version (#25600) ([#25939](https://github.com/frappe/erpnext/pull/25939))
- Invalid 'depends_on' expression in opportunity ([#25954](https://github.com/frappe/erpnext/pull/25954))
- Ignore rounding diff while importing JV using data import ([#25715](https://github.com/frappe/erpnext/pull/25715))
- update cost center from POS ([#25972](https://github.com/frappe/erpnext/pull/25972))
- update employee field on renaming employee ([#25958](https://github.com/frappe/erpnext/pull/25958))
- student invalid password reset link ([#25827](https://github.com/frappe/erpnext/pull/25827))
- Backward compatibility for GSTR-1 report ([#25913](https://github.com/frappe/erpnext/pull/25913))

View File

@@ -0,0 +1,20 @@
## Version 12.23.0 Release Notes
### Fixes & Enhancements
- Added Permissions for employee to book an appointment ([#26246](https://github.com/frappe/erpnext/pull/26246))
- New check field in subscriptions for (not) submitting invoices (BP #25394) ([#25560](https://github.com/frappe/erpnext/pull/25560))
- fix(e-invoicing): allow export invoice even if no taxes applied (#26363) ([#26406](https://github.com/frappe/erpnext/pull/26406))
- Omit item discount amount for e-invoicing (#26353) ([#26408](https://github.com/frappe/erpnext/pull/26408))
- fix(plaid): cannot reset plaid link for a bank account ([#26282](https://github.com/frappe/erpnext/pull/26282))
- Job applicant link issue ([#25935](https://github.com/frappe/erpnext/pull/25935))
- LMS progress issue ([#26254](https://github.com/frappe/erpnext/pull/26254))
- Half day to be accounted in its leave type ([#26267](https://github.com/frappe/erpnext/pull/26267))
- Material request status issue ([#26089](https://github.com/frappe/erpnext/pull/26089))
- fix(e-invoicing): service item check ([#26141](https://github.com/frappe/erpnext/pull/26141))
- Invoices can alter profit and loss of a closed year ([#26161](https://github.com/frappe/erpnext/pull/26161))
- Material request and supplier quotation not linked if supplier quotation created from supplier portal ([#26117](https://github.com/frappe/erpnext/pull/26117))
- Update positions in default cashflow mappers ([#26091](https://github.com/frappe/erpnext/pull/26091))
- Staffing plan vacancies data type issue ([#25940](https://github.com/frappe/erpnext/pull/25940))
- Added company filter while fetching loans ([#26296](https://github.com/frappe/erpnext/pull/26296))
- Serial no issue in subcontract purchase receipt ([#26423](https://github.com/frappe/erpnext/pull/26423))
- Fixed rounding off ordered percent to 100 in condition ([#26153](https://github.com/frappe/erpnext/pull/26153))

View File

@@ -108,8 +108,14 @@ class AccountsController(TransactionBase):
self.validate_deferred_start_and_end_date()
validate_regional(self)
validate_einvoice_fields(self)
if self.doctype != 'Material Request':
apply_pricing_rule_on_transaction(self)
def before_cancel(self):
validate_einvoice_fields(self)
def validate_deferred_start_and_end_date(self):
for d in self.items:
@@ -1179,43 +1185,28 @@ def add_taxes_from_tax_template(child_item, parent_doc):
})
tax_row.db_insert()
def set_sales_order_defaults(parent_doctype, parent_doctype_name, child_docname, trans_item):
def set_order_defaults(parent_doctype, parent_doctype_name, child_doctype, child_docname, trans_item):
"""
Returns a Sales Order Item child item containing the default values
Returns a Sales/Purchase Order Item child item containing the default values
"""
p_doc = frappe.get_doc(parent_doctype, parent_doctype_name)
child_item = frappe.new_doc('Sales Order Item', p_doc, child_docname)
child_item = frappe.new_doc(child_doctype, p_doc, child_docname)
item = frappe.get_doc("Item", trans_item.get('item_code'))
child_item.item_code = item.item_code
child_item.item_name = item.item_name
child_item.description = item.description
child_item.delivery_date = trans_item.get('delivery_date') or p_doc.delivery_date
child_item.conversion_factor = flt(trans_item.get('conversion_factor')) or get_conversion_factor(item.item_code, item.stock_uom).get("conversion_factor") or 1.0
child_item.uom = item.stock_uom
set_child_tax_template_and_map(item, child_item, p_doc)
add_taxes_from_tax_template(child_item, p_doc)
child_item.warehouse = get_item_warehouse(item, p_doc, overwrite_warehouse=True)
if not child_item.warehouse:
frappe.throw(_("Cannot find {} for item {}. Please set the same in Item Master or Stock Settings.")
.format(frappe.bold("default warehouse"), frappe.bold(item.item_code)))
return child_item
def set_purchase_order_defaults(parent_doctype, parent_doctype_name, child_docname, trans_item):
"""
Returns a Purchase Order Item child item containing the default values
"""
p_doc = frappe.get_doc(parent_doctype, parent_doctype_name)
child_item = frappe.new_doc('Purchase Order Item', p_doc, child_docname)
item = frappe.get_doc("Item", trans_item.get('item_code'))
child_item.item_code = item.item_code
child_item.item_name = item.item_name
child_item.description = item.description
child_item.schedule_date = trans_item.get('schedule_date') or p_doc.schedule_date
child_item.conversion_factor = flt(trans_item.get('conversion_factor')) or get_conversion_factor(item.item_code, item.stock_uom).get("conversion_factor") or 1.0
child_item.uom = item.stock_uom
child_item.base_rate = 1 # Initiallize value will update in parent validation
child_item.base_amount = 1 # Initiallize value will update in parent validation
for field in ("item_code", "item_name", "description", "item_group"):
child_item.update({field: item.get(field)})
date_fieldname = "delivery_date" if child_doctype == "Sales Order Item" else "schedule_date"
child_item.update({date_fieldname: trans_item.get(date_fieldname) or p_doc.get(date_fieldname)})
child_item.uom = trans_item.get("uom") or item.stock_uom
conversion_factor = flt(get_conversion_factor(item.item_code, child_item.uom).get("conversion_factor"))
child_item.conversion_factor = flt(trans_item.get('conversion_factor')) or conversion_factor
if child_doctype == "Purchase Order Item":
child_item.base_rate = 1 # Initiallize value will update in parent validation
child_item.base_amount = 1 # Initiallize value will update in parent validation
if child_doctype == "Sales Order Item":
child_item.warehouse = get_item_warehouse(item, p_doc, overwrite_warehouse=True)
if not child_item.warehouse:
frappe.throw(_("Cannot find {} for item {}. Please set the same in Item Master or Stock Settings.")
.format(frappe.bold("default warehouse"), frappe.bold(item.item_code)))
set_child_tax_template_and_map(item, child_item, p_doc)
add_taxes_from_tax_template(child_item, p_doc)
return child_item
@@ -1279,8 +1270,8 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
)
def get_new_child_item(item_row):
new_child_function = set_sales_order_defaults if parent_doctype == "Sales Order" else set_purchase_order_defaults
return new_child_function(parent_doctype, parent_doctype_name, child_docname, item_row)
child_doctype = "Sales Order Item" if parent_doctype == "Sales Order" else "Purchase Order Item"
return set_order_defaults(parent_doctype, parent_doctype_name, child_doctype, child_docname, item_row)
def validate_quantity(child_item, d):
if parent_doctype == "Sales Order" and flt(d.get("qty")) < flt(child_item.delivered_qty):
@@ -1299,6 +1290,11 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
for d in data:
new_child_flag = False
if not d.get("item_code"):
# ignore empty rows
continue
if not d.get("docname"):
new_child_flag = True
check_doc_permissions(parent, 'create')
@@ -1310,6 +1306,7 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
prev_rate, new_rate = flt(child_item.get("rate")), flt(d.get("rate"))
prev_qty, new_qty = flt(child_item.get("qty")), flt(d.get("qty"))
prev_con_fac, new_con_fac = flt(child_item.get("conversion_factor")), flt(d.get("conversion_factor"))
prev_uom, new_uom = child_item.get("uom"), d.get("uom")
if parent_doctype == 'Sales Order':
prev_date, new_date = child_item.get("delivery_date"), d.get("delivery_date")
@@ -1318,9 +1315,10 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
rate_unchanged = prev_rate == new_rate
qty_unchanged = prev_qty == new_qty
uom_unchanged = prev_uom == new_uom
conversion_factor_unchanged = prev_con_fac == new_con_fac
date_unchanged = prev_date == new_date if prev_date and new_date else False # in case of delivery note etc
if rate_unchanged and qty_unchanged and conversion_factor_unchanged and date_unchanged:
date_unchanged = prev_date == getdate(new_date) if prev_date and new_date else False # in case of delivery note etc
if rate_unchanged and qty_unchanged and conversion_factor_unchanged and uom_unchanged and date_unchanged:
continue
validate_quantity(child_item, d)
@@ -1341,6 +1339,11 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
child_item.conversion_factor = 1
else:
child_item.conversion_factor = flt(d.get('conversion_factor'), conv_fac_precision)
if d.get("uom"):
child_item.uom = d.get("uom")
conversion_factor = flt(get_conversion_factor(child_item.item_code, child_item.uom).get("conversion_factor"))
child_item.conversion_factor = flt(d.get('conversion_factor')) or conversion_factor
if d.get("delivery_date") and parent_doctype == 'Sales Order':
child_item.delivery_date = d.get('delivery_date')
@@ -1382,6 +1385,7 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
parent.flags.ignore_validate_update_after_submit = True
parent.set_qty_as_per_stock_uom()
parent.calculate_taxes_and_totals()
parent.set_total_in_words()
if parent_doctype == "Sales Order":
make_packing_list(parent)
parent.set_gross_profit()
@@ -1407,6 +1411,8 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
parent.update_receiving_percentage()
if parent.is_subcontracted == "Yes":
parent.update_reserved_qty_for_subcontract()
parent.create_raw_materials_supplied("supplied_items")
parent.save()
else:
parent.update_reserved_qty()
parent.update_project()
@@ -1423,3 +1429,7 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
@erpnext.allow_regional
def validate_regional(doc):
pass
@erpnext.allow_regional
def validate_einvoice_fields(doc):
pass

View File

@@ -6,6 +6,7 @@ import frappe
from frappe import _, msgprint
from frappe.utils import flt,cint, cstr, getdate
from six import iteritems
from collections import OrderedDict
from erpnext.accounts.party import get_party_details
from erpnext.stock.get_item_details import get_conversion_factor
from erpnext.buying.utils import validate_for_items, update_last_purchase_rate
@@ -294,9 +295,12 @@ class BuyingController(StockController):
for raw_material in transferred_raw_materials + non_stock_items:
rm_item_key = (raw_material.rm_item_code, item.item_code, item.purchase_order)
raw_material_data = backflushed_raw_materials_map.get(rm_item_key, {})
if not raw_material_data and raw_material.get('batch_nos'):
backflushed_raw_materials_map.setdefault(rm_item_key, {'consumed_batch': {}})
raw_material_data = backflushed_raw_materials_map.get(rm_item_key, {})
consumed_qty = raw_material_data.get('qty', 0)
consumed_serial_nos = raw_material_data.get('serial_nos', '')
consumed_serial_nos = raw_material_data.get('serial_no', '')
consumed_batch_nos = raw_material_data.get('batch_nos', '')
transferred_qty = raw_material.qty
@@ -325,14 +329,17 @@ class BuyingController(StockController):
batches_qty = get_batches_with_qty(raw_material.rm_item_code, raw_material.main_item_code,
qty, transferred_batch_qty_map, backflushed_batch_qty_map, item.purchase_order)
for batch_data in batches_qty:
qty = batch_data['qty']
raw_material.batch_no = batch_data['batch']
self.append_raw_material_to_be_backflushed(item, raw_material, qty)
if qty > 0:
self.append_raw_material_to_be_backflushed(item, raw_material, qty)
else:
self.append_raw_material_to_be_backflushed(item, raw_material, qty)
def append_raw_material_to_be_backflushed(self, fg_item_doc, raw_material_data, qty):
qty = flt(qty, fg_item_doc.precision('qty'))
rm = self.append('supplied_items', {})
rm.update(raw_material_data)
@@ -790,9 +797,10 @@ class BuyingController(StockController):
if not self.get("items"):
return
earliest_schedule_date = min([d.schedule_date for d in self.get("items")])
if earliest_schedule_date:
self.schedule_date = earliest_schedule_date
if any(d.schedule_date for d in self.get("items")):
# Select earliest schedule_date.
self.schedule_date = min(d.schedule_date for d in self.get("items")
if d.schedule_date is not None)
if self.schedule_date:
for d in self.get('items'):
@@ -973,8 +981,16 @@ def get_non_stock_items(purchase_order, fg_item_code):
def set_serial_nos(raw_material, consumed_serial_nos, qty):
serial_nos = set(get_serial_nos(raw_material.serial_nos)) - \
set(get_serial_nos(consumed_serial_nos))
consumed_serial_nos_list = []
if consumed_serial_nos and isinstance(consumed_serial_nos, list):
for row in consumed_serial_nos:
consumed_serial_nos_list.extend(get_serial_nos(row))
elif consumed_serial_nos:
consumed_serial_nos_list = get_serial_nos(consumed_serial_nos)
serial_nos = set(get_serial_nos(raw_material.serial_nos)) - set(consumed_serial_nos_list)
if serial_nos and qty <= len(serial_nos):
raw_material.serial_no = '\n'.join(list(serial_nos)[0:frappe.utils.cint(qty)])
@@ -1009,7 +1025,7 @@ def get_transferred_batch_qty_map(purchase_order, fg_item):
for batch_data in transferred_batches:
key = ((batch_data.item_code, fg_item)
if batch_data.subcontracted_item else (batch_data.item_code, purchase_order))
transferred_batch_qty_map.setdefault(key, {})
transferred_batch_qty_map.setdefault(key, OrderedDict())
transferred_batch_qty_map[key][batch_data.batch_no] = batch_data.qty
return transferred_batch_qty_map
@@ -1062,8 +1078,14 @@ def get_batches_with_qty(item_code, fg_item, required_qty, transferred_batch_qty
if available_qty >= required_qty:
available_batches.append({'batch': batch, 'qty': required_qty})
break
else:
elif available_qty != 0:
available_batches.append({'batch': batch, 'qty': available_qty})
required_qty -= available_qty
for row in available_batches:
if backflushed_batches.get(row.get('batch'), 0) > 0:
backflushed_batches[row.get('batch')] += row.get('qty')
else:
backflushed_batches.setdefault(row.get('batch'), row.get('qty'))
return available_batches

View File

@@ -320,7 +320,7 @@ def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len,
and status not in ("Stopped", "Closed") %(fcond)s
and (
(`tabDelivery Note`.is_return = 0 and `tabDelivery Note`.per_billed < 100)
or `tabDelivery Note`.grand_total = 0
or (`tabDelivery Note`.grand_total = 0 and `tabDelivery Note`.per_billed < 100)
or (
`tabDelivery Note`.is_return = 1
and return_against in (select name from `tabDelivery Note` where per_billed < 100)

View File

@@ -279,6 +279,7 @@ def make_return_doc(doctype, source_name, target_doc=None):
target_doc.po_detail = source_doc.po_detail
target_doc.pr_detail = source_doc.pr_detail
target_doc.purchase_invoice_item = source_doc.name
target_doc.price_list_rate = 0
elif doctype == "Delivery Note":
target_doc.against_sales_order = source_doc.against_sales_order
@@ -297,6 +298,7 @@ def make_return_doc(doctype, source_name, target_doc=None):
target_doc.dn_detail = source_doc.dn_detail
target_doc.expense_account = source_doc.expense_account
target_doc.sales_invoice_item = source_doc.name
target_doc.price_list_rate = 0
if default_warehouse_for_sales_return:
target_doc.warehouse = default_warehouse_for_sales_return

View File

@@ -310,12 +310,27 @@ class SellingController(StockController):
if flt(d.conversion_factor)==0.0:
d.conversion_factor = get_conversion_factor(d.item_code, d.uom).get("conversion_factor") or 1.0
return_rate = 0
if cint(self.is_return) and self.return_against and self.docstatus==1:
against_document_no = (d.get("sales_invoice_item")
if self.doctype == "Sales Invoice" else d.get("delivery_note_item"))
if cint(self.is_return) and self.docstatus==1:
if self.return_against:
against_document_no = (d.get("sales_invoice_item")
if self.doctype == "Sales Invoice" else d.get("delivery_note_item"))
return_rate = self.get_incoming_rate_for_sales_return(d.item_code,
self.return_against, against_document_no)
return_rate = self.get_incoming_rate_for_sales_return(d.item_code,
self.return_against, against_document_no)
else:
# For standalone credit note
args = frappe._dict({
"item_code": d.item_code,
"warehouse": d.warehouse,
"posting_date": self.posting_date,
"posting_time": self.posting_time,
"qty": flt(d.qty),
"serial_no": d.serial_no,
"company": d.company,
"allow_zero_valuation": d.allow_zero_valuation
})
return_rate = get_incoming_rate(args)
# On cancellation or if return entry submission, make stock ledger entry for
# target warehouse first, to update serial no values properly

View File

@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, comma_or, nowdate, getdate
from frappe.utils import flt, comma_or, nowdate, getdate, now
from frappe import _
from frappe.model.document import Document
@@ -307,10 +307,14 @@ class StatusUpdater(Document):
target.notify_update()
def _update_modified(self, args, update_modified):
args['update_modified'] = ''
if update_modified:
args['update_modified'] = ', modified = now(), modified_by = {0}'\
.format(frappe.db.escape(frappe.session.user))
if not update_modified:
args['update_modified'] = ''
return
args['update_modified'] = ', modified = {0}, modified_by = {1}'.format(
frappe.db.escape(now()),
frappe.db.escape(frappe.session.user)
)
def update_billing_status_for_zero_amount_refdoc(self, ref_dt):
ref_fieldname = frappe.scrub(ref_dt)

View File

@@ -319,12 +319,13 @@ class StockController(AccountsController):
return incoming_rate
def validate_warehouse(self):
from erpnext.stock.utils import validate_warehouse_company
from erpnext.stock.utils import validate_warehouse_company, validate_disabled_warehouse
warehouses = list(set([d.warehouse for d in
self.get("items") if getattr(d, "warehouse", None)]))
for w in warehouses:
validate_disabled_warehouse(w)
validate_warehouse_company(w, self.company)
def update_billing_percentage(self, update_modified=True):
@@ -417,7 +418,7 @@ def compare_existing_and_expected_gle(existing_gle, expected_gle):
for e in existing_gle:
if entry.account == e.account:
account_existed = True
if entry.account == e.account and entry.against_account == e.against_account \
if entry.account == e.account \
and (not entry.cost_center or not e.cost_center or entry.cost_center == e.cost_center) \
and (entry.debit != e.debit or entry.credit != e.credit):
matched = False

View File

@@ -93,7 +93,7 @@
"fieldtype": "Column Break"
}
],
"modified": "2019-10-14 15:23:54.630731",
"modified": "2021-06-28 16:27:53.235714",
"modified_by": "Administrator",
"module": "CRM",
"name": "Appointment",
@@ -144,6 +144,18 @@
"role": "Sales User",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Employee",
"share": 1,
"write": 1
}
],
"quick_entry": 1,

View File

@@ -277,7 +277,6 @@
"read_only": 1
},
{
"depends_on": "eval:",
"fieldname": "territory",
"fieldtype": "Link",
"label": "Territory",
@@ -413,7 +412,7 @@
],
"icon": "fa fa-info-sign",
"idx": 195,
"modified": "2020-08-12 23:34:39.665513",
"modified": "2021-06-04 10:11:22.831139",
"modified_by": "Administrator",
"module": "CRM",
"name": "Opportunity",

View File

@@ -244,7 +244,6 @@ def make_quotation(source_name, target_doc=None):
"doctype": "Quotation",
"field_map": {
"opportunity_from": "quotation_to",
"opportunity_type": "order_type",
"name": "enq_no",
}
},

View File

@@ -19,15 +19,50 @@ def set_defaut_value_for_filters(filters):
if not filters.get('lead_age'): filters["lead_age"] = 60
def get_columns():
return [
_("Lead") + ":Link/Lead:100",
_("Name") + "::100",
_("Organization") + "::100",
_("Reference Document") + "::150",
_("Reference Name") + ":Dynamic Link/"+_("Reference Document")+":120",
_("Last Communication") + ":Data:200",
_("Last Communication Date") + ":Date:180"
]
columns = [{
"label": _("Lead"),
"fieldname": "lead",
"fieldtype": "Link",
"options": "Lead",
"width": 130
},
{
"label": _("Name"),
"fieldname": "name",
"width": 120
},
{
"label": _("Organization"),
"fieldname": "organization",
"width": 120
},
{
"label": _("Reference Document Type"),
"fieldname": "reference_document_type",
"fieldtype": "Link",
"options": "Doctype",
"width": 100
},
{
"label": _("Reference Name"),
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"options": "reference_document_type",
"width": 140
},
{
"label": _("Last Communication"),
"fieldname": "last_communication",
"fieldtype": "Data",
"width": 200
},
{
"label": _("Last Communication Date"),
"fieldname": "last_communication_date",
"fieldtype": "Date",
"width": 100
}]
return columns
def get_data(filters):
lead_details = []

View File

@@ -13,7 +13,7 @@
"fields": [
{
"fieldname": "question",
"fieldtype": "Small Text",
"fieldtype": "Text Editor",
"in_list_view": 1,
"label": "Question",
"reqd": 1
@@ -34,7 +34,7 @@
"read_only": 1
}
],
"modified": "2019-05-30 18:39:21.880974",
"modified": "2021-01-28 18:39:21.880974",
"modified_by": "Administrator",
"module": "Education",
"name": "Question",
@@ -77,4 +77,4 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
}
}

View File

@@ -58,7 +58,6 @@ class Student(Document):
student_user.flags.ignore_permissions = True
student_user.add_roles("Student")
student_user.save()
update_password_link = student_user.reset_password()
def update_applicant_status(self):
"""Updates Student Applicant status to Admitted"""

View File

@@ -345,11 +345,11 @@ def get_or_create_course_enrollment(course, program):
student = get_current_student()
course_enrollment = get_enrollment("course", course, student.name)
if not course_enrollment:
program_enrollment = get_enrollment('program', program, student.name)
program_enrollment = get_enrollment('program', program.name, student.name)
if not program_enrollment:
frappe.throw(_("You are not enrolled in program {0}".format(program)))
return
return student.enroll_in_course(course_name=course, program_enrollment=get_enrollment('program', program, student.name))
return student.enroll_in_course(course_name=course, program_enrollment=get_enrollment('program', program.name, student.name))
else:
return frappe.get_doc('Course Enrollment', course_enrollment)

View File

@@ -14,8 +14,7 @@ def verify_request():
)
if frappe.request.data and \
frappe.get_request_header("X-Wc-Webhook-Signature") and \
not sig == bytes(frappe.get_request_header("X-Wc-Webhook-Signature").encode()):
not sig == frappe.get_request_header("X-Wc-Webhook-Signature", "").encode():
frappe.throw(_("Unverified Webhook Data"))
frappe.set_user(woocommerce_settings.creation_user)

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