Compare commits

...

741 Commits

Author SHA1 Message Date
Ameya Shenoy
65652071ff Merge branch 'hotfix' 2018-10-04 09:11:50 +00:00
Ameya Shenoy
79dc8ac9cc bumped to version 10.1.55 2018-10-04 09:11:50 +00:00
rohitwaghchaure
15e7646edd Merge pull request #15569 from rohitwaghchaure/stock_adjustment_to_cost_of_goods_sold
Book cost of goods sold instead of stock adjustment
2018-10-03 17:36:29 +05:30
Rohit Waghchaure
d1b87ba41c Book cost of goods sold instead of stock adjustment 2018-10-03 16:29:43 +05:30
rohitwaghchaure
a5576f5b21 [Fix] Stock difference between gl entry and stock ledger entry booked in stock adjustment (#15374) 2018-10-03 10:39:50 +05:30
rohitwaghchaure
8976ad5ca1 Merge pull request #15523 from rohitwaghchaure/fix_attendance_tool_issue
[Fix] Attendance tool
2018-10-01 15:07:49 +05:30
Rohit Waghchaure
c7f8b82fff [Fix] Attendance tool 2018-10-01 12:30:58 +05:30
rohitwaghchaure
6b62b86bbf Merge pull request #15545 from rohitwaghchaure/salary_slip_not_creating_because_of_the_date_issue
[Fix] Salary slip
2018-10-01 12:03:26 +05:30
Rohit Waghchaure
8fbf856618 [Fix] Salary slip 2018-10-01 12:00:45 +05:30
Nabin Hait
7d6d678e8d purchase receipt return entry in dashboard 2018-09-26 19:04:11 +05:30
Nabin Hait
c22ba2ec26 fix(sales return): validation message fix 2018-09-26 18:56:45 +05:30
rohitwaghchaure
0cf0ebf08b [Refactored] Asset Depreciation Ledger report based on GL entries (#15415)
* [Refactored] Asset Depreciation Ledger report is based on GL entries

* Provision to make manual JV from the asset if Calculate Depreciation is disabled
2018-09-26 15:24:49 +05:30
Ameya Shenoy
0ff35a852a Merge branch 'hotfix' 2018-09-26 07:26:49 +00:00
Ameya Shenoy
e04431ea5c bumped to version 10.1.54 2018-09-26 07:26:49 +00:00
rohitwaghchaure
fafc277666 [Fix] BOM update tool, too many writes in one request. Please send smaller requests (#15432) 2018-09-25 18:59:20 +05:30
rohitwaghchaure
fe1e4a41e6 Validate negative stock serial number (#15492) 2018-09-25 18:36:32 +05:30
Faris Ansari
7a8c5b0c2c fix(setup wizard): Validate FY dates (#15473) 2018-09-25 18:34:33 +05:30
Saurabh
056ecdca6a Merge branch 'hotfix' 2018-09-20 13:22:36 +05:30
Saurabh
3b281a0a1b bumped to version 10.1.53 2018-09-20 13:52:36 +06:00
rohitwaghchaure
a60ab1af75 [Fix] Salary slip is not saving (#15449) 2018-09-20 13:18:49 +05:30
rohitwaghchaure
550fc695f1 [Fix] Precision issue in the accounts receivable report (#15440) 2018-09-19 19:03:40 +05:30
Zarrar
013493de7a lable for discount_amount should be configurable (#15408) 2018-09-17 11:06:49 +05:30
Saurabh
b3737c812a Merge branch 'hotfix' 2018-09-12 14:44:25 +05:30
Saurabh
6d5a29af6a bumped to version 10.1.52 2018-09-12 15:14:25 +06:00
Ahmed Madi
20d8c52d2a Update salary_slip.js (#15200) 2018-09-12 11:02:57 +05:30
Nabin Hait
e11f299b21 Update production_order.py 2018-09-11 11:36:05 +05:30
Zarrar
68000c66fc check if Data Migration Plan exists before deleting (#15368) 2018-09-09 19:19:13 +05:30
rohitwaghchaure
3cc77b52e7 [Fix] Timeout error for bom update tool (#15343) 2018-09-07 16:16:58 +05:30
rohitwaghchaure
bd4348db10 [Enhance] Add additional cost of the manufacture stock entry in the project costing (#15341) 2018-09-07 16:16:23 +05:30
Nabin Hait
4fd1cebf95 fix(patch): Delete all documents from Hub Node module 2018-09-06 18:53:46 +05:30
Faris Ansari
b892cc8b02 fix(item): Remove Hub Category field (#15331) 2018-09-06 18:02:48 +05:30
Nabin Hait
8652bce9e3 Update modules.txt 2018-09-06 14:18:49 +05:30
Faris Ansari
4e372a30fa fix(patch): Remove old Hub Page (#15328) 2018-09-06 14:08:31 +05:30
Prateeksha Singh
df327f2974 [remove-hub] delete hub module 2018-09-06 13:34:47 +05:30
Prateeksha Singh
3ccbb8f8b7 [remove-hub] delete hub_settings and hub_category 2018-09-06 13:28:47 +05:30
Zarrar
0d931e1d7d fix uom & stock_uom print hide logic (#15327) 2018-09-06 13:08:58 +05:30
johnhkelley1
431b4fba72 Allow for 0 valuation rate in Stock Reconciliation (#15313)
Currently, a valuation rate of 0 gets treated the same as an omitted
valuation rate, and gets overwritten during validation. This hotfix
allows a Stock Reconciliation Item's valuation rate to be set to 0.
2018-09-05 11:43:28 +05:30
Saurabh
fba985d49d Merge branch 'hotfix' 2018-09-03 17:00:15 +05:30
Saurabh
4bd562d669 bumped to version 10.1.51 2018-09-03 17:30:15 +06:00
Shreya Shah
bb88e964a4 Remove unnecessary code (#15296) 2018-09-03 13:01:12 +05:30
rohitwaghchaure
5f79479bd0 Merge pull request #15282 from rohitwaghchaure/budget_should_check_on_submit_document
[Minor] Don't validate on cancelled budgets
2018-08-31 16:59:56 +05:30
Rohit Waghchaure
12b4096e68 [Minor] Don't validate on cancelled budgest 2018-08-31 16:54:59 +05:30
Saurabh
1ef72c0b66 Merge branch 'hotfix' 2018-08-31 11:29:13 +05:30
Saurabh
648191b9e8 bumped to version 10.1.50 2018-08-31 11:59:13 +06:00
rohitwaghchaure
624927bf0b [Fix] Not able to export the Supplier-Wise Sales Analytics report (#15271) 2018-08-30 19:19:14 +05:30
Shreya Shah
3df2639a32 Optimize patch (#15263) 2018-08-30 17:24:03 +05:30
Nabin Hait
d982e8fcda Merge branch 'hotfix' 2018-08-29 13:13:54 +05:30
Nabin Hait
af497ef669 bumped to version 10.1.49 2018-08-29 13:43:53 +06:00
Saurabh
79f3ea4094 [minor][fix] call update_percent_complete via validate (#15235) 2018-08-28 14:01:34 +05:30
Shreya Shah
e0a47aeb2f Improve performance for warehouse tree (#15207)
* Fix conflicts

* Modify query structure

* Remove whitespaces
2018-08-28 13:46:22 +05:30
Ahmed Madi
1516b8d54a Update asset_category.js (#15222) 2018-08-27 12:04:12 +05:30
rohitwaghchaure
e33047250e [Fix] Speacial character issue in searching project in sales invoice (#15220) 2018-08-27 11:43:57 +05:30
Faris Ansari
c4e38ffd4d Remove hub page (#15195) 2018-08-23 11:09:31 +05:30
Shreya Shah
be7703387d Fetch reserved qty (#15182)
* Fetch reserved qty

* Update get_item_details.py
2018-08-22 14:45:22 +05:30
rohitwaghchaure
b800382abf [Fix] Due to incorrect conversion factor user not able to make purchase return entry (#15163) 2018-08-20 17:50:31 +05:30
rohitwaghchaure
e689a903d8 Allowed data import for Assessment Result (#15168) 2018-08-20 17:50:04 +05:30
rohitwaghchaure
ecc6af9d2a [Fix] Total materials consumed cost not consider in the calculation of Gross Margin in project (#15171) 2018-08-20 17:39:54 +05:30
rohitwaghchaure
5c5688b374 Added provision to disabled in stock in products settings (#15133) 2018-08-16 10:33:28 +05:30
Shreya Shah
80f30094fb Fix error msg (#15146) 2018-08-16 10:29:16 +05:30
rohitwaghchaure
6fb2117767 Allow to make budget for the same cost center with different account (#15149) 2018-08-16 10:22:06 +05:30
Shreya Shah
0631aed3d9 Discount amount field in all transactions' child tables (#15124)
* Add discount_amount and base_discount_amount in Sales Invoice Item

* Add patch for existing documents

* Discount amount field in all child tables of Purchase and Selling

* Remove console statements
2018-08-14 10:51:48 +05:30
rohitwaghchaure
88b0a1305f Code optimization for accounts receivable report to avoid timeout error (#15114)
* Code optimization for accounts receivable report to avoid timeout error

* Added index for party_type
2018-08-14 10:51:13 +05:30
Saurabh
9e98fdfc6e Merge branch 'hotfix' 2018-08-13 13:15:56 +05:30
Saurabh
cd6b955b99 bumped to version 10.1.48 2018-08-13 13:45:56 +06:00
Saurabh
bfd26b7084 Merge pull request #15131 from rohitwaghchaure/project_task_custom_field_not_copying
Project task custom field not copying and error on project
2018-08-13 12:15:40 +05:30
Rohit Waghchaure
18960c7757 Project task custom field not copying and error on project 2018-08-13 11:40:11 +05:30
Saurabh
9a7838265d Merge branch 'hotfix' 2018-08-10 17:07:01 +05:30
Saurabh
57d3c93e6b bumped to version 10.1.47 2018-08-10 17:37:01 +06:00
rohitwaghchaure
a0b846fb88 [Minor] Added condition for get_bank_cash_account (#15112) 2018-08-09 15:51:38 +05:30
rohitwaghchaure
8356d4b892 [Fix] disable_rounded_total not found error (#15113) 2018-08-09 15:51:11 +05:30
rohitwaghchaure
ba62013cbb [Fix] Not able to delete the task even if task removed from the project (#15105)
* [Fix] Not able to delete the task even if task removed from the project

* [Fix] Custom field's data in task not updating from the project
2018-08-09 15:50:23 +05:30
rohitwaghchaure
59de1dae6a [Fix] Math domain error (#15107) 2018-08-09 10:58:37 +05:30
Saurabh
91cecf8eac Merge branch 'hotfix' 2018-08-07 12:55:51 +05:30
Saurabh
6ec558bd59 bumped to version 10.1.46 2018-08-07 13:25:51 +06:00
Shreya Shah
11dd3ffdb5 Force delete item on deletion of Lab test template (#15079) 2018-08-06 14:43:00 +05:30
Shreya Shah
f0ef673498 Accounts receivable aging based on supplier due date (#15080)
* Accounts receivable aging based on supplier due date (#13801)

* Remove spaces
2018-08-06 14:42:35 +05:30
rohitwaghchaure
57d07d6b8e Merge pull request #15097 from rohitwaghchaure/incorrect_tax_amount_in_report
[Fix] Incorrect tax amount calculation because of same fieldname in the code
2018-08-06 14:32:44 +05:30
rohitwaghchaure
fc682c86c6 [Fix] Inactive student validation issue while disabling the student group (#15095) 2018-08-06 14:29:46 +05:30
Rohit Waghchaure
15f52e7b71 [Fix] Incorrect tax amount calculation because of same fieldname in the code 2018-08-06 14:29:34 +05:30
Ameya Shenoy
26bfede116 Merge pull request #15078 from rohitwaghchaure/task_email_alert_not_working_from_project
Fix] Task's email alert on status change not working if we change the task status from the project form
2018-08-06 12:33:07 +05:30
Rohit Waghchaure
86217ca96c [Fix] Task email alert on status change not working if we change the task status from the project form 2018-08-02 16:41:53 +05:30
rohitwaghchaure
ae4ff5a403 [Fix] In words showing grand total instead of rounded total (#15065) 2018-08-01 18:09:51 +05:30
rohitwaghchaure
0452b405f4 [Fix] Not able to submit the expense claim (#15057) 2018-08-01 17:45:51 +05:30
rohitwaghchaure
dc7004e083 [Fix] Patient Appointment Calendar not showing data properly (#15052) 2018-07-31 16:01:02 +05:30
Nabin Hait
ebdefade9b Merge branch 'hotfix' 2018-07-31 12:18:23 +05:30
Nabin Hait
e9afbfde76 bumped to version 10.1.45 2018-07-31 12:48:22 +06:00
rohitwaghchaure
086da451ca Removed academic term from validation to check duplicate program enrollement (#15046) 2018-07-30 19:11:14 +05:30
rohitwaghchaure
91d2ace9bb Account no + account name in trial balance and financial statements reports (#15038) 2018-07-30 10:38:51 +05:30
Shreya Shah
91a9ee5179 Merge accounts functionality (#14993)
* Add dialog to merge accounts

* Add conditions and merge functionality

* Fix travis

* Add test case

* Add more test scenarios
2018-07-28 10:26:11 +05:30
Nabin Hait
11137850cb Merge branch 'hotfix' 2018-07-27 12:35:42 +05:30
Nabin Hait
584153a1b1 bumped to version 10.1.44 2018-07-27 13:05:42 +06:00
Shreya Shah
eed0a4e2df Do not copy remarks field while duplicating (#15023) 2018-07-27 11:26:35 +05:30
FinByz Tech Pvt. Ltd
f5cc1bd44c Created Eway Bill Report (#14926)
* Created Eway Bill Report

* Field value changes

* Changed module from Stock to Regional

* Added comments and minor fix

* minor fix
2018-07-27 11:21:42 +05:30
Yaqin Shurrab
cc56ff5c37 Get the correct Summation of Closing Balances (#14990)
Fix total raw values for Closing Credit and Closing Debit
2018-07-27 11:13:00 +05:30
rohitwaghchaure
20d3bef3c3 [Fix] Deducted tax amount adding up in the total amount in the GST Itemised Purchase Register report (#14994) 2018-07-27 11:03:53 +05:30
Shreya Shah
1f4c263a63 [minor] Program Enrollment Tool (#15013)
* Make academic term field mandatory

* Add disabled field to Student Group

* Mandatory check in Education Settings for Academic Term

* Fix as per review
2018-07-27 10:59:14 +05:30
Nabin Hait
d0a2b1619b Optimization for marking student attendance 2018-07-27 10:51:55 +05:30
rohitwaghchaure
0fe6ced99d [Fix] Valuation rate for serialized items (#15017) 2018-07-27 10:33:30 +05:30
Nabin Hait
e50e0e4b30 Update repost_reserved_qty_for_production.py 2018-07-25 17:49:47 +05:30
Shreya Shah
cd717e422f Modify renaming process of Account (#14839)
* Disable renaming for Account Master

* Update account name along with account number

* Fix as per suggestions

* Update account.js

* Fix typo

* Remove after_rename and before_rename methods

* Modify test case

* Modify field placement

* Remove unused method
2018-07-23 14:15:20 +05:30
rohitwaghchaure
6b862fcae5 [Fix] Rounded total is not working in the purchase receipt (#14984) 2018-07-23 13:02:07 +05:30
Zarrar
a22e0d0c99 return empty if no stock ledger entry found (#14968) 2018-07-23 11:31:04 +05:30
Saurabh
8ca5940f76 Merge branch 'hotfix' 2018-07-18 16:24:54 +05:30
Saurabh
6c46b4edc4 bumped to version 10.1.43 2018-07-18 16:54:54 +06:00
Shreya Shah
8395a7ad6f Modifications in last purchase rate button (#14948)
* Make last purchase rate button visible until submitted

* Move buttons

- Get last purchase rate and link to material request buttons moved to toolbar under Tools button

* Remove disable fetch last rate functionality

* Make last purchase rate field read_only
2018-07-18 12:27:27 +05:30
rohitwaghchaure
6863b03790 Naming series increase even if there is an exception while saving the invoice from the backend (#14938) 2018-07-17 17:20:15 +05:30
rohitwaghchaure
a76067eea1 [Fix] Per billed showing as 100% in the sales order even if sales return has made against the sales order (#14899)
* [Fix] Per billed showing as 100% in the sales order even if sales return has made against the sales order

* Added test cases
2018-07-17 16:50:50 +05:30
rohitwaghchaure
216f9373c9 Provision to select the cost center in the asset (#14934) 2018-07-17 16:47:51 +05:30
rohitwaghchaure
5fe88ea93e [Fix] Not able to update the current value of the prefixes which are defined in the autoname field (#14918) 2018-07-17 12:45:25 +05:30
Shreya Shah
fbeab5bf73 Show opening balance of leaves (#14925)
* Show opening balance of leaves

* Update employee_leave_balance.py
2018-07-17 11:59:51 +05:30
rohitwaghchaure
a3e070bc6b [Fix] Invoices not showing in the gross profit report against which sales return entry has created (#14914) 2018-07-16 18:11:19 +05:30
rohitwaghchaure
3ffe89659a [Fix] System always fetches the payment terms template from the company even if it's removed from the sales invoice (#14879) 2018-07-13 17:40:48 +05:30
Ameya Shenoy
5c3b69476d shift to self-hosted frankfurter api (#14792) 2018-07-13 12:46:07 +05:30
Nabin Hait
da17ceea73 patch fixes 2018-07-13 12:04:06 +05:30
rohitwaghchaure
2d84945839 [Fix] Stock reconciliation wrong difference amount calculation (#14893) 2018-07-13 11:07:27 +05:30
Shreya Shah
8dc4c945dc Fix UX (#14862) 2018-07-11 14:36:49 +05:30
rohitwaghchaure
cc9c7d5e2a [Fix] GSTIN not displaying in the address print (#14855)
* [Fix] GSTIN not displaying in the address print

* Made changes in the patch and set Patch as False

* Update update_address_template_for_india.py
2018-07-10 15:41:42 +05:30
rohitwaghchaure
07d0e9a2b2 Don't show disabled items in the stock balance report (#14851) 2018-07-09 16:56:41 +05:30
Saurabh
f38d6d9c44 Merge branch 'hotfix' 2018-07-09 15:53:50 +05:30
Saurabh
07bb1811af bumped to version 10.1.42 2018-07-09 16:23:50 +06:00
rohitwaghchaure
f07462860b Merge pull request #14846 from shreyashah115/fix-digest
Filter out pending orders based on company
2018-07-09 14:48:13 +05:30
rohitwaghchaure
720b06495c [Fix] Not able to save project (#14848) 2018-07-09 13:57:16 +05:30
Shreya
83ad646af4 Filter out pending orders based on company 2018-07-09 12:14:03 +05:30
rohitwaghchaure
8179bcbabd [Fix] Code cleanup (#14843) 2018-07-09 09:29:40 +05:30
rohitwaghchaure
6be8bea934 Provision to view return entries in Sales Person-wise Transaction Summary (#14830) 2018-07-08 19:25:13 +05:30
Saurabh
0b9129e519 Merge branch 'hotfix' 2018-07-06 13:02:58 +05:30
Saurabh
778e06d0ee bumped to version 10.1.41 2018-07-06 13:32:57 +06:00
rohitwaghchaure
3f5e80ebe3 Allow bulk edit for the sales invoice item (#14826) 2018-07-06 12:39:04 +05:30
rohitwaghchaure
ea943c6fe4 [Fix] Due date validate issue in the POS (#14825) 2018-07-06 12:28:58 +05:30
rohitwaghchaure
82a9fde921 Added compact print option for the material request (#14799) 2018-07-06 10:40:51 +05:30
Saurabh
b35721029b Merge pull request #14820 from saurabh6790/fix_task_status
[fix] Add Overdue status in Project Task
2018-07-06 05:54:47 +05:30
Saurabh
f403031449 [fix] Add Overdue status in Project Task 2018-07-05 19:38:59 +05:30
rohitwaghchaure
25f36489b3 Merge pull request #14805 from rohitwaghchaure/pos_ignore_pricing_issue_online
[Fix] POS Profile ignore pricing rule not working for online pos
2018-07-04 16:26:48 +05:30
Rohit Waghchaure
5005e467a0 [Fix] POS Profile ignore pricing rule not working for online pos 2018-07-04 12:37:38 +05:30
Zarrar
68a148e293 half_day enable/disable check (#14795) 2018-07-03 17:00:38 +05:30
rohitwaghchaure
205eae322b [Fix] BOM replace timeout issue (#14782) 2018-07-03 15:06:38 +05:30
Ameya Shenoy
935f4a474b Prevent creation of more than 500 item variants (#14790) 2018-07-03 10:48:59 +05:30
Shreya Shah
aa62a62bb0 Add VAT related fields after printing settings fields (#14773) 2018-07-03 10:28:20 +05:30
Nabin Hait
104f62090d Add filters for cost center in Budget Variance report 2018-06-29 12:25:03 +05:30
Manas Solanki
3ff7f79cc7 Merge pull request #14740 from manassolanki/fix-20
[minor] fix for the args in the frm.call
2018-06-28 20:47:25 +05:30
Manas Solanki
89e7f8b387 [minor] fix for the args in the frm.call 2018-06-28 20:44:53 +05:30
Shreya Shah
2fbc8509f5 Fix error message (#14716) 2018-06-28 14:14:28 +05:30
rohitwaghchaure
67d87e29e3 [Fix] Wrong rate calculation in Itemwise sales register report for multi uom (#14690) 2018-06-27 11:22:03 +05:30
Deepak kumar
55cf6c5f7e Membership (#14688)
* Correct the label and field name

* Update membership.json
2018-06-27 09:17:33 +05:30
rohitwaghchaure
f3cf15fa0d [Fix] While saving project getting timeout error (#14672) 2018-06-26 17:06:00 +05:30
Prateeksha Singh
d53d2ed791 Merge pull request #14679 from pratu16x7/hotfix
[fix] yet another python attribute fetch
2018-06-26 12:20:26 +05:30
Prateeksha Singh
34aeefc0a1 [fix] yet another python attribute fetch 2018-06-26 12:18:29 +05:30
Shreya Shah
d8031d1a53 Clear child table before appending (#14648) 2018-06-25 10:34:55 +05:30
Ameya Shenoy
1098755d26 Merge branch 'hotfix' 2018-06-22 05:10:27 +00:00
Ameya Shenoy
774f676a25 bumped to version 10.1.40 2018-06-22 05:10:27 +00:00
Ameya Shenoy
1629393618 Merge pull request #14628 from Zlash65/fix-pe
Expense Claim - Payment Entry related fix
2018-06-21 18:49:50 +05:30
Zlash65
4cf46edabc expense_claim related fix in payment entry
outstanding amount calculation fix, manual entry of expense trigger calculation of allocation added
2018-06-21 15:18:13 +05:30
Saurabh
e6498996fa Merge branch 'hotfix' 2018-06-20 15:21:40 +05:30
Saurabh
98b7bb5679 bumped to version 10.1.39 2018-06-20 15:51:40 +06:00
Zarrar
99017b173d naming for asset maintenance task should be task name (#14607) 2018-06-20 14:53:13 +05:30
Zarrar
42f2d1a7a8 fix incase no customer fetched (#14596) 2018-06-20 10:50:11 +05:30
Nabin Hait
a125a6199c Allowed paid amount against debit/credit note 2018-06-19 12:07:02 +05:30
Zarrar
ba1cdc6c57 fix opening invoice related authorization control - item=None (#14567) 2018-06-19 10:45:47 +05:30
Nabin Hait
875c941f3d fixes in setting itemised tax breakup 2018-06-18 17:41:27 +05:30
Nabin Hait
8eeb5694ba Fixed qty in item-wise sales history report 2018-06-18 17:41:27 +05:30
Nabin Hait
0bef91c241 minor fix in item type validation 2018-06-18 17:41:27 +05:30
Nabin Hait
ae02209b6a Removed autoname of child table 2018-06-18 17:41:27 +05:30
Zarrar
e0adb6bbd6 cost_center overridden by company's default fix in SI (#14560) 2018-06-18 15:49:12 +05:30
Manas Solanki
efa191c72e [minor fix] change the unicode/str to the datetime obejct (#14534) 2018-06-15 18:04:12 +05:30
Ameya Shenoy
40fe3a2cdf Merge branch 'hotfix' 2018-06-15 09:29:56 +00:00
Ameya Shenoy
ed77429496 bumped to version 10.1.38 2018-06-15 09:29:56 +00:00
Manas Solanki
c7afbea708 Update bom.py (#14524) 2018-06-14 17:30:26 +05:30
Shreya Shah
dd8fba6783 Do not check for batch on cancellation (#14506) 2018-06-14 11:49:45 +05:30
Saurabh
8e74df09a4 [fix] On deletion of salary slip decrease the series count (#14508) 2018-06-14 11:47:21 +05:30
Shreya Shah
3d73a6f7f2 Fetch details from Journal Entry in Accounts Payable report (#14495)
* Fetch bill_no, bill_date from Journal Entry

* Fix as per suggestion

* Fetch details only if bill_no exists
2018-06-13 16:33:06 +05:30
FinByz Tech Pvt. Ltd
46c8ccc6a8 Fix conflict for taxable value having same item in GSTR-1 Report (#14492)
* Update gstr_1.py

Merge conflict for taxable value having same item

* Update gstr_1.py

* Minor Fix

* Update gstr_1.py
2018-06-13 15:34:17 +05:30
Prateeksha Singh
5d0674a23a Merge pull request #14452 from pratu16x7/hotfix
[hotfix][enhance][tax-breakup] store itemized tax by item_name when possible
2018-06-12 17:42:01 +05:30
Prateeksha Singh
a831868d02 Merge pull request #14460 from chdecultot/hotfix_customer
Customer timeline data hotfix
2018-06-11 16:31:17 +05:30
Charles-Henri Decultot
943dc09f29 Customer timeline data hotfix 2018-06-11 09:42:05 +00:00
Prateeksha Singh
ea7533fa75 [tax-breakup] store itemized tax by item_name when can 2018-06-11 13:31:33 +05:30
Shreya Shah
b9399d8781 Cancel attendance if leave application is cancelled (#14372)
* Cancel attendance if leave application is cancelled

* Fix as per review
2018-06-08 11:24:08 +05:30
Zarrar
8cd0f67b25 query fix if name contains apostrophe (#14370) 2018-06-07 16:48:31 +05:30
Zarrar
32a118d68c fix precision in stock entry (#14366) 2018-06-06 15:06:52 +05:30
Ameya Shenoy
a02d5d1104 Merge branch 'hotfix' 2018-06-06 05:41:37 +00:00
Ameya Shenoy
36cd433999 bumped to version 10.1.37 2018-06-06 05:41:37 +00:00
Shreya Shah
6ff3a094e2 Fix currency exchange tests (#14356) 2018-06-05 14:16:10 +05:30
rohitwaghchaure
50d8c4a10f [Fix] Not able to save purchase invoice, due to invalid condition (#14355) 2018-06-05 13:08:10 +05:30
Zarrar
7c088ff623 dont validate items if item_code not found (#14344)
item_code field is not set when created using invoice creation tool
2018-06-05 10:32:09 +05:30
rohitwaghchaure
7cf01e7c75 Replaced fixer api with exchangeratesapi (#14347) 2018-06-05 10:30:20 +05:30
Zarrar
fc03a0463c [Fix] Validate items for saleable, purchaseable or subcontractable in transactions (#14316)
* validate items to see if they are saleable

* check if items are subcontractable or saleable

* improvise name,error message and code
Validate type function validates item if they are of proper type for that transaction and throws descriptive error.
2018-06-04 12:52:52 +05:30
rohitwaghchaure
5ecc26bf15 [Fix] get_shipping_address() takes at least 1 argument (0 given) (#14328) 2018-06-04 11:00:24 +05:30
rohitwaghchaure
c1cf495a93 [Fix] Special character issue (#14322) 2018-06-03 16:00:31 +05:30
rohitwaghchaure
ce642d73cb [Fix] Special character issue while upadting customer group in customer (#14312) 2018-06-01 15:11:21 +05:30
rohitwaghchaure
2fa057e4ad [Fix] Expense claim showing status as Unpaid even if Total Advance Amount and Total Sanctioned Amount is same (#14311) 2018-06-01 15:10:55 +05:30
Zarrar
7e0e85912b item_name not fetched in packing slip (#14310) 2018-06-01 15:10:33 +05:30
Saurabh
defecd3785 Merge branch 'hotfix' 2018-05-31 17:24:53 +05:30
Saurabh
fccf7f2a68 bumped to version 10.1.36 2018-05-31 17:54:53 +06:00
Ameya Shenoy
cce7189b4f Added issue and PR Templates (#14300) 2018-05-31 08:42:52 +05:30
rohitwaghchaure
31a96d2a3f [Fix] System not fetching default warehoue defined in pos profile for packing materials of product bundle item (#14287) 2018-05-30 18:13:47 +05:30
Zarrar
39c0add5a2 query fix sales-person-target-variance-item-group-wise (#14271) 2018-05-30 11:56:58 +05:30
Zarrar
58200182b4 update timeline data form Activity Log (#14276)
Documents updated are stored in Activity Log rather than Communication
2018-05-30 11:56:23 +05:30
Ameya Shenoy
c2c73ae96a [minor] removed vim swap file (#14277) 2018-05-30 11:55:38 +05:30
Shreya Shah
ae95a8aa15 Update status in Purchase Receipt (#14257)
* Update status on submission if per_billed = 100

* Add patch to update existing records
2018-05-28 18:24:28 +05:30
Zarrar
b9f54ca946 [Enhance] Group same items during printing Delivery Note, Invoices, etc (#14250)
* add doctypes allowed to group items, average the rate

* add check field to group items during print

* call common before_print in delivery note

* fix precision issue while calculating average
2018-05-28 17:41:09 +05:30
rohitwaghchaure
a8c6ec27c0 Merge pull request #14252 from rohitwaghchaure/leaderboard_translation_issue
[Fix] Translation issue in leaderboard
2018-05-28 15:51:00 +05:30
Saurabh
3c1b153cdb Merge pull request #14111 from netchampfaris/stock-ledger-report-hotfix
[fix] Stock Ledger report item filter
2018-05-28 15:23:21 +05:30
Rohit Waghchaure
06f91e2dc1 [Fix] Translation issue in leaderboard 2018-05-28 14:43:17 +05:30
Shreya Shah
13f39eb821 Display rate on the basis of stock UOM (#14246) 2018-05-28 11:50:28 +05:30
rohitwaghchaure
a8fb2db001 [Fix] If two po consolidated in one purchase invoice, Total Net Weight not get summed (#14230) 2018-05-26 09:23:02 +05:30
Ranjith Kurungadam
27cf190269 healthcare fix - str encode to utf-8 (#14213) 2018-05-24 17:15:22 +05:30
Ameya Shenoy
7ad556cd4c Merge branch 'hotfix' 2018-05-24 08:45:12 +00:00
Ameya Shenoy
475729cefe bumped to version 10.1.35 2018-05-24 08:45:12 +00:00
Manas Solanki
f7713ebfa7 [optimize] introduce two filter in the report in order to handle large item master data (#14193) 2018-05-23 19:43:04 +05:30
Ameya Shenoy
92640cc899 Merge branch 'hotfix' 2018-05-22 09:06:38 +00:00
Ameya Shenoy
826f020862 bumped to version 10.1.34 2018-05-22 09:06:38 +00:00
Zarrar
93a186aa11 fetch customer_gstin or billing_address_gstin optionally (#14075) 2018-05-22 09:16:42 +05:30
rohitwaghchaure
742d3e5549 [Fix] General ledger default_currency issue for member party type (#14172) 2018-05-22 09:10:01 +05:30
Prateeksha Singh
bcbe32ce7c Merge pull request #14169 from pratu16x7/hotfix
[hotfix][charts] update, without new build system
2018-05-21 18:31:39 +05:30
Prateeksha Singh
b434f2687e [charts] update, without new build system 2018-05-21 18:04:50 +05:30
Manas Solanki
a752eca82c Merge pull request #14163 from manassolanki/fix-20
[fix] don't update the modified of item price while updating item
2018-05-21 16:37:01 +05:30
rohitwaghchaure
37da7d7d05 Merge pull request #14162 from rohitwaghchaure/permissions_issue_leave_application
[Fix] Permission issue while saving leave application
2018-05-21 16:02:58 +05:30
Manas Solanki
b5d9b38dee don't update the modified of the item price 2018-05-21 15:40:51 +05:30
Rohit Waghchaure
11e2a9ac90 [Fix] Permission issue while saving leave application 2018-05-21 15:39:38 +05:30
rohitwaghchaure
1275ea5123 Merge pull request #14154 from rohitwaghchaure/set_default_leave_approver
Set leave approver in the leave application
2018-05-21 11:58:41 +05:30
Rohit Waghchaure
812224e56e Set leave approver in the leave application 2018-05-20 21:21:33 +05:30
Gaurav Naik
8f17281011 Initialized dynamic link on Warehouse (#14135)
* Initialized dynamic link for Warehouse

* Codacy Fixes
2018-05-20 10:39:14 +05:30
Prateeksha Singh
8233cb11ed Merge pull request #14124 from pratu16x7/hotfix
[item-query] change order of description terms, name first
2018-05-17 17:32:54 +05:30
Prateeksha Singh
984a7a7e61 [item-query] change order of description terms, name first 2018-05-17 17:29:36 +05:30
rohitwaghchaure
b5cc946771 Merge pull request #14122 from shreyashah115/fixes
Fix in marking attendance from Leave Application
2018-05-17 17:16:57 +05:30
Shreya
65dd1f6b4c Mark attendance only if to_date <= nowdate in Leave Application 2018-05-17 17:13:56 +05:30
Prateeksha Singh
7c9a6eba3f Merge pull request #14116 from rohitwaghchaure/project_heatmap_issue
[Fix] Heatmap issue in the project
2018-05-17 15:42:58 +05:30
Rohit Waghchaure
f2ccde0454 [Fix] Heatmap issue in the project 2018-05-17 15:40:32 +05:30
Faris Ansari
9e4889d756 [fix] Stock Ledger report item filter
- breaks when Item Code contains % symbol
2018-05-17 12:18:28 +05:30
Manas Solanki
b81ece9ddf Merge pull request #14076 from chdecultot/pricing_rule
Missing parentheses in price list rate determination
2018-05-16 14:55:32 +05:30
Charles-Henri Decultot
2f822476dd Removal of debugging print 2018-05-16 08:40:16 +00:00
Charles-Henri Decultot
dcfe19d868 Missing parentheses in price list rate determination 2018-05-16 08:34:41 +00:00
Shreya Shah
4f40b2dca5 [Fix] Sales Person Reports (#13987)
* Fix Sales Person Reports
- Show quantity and amounts based on the delivered quantities if the Sales Order has been closed and all quantities weren't considered for further transactions.

* Fix codacy

* Modify as per the review comment
2018-05-16 11:22:59 +05:30
Manas Solanki
1b48fde986 Make the communication from the issue webform (#14015) 2018-05-16 10:47:02 +05:30
Rushabh Mehta
33db332eca Revert "apply sorting for make multiple variant attributes (#14060)" (#14065)
This reverts commit 257e18b640.
2018-05-16 10:43:58 +05:30
lasalesi
257e18b640 apply sorting for make multiple variant attributes (#14060) 2018-05-16 10:42:42 +05:30
Saurabh
292f46fec0 Merge branch 'hotfix' 2018-05-15 14:59:36 +05:30
Saurabh
78a0be666f bumped to version 10.1.33 2018-05-15 15:29:36 +06:00
Saurabh
ce4f520908 Merge pull request #14042 from saurabh6790/patch_fix_15_05
[fix] if UOM and Warehouse link is invalid then set blank values
2018-05-15 14:58:12 +05:30
Saurabh
29160441bb [fix] if UOM and Warehouse link is invalid then set blank values 2018-05-15 14:56:18 +05:30
Saurabh
1b18bba04a Merge branch 'hotfix' 2018-05-15 12:58:15 +05:30
Saurabh
f8c26bb778 bumped to version 10.1.32 2018-05-15 13:28:15 +06:00
Saurabh
ccd0617e19 Merge pull request #14017 from netchampfaris/apply-price-list-hotfix
[fix] apply price list
2018-05-15 11:25:08 +05:30
Saurabh
bf10d0f98b Merge pull request #14031 from shreyashah115/leave-balance
[Bug] Clear leave balance in Leave Application
2018-05-15 11:11:49 +05:30
Shreya
dbb67fb4fd Clear leave balance on changing leave type 2018-05-14 23:02:09 +05:30
Faris Ansari
404f39d373 [fix] apply price list
in_apply_price_list flag remains true if server exception occurs
2018-05-14 15:46:45 +05:30
Shreya Shah
bbee9b6cc4 [Enhancement] Monthly Attendance Report (#13970)
* Update Attendance on Approval of Leave

* Separate out leaves on the basis of its type

* Remove commented code

* Make attendance records if not found

* Fix Codacy

* Replace bad code in attendance.py
2018-05-14 14:30:58 +05:30
Faris Ansari
69b0535e10 [fix] Incorrect currency conversion in Itemised Tax Breakup (#14006) 2018-05-14 14:19:31 +05:30
rohitwaghchaure
7f63c1ad7c Merge pull request #14014 from rohitwaghchaure/hotfix_production_order_name_issue
[Fix] 'ProductionOrder' object has no attribute 'set_work_order_operations'
2018-05-14 14:04:09 +05:30
Rohit Waghchaure
ebe1ebead2 [Fix] 'ProductionOrder' object has no attribute 'set_work_order_operations' 2018-05-14 13:21:45 +05:30
Faris Ansari
f2b3307136 Remove escaped customer string (#13986)
- no need to escape strings that are passed to the values parameter of the sql method
- this query was failing for inputs like "D'Arby" which have quotes
2018-05-11 21:07:27 +05:30
Nabin Hait
9d215c2d9b Set operations on production order while making from Material Request 2018-05-09 18:32:54 +05:30
Vishal Dhayagude
3cf0d51e65 [fix] Compounding error in task weight (#13958)
* [fix] Compounding error in task weight

* [minor] minor changes

* [fix] Requested Changes added
2018-05-09 10:42:39 +05:30
Nabin Hait
9fc5ddc26e Merge branch 'hotfix' 2018-05-08 16:31:38 +05:30
Nabin Hait
0ff31f0ebf bumped to version 10.1.31 2018-05-08 17:01:38 +06:00
Saurabh
40349f4b00 [fix] add stock entry link on Material Request Dashboard (#13950) 2018-05-08 15:23:51 +05:30
Saurabh
b36517158b [fix] cheque print template coordinates (#13959) 2018-05-08 15:23:29 +05:30
Manas Solanki
3b9720f0be Merge pull request #13952 from manassolanki/minor-report-fix
[minor] fix for the student report card
2018-05-08 12:43:43 +05:30
Manas Solanki
cf26b2ca1c [minor] fix for the student report card 2018-05-08 12:39:02 +05:30
Nabin Hait
02a40e9d7b Merge branch 'hotfix' 2018-05-05 14:33:33 +05:30
Nabin Hait
ea199f9cd9 bumped to version 10.1.30 2018-05-05 15:03:33 +06:00
Nabin Hait
161f35a687 Update sales_invoice.py 2018-05-05 14:32:31 +05:30
Nabin Hait
fcb984b294 Merge branch 'hotfix' 2018-05-05 12:13:29 +05:30
Nabin Hait
723fe8fb1b bumped to version 10.1.29 2018-05-05 12:43:29 +06:00
Ameya Shenoy
47c0c8ba49 removed bad code and made compatible with pip 10 (#13805) 2018-05-04 19:20:20 +05:30
Rohit Waghchaure
3e0a937cb8 [Fix] Tax not changes when user change the POS profile in the sales invoice 2018-05-04 19:20:20 +05:30
Jamsheer
bd63f0056a Patient medical record updation and deletion fixes (#13891) 2018-05-04 18:13:28 +05:30
Shreya Shah
55daa9cd24 fix taxable amount for same items (#13927) 2018-05-04 18:01:23 +05:30
Shreya Shah
764b9bfeba cint for Item field has_variants (#13916)
* convert none type value to int

* Fix typo
2018-05-04 17:58:36 +05:30
Nabin Hait
62b985d405 [fix] Update show_in_website in template 2018-05-04 12:21:15 +05:30
Saurabh
ed393d1025 [fix] consider user permissions in leave application calendar view (#13902)
* [fix] consider user permissions in leave application calendar view

* add hr settings to control leave calendar view

* add patch
2018-05-03 18:52:25 +05:30
Nabin Hait
ed376cacc8 Set Qty in transactions based on serial no via Stock Settings (#13897) 2018-05-03 16:24:52 +05:30
Saurabh
7461806b1c Merge pull request #13892 from codingCoffee/travis
dark magic to revive travis
2018-05-02 23:23:07 +05:30
Ameya Shenoy
bb7c5ac0f8 dark magic to revive travis
It seems that some process inside travis is using port no 9000. Hence
adding this line in the travis.yml to change common_site_config.json and
use port no 9001 for socket_io
2018-05-02 17:32:39 +05:30
Saurabh
0272fc05bf Merge branch 'hotfix' 2018-05-02 14:48:09 +05:30
Saurabh
4f6b68fef2 bumped to version 10.1.28 2018-05-02 15:18:09 +06:00
Faris Ansari
eae2ddac69 validate_conversion_rate in taxes_and_totals (#13880) 2018-05-02 12:19:30 +05:30
Prateeksha Singh
99be9d17d5 Merge pull request #13850 from netchampfaris/msgprint-to-alert
Change msgprint to alert
2018-05-01 18:52:49 +05:30
Faris Ansari
5df63e36d4 Merge branch 'hotfix' of https://github.com/frappe/erpnext into hotfix 2018-05-01 10:52:15 +05:30
Faris Ansari
bd99606a14 Change msgprint to unobtrusive alert 2018-05-01 10:52:02 +05:30
Zarrar
b0a46f397a display customer's name while printing receivable report (#13830) 2018-04-30 19:40:18 +05:30
Prateeksha Singh
53c9b63c0b Merge pull request #13842 from pratu16x7/hotfix
[fix] setup_website, fixes #11143
2018-04-30 18:21:53 +05:30
Prateeksha Singh
9b2078feab [fix] setup_website, fixes #11143 2018-04-30 18:11:20 +05:30
Faris Ansari
30304e68ff [fix] Current stock qty calculation in case of different UOM 2018-04-30 15:44:49 +05:30
Zarrar
6bc500bffa [Minor] Validate dates in Salary Structure (#13807)
* validate date

* fix date trigger issue
2018-04-30 11:14:09 +05:30
Faris Ansari
8be895091e Set is_pos to 0 in Opening Invoice Tool (#13810) 2018-04-30 11:13:06 +05:30
Ameya Shenoy
f5f8a1f288 i still don't know why we're still using travis (#13817) 2018-04-30 11:10:39 +05:30
Gaurav Naik
c925a38f79 Ignore mandatory for default warehouses (#13812) 2018-04-27 15:31:11 +05:30
Prateeksha Singh
c23230faea Merge pull request #13786 from pratu16x7/hotfix
[fix] featured product thumbnail
2018-04-25 13:04:19 +05:30
Prateeksha Singh
6855b87f76 [fix] featured product thumbnail 2018-04-25 13:03:11 +05:30
Saurabh
07d030208f Merge branch 'hotfix' 2018-04-25 12:46:48 +05:30
Saurabh
47f6e32920 bumped to version 10.1.27 2018-04-25 13:16:48 +06:00
Saurabh
7bd1453f8f Merge pull request #13785 from rohitwaghchaure/fix_patch_pos_taxes
[Fix] POS Patch
2018-04-25 12:44:20 +05:30
Rohit Waghchaure
bf416cfbf8 [Fix] POS Patch 2018-04-25 12:32:22 +05:30
Saurabh
67918fff32 Merge branch 'hotfix' 2018-04-25 11:31:48 +05:30
Saurabh
132dac9712 bumped to version 10.1.26 2018-04-25 12:01:48 +06:00
rohitwaghchaure
57914f140e [HotFix] Taxes not adding in POS sales invoice (#13776) 2018-04-24 19:19:47 +05:30
Saurabh
ede0af97cd Merge branch 'hotfix' 2018-04-24 12:09:38 +05:30
Saurabh
ad4ede0e23 bumped to version 10.1.25 2018-04-24 12:39:38 +06:00
Saurabh
cfcf9b3832 Merge pull request #13772 from saurabh6790/supp_240418
typo fix
2018-04-24 12:08:38 +05:30
Saurabh
d2065ce3bf typo fix 2018-04-24 12:07:37 +05:30
Rohit Waghchaure
31edddace6 [Fix] Tax not changes when user change the POS profile in the sales invoice 2018-04-24 11:43:31 +05:30
Saurabh
8f29159fb7 Merge branch 'hotfix' 2018-04-24 11:12:07 +05:30
Saurabh
d9f1b539dc bumped to version 10.1.24 2018-04-24 11:42:07 +06:00
Prateeksha Singh
60bd383a25 Merge pull request #13763 from pratu16x7/hotfix
[fix] cal view start end date field discrepancies
2018-04-23 13:34:49 +05:30
Prateeksha Singh
c0ec3c3f7b [fix] cal view start end date field discrepancies 2018-04-23 13:32:59 +05:30
Manas Solanki
60aa1170d5 Merge pull request #13762 from manassolanki/fix-patient-appointment
fixed the gantt view of patient appointment
2018-04-23 12:39:28 +05:30
Manas Solanki
9630aa3d7f fixed the gantt view of patient appointment 2018-04-23 12:37:11 +05:30
Manas Solanki
aa6576c0ea Merge pull request #13755 from Zlash65/typo
[Minor] Typo fix in Leaderboard
2018-04-23 11:09:18 +05:30
Zlash65
fa5ecb066e typo fix in leaderboard 2018-04-22 12:11:01 +05:30
Nabin Hait
c36524ec54 Update chart_of_accounts.py 2018-04-20 11:00:20 +05:30
Saurabh
cba3570cf6 Merge pull request #13734 from rohitwaghchaure/pos_special_character_item_issue
[Fix] Item with special character not adding in the POS cart
2018-04-19 15:58:35 +05:30
Saurabh
5b7503c074 Merge pull request #13691 from saurabh6790/supp_180417_1
[hotfix] multiple fixes
2018-04-19 15:57:35 +05:30
Rohit Waghchaure
8441dd9184 [Fix] Item with special character not adding in the POS cart 2018-04-19 12:55:06 +05:30
Julian Robbins
78869f1e77 Update manual-feedback-request.md (#13709)
Changed wording to reflect current wording of Feedback Request rather than 'Ask a Feedback'
2018-04-18 03:12:30 -08:00
Rushabh Mehta
ff8f1bc88e Revert "removed bad code and made compatible with pip 10 (#13685)" (#13713)
This reverts commit 91b0dce4d8.
2018-04-18 02:57:44 -08:00
Ameya Shenoy
91b0dce4d8 removed bad code and made compatible with pip 10 (#13685) 2018-04-18 02:57:04 -08:00
Zarrar
59f7b8c4a1 issue routing to report (#13710) 2018-04-18 02:56:02 -08:00
Saurabh
2476a8aab9 a[fix] check content before making in condition 2018-04-17 20:45:06 +05:30
Saurabh
46ffbb74ff fix cheque print measurements 2018-04-17 20:44:37 +05:30
Saurabh
492aff2a8b [fix] check if academic_year exists (#13665) 2018-04-17 14:21:40 +05:30
Saurabh
c3fbc04aab Merge branch 'hotfix' 2018-04-17 12:00:19 +05:30
Saurabh
5b866db6bc bumped to version 10.1.23 2018-04-17 12:30:19 +06:00
Saurabh
9fbb8192e1 [fix] do not escape % while using clause (#13677) 2018-04-17 11:56:46 +05:30
Saurabh
ea1408f2e0 [fix] enqueue salary slip print email after completing accounting entries (#13633) 2018-04-15 21:38:49 -08:00
Saurabh
f2a941b1a4 [fix] check if supplier value exists (#13616) 2018-04-15 21:37:14 -08:00
Saurabh
ca1cfd91ea Merge branch 'hotfix' 2018-04-15 12:54:49 +05:30
Saurabh
c3d43e672b bumped to version 10.1.22 2018-04-15 13:24:49 +06:00
Saurabh
e141fdcfcc Merge pull request #13661 from codingCoffee/pip10
Compatibility for pip 10
2018-04-15 12:43:28 +05:30
Ameya Shenoy
7cb8f890bc Compatibility for pip 10
- also some spaces and tabs fixes
2018-04-15 03:43:21 +05:30
Nabin Hait
d6aadef395 Merge branch 'hotfix' 2018-04-13 14:38:23 +05:30
Nabin Hait
11c899bc1f bumped to version 10.1.21 2018-04-13 15:08:22 +06:00
Nabin Hait
00efeb26f4 Email Account field added in Issue 2018-04-13 14:30:26 +05:30
rohitwaghchaure
1129ac711e [Fix] Patch (#13610) 2018-04-12 14:48:23 +05:30
rohitwaghchaure
2ea593bdd8 [Fix] POS Profile data not set in the sales invoice (#13568) 2018-04-12 13:37:08 +05:30
Ahmed Madi
02fd6f56d6 Update leave_application.py (#13575)
Make get_holidays function white listed
2018-04-12 13:31:50 +05:30
rohitwaghchaure
098b444f6f [minor] Toggle required opportunity item table based on with items field (#13584) 2018-04-12 13:26:50 +05:30
rohitwaghchaure
e72bde5159 Removed expired items from the list of POS items (#13582) 2018-04-12 13:26:11 +05:30
Nabin Hait
c10e106f8f Optimization related to large number of items (#13606) 2018-04-12 13:25:03 +05:30
rohitwaghchaure
2c111b7b14 Minor fix (#13600) 2018-04-11 02:20:06 -08:00
Nabin Hait
f92fcdbac4 Merge branch 'hotfix' 2018-04-06 15:06:09 +05:30
Nabin Hait
1ff9e0432a bumped to version 10.1.20 2018-04-06 15:36:09 +06:00
rohitwaghchaure
c0f149a3be [Fix] Delivery notification for delivery trip (#13543) 2018-04-06 14:26:26 +05:30
rohitwaghchaure
2ae6cfda5f [Fix] Item variant details report (#13545) 2018-04-06 11:49:04 +05:30
rohitwaghchaure
22d9f0a4aa [Fix] Bin not deleted on delete of an item (#13539) 2018-04-06 10:29:07 +05:30
rohitwaghchaure
aa7cddef5c Merge pull request #13511 from rohitwaghchaure/table_styling
[Fix] Width and margin for account receivable pdc print format
2018-04-04 16:34:21 +05:30
Rohit Waghchaure
3d2b3d37d4 [Fix] Width and margin for account receivable pdc print format 2018-04-04 16:01:33 +05:30
Nabin Hait
821222653b Merge branch 'hotfix' 2018-04-04 11:26:19 +05:30
Nabin Hait
adddb15380 bumped to version 10.1.19 2018-04-04 11:56:19 +06:00
Nabin Hait
5fd79f7f77 Update stock_ledger.py 2018-04-04 11:20:16 +05:30
Vishal Dhayagude
2505c74d64 Place of Supply set on save Delivery Note if Customer Address Present (#13492) 2018-04-04 11:05:21 +05:30
Rushabh Mehta
d5f9ebd008 [optimize] item queries (#13480) 2018-04-02 23:37:33 +05:30
Shreya Shah
d021e45301 exclude current doc while validating (#13450) 2018-04-02 10:43:19 +05:30
Zarrar
e9ca5e81d2 hide add_child for root node (#13444) 2018-04-02 10:40:39 +05:30
Manas Solanki
a7f5589564 fix for the update button in the sales invoice (#13435) 2018-04-02 10:32:00 +05:30
Shreya Shah
a8df73c263 typo in landed cost voucher doc (#13472) 2018-04-02 10:16:27 +05:30
rohitwaghchaure
40a5a3063c [Fix] Allow zero valuation rate if previous sle has zero valuation rate (#13432) 2018-04-02 10:14:49 +05:30
Shreya Shah
d17c24f969 set query in payment account (#13446) 2018-04-02 10:13:48 +05:30
Manas Solanki
0289ad285f fix the route filters and payment account (#13447) 2018-04-02 10:13:22 +05:30
Shreya Shah
562227db8f db escape as single quote in address causes error (#13451) 2018-04-02 10:12:37 +05:30
Achilles Rasquinha
9c1cac80fe Merge pull request #13445 from shreyashah115/typo-in-payroll
Typo in Payroll Entry
2018-04-01 10:29:16 +05:30
Gaurav Naik
03016e5000 Exploded view for BOM Stock Report (#12506)
* Multilevel BOM Stock Report prototype

* Rechristened multilevel to exploded view

* Removed trailing whitespace in line 16. Replaced spaces with tabs for indentation

* Used BOM Explosion item in query for exploded view

* Removed trailing whitespaces for Codacy compliance
2018-03-30 13:03:19 +05:30
Shreya
9240eaa0a6 typo for accrual journal entry 2018-03-30 12:19:11 +05:30
Manas Solanki
618940b5c9 Merge pull request #13433 from manassolanki/fix-pe
minor fix for the program enrollment tool
2018-03-29 16:37:54 +05:30
Manas Solanki
ccf2b7b08b minor fix for the program enrollment tool 2018-03-29 16:36:59 +05:30
Nabin Hait
1e989b35ad Merge branch 'hotfix' 2018-03-29 13:53:00 +05:30
Nabin Hait
cae2723920 bumped to version 10.1.18 2018-03-29 14:23:00 +06:00
rohitwaghchaure
badc855400 [Fix] BOM validation issue for scrap item (#13429) 2018-03-29 13:48:38 +05:30
Manas Solanki
a4502c4f6b Merge pull request #13430 from codingCoffee/child_doc_perm_fix
Permisssion fixes for child table
2018-03-29 13:27:08 +05:30
Manas Solanki
1f02c62339 Merge pull request #13431 from manassolanki/fix-22
fix the item varint details
2018-03-29 13:26:14 +05:30
Manas Solanki
ef770b593a fix the item varint details 2018-03-29 13:25:00 +05:30
Manas Solanki
a9c90c96a9 Merge pull request #13428 from frappe/manassolanki-patch-3
Update get_item_details.py
2018-03-29 13:16:40 +05:30
Ameya Shenoy
c5d222253a Permisssion fixes for child table
Related to commit 595929eb2432140a27dc262d4d78aca4ec5455c3
frappe.client.[get_list, get, get_value] when called on child table
needs parent as an argument or it throws an error by default
2018-03-29 13:16:08 +05:30
Manas Solanki
94769d81a8 Update get_item_details.py 2018-03-29 11:15:05 +05:30
rohitwaghchaure
edd63a178f Merge pull request #13418 from rohitwaghchaure/pdf_and_alignment_issue
[Fix] Alignment and date issue in PDC report
2018-03-28 17:17:37 +05:30
Rohit Waghchaure
ace68cd283 [Fix] Alignment and date issue in PDC report 2018-03-28 15:53:29 +05:30
Nabin Hait
d3bd151c30 Merge branch 'hotfix' 2018-03-28 15:51:16 +05:30
Nabin Hait
0794816527 bumped to version 10.1.17 2018-03-28 16:21:16 +06:00
Nabin Hait
7041a45294 Update fix_reserved_qty_for_sub_contract.py 2018-03-28 15:50:14 +05:30
Nabin Hait
a6746407e5 Fixed waiting qty in item dashboard data 2018-03-28 11:16:12 +05:30
Nabin Hait
e3407083fe Merge branch 'hotfix' 2018-03-28 10:40:12 +05:30
Nabin Hait
63e40b52af bumped to version 10.1.16 2018-03-28 11:10:12 +06:00
Nabin Hait
2e203e53c6 Update fix_reserved_qty_for_sub_contract.py 2018-03-28 10:38:55 +05:30
Shreya Shah
c0201877dd fixed column fieldnames for translations (#13406) 2018-03-27 18:45:42 +05:30
Nabin Hait
745292ce98 Merge branch 'hotfix' 2018-03-27 14:22:28 +05:30
Nabin Hait
00279f27f3 bumped to version 10.1.15 2018-03-27 14:52:27 +06:00
Nabin Hait
f620dae8ca Null issue fixed in gstr reports 2018-03-27 14:15:36 +05:30
Nabin Hait
9d7fe1f7cd Indicator fix for stock entry item table 2018-03-27 13:30:11 +05:30
Shreya Shah
ba4f32be5c set default warehouse instead of product bundle's warehouse for packed_items in delivery note (#13398) 2018-03-27 11:32:10 +05:30
rohitwaghchaure
85f63a3866 [Fix] Showing to bill even if per deliverd in sales order is 99.9996 (#13392) 2018-03-27 11:31:44 +05:30
Shreya Shah
149f7ee875 [Fix] General Ledger Report (#13374)
* error fix if party_type = student or shareholder

* clear party filter when party_type changes to avoid error throw

* dict with values of party_name in utils.js

* fetch party_name from erpnext.utils.get_party_name

* Update general_ledger.py
2018-03-27 11:29:25 +05:30
rohitwaghchaure
c9a1eb1081 [Fix] Not able to delete row in modal table (#13377) 2018-03-27 11:26:43 +05:30
rohitwaghchaure
2e560cb25d [Fix] Same serial no returned two times (#13378) 2018-03-27 11:24:50 +05:30
Nabin Hait
651b612909 Fixed logic for reserved qty for subcontract and production and written a patch (#13396)
* Fixed logic for reserved qty for subcontract and production and written a patch

* repost reserved qty for filtered bins
2018-03-27 11:24:20 +05:30
Manas Solanki
398eac3f4c message in the program enrollment tool (#13393) 2018-03-27 11:21:47 +05:30
Shreya Shah
f3025f1596 operation time in grid view (#13400) 2018-03-27 10:34:05 +05:30
Nabin Hait
0712013960 Merge branch 'hotfix' 2018-03-23 16:05:06 +05:30
Nabin Hait
3fdda7a9b7 bumped to version 10.1.14 2018-03-23 16:35:06 +06:00
Shreya Shah
9bcadf8126 Tax Id in some reports and print formats (#13373)
* tax-id in sales and purchase registers

* tax-id in general ledger print_format

* tax-id in accounts payable

* tax-id in accounts receivable
2018-03-23 15:04:37 +05:30
rohitwaghchaure
492de67d7b Added consumed material cost in project (#13365) 2018-03-23 15:02:04 +05:30
Nabin Hait
80a9f523d5 Minor fix AR/AP summary report 2018-03-23 13:02:27 +05:30
Nabin Hait
e3f0412570 Pass doc while autonaming item 2018-03-22 12:13:21 +05:30
rohitwaghchaure
23fa8893a8 [Fix] Division by zero issue (#13362) 2018-03-22 11:16:00 +05:30
Manas Solanki
a3714e1678 Merge pull request #13360 from frappe/manassolanki-patch-3
Update update_project_in_sle.py
2018-03-21 18:25:26 +05:30
Manas Solanki
0f6c35d63f Update update_project_in_sle.py 2018-03-21 18:24:45 +05:30
rohitwaghchaure
93779c21a7 [Fix] Project not set in the stock ledger entry (#13357) 2018-03-21 17:52:41 +05:30
Manas Solanki
e010ddf65f Student Report Card (#13346)
* finalise the assessment report

* minor fixes for button

* fix the travis and codacy
2018-03-21 17:50:42 +05:30
Zarrar
969c8aaf52 [Enhance] Fetch Customer's Item code based on Customer Name or Customer Group (#13198)
* customer code can be assigned based on customer group

* improvise customer group selection

* requested changes made
2018-03-21 11:17:49 +05:30
Manas Solanki
c711445b91 add the student as party type (#13348) 2018-03-21 10:12:27 +05:30
rohitwaghchaure
2b88ac948e [Fix] Special character issue (#13350) 2018-03-21 10:04:47 +05:30
Siddhi Sawant
c672530210 [hotfix] Added 'Paid Amount' and 'Change Amount' in POS print formats (#13316)
* Added 'Paid Amount' and 'Change Amount' in GST POS Invoice and POS Invoice print formats

* Update gst_pos_invoice.json

Updated its 'disabled' property.

* Update pos_invoice.json

Updated its 'disabled' property.

* Shows change amount only if it exists

* Updated disable property of print formats
2018-03-20 14:31:14 +05:30
Zarrar
c5b061834b doctype dropdown rectify, validate series is set (#13305) 2018-03-20 13:06:18 +05:30
Nabin Hait
8a8966ce9b minor fix 2018-03-20 11:19:57 +05:30
Achilles Rasquinha
54f3a0f7c6 Merge pull request #13333 from achillesrasquinha/hotfixes
Check Set Sales Target Item exists in User Slides
2018-03-19 22:23:11 +05:30
Achilles Rasquinha
ecc4fdd3ef Check Set Sales Target Item exists in User Slides 2018-03-19 22:21:45 +05:30
Achilles Rasquinha
60da37b502 Merge pull request #13329 from shreyashah115/travis-fix
[Fix] Travis
2018-03-19 19:10:21 +05:30
Saurabh
2777fd4332 [fix] validate minimum transaction amount in Payment Request for selected payment gateway (#13328) 2018-03-19 18:29:01 +05:30
Shreya
9602bf4ba3 patch fix 2018-03-19 18:17:54 +05:30
Shreya
5042dd32da undefined args error 2018-03-19 17:45:39 +05:30
Shreya
4d347b1ca0 travis fix 2018-03-19 17:31:19 +05:30
Achilles Rasquinha
3d85951c1f Merge pull request #13304 from achillesrasquinha/hotfix-hub
[HOTFIX] Hub Domain Change
2018-03-19 11:54:13 +05:30
Manas Solanki
7b91042ae6 Merge pull request #13310 from manassolanki/student-report-card
addition of student report card generation tool
2018-03-16 02:00:07 +05:30
Manas Solanki
633a39144d addition of student report card generation tool 2018-03-16 01:57:45 +05:30
Achilles Rasquinha
94b41ea4f6 removed debugging 2018-03-15 12:53:22 +05:30
Achilles Rasquinha
d8f7de9946 fixed patch for hub 2018-03-15 12:48:32 +05:30
Nabin Hait
b2d318ec48 Merge branch 'hotfix' 2018-03-15 12:38:41 +05:30
Nabin Hait
60200eaf0d bumped to version 10.1.13 2018-03-15 13:08:41 +06:00
Nabin Hait
1e4cfb4bf5 Fixes in setting po nos manually in sales invoice 2018-03-15 12:27:24 +05:30
Nabin Hait
70abac0061 Get territory from sales invoice 2018-03-15 12:19:16 +05:30
Nabin Hait
d7f32e492f Merge branch 'hotfix' 2018-03-14 13:33:36 +05:30
Nabin Hait
6c09297bcd bumped to version 10.1.12 2018-03-14 14:03:36 +06:00
Nabin Hait
363cedde76 Fixed minor issue 2018-03-14 13:32:14 +05:30
Nabin Hait
f5ad339cae Merge branch 'hotfix' 2018-03-13 18:13:43 +05:30
Nabin Hait
c8c733bc54 bumped to version 10.1.11 2018-03-13 18:43:42 +06:00
Shreya Shah
7acc8cb747 fix else condition (#13295) 2018-03-13 18:12:19 +05:30
Nabin Hait
9a398b4742 Merge branch 'hotfix' 2018-03-13 17:11:49 +05:30
Nabin Hait
56882033bf bumped to version 10.1.10 2018-03-13 17:41:49 +06:00
Nabin Hait
74c817e7f9 Update update_reserved_qty_for_purchase_order.py 2018-03-13 17:10:14 +05:30
Nabin Hait
d98a6d81eb Merge branch 'hotfix' 2018-03-13 16:14:02 +05:30
Nabin Hait
baac05955b bumped to version 10.1.9 2018-03-13 16:44:02 +06:00
Nabin Hait
89346967da Reverted #13259 (#13291) 2018-03-13 16:01:11 +05:30
Nabin Hait
97e890d0b3 Fix in unallocated amount calc in payment entry (#13288) 2018-03-13 15:57:34 +05:30
Ameya Shenoy
95763bc233 Purchase Order fixes (#13287)
- Reason: If Item Code was changed in Item Master, it didn't used to reflect on the 'Purchase Order Item Supplied' and 'Purchase Reciept Item Supplied'
- Data field in 'Production Order Item Supplied' and 'Production Reciept Item Supplied' converted to Link Field.
2018-03-13 15:51:56 +05:30
Nabin Hait
96f4b22589 Set po nos in DN and SI (#13290) 2018-03-13 15:46:59 +05:30
rohitwaghchaure
13460f023d [Fix] Batch value showing as item value while making batch (#13281) 2018-03-12 17:20:50 +05:30
Nabin Hait
3907eae83f Merge branch 'hotfix' 2018-03-12 15:31:03 +05:30
Nabin Hait
04f50be306 bumped to version 10.1.8 2018-03-12 16:01:03 +06:00
Ameya Shenoy
b34ab7549a fixed subject to task_name (#13278) 2018-03-12 15:24:01 +05:30
Shreya Shah
aa54d934b8 make stock qty negative (#13276) 2018-03-12 15:23:28 +05:30
Nabin Hait
2c7a6e6b43 Reserve for subcontracting (#13195)
* [fix] #8427

* review comments changes

* Validation for reserved warhouse

* code improvements

* alignment

* test case

* message changes

* default warehouse / remove validation / change sql

* fix

* patch

* Fixed merge conflict

* Fixes and cleanups of reserve qty for subcontracting

* set from_warehouse only if purchase_order and purpose found (#12398)

* [HotFix] Validation issue for subcontract stock entry (#12127)

* [Fix] Validation issue for subcontract stock entry

* Update stock_entry.py

* Fixes and cleanups of reserve qty for subcontracting

* patch fixed

* Reload bin in patch

* [fix] set source warehouse in stock entry for manufacture

* [fix] #8540

* code alignment

* code alignment

* Move target warehouse validation to submit

* validation code improvement

* code changes for single stock entry

* validation fix

* call make_rm_stock_entry

* remove old stock entry method/rewrite test case

* Don't set bom_no against raw materials while trasferring items for sub-contracting

* minor fix
2018-03-12 14:12:12 +05:30
Shreya Shah
58797481f0 uncheck report hide (#13256) 2018-03-12 13:08:01 +05:30
rohitwaghchaure
12aa4265ff Don't allow to set negative quantity if transaction is not return entry (#13255) 2018-03-12 11:20:30 +05:30
Shreya Shah
69d9f51dbb if price list not found, set default selling/ buying price list from settings (#13259) 2018-03-12 11:15:49 +05:30
Nabin Hait
3dea6589d7 Merge branch 'hotfix' 2018-03-09 16:38:51 +05:30
Nabin Hait
096d136460 bumped to version 10.1.7 2018-03-09 17:08:50 +06:00
Nabin Hait
c3889d85a1 Update shopping_cart.js 2018-03-09 16:28:25 +05:30
Nabin Hait
052333ea63 subctracting stock entry should also be considered as consumed qty 2018-03-09 14:30:32 +05:30
Shreya Shah
aadd30d194 fetch delivery date on add-row only if item_code exists (#13250) 2018-03-09 12:19:35 +05:30
Harsh Patel
22e6f8d4c2 Fixes for #13071 (#13234) 2018-03-08 16:23:59 +05:30
rohitwaghchaure
acd3479269 Bank POS transactions in bank reconciliation (#13225) 2018-03-08 16:22:39 +05:30
rohitwaghchaure
a32e57ae82 [Fix] Discount in offline POS is enabled even is it's disabled in POS Profile (#13233) 2018-03-08 16:21:13 +05:30
Ranjith Kurungadam
a3a63177a1 fix- cannot cancel consultation, remove updating age (#13226) 2018-03-08 16:20:22 +05:30
tundebabzy
1643cce479 fetch journal entry details (#13218) 2018-03-08 11:17:17 +05:30
Manas Solanki
bb42e3b411 Merge pull request #13214 from manassolanki/assessment-report-fix
minor fix for key error in assessment reports
2018-03-07 16:30:35 +05:30
Manas Solanki
586e9400b1 minor fix for key error 2018-03-07 16:28:21 +05:30
Vishal Dhayagude
668ec25d19 Allow Item variant Rename (#13161)
* [WIP] Item varient rename

* [wip] Item Variant

* [fix] Item Varient Rename

* [fix] Item Attribution Rename

* removed unwanted code
2018-03-07 15:31:08 +05:30
Nabin Hait
f0543a9765 Merge branch 'hotfix' 2018-03-07 13:09:06 +05:30
Nabin Hait
36b4faab48 bumped to version 10.1.6 2018-03-07 13:39:05 +06:00
Saurabh
2b59a851c4 Merge pull request #13166 from saurabh6790/patches_fixes
[fix] use join instead of subquery
2018-03-07 12:59:03 +05:30
Manas Solanki
857d4f7a0b Merge pull request #13209 from manassolanki/guardian-fix
allow renaming of the guardian
2018-03-07 12:53:40 +05:30
Manas Solanki
12d7bfb658 allow renaming of the guardian 2018-03-07 12:52:31 +05:30
Saurabh
ca6e223694 [fix] use join instead of subquery 2018-03-07 12:13:32 +05:30
rohitwaghchaure
343ba85e3a Merge pull request #13203 from saurabh6790/pe_fix
[fix] setup_party_account_field on init
2018-03-07 12:11:46 +05:30
Manas Solanki
16c324f699 Merge pull request #13207 from manassolanki/course-schedule-fix
fix the desktop icon for course schedule
2018-03-07 12:10:36 +05:30
Manas Solanki
1fa992564a fix the desktop icon for course schedule 2018-03-07 12:08:52 +05:30
Saurabh
a65b28772f [fix] setup_party_account_field on init 2018-03-06 18:22:01 +05:30
Nabin Hait
ba6003ece7 Merge branch 'hotfix' 2018-03-05 14:47:19 +05:30
Nabin Hait
491ce05b8d bumped to version 10.1.5 2018-03-05 15:17:18 +06:00
Saurabh
2cfcbf933d Patches fixes (#13163)
* [fix] if serialised items not found then return

* [fix] unicode encoding in patch
2018-03-05 13:01:15 +05:30
Zarrar
2550180a05 remove updating territory for customers on change (#13162) 2018-03-05 12:32:41 +05:30
Manas Solanki
5fd7b3bb80 Fix status updater (#13033)
* fix the status updater for multiple sources

* patch for updating the status

* patch for updating the sales order item

* Update update_status_for_multiple_source_in_po.py
2018-03-05 11:28:29 +05:30
Vishal Dhayagude
35b665cb26 [new] Create multiple warehouse address and fetch address to stock entry (#13109)
* [new] Create multiple warehouse address and fetch address to stock entry

* [fix] Deleted unwanted field and added patch to link warehouse details to Address

* [fix] Codacy fixed

* [fix] Modified patch for warehouse address

* [fix] Modified patch for warehouse address

* [fix] Patch updated and removed contact details from stock entry

* [fix] Patch Updated
2018-03-05 11:10:01 +05:30
rohitwaghchaure
a6a4e86dc8 [Fix] System only shows 20 attribute values while making variants (#13155) 2018-03-05 11:03:59 +05:30
rohitwaghchaure
0eb8bb2511 [Fix] Wrong salary slips showing when click on view salary slips from payroll entry (#13152) 2018-03-05 11:03:27 +05:30
rohitwaghchaure
67cfa81de2 [Fix] Stock Ageing report does not work with group warehouse (#13151) 2018-03-05 11:00:42 +05:30
rohitwaghchaure
a942722619 [Fix] Timeout issue while saving multilevel BOM (#13118) 2018-03-01 13:15:25 +05:30
Nabin Hait
c10bbd6aa7 Editable unallocated amount in pe (#13130)
* editable unallocated amount in payment entry to handle multi currency

* set unallocated amount on server side

* some minor fixes

* Fixes in territory patch

* removed print

* minor fixes
2018-03-01 13:14:14 +05:30
rohitwaghchaure
4badb45ee5 Merge pull request #13139 from rohitwaghchaure/sales_invoice_email_propmt_issue
[Fix] Sales invoice email prompt not working
2018-03-01 13:07:31 +05:30
Rohit Waghchaure
855d843e55 [Fix] Sales invoice email prompt not working 2018-03-01 13:06:01 +05:30
rohitwaghchaure
0df95fa781 Multi-UOM for sales/purchase return (#13132)
* Multi-UOM for sales/purchase return

* Update sales_and_purchase_return.py
2018-03-01 11:31:33 +05:30
Zarrar
6578bc11b6 wrong query formed to delete events (#13119) 2018-03-01 10:54:55 +05:30
Nabin Hait
f68dc69078 Set auto created serial nos in incoming transactions in case of multi UOM (#13112)
* Create user from Employee

* Set auto created serial nos in incoming transactions in case of multi uom
2018-03-01 10:54:24 +05:30
Zarrar
502af4dd67 display image fnd description for root BOM also (#13099) 2018-03-01 10:44:47 +05:30
rohitwaghchaure
db9fa78ee8 Do not validate payment schedule for POS (#13115) 2018-03-01 10:32:29 +05:30
Nabin Hait
a645f36b2b Get valuation rate from historical SLE even if it is zero (#13129)
* Don't overwrite start and end date comes from payroll entry

* Get valuation rate from historical SLE even if it is zero, if records exists

* Valid till should be autoset if not any default value

* Set status of expense claim based on is_paid check
2018-03-01 10:31:24 +05:30
rohitwaghchaure
332a17ee86 [Fix] Test case for serial no (#13136) 2018-03-01 10:28:04 +05:30
Shreya Shah
a310cc7156 order by modified instead of item name (#13113) 2018-02-28 18:59:55 +05:30
Nabin Hait
3b43c0d160 Update territory and customer_group patch optimization (#13076)
* Update territory and customer_group patch optimization

* Update update_territory_and_customer_group.py
2018-02-27 15:57:14 +05:30
Zarrar
96002c28bd optimize patch for faster execution (#13068) 2018-02-27 15:57:01 +05:30
Zarrar
91fc1a8fbe Update Territory & Customer Group across all transaction (#13004)
* added method for update query based on changes

* patch added

* updated function, moved util function
2018-02-27 15:56:38 +05:30
rohitwaghchaure
f1755fb5b1 Merge pull request #13094 from rohitwaghchaure/pos_discount_v10_1
[Hotfix] POS discount issue
2018-02-27 11:58:33 +05:30
Manas Solanki
be841ccc53 Merge pull request #13096 from manassolanki/fix-fee-schedule
Fixes in the Fees Schedule
2018-02-27 11:23:38 +05:30
Manas Solanki
51dfba749b filter students on basis of category and button to show fees 2018-02-26 19:32:26 +05:30
Nabin Hait
3799f8bec9 Don't validate serial nos while cancelling the transaction 2018-02-26 16:39:06 +05:30
Rohit Waghchaure
3edc101957 [Fix] POS discount issue 2018-02-26 13:25:58 +05:30
Nabin Hait
127c61e930 Fixed logic in itemwise recommended reorder level 2018-02-26 12:43:17 +05:30
Nabin Hait
e55831a89c Projected Qty in Auto reorder email 2018-02-26 11:38:40 +05:30
Nabin Hait
4ff4d185f7 Merge branch 'hotfix' 2018-02-23 16:59:42 +05:30
Nabin Hait
d54953e419 bumped to version 10.1.4 2018-02-23 17:29:42 +06:00
Zarrar
339426c926 fix permission issue for stock balance report - Item Group (#13069) 2018-02-23 16:58:55 +05:30
Nabin Hait
489ff6e21c Merge branch 'hotfix' 2018-02-23 16:49:41 +05:30
Nabin Hait
d12fb58c12 bumped to version 10.1.3 2018-02-23 17:19:40 +06:00
Ameya Shenoy
82048cf3ce verify payment entry amount is positive (#13066)
* verify payment entry amount is positive

* Update sales_invoice.py

* Update sales_invoice.py
2018-02-23 16:33:28 +05:30
rohitwaghchaure
4d76269eeb [Fix] Item wise sales register report (#13055) 2018-02-23 16:25:30 +05:30
Shreya Shah
d5b2e39f45 improve validation (#13058) 2018-02-23 16:23:57 +05:30
rohitwaghchaure
dd0fc1084e [Fix] PDC amount, PDC print layout issue (#13062) 2018-02-23 16:20:46 +05:30
Nabin Hait
d283ee73f3 Fetch timesheet based on project 2018-02-23 12:58:39 +05:30
Nabin Hait
93f138eece Merge branch 'hotfix' 2018-02-22 18:18:34 +05:30
Nabin Hait
2b2cf13408 bumped to version 10.1.2 2018-02-22 18:48:34 +06:00
Nabin Hait
7f49b57aaa Update added_extra_gst_custom_field_in_gstr2.py 2018-02-22 18:17:57 +05:30
Nabin Hait
00330f52bd Merge branch 'hotfix' 2018-02-22 18:10:37 +05:30
Nabin Hait
6b69fc7e5d bumped to version 10.1.1 2018-02-22 18:40:37 +06:00
Saurabh
d8cd54dfd0 [fix] remove gstr2 fields from Sales Invoice and Delivery Note too (#13047) 2018-02-22 18:05:40 +05:30
tundebabzy
2949e9c5dc Merge pull request #13036 from tundebabzy/issue-13019
Uncaught Server Exception : adjust_qty_for_expired_items #13019
2018-02-22 11:04:53 +01:00
Nabin Hait
15bd3167a8 Merge branch 'hotfix' 2018-02-22 14:39:37 +05:30
Nabin Hait
9b530fb2cb bumped to version 10.1.0 2018-02-22 15:09:37 +06:00
Nabin Hait
06bace9089 Fixed develop version 2018-02-22 14:36:26 +05:30
tundebabzy
c15978fca0 fix indentation 2018-02-22 09:50:49 +01:00
Nabin Hait
cb2264e0b4 Merge branch 'vishdha-leaderboard' into hotfix 2018-02-22 14:00:04 +05:30
Nabin Hait
7d862276af Cleanup and fixes on leaderboard 2018-02-22 13:59:41 +05:30
Nabin Hait
e4fe2d9603 Merge branch 'leaderboard' of https://github.com/vishdha/erpnext into vishdha-leaderboard 2018-02-22 11:35:10 +05:30
rohitwaghchaure
23a2b65576 [Fix] BOM Update Tool not update grandparent's exploded BOM (#13026) 2018-02-22 11:32:09 +05:30
Shreya Shah
0bde9e11c7 clear log if no attachments (#13023) 2018-02-22 10:55:40 +05:30
vishdha
09d56754ea [fix] Codacy issue 2018-02-21 16:10:09 +05:30
vishdha
e9166d7c19 [fix] Sales partner details get from sales Order and company currency details from selected company 2018-02-21 15:35:58 +05:30
vishdha
9a64d4371e [fix] Codacy Issue 2018-02-21 15:35:58 +05:30
vishdha
d4491d361f [new] Filter based on company: 2018-02-21 15:35:58 +05:30
vishdha
09acb779d7 [new] Leader board 2018-02-21 15:35:58 +05:30
Zarrar
67f74414c4 disable expand_all button for BOM (#13015) 2018-02-21 14:46:41 +05:30
Shreya Shah
8a77a0e1e4 Add total row in all trends reports (#13010)
* total in sales order trends report

* total in all trends reports
2018-02-21 14:46:07 +05:30
Zarrar
bc5515651b [Hotfix] Selecting create on blank field throws error (#13014)
* selecting create on blank field error fix

* error when fetching default_print_format
2018-02-21 11:13:14 +05:30
Shreya Shah
f65afac353 db_update instead of save to avoid unnecessary validations (#13009) 2018-02-21 11:12:04 +05:30
Pawan Mehta
2fbb4923a7 item balance report (#12983)
* item balance report

* remove hard coding

* Update item_balance.json

* Update item_balance.json

Change name to "Item Balance (Simple)"

* Update item_balance.json
2018-02-20 12:17:49 +05:30
rohitwaghchaure
554f2de23d Code cleanup online POS (#12985) 2018-02-20 11:18:01 +05:30
Vishal Dhayagude
a5003f8f5b [minor] Balance Qty added in reorder level email notification (#13000) 2018-02-20 11:14:54 +05:30
tundebabzy
6c5d7986ab Outstanding Amount not getting updated in Payment Entry #12713 (#12975)
* allow to `set_missing_ref_details` by force

* update payment entry references during submit and cancel
2018-02-19 13:11:56 +05:30
Shreya Shah
5448318146 fix total field (#12992) 2018-02-19 12:44:52 +05:30
Pawan Mehta
174a18399c Added Payment Details to Sales Payment Summary Report (#12358)
* [fix] #12357

* label changes
2018-02-19 12:39:13 +05:30
Saurabh
ec23a6f0eb [fix] section break for raw_material_details (#12976) 2018-02-19 11:33:11 +05:30
Jay Parikh
33b2614377 [Bug] Wrong Calculation of Total Weight at Purchase Invoice item for Purchasing in Different Unit (UoM) #12965 (#12966) 2018-02-16 14:45:40 +05:30
Nabin Hait
b95ecd7fcd Gstr reports (#12940)
* GSTR1 for B2B (#12296)

* [minor] Modified GSTR1 report to identify missing GST Account in GST Settings (#12426)

* [minor] Modified GSTR1 report to identify missing GST Account in GST Settings

* Update gstr_1.py

* GSTR1 for B2B, B2CL and B2CS (#12459)

* [Report] GSTR - 1 CDNR Report (#12554)

* [wip] cdnr

* [WIP] cdnr with optional data

* [wip] Export GSTR-1

* [minor] Minor changes in export

* [new] Custom field added for GST

* [fix] Minor changes in GSTR1 Report

* [minor] Minor changes in gstr1

* [fix] Codacy Fixed

* Update setup.py

* [wip] Gstr2

* [fix] Fetch correct Tax Details

* [minor] ITC data append to row

* [fix] CDNR negative value

* Cleanup and fixes on GSTR-2

* Minor fixes in gstr reports (#12848)

* [new] B2C limit fetch from GST Settings (#12905)

* [new] b2c limit fetch from gst setting

* [fix] Patch Added for b2c limit

* Update gstr_1.py

* Update utils.py

* Cusotm fields related GSTR2

* minor fixes

* minor fixes

* some more fixes

* Added duplicate patch and some tests as not required on develop
2018-02-16 13:19:04 +05:30
Nabin Hait
cc98d40ff7 Payment reco auto allocation and maintain same order of records (#12963)
* Automatically allocate amount after selecting invoice against a payment entry

* codacy fixes
2018-02-16 13:14:20 +05:30
rohitwaghchaure
103c4e9b92 [Fix] Incorrect rate in item-wise sales register (#12943) 2018-02-16 12:57:35 +05:30
Zarrar
5a947f38ab avoid overlap with dropdown (#12941) 2018-02-16 12:49:30 +05:30
Prateeksha Singh
0acb63a938 Update hub domain 💥 2018-02-16 11:07:12 +05:30
Saurabh
db6f0848e3 Merge branch 'hotfix' 2018-02-15 15:17:03 +05:30
Saurabh
ca166eaae5 bumped to version 10.0.23 2018-02-15 15:47:03 +06:00
rohitwaghchaure
a13b177908 [Fix] Not able to select delivery note in delivery trip (#12912) 2018-02-14 17:06:21 +05:30
Saurabh
0500ce445f Merge branch 'hotfix' 2018-02-14 11:45:31 +05:30
Saurabh
351dc08576 bumped to version 10.0.22 2018-02-14 12:15:31 +06:00
rohitwaghchaure
8e675ebbe2 [Fix] Price list exchange rate is not visible when base currency and price list currency is different (#12898) 2018-02-13 17:11:06 +05:30
Faris Ansari
d53b149828 [deadlock fix] Save if not set (#12896) 2018-02-13 16:31:00 +05:30
Faris Ansari
5a91989665 Remove total_projected_qty (#12889) 2018-02-13 16:00:52 +05:30
rohitwaghchaure
62d6593fe7 [Fix] Allow to make disbursement entry even if payment account in not set in the employee loan (#12882) 2018-02-13 14:43:37 +05:30
saurabh-bhosale
ed35a296ab closes #12872 (#12888) 2018-02-13 14:40:59 +05:30
rohitwaghchaure
6a7495dbc8 Removed set only once for maintain stock field in item master (#12878) 2018-02-12 17:25:24 +05:30
tundebabzy
6e90f49a35 Wrong Exchange Rate Is Fetched When Exchange Rate Is Different From Company Currency For Price Lists #12712 (#12714)
* unconditionally fetch exchange rate

* Revert "unconditionally fetch exchange rate"

This reverts commit d0d404d342.

* allow for `plc_conversion_rate` field to be reset

* fetch exchange rate using price list currency and company currency not form currency

* clean up
2018-02-12 15:18:57 +05:30
rohitwaghchaure
6e7e70c977 Added PDC from journal entry in AR report (#12844) 2018-02-12 11:55:07 +05:30
rohitwaghchaure
0aeeb7e02c [Fix] Item variant details report (#12869) 2018-02-12 11:44:39 +05:30
Shreya Shah
caccd2289d posting-date-fix (#12849) 2018-02-12 11:34:46 +05:30
rohitwaghchaure
45ac31ab93 [Fix] Not able to save sales order (#12851) 2018-02-12 11:27:37 +05:30
rohitwaghchaure
7477899d2e Formatter, code cleanup (#12852) 2018-02-12 11:25:58 +05:30
rohitwaghchaure
13afef2f72 Merge pull request #12853 from saurabh6790/timesheet_fixes
[fix] execute update_time_and_costing and update_project only for distinct task and projects
2018-02-12 11:19:22 +05:30
Saurabh
cab73b8a02 [fix] execute update_time_and_costing and update_project only for distinct task and projects 2018-02-09 17:04:12 +05:30
Manas Solanki
c7a9e3424b Merge pull request #12845 from manassolanki/fix-so-update
don't set the ordered_qty in SO on load from BIN
2018-02-09 13:16:14 +05:30
Manas Solanki
a884bd9c6a don't set the ordered_qty in SO on load from BIN 2018-02-09 13:12:07 +05:30
Manas Solanki
37b2aa2b11 changes in the education module (#12827)
update the module page
    remove fee from beta
2018-02-08 19:00:51 +05:30
Saurabh
f4211c4a52 Merge branch 'hotfix' 2018-02-08 15:04:25 +05:30
Saurabh
c1f982a9bb bumped to version 10.0.21 2018-02-08 15:34:25 +06:00
rohitwaghchaure
4d250585a6 Merge pull request #12824 from netchampfaris/hotfix-advance_payment
[hotfix] Advance Total validation
2018-02-08 14:32:29 +05:30
Faris Ansari
6041f5cb8c [hotfix] Advance Total validation 2018-02-08 13:33:52 +05:30
rohitwaghchaure
144c9977a2 Merge pull request #12819 from netchampfaris/hotfix-get_party_account
get_party_account only if company is set
2018-02-08 11:42:41 +05:30
rohitwaghchaure
f1fa338999 Merge pull request #12816 from mntechnique/hotfix-for-#12810
Does not allow discount over 100% in POS
2018-02-08 11:42:08 +05:30
Faris Ansari
f7717b9ec2 get_party_account only if company is set 2018-02-08 11:11:21 +05:30
Saurabh
1a4d77a962 Fixes #12810 for Offline POS 2018-02-08 01:32:48 +05:30
Saurabh
056c1709c6 Fixes #12810 2018-02-08 00:22:53 +05:30
rohitwaghchaure
b553b7a69d PDC Enhancements (#12462) 2018-02-07 18:32:51 +05:30
Nabin Hait
0725eab858 Merge branch 'hotfix' 2018-02-07 16:07:19 +05:30
Nabin Hait
67d6dc1ac6 bumped to version 10.0.20 2018-02-07 16:37:19 +06:00
Nabin Hait
33f967d97c Account name length fixed in HUngary and Germen COA 2018-02-07 16:00:42 +05:30
rohitwaghchaure
9a5037193f Removed DR/CR from balance column (#12791)
* Removed DR/CR from balance column

* Update general_ledger.html

* Update general_ledger.py
2018-02-07 12:10:14 +05:30
Shreya Shah
80423de611 posting date in journal entry should not be nowdate (#12801) 2018-02-07 12:08:08 +05:30
Manas Solanki
b4693c6957 fix for making the invoice from the timesheet (#12803) 2018-02-07 12:07:27 +05:30
rohitwaghchaure
ba31369764 Merge pull request #12773 from rohitwaghchaure/change_amount_issue
[Fix] Incorrect change amount if enabled rounded total
2018-02-06 17:27:04 +05:30
Rohit Waghchaure
e8d22bb999 [Fix] Incorrect change amount if enabled rounded total 2018-02-05 18:13:29 +05:30
Vishal Dhayagude
cce29fabf4 [fix] validation between Selling Price and Valuation Rate should not be validated in the Sales Return entry (#12767) 2018-02-05 12:25:51 +05:30
rohitwaghchaure
0f5c18ca81 [Fix] For non stock item, not able to place an order from shopping cart (#12758) 2018-02-05 12:25:02 +05:30
rohitwaghchaure
a4c40e0fd6 [Fix] After accesing POS page, it does not work when going back from another page (#12763) 2018-02-05 12:24:06 +05:30
Nabin Hait
59aca770c1 Merge branch 'hotfix' 2018-02-03 09:13:12 +05:30
Nabin Hait
9d2f04139c bumped to version 10.0.19 2018-02-03 09:43:12 +06:00
Saurabh
41c47e3ffa Merge pull request #12677 from tundebabzy/issue-12535-1
Website Cart Should Not Show Expired Items As 'In Stock' #12535
2018-02-02 15:58:07 +05:30
rohitwaghchaure
cf6360d825 Merge pull request #12739 from jay-parikh/hotfix
Enable/Disable Discount in POS using POS Profile #11748
2018-02-02 13:12:38 +05:30
Jay Parikh
2c95ab3897 Code fix for Enable/Disable Discount in POS using POS Profile #11748 2018-02-01 22:52:58 -08:00
Jay Parikh
171e5af995 Fixed indentation issue in pull # 11748 2018-02-01 21:39:20 -08:00
tundebabzy
5df64d84a1 code review fix 2018-02-01 17:05:54 +01:00
tundebabzy
a829d5a4d5 Merge branch 'hotfix' into issue-12535-1 2018-02-01 16:56:05 +01:00
Nabin Hait
91c5e4c429 Validate rate in PO with supplier quotation only if checking is enabled via Buying Settings (#12734) 2018-02-01 18:58:22 +05:30
Nabin Hait
cae13bf048 Fixes in purchase register report (#12737) 2018-02-01 18:58:14 +05:30
Nabin Hait
2aba97bff1 Fetch items from BOM in Material Request 2018-02-01 18:52:50 +05:30
Jay Parikh
d4359faa31 Enable/Disable Discount in POS using POS Profile #11748 2018-02-01 04:26:24 -08:00
rohitwaghchaure
c830344ca7 Merge pull request #12738 from rohitwaghchaure/hotfix_pos_issue
[Fix] Pay button not working in pos
2018-02-01 17:39:33 +05:30
Rohit Waghchaure
d85247cd7a [Fix] Pay button not working in pos 2018-02-01 17:18:38 +05:30
Nabin Hait
b9ce104b09 Opening balance in stock ledger report (#12729) 2018-02-01 14:58:50 +05:30
Rushabh Mehta
82fa04ce32 Update projects.py 2018-01-31 22:20:14 +05:30
rohitwaghchaure
32a5f38595 Merge pull request #12633 from vishdha/issue_12388
[fix] Sales order link to purchase order not working fixed
2018-01-31 17:30:43 +05:30
tundebabzy
4990cf7783 remove stray code 2018-01-31 11:35:56 +01:00
Nabin Hait
8f38a17c14 Merge branch 'hotfix' 2018-01-31 15:39:15 +05:30
Nabin Hait
bff1971bb2 bumped to version 10.0.18 2018-01-31 16:09:15 +06:00
Zarrar
4e05f02038 error in throw message rectify (#12719) 2018-01-31 15:33:51 +05:30
Nabin Hait
7918b92d95 Invalid date value comparison, fixes for mariadb 10.2.3+ 2018-01-31 15:30:03 +05:30
tundebabzy
29c8142678 refactor adjust_for_expired_items and others as per code review
use get_all instead of get_list

rename `adjust_for_expired_items` to `adjust_qty_for_expired_items`
2018-01-31 10:51:06 +01:00
vishdha
df1653827f [fix] Patch for material request to purchase order added 2018-01-31 15:11:24 +05:30
Vishal
fc05cc4e70 [fix] link with supplier quotation to purchase order 2018-01-31 15:10:39 +05:30
Vishal
4dc329f5ea [fix] Sales order link to purchase order not working fixed 2018-01-31 15:10:39 +05:30
Nabin Hait
e37e5d6134 minor fix in patch for mariadb version 2018-01-31 15:00:18 +05:30
Zarrar
dea99cc3a8 treeview not set when routed from bom form (#12707) 2018-01-31 13:07:04 +05:30
Nabin Hait
bc640fe6a6 minor fix in old patch 2018-01-30 19:26:28 +05:30
Nabin Hait
dba5e7645b Minor fix in old patch 2018-01-30 16:38:47 +05:30
Nabin Hait
927d13fadb Minor fix in old patch 2018-01-30 15:59:44 +05:30
Nabin Hait
0f75a022f2 Minor fix in old patch 2018-01-30 15:32:17 +05:30
Nabin Hait
4eae6c985c Fixed test records for supplier 2018-01-30 15:27:29 +05:30
Nabin Hait
b9e8b917b6 Removed ui-tests from travis 2018-01-30 15:08:33 +05:30
tundebabzy
2f4854ad1a create new dialog everytime (#12696) 2018-01-30 12:18:15 +05:30
Nabin Hait
585254456e Check credit limit while making DN, if bypassed on SO (#12702) 2018-01-30 12:11:22 +05:30
rohitwaghchaure
ce5b93ca77 [Fix] Allow user to edit rate in online POS (#12701) 2018-01-30 10:39:46 +05:30
Saurabh
32c2c474fd Merge branch 'hotfix' 2018-01-29 18:53:53 +05:30
Saurabh
f3d30c5bb9 bumped to version 10.0.17 2018-01-29 19:23:53 +06:00
Saurabh
8df20f6501 Merge pull request #12695 from Zlash65/fix-dn
[Hotfix] Stock entry issue
2018-01-29 18:52:32 +05:30
Zlash65
f7a4d4221b check precision with qty 2018-01-29 18:47:21 +05:30
Shreya Shah
406d449e12 fix posting date in journal entry on load (#12694) 2018-01-29 18:01:20 +05:30
Saurabh
e2021252d9 Merge branch 'hotfix' 2018-01-29 17:42:37 +05:30
Saurabh
373066e0ca bumped to version 10.0.16 2018-01-29 18:12:37 +06:00
rohitwaghchaure
52beb77539 Don't validate payment terms for POS (#12692) 2018-01-29 17:40:44 +05:30
Saurabh
e1e690541c set payment term name in payment_terms (#12693) 2018-01-29 17:39:56 +05:30
rohitwaghchaure
86c7ede321 Merge pull request #12690 from rohitwaghchaure/subscription_sent_email_issue
[Fix] Subscription send notification issue
2018-01-29 17:01:00 +05:30
Rohit Waghchaure
7e033aae11 [Fix] Subscription send notification issue 2018-01-29 16:53:37 +05:30
Zarrar
5bf77beb83 precision while checking qty (#12688) 2018-01-29 16:47:52 +05:30
Nabin Hait
1e1b2364ab Optimization: don't update outstanding amount while cancelling payment entry for advance adjustment (#12689) 2018-01-29 16:45:43 +05:30
Saurabh
4d50fac869 Merge branch 'hotfix' 2018-01-29 16:24:55 +05:30
Saurabh
05eed01eec bumped to version 10.0.15 2018-01-29 16:54:55 +06:00
Nabin Hait
cfa9d1adb7 Patch: Create Payment Terms based on default credit days set in company and use it while setting due_date (#12685)
* Patch: Create Payment Terms based on default credit days set in company and use it while setting due_date

* Payment Terms patch for credit days defined in customer group
2018-01-29 16:07:21 +05:30
tundebabzy
c7c1defe64 after adjusting stock_qty for expired, set in_stock flag 2018-01-27 12:16:13 +01:00
tundebabzy
c14f1f145b adjust stock_qty for expired quantities
adjust based on warehouse

add parameters to `get_qty_in_stock` so it can be useful in other parts of the code base
2018-01-27 12:16:13 +01:00
tundebabzy
186bea6e95 Merge pull request #12674 from tundebabzy/issue-12673-1
Batch List Shows Wrong Expired Status For Batches #12673
2018-01-27 07:50:12 +01:00
tundebabzy
794ecda618 corrected wrong get_diff arguments 2018-01-27 05:54:40 +01:00
Manas Solanki
8985077652 Assessment Module Report (#12605)
* updated course wise assessment report

* added new report Final assessment grades
2018-01-26 11:20:33 +05:30
rohitwaghchaure
bfa898ff9b [Fix] System pull the valuation rate even if allow zero valuation rate is enabled (#12537) 2018-01-26 10:59:00 +05:30
tundebabzy
0a33a359ca Merge pull request #12659 from tundebabzy/issue-12658
set batch number only in Sales Invoice and Delivery Note - #12659
2018-01-26 06:10:13 +01:00
tundebabzy
f9b5c74871 set batch number only in Sales Invoice and Delivery Note 2018-01-25 19:21:05 +01:00
Prateeksha Singh
4c58299eb0 [fix] encode if letterhead 2018-01-25 17:29:57 +05:30
rohitwaghchaure
fc318ebeff Merge pull request #12642 from mntechnique/fix-to-issue-#12512
Fix to issue #12512
2018-01-25 17:13:05 +05:30
rohitwaghchaure
3574c96c8c Update item_dashboard_list.html 2018-01-25 17:11:52 +05:30
Vinayak Jethe
5743ce2b6b Made changes as per suggestions 2018-01-25 13:37:20 +05:30
Vinayak Jethe
84f7727432 Merge branch 'hotfix' of https://github.com/frappe/erpnext into fix-to-issue-#12512 2018-01-24 19:48:24 +05:30
Vinayak Jethe
549c196beb Fixes issue #12512 2018-01-24 19:47:59 +05:30
rohitwaghchaure
1bf4015567 Merge pull request #12632 from mntechnique/solves_issue_#12588
Solves issue #12588
2018-01-24 18:26:39 +05:30
Saurabh
cadd31cb0c [Fix] Solves issue #12588 2018-01-24 16:38:22 +05:30
Vinayak Jethe
46c82c45e0 Revised changes for codacy 2018-01-24 14:24:58 +05:30
Vinayak Jethe
2c8ce5a717 Fixes issue #12512 2018-01-24 13:51:26 +05:30
Saurabh
6c3289dbcd Merge branch 'hotfix' 2018-01-24 11:22:54 +05:30
Saurabh
381d452b78 bumped to version 10.0.14 2018-01-24 11:52:53 +06:00
Saurabh
769874d0e9 Merge pull request #12628 from saurabh6790/enable_rename_option
[fix] enable rename for payment terms and payment term template
2018-01-24 11:15:53 +05:30
Saurabh
6cc10104f0 [fix] enable rename for payment terms and payment term template 2018-01-24 11:15:02 +05:30
Saurabh
5b67f4d953 Merge pull request #12626 from saurabh6790/item_price_stock_report_fix
[fix] If buying or selling price list not found, return empty dict
2018-01-24 10:55:51 +05:30
Saurabh
4b9a55b0ef [fix] If buying or selling price list not found, return empty dict 2018-01-24 07:48:56 +05:30
Saurabh
c8399fd093 Merge pull request #12614 from rohitwaghchaure/removed_set_only_once_for_batch_serialno
Disabled property set only once for has serial no and has batch no field in item doctype
2018-01-23 18:08:56 +05:30
Rohit Waghchaure
266e66cd1b Disabled property set only once for has serial no and has batch no field in item doctype 2018-01-23 18:06:12 +05:30
rohitwaghchaure
f3a452850e Merge pull request #12617 from saurabh6790/ux_fix
parse value before setting it to dissable_rounded_total on Purchase Invoice
2018-01-23 17:35:16 +05:30
Saurabh
57df096725 Merge pull request #12600 from vishdha/allow_rename
[new] Allow Rename and Member link with user
2018-01-23 16:49:48 +05:30
Saurabh
db2d02a3e3 Merge pull request #12618 from shreyashah115/warehouse-list
Disabled field in list view - Warehouse DocType
2018-01-23 16:48:59 +05:30
Shreya
dfae11bcee disabled warehouse in list view 2018-01-23 16:46:24 +05:30
rohitwaghchaure
d78e6e04ea Run country fixtures if country changed in the company (#12494) 2018-01-23 15:42:46 +05:30
Saurabh
3959aeb848 [fix] parse value before setting it to dissable_rounded_total on Purchase Invoice 2018-01-23 15:40:43 +05:30
rohitwaghchaure
51293390e4 Merge pull request #12611 from shreyashah115/fetch-conversion-factor
[Fix] Fetch uom conversion factor in material request
2018-01-23 12:41:01 +05:30
rohitwaghchaure
63f4da4402 Merge pull request #12612 from shreyashah115/fix-validation
Fix validation message for overbilling
2018-01-23 12:35:37 +05:30
Shreya
a137fe82a1 fix error message 2018-01-23 11:00:58 +05:30
Shreya
e2b31085a7 fetch uom conversion factor in material request 2018-01-23 10:54:23 +05:30
Vishal
a54815fd9d [new] Allow Rename and Member link with user 2018-01-22 16:02:45 +05:30
Saurabh
4f927ac3e8 Merge branch 'hotfix' 2018-01-22 15:29:14 +05:30
Saurabh
b9f678b350 bumped to version 10.0.13 2018-01-22 15:59:14 +06:00
Saurabh
fb4caff0b2 Merge pull request #12573 from rohitwaghchaure/reorder_issue
[Fix] Wrong projected qty for warehouse group in the process of reorder item, which making extra material requests
2018-01-22 16:49:54 +07:00
Saurabh
e72915847c Merge pull request #12570 from rohitwaghchaure/currency_in_balance_column
Added currency in balance column in general ledger print
2018-01-22 16:35:37 +07:00
rohitwaghchaure
1d93bd50eb Merge pull request #12585 from rohitwaghchaure/sales_income_account_issue
[Fix] Income account can not be group
2018-01-22 15:04:46 +05:30
rohitwaghchaure
8e998875a5 Merge pull request #12590 from shreyashah115/total-on-items-remove
[Fix] Calculate taxes when shipping rule not present at removal of item
2018-01-22 15:03:11 +05:30
rohitwaghchaure
c87a3370cd Merge pull request #12595 from rohitwaghchaure/image_path_in_item_search
[Fix] Image path showing in the item link
2018-01-22 15:01:58 +05:30
Rohit Waghchaure
c4c2bf0bfb [Fix] Image patch showing in the item link 2018-01-22 13:47:28 +05:30
Shreya
39adc8f85f calculate total when items are removed 2018-01-22 13:08:05 +05:30
Rohit Waghchaure
8676590cfe [Fix] Income account can not be group 2018-01-22 12:35:36 +05:30
rohitwaghchaure
cf7b6511ba Merge pull request #12574 from rohitwaghchaure/sales_payment_summary_issue
[Fix] Sales payment summary issue
2018-01-20 17:02:13 +05:30
Rohit Waghchaure
bc94914338 [Fix] Sales payment summary issue 2018-01-20 17:01:31 +05:30
Rohit Waghchaure
f83f6aae22 [Fix] Wrong projected qty for warehouse group in the process of reorder item making extra material requests 2018-01-20 15:44:38 +05:30
rohitwaghchaure
6a81acfddf Merge pull request #12563 from Zlash65/general-ledger-fix
[Hotfix] General Ledger report not working for group_by_account filter
2018-01-20 12:55:35 +05:30
Rohit Waghchaure
edef642794 Added currency in balance column in general ledger print 2018-01-20 12:54:25 +05:30
Zlash65
93344dff26 group_by_account not displayed fix 2018-01-19 19:06:39 +05:30
Rohit Waghchaure
03adf84a8d Merge branch 'hotfix' 2018-01-19 15:49:29 +05:30
Rohit Waghchaure
0e61b52022 bumped to version 10.0.12 2018-01-19 16:19:28 +06:00
rohitwaghchaure
0efd7934b8 Merge pull request #12530 from frappe/manassolanki-patch-2
Issue in the data import while importing the invoice
2018-01-19 15:35:23 +05:30
Rohit Waghchaure
16cde58821 Merge branch 'hotfix' 2018-01-19 13:29:56 +05:30
Rohit Waghchaure
e1815f0989 bumped to version 10.0.11 2018-01-19 13:59:56 +06:00
rohitwaghchaure
c59d52d073 Merge pull request #12550 from rohitwaghchaure/po_permission_issue
[Fix] Error in PO. No Permission for Buying Settings
2018-01-19 13:00:36 +05:30
rohitwaghchaure
7b605a628e Merge pull request #12543 from rohitwaghchaure/precision_issue_bom
[Fix] Precision issue while making material requests from production planning tool
2018-01-19 13:00:16 +05:30
Rohit Waghchaure
2f3ad64bd6 [Fix] Precision issue while making material requests from production planning tool 2018-01-19 12:47:55 +05:30
Rohit Waghchaure
86cbde9057 [Fix] Error in PO. No Permission for Buying Settings 2018-01-19 12:45:53 +05:30
rohitwaghchaure
65a669c81e Merge pull request #12534 from rohitwaghchaure/patch_fix_v7
[Fix] Timesheet patch
2018-01-19 11:37:18 +05:30
rohitwaghchaure
39e0d1b7d6 Merge pull request #12539 from rohitwaghchaure/minor_sales_payment_summary_issue
[Fix] Sales payment summary issue
2018-01-19 11:34:48 +05:30
Rohit Waghchaure
de420322b5 [Fix] Sales payment summary issue 2018-01-18 17:20:21 +05:30
rohitwaghchaure
c8e016522d Merge pull request #12533 from rohitwaghchaure/pos_css_issue
[Fix] POS css
2018-01-18 16:12:00 +05:30
Rohit Waghchaure
5c4f52ccf1 [Fix] POS css 2018-01-18 16:10:19 +05:30
Rohit Waghchaure
95adb60a8f Fix patch 2018-01-18 15:52:52 +05:30
Manas Solanki
c6d5611408 Issue in the data import while importing the invoice 2018-01-18 11:20:24 +05:30
rohitwaghchaure
bd47abdc9a [Enhance] Running Balance in GL Report (#12491)
* Running Balance in GL Report

* Supplier invoice no in GL Report/Print Format
2018-01-18 09:32:43 +05:30
Faris Ansari
00e547d319 Encode letterhead filename (#12525) 2018-01-18 09:28:13 +05:30
Nabin Hait
f1b098e03c payment terms filter in AR Summary report (#12529) 2018-01-18 09:23:32 +05:30
Nabin Hait
a7bcf6791e Merge branch 'hotfix' 2018-01-17 18:51:20 +05:30
Nabin Hait
f76fb50685 bumped to version 10.0.10 2018-01-17 19:21:20 +06:00
rohitwaghchaure
da941af687 Set due date in purchase invoice based on suppler invoice date (#12395) 2018-01-17 16:23:04 +05:30
Nabin Hait
91fd29a963 Remove enqueuing update_total_sales method, sometimes it does not include current invoice (#12522) 2018-01-17 16:14:31 +05:30
Umair Sayed
230805b016 Update total.html (#12511) 2018-01-17 14:41:38 +05:30
rohitwaghchaure
60febc5465 [Fix] Gross profit validation issue (#12516) 2018-01-17 14:40:59 +05:30
Faris Ansari
4d4ce3e5cf Rename enquiry_type to opportunity_type in MultiSelect dialog (#12517) 2018-01-17 14:40:27 +05:30
Vishal Dhayagude
052b51ab20 [fix] Fetch UOM conversion and stock_uom from BOM into material request (#12513)
* [fix]Fetch UOM conversion and stock_uom from BOM into material Request

* Update material_request.js
2018-01-17 14:39:54 +05:30
Nabin Hait
2bfa1803e9 GL Entry on asset sale (#12514)
* GL Entry on asset sale

* Asset sale test case fixed
2018-01-17 14:39:05 +05:30
Nabin Hait
b44ef0b249 Delete employee records on deletion of company 2018-01-16 19:21:02 +05:30
Saurabh
dfb1646a16 Merge branch 'hotfix' 2018-01-15 18:36:34 +05:30
Saurabh
d40bfeb7d3 bumped to version 10.0.9 2018-01-15 19:06:34 +06:00
Saurabh
af7df6ba50 Merge pull request #12495 from netchampfaris/hotfix-add-ac-2
[fix] is_root check
2018-01-15 18:35:54 +05:30
Faris Ansari
f18cd2eaf7 [fix] is_root check 2018-01-15 18:30:01 +05:30
Nabin Hait
a2426fcc9e Get default tax template only if tax template not selected or template is for other company (#12492) 2018-01-15 17:45:46 +05:30
Faris Ansari
184491bbbe [hotfix] Validate posting_time (#12484) 2018-01-15 14:18:53 +05:30
Vishal Dhayagude
eec0f7fd6b [non_profit][fix] Chapter listing and join and leave chapter issue (#12463)
* [fix] Chapter listing and Join and leave chapter issue

* [minor] Changes in chapter html, chapter title to chapter name
2018-01-15 14:10:23 +05:30
Vishal Dhayagude
e04aedadcd [fix] Add to cart issue fixed (#12474) 2018-01-15 14:01:05 +05:30
Vishal Dhayagude
e88f928f0f [fix] Image with name listing (#12479) 2018-01-15 12:29:39 +05:30
449 changed files with 16731 additions and 10679 deletions

68
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,68 @@
---
name: Bug report
about: Create a report to help us improve
---
Issue: Bug report
Our project, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
**Do the checklist before filing an issue:**
- [ ] Have a usage question? Ask your question on [Discuss Forum](https://discuss.erpnext.com). We use [Discuss Forum](https://discuss.erpnext.com) for usage question and GitHub for bugs.
- [ ] Can you replicate the issue?
- [ ] Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome
**Describe the bug** :chart_with_downwards_trend:
A clear and concise description of what the bug is.
**To Reproduce** :page_with_curl:
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior** :chart_with_upwards_trend:
A clear and concise description of what you expected to happen.
**Screenshots** :crystal_ball:
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):** :cyclone:
- OS:
- [ ] Linux
- [ ] macOS
- [ ] Windows
- [ ] Others? Please mention:
- Browser:
- [ ] Safari
- [ ] Chrome
- [ ] Firefox
- [ ] Other? Please mention:
**Smartphone (please complete the following information):** :iphone: :computer:
- Device:
- [ ] iPhone
- [ ] Android
- Browser:
- [ ] Safari
- [ ] Chrome
- [ ] Firefox
- [ ] Other? Please mention:
**Version Information**
- Which branch are you on?
- [ ] `master` :star2:
- [ ] `develop` :fire:
- Frappe Version:
- ERPNext Version:
**Additional context** :page_facing_up:
Add any other context about the problem here.
**Possible Solution** :bookmark_tabs:
Any idea what might be causing the issue. Or if you have a proposed solution to the problem,
**Please don't be intimidated by the long list of options you've fill. Try to fill out as much as you can. Remember, the more the information the easier it is for us to replicate and fix the issue** :grin:

View File

@@ -0,0 +1,21 @@
---
name: Feature request
about: Suggest an idea for this project
---
Issue: Feature Request
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

28
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,28 @@
Pull-Request
- [ ] Have you followed the guidelines in our Contributing document?
- [ ] Have you checked to ensure there aren't other open [Pull Requests](../pulls) for the same update/change?
- [ ] Have you lint your code locally prior to submission?
- [ ] Have you successfully run tests with your changes locally?
- [ ] Does your commit message have an explanation for your changes and why you'd like us to include them?
- [ ] Docs have been added / updated
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Did you modify the existing test cases? If yes, why?
---
What type of a PR is this?
- [ ] Changes to Existing Features
- [ ] New Feature Submissions
- [ ] Bug Fix
- [ ] Breaking Change
---
- Motivation and Context (What existing problem does the pull request solve):
- Related Issue:
- Screenshots (if applicable, remember, a picture tells a thousand words):
**Please don't be intimidated by the long list of options you've fill. Try to fill out as much as you can. Remember, the more the information the easier it is for us to test and get your pull request merged** :grin:

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@ latest_updates.json
*.egg-info
dist/
erpnext/docs/current
*.swp

BIN
.swp

Binary file not shown.

View File

@@ -1,13 +1,6 @@
language: python
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
python:
- "2.7"
@@ -18,6 +11,7 @@ install:
- pip install flake8==3.3.0
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
- sudo rm /etc/apt/sources.list.d/docker.list
- sudo apt-get install hhvm && rm -rf /home/travis/.kiex/
- sudo apt-get purge -y mysql-common mysql-server mysql-client
- nvm install v7.10.0
- wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
@@ -29,15 +23,6 @@ install:
- cp -r $TRAVIS_BUILD_DIR/test_sites/test_site ~/frappe-bench/sites/
before_script:
- wget http://chromedriver.storage.googleapis.com/2.33/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- sudo apt-get install libnss3
- sudo apt-get --only-upgrade install google-chrome-stable
- sudo cp chromedriver /usr/local/bin/.
- sudo chmod +x /usr/local/bin/chromedriver
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
- mysql -u root -ptravis -e 'create database test_frappe'
- echo "USE mysql;\nCREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe';\nFLUSH PRIVILEGES;\n" | mysql -u root -ptravis
- echo "USE mysql;\nGRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost';\n" | mysql -u root -ptravis
@@ -48,6 +33,7 @@ before_script:
- bench reinstall --yes
- bench build
- bench scheduler disable
- sed -i 's/9000/9001/g' sites/common_site_config.json
- bench start &
- sleep 10
@@ -58,24 +44,6 @@ jobs:
- set -e
- bench run-tests
env: Server Side Test
- # stage
script:
- bench --verbose run-setup-wizard-ui-test
- bench execute erpnext.setup.utils.enable_all_roles_and_domains
- bench run-ui-tests --app erpnext
env: Client Side Test
- # stage
script:
- bench --verbose run-setup-wizard-ui-test
- bench execute erpnext.setup.utils.enable_all_roles_and_domains
- bench run-ui-tests --app erpnext --test-list erpnext/tests/ui/tests2.txt
env: Client Side Test - 2
- # stage
script:
- bench --verbose run-setup-wizard-ui-test
- bench execute erpnext.setup.utils.enable_all_roles_and_domains
- bench run-ui-tests --app erpnext --test-list erpnext/tests/ui/agriculture.txt
env: Agriculture Client Side Test
- # stage
script:
- wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz

View File

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

View File

@@ -49,10 +49,16 @@ frappe.ui.form.on('Account', {
}
if(!frm.doc.__islocal) {
frm.add_custom_button(__('Update Account Number'), function () {
frm.add_custom_button(__('Update Account Name / Number'), function () {
frm.trigger("update_account_number");
});
}
if(!frm.doc.__islocal) {
frm.add_custom_button(__('Merge Account'), function () {
frm.trigger("merge_account");
});
}
},
account_type: function (frm) {
if (frm.doc.is_group == 0) {
@@ -98,20 +104,65 @@ frappe.ui.form.on('Account', {
}
},
update_account_number: function(frm) {
merge_account: function(frm) {
var d = new frappe.ui.Dialog({
title: __('Update Account Number'),
title: __('Merge with Existing Account'),
fields: [
{
"label": "Account Number",
"fieldname": "account_number",
"label" : "Name",
"fieldname": "name",
"fieldtype": "Data",
"reqd": 1
"reqd": 1,
"default": frm.doc.name
}
],
primary_action: function() {
var data = d.get_values();
if(data.account_number === frm.doc.account_number) {
frappe.call({
method: "erpnext.accounts.doctype.account.account.merge_account",
args: {
old: frm.doc.name,
new: data.name,
is_group: frm.doc.is_group,
root_type: frm.doc.root_type,
company: frm.doc.company
},
callback: function(r) {
if(!r.exc) {
if(r.message) {
frappe.set_route("Form", "Account", r.message);
}
d.hide();
}
}
});
},
primary_action_label: __('Merge')
});
d.show();
},
update_account_number: function(frm) {
var d = new frappe.ui.Dialog({
title: __('Update Account Number / Name'),
fields: [
{
"label": "Account Name",
"fieldname": "account_name",
"fieldtype": "Data",
"reqd": 1,
"default": frm.doc.account_name
},
{
"label": "Account Number",
"fieldname": "account_number",
"fieldtype": "Data",
"default": frm.doc.account_number
}
],
primary_action: function() {
var data = d.get_values();
if(data.account_number === frm.doc.account_number && data.account_name === frm.doc.account_name) {
d.hide();
return;
}
@@ -120,6 +171,7 @@ frappe.ui.form.on('Account', {
method: "erpnext.accounts.doctype.account.account.update_account_number",
args: {
account_number: data.account_number,
account_name: data.account_name,
name: frm.doc.name
},
callback: function(r) {
@@ -128,6 +180,7 @@ frappe.ui.form.on('Account', {
frappe.set_route("Form", "Account", r.message);
} else {
frm.set_value("account_number", data.account_number);
frm.set_value("account_name", data.account_name);
}
d.hide();
}
@@ -138,4 +191,4 @@ frappe.ui.form.on('Account', {
});
d.show();
}
});
});

View File

@@ -2,7 +2,7 @@
"allow_copy": 1,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
"allow_rename": 0,
"beta": 0,
"creation": "2013-01-30 12:49:46",
"custom": 0,
@@ -40,6 +40,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -68,6 +69,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -100,6 +102,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -130,6 +133,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -161,6 +165,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -193,6 +198,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -223,6 +229,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -253,6 +260,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -285,6 +293,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -313,6 +322,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -346,6 +356,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -379,6 +390,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -411,6 +423,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -444,6 +457,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -474,6 +488,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -503,6 +518,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -532,6 +548,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
@@ -561,6 +578,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}
],
@@ -575,7 +593,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-08-22 17:39:10.711343",
"modified": "2018-07-08 09:47:04.287841",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",

View File

@@ -165,53 +165,6 @@ class Account(NestedSet):
super(Account, self).on_trash(True)
def before_rename(self, old, new, merge=False):
# Add company abbr if not provided
from erpnext.setup.doctype.company.company import get_name_with_abbr
new_account = get_name_with_abbr(new, self.company)
new_account = get_name_with_number(new_account, self.account_number)
# Validate properties before merging
if merge:
if not frappe.db.exists("Account", new):
throw(_("Account {0} does not exist").format(new))
val = list(frappe.db.get_value("Account", new_account,
["is_group", "root_type", "company"]))
if val != [self.is_group, self.root_type, self.company]:
throw(_("""Merging is only possible if following properties are same in both records. Is Group, Root Type, Company"""))
if self.is_group and frappe.db.get_value("Account", new, "parent_account") == old:
frappe.db.set_value("Account", new, "parent_account",
frappe.db.get_value("Account", old, "parent_account"))
return new_account
def after_rename(self, old, new, merge=False):
super(Account, self).after_rename(old, new, merge)
if not merge:
new_acc = frappe.db.get_value("Account", new, ["account_name", "account_number"], as_dict=1)
# exclude company abbr
new_parts = new.split(" - ")[:-1]
# update account number and remove from parts
if new_parts[0][0].isdigit():
# if account number is separate by space, split using space
if len(new_parts) == 1:
new_parts = new.split(" ")
if new_acc.account_number != new_parts[0]:
self.account_number = new_parts[0]
self.db_set("account_number", new_parts[0])
new_parts = new_parts[1:]
# update account name
account_name = " - ".join(new_parts)
if new_acc.account_name != account_name:
self.account_name = account_name
self.db_set("account_name", account_name)
def get_parent_account(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.sql("""select name from tabAccount
where is_group = 1 and docstatus != 2 and company = %s
@@ -252,25 +205,38 @@ def validate_account_number(name, account_number, company):
.format(account_number, account_with_same_number))
@frappe.whitelist()
def update_account_number(name, account_number):
account = frappe.db.get_value("Account", name, ["account_name", "company"], as_dict=True)
def update_account_number(name, account_name, account_number=None):
account = frappe.db.get_value("Account", name, "company", as_dict=True)
if not account: return
validate_account_number(name, account_number, account.company)
frappe.db.set_value("Account", name, "account_number", account_number)
account_name = account.account_name
if account_name[0].isdigit():
separator = " - " if " - " in account_name else " "
account_name = account_name.split(separator, 1)[1]
frappe.db.set_value("Account", name, "account_name", account_name)
if account_number:
frappe.db.set_value("Account", name, "account_number", account_number.strip())
else:
frappe.db.set_value("Account", name, "account_number", "")
frappe.db.set_value("Account", name, "account_name", account_name.strip())
new_name = get_account_autoname(account_number, account_name, account.company)
if name != new_name:
frappe.rename_doc("Account", name, new_name)
frappe.rename_doc("Account", name, new_name, ignore_permissions=1)
return new_name
def get_name_with_number(new_account, account_number):
if account_number and not new_account[0].isdigit():
new_account = account_number + " - " + new_account
return new_account
@frappe.whitelist()
def merge_account(old, new, is_group, root_type, company):
# Validate properties before merging
if not frappe.db.exists("Account", new):
throw(_("Account {0} does not exist").format(new))
val = list(frappe.db.get_value("Account", new,
["is_group", "root_type", "company"]))
if val != [cint(is_group), root_type, company]:
throw(_("""Merging is only possible if following properties are same in both records. Is Group, Root Type, Company"""))
if is_group and frappe.db.get_value("Account", new, "parent_account") == old:
frappe.db.set_value("Account", new, "parent_account",
frappe.db.get_value("Account", old, "parent_account"))
frappe.rename_doc("Account", old, new, merge=1, ignore_permissions=1)
return new

View File

@@ -71,7 +71,7 @@ frappe.treeview_settings["Account"] = {
// financial statements
for (let report of ['Trial Balance', 'General Ledger', 'Balance Sheet',
'Profit and Loss', 'Cash Flow Statement', 'Accounts Payable', 'Accounts Receivable']) {
'Profit and Loss Statement', 'Cash Flow Statement', 'Accounts Payable', 'Accounts Receivable']) {
treeview.page.add_inner_button(__(report), function() {
frappe.set_route('query-report', report, {company: get_company()});
}, __('Financial Statements'));

View File

@@ -165,7 +165,7 @@ def build_account_tree(tree, parent, all_accounts):
tree[child.account_name] = {}
# assign account_type and root_type
if child.account_type:
if child.account_number:
tree[child.account_name]["account_number"] = child.account_number
if child.account_type:
tree[child.account_name]["account_type"] = child.account_type
@@ -175,4 +175,4 @@ def build_account_tree(tree, parent, all_accounts):
tree[child.account_name]["root_type"] = child.root_type
# call recursively to build a subtree for current account
build_account_tree(tree[child.account_name], child, all_accounts)
build_account_tree(tree[child.account_name], child, all_accounts)

View File

@@ -176,7 +176,7 @@
"Eingeforderte Nachsch\u00fcsse (gegenkonto 2929)": {}
},
"Eingeforderte- noch ausstehende Kapitaleinlagen": {
"Ausstehende Einlagen auf das gezeichnete Kapital- eingefordert (Forderungen- nicht eingeforderte ausstehende Einlagen s. Konto 2910)": {}
"Ausstehende Einlagen auf das gezeichnete Kapital- eingefordert": {}
},
"Forderungen aus Lieferungen und Leistungen H-Saldo": {
"Einzelwertberechtigungen zu Forderungen mit einer Restlaufzeit bis zu 1 Jahr": {},
@@ -685,7 +685,6 @@
"Umsatzsteuer aus innergemeinschaftlichem Erwerb 16%": {},
"Umsatzsteuer aus innergemeinschaftlichem Erwerb 19%": {},
"Umsatzsteuer aus innergemeinschaftlichem Erwerb ohne Vorsteuerabzug": {},
"Umsatzsteuer aus innergemeinschaftlichem Erwerb von Neufahrzeugen von Lieferanten ohne Umsatzsteuer-Identifikationsnummer": {},
"Umsatzsteuer fr\u00fchere Jahre": {},
"Umsatzsteuer laufendes Jahr": {},
"Umsatzsteuer nach \u00a713b UStG": {},
@@ -747,7 +746,7 @@
"Verbindlichkeiten gegen\u00fcber Kreditinstituten ": {
"Gegenkonto 3159-3209 bei Aufteilung der Konten 3210-3248": {}
},
"Verbindlichkeiten gegen\u00fcber Kreditinstituten oder Kassenbestand- Bundesbankguthaben- Guthaben bei Kreditinstituten und Schecks": {
"Verbindlichkeiten gegen\u00fcber Kreditinstituten - Bundesbankguthaben- Guthaben bei Kreditinstituten und Schecks": {
"Verbindlichkeiten gegen\u00fcber Kreditinstituten 1": {
"(frei- in Bilanz kein Restlaufzeit vermerkt) 1": {},
"Verbindlichkeiten gegen\u00fcber Kreditinstituten Restlaufzeit 1 bis 5 Jahre": {},
@@ -778,8 +777,8 @@
},
"Gewinn u. Verlust - Aufwendungen": {
"Betriebliche Aufwendungen": {
"Abschreibungen a. Verm\u00f6gensgeg. d. Umlaufverm\u00f6gens- soweit diese die in der Kapitalgesellschaft \u00fcblichen Abschreibungen \u00fcberschreiten": {
"Abschreibungen a. Verm\u00f6gensgeg. d. Umlaufverm\u00f6gens- soweit diese die in der Kapitalgesellschaft \u00fcblichen Abschreibungen \u00fcberschreiten": {
"Abschreibungen a. Verm\u00f6gensgeg. d. Umlaufverm\u00f6gens- soweit diese die in der Abschreibungen \u00fcberschreiten": {
"Abschreibungen a. Verm\u00f6gensgeg. d. Umlaufverm\u00f6gens- soweit diese die in der Abschreibungen \u00fcberschreiten": {
"Abschreibungen auf Umlaufverm\u00f6gen- steuerrechtlich bedingt (soweit un\u00fcblich hoch)": {},
"Abschreibungen auf Verm\u00f6gensgegenst\u00e4nde des Umlaufverm\u00f6gens (soweit un\u00fcblich hoch)": {},
"Forderungsverluste (soweit un\u00fcblich hoch)": {},
@@ -852,7 +851,7 @@
"Sonstige betriebliche Aufwendungen 3": {
"Sonstige betriebliche Aufwendungen 4": {
"Abgaben f\u00fcr betrieblich genutzten Grundbesitz": {},
"Abgang von Wirtschaftsg\u00fctern des Umlaufverm\u00f6gens 100% / 50% nicht abzugsf\u00e4hig (inlandische Kap. Ges.) nach \u00a7 4 Abs. 3 Satz 4 EStG": {},
"Abgang von Wirtschaftsg\u00fctern des Umlaufverm\u00f6gens 100% / 50% nicht abzugsf\u00e4hig (inlandische Kap. Ges.) nach": {},
"Abgang von Wirtschaftsg\u00fctern des Umlaufverm\u00f6gens nach \u00a7 4 Abs. 3 Satz 4 EStG": {},
"Abschluss- und Pr\u00fcfungskosten": {},
"Abschreibung auf Umlaufverm\u00f6gen au\u00dfer Vorr\u00e4te und Wertpapieren des UV (\u00fcbliche H\u00f6he)": {},
@@ -867,7 +866,7 @@
"Aufwendungen aus Anteilen an Kapitalgesellschaften 100% / 50% nicht abzugsf\u00e4hig (inlandische Kap. Ges.)": {},
"Aufwendungen aus Bewertung Finanzmittelfonds": {},
"Aufwendungen aus Kursdifferenzen": {},
"Aufwendungen aus der Ver\u00e4u\u00dferung von Anteilen an Kapitalgesellschaften 100% / 50% nicht abzugsf\u00e4hig (inl\u00e4ndische Kap. Ges.)": {},
"Aufwendungen aus der Ver\u00e4u\u00dferung von Anteilen an Kapitalgesellschaften 100% / 50% nicht abzugsf\u00e4hig": {},
"Aufwendungen aus der Zuschreibung von steuertlich niedriger bewerteten R\u00fcckstellungen": {},
"Aufwendungen aus der Zuschreibung von steuertlich niedriger bewerteten Verbindlichkeiten": {},
"Aufwendungen f\u00fcr Abraum- und Abfallbeseitigung": {},
@@ -987,9 +986,9 @@
"Verg\u00fctungen an Mitunternehmer \u00a7 15 EStG": {},
"Verkaufsprovisionen": {},
"Verluste aus dem Abgang von Gegenst\u00e4nden des Anlageverm\u00f6gens": {},
"Verluste aus dem Abgang von Gegenst\u00e4nden des Umlaufverm\u00f6gens (au\u00dfer Vorr\u00e4te) 100% / 50% nicht anzugsf\u00e4hig (inlandische Kap. Ges.)": {},
"Verluste aus dem Abgang von Gegenst\u00e4nden des Umlaufverm\u00f6gens (au\u00dfer Vorr\u00e4te) 100%/50% nicht anzugsf\u00e4hig": {},
"Verluste aus dem Abgang von Gegenst\u00e4nden des Umlaufverm\u00f6gens au\u00dfer Vorr\u00e4te": {},
"Verluste aus der Ver\u00e4u\u00dferung von Anteilen an Kapitalgesellschaften 100% / 50% nicht abzugsf\u00e4hig (inl\u00e4ndische Kap. Ges.)": {},
"Verluste aus der Ver\u00e4u\u00dferung von Anteilen an Kapitalgesellschaften 100% / 50% nicht abzugsf\u00e4hig": {},
"Verpackungsmaterial": {},
"Versicherungen": {},
"Versicherungen f\u00fcr Geb\u00e4ude": {},
@@ -1020,10 +1019,10 @@
},
"Abschreibungen auf Finanzanlagen 100% / 50% nicht abzugsf\u00e4hig (inl\u00e4ndische Kap. Ges.)": {},
"Abschreibungen auf Finanzanlagen auf Grund steuerlicher Sondervorschriften": {},
"Abschreibungen auf Finanzanlagen auf Grund steuerlicher Sondervorschriften 100% / 50% nicht abzugsf\u00e4hig (inl\u00e4ndische Kap. Ges.)": {},
"Abschreibungen auf Finanzanlagen auf Grund steuerlicher Sondervorschriften 100% / 50% nicht abzugsf\u00e4hig": {},
"Abschreibungen auf Grund von Verlustanteilen an Mitunternehmerschaften \u00a7 8 GewStG": {},
"Abschreibungen auf Wertpapiere des Umlaufverm\u00f6gens": {},
"Abschreibungen auf Wertpapiere des Umlaufverm\u00f6gens 100% / 50% nicht abzugsf\u00e4hig (inl\u00e4ndische Kap. Ges.)": {},
"Abschreibungen auf Wertpapiere des Umlaufverm\u00f6gens 100% / 50% nicht abzugsf\u00e4hig": {},
"Vorwegnahme k\u00fcnftiger Wertschwankungen bei Wertpapieren des Umlaufverm\u00f6gens": {}
},
"account_type": "Depreciation"
@@ -1123,15 +1122,15 @@
}
},
"Erh\u00f6hung oder Verminderung des Bestands an fertigen und unfertige Erzeugnissen": {
"Erh\u00f6hung des Bestands an fertigen und unfertigen Erzeugnissen oder Verminderung des Bestands an fertigen und unfertigen Erzeugnissen": {
"Erh\u00f6hung / Verminderung des Bestands an fertigen und unfertigen Erzeugnissen": {
"Bestandsver\u00e4nderungen - fertige Erzeugnisse": {},
"Bestandsver\u00e4nderungen - unfertige Erzeugnisse": {},
"Bestandsver\u00e4nderungen - unfertige Leistungen": {}
},
"Erh\u00f6hung des Bestands in Arbeit befindlicher Auftr\u00e4ge oder Verminderung des Bestands in Arbeit befindlicher Auftr\u00e4ge": {
"Erh\u00f6hung / Verminderung des Bestands in Arbeit befindlicher Auftr\u00e4ge": {
"Bestandsver\u00e4nderungen in Arbeit befindlicher Auftr\u00e4ge": {}
},
"Erh\u00f6hung des Bestands in Ausf\u00fchrung befindlicher Bauaftr\u00e4ge oder Verminderung des Bestands in Ausf\u00fchrung befindlicher Bauauftr\u00e4ge": {
"Erh\u00f6hung / Verminderung des Bestands in Ausf\u00fchrung befindlicher Bauaftr\u00e4ge": {
"Bestandsver\u00e4nderungen in Ausf\u00fchrung befindliche Bauauftr\u00e4ge": {}
}
},
@@ -1384,8 +1383,8 @@
"Sonstige Zinsen und \u00e4hnliche Ertr\u00e4ge 1": {
"Diskontertr\u00e4ge": {},
"Diskontertr\u00e4ge aus verbundenen Unternehmen": {},
"Laufende Ertr\u00e4ge aus Anteilen an Kapitalgesellschaften (Umlaufverm\u00f6gen) 100% / 50% steuerfrei (inl\u00e4ndische Kap. Ges.)": {},
"Laufende Ertr\u00e4ge aus Anteilen an Kapitalgesellschaften (verbundene Unternehmen) 100% / 50% steuerfrei (inl\u00e4ndische Kap. Ges.)": {},
"Laufende Ertr\u00e4ge aus Anteilen an Kapitalgesellschaften 100% / 50% steuerfrei": {},
"Laufende Ertr\u00e4ge aus Anteilen an Kapitalgesellschaften 100% / 50% steuerfrei": {},
"Sonstige Zinsen und \u00e4hnliche Ertr\u00e4ge 2": {},
"Sonstige Zinsen und \u00e4hnliche Ertr\u00e4ge aus verbundenen Unternehmen": {},
"Sonstige Zinsertr\u00e4ge": {},

View File

@@ -588,7 +588,6 @@
"5592. Munk\u00e1ltat\u00f3 \u00e1ltal \u00f6nk\u00e9ntes p\u00e9nzt\u00e1rba befizetett munk\u00e1ltat\u00f3i tagd\u00edj hozz\u00e1j\u00e1rul\u00e1s": {},
"5593. Munk\u00e1ltat\u00f3t terhel\u0151 szem\u00e9lyi j\u00f6vedelemad\u00f3": {},
"5594. Munk\u00e1ltat\u00f3i hozz\u00e1j\u00e1rul\u00e1s a korengedm\u00e9nyes nyugd\u00edj ig\u00e9nybev\u00e9tel\u00e9hez": {},
"5595. Tal\u00e1lm\u00e1nyi d\u00edj, szabadalom v\u00e9tel\u00e1ra \u00e9s hasznos\u00edt\u00e1si d\u00edja, az \u00faj\u00edt\u00e1si d\u00edj \u00e9s ezekkel kapcsolatos k\u00f6zrem\u0171k\u00f6d\u00e9si d\u00edjak": {},
"5596. Fizetett szerz\u0151i, \u00edr\u00f3i \u00e9s m\u00e1s jogv\u00e9delmet \u00e9lvez\u0151 munk\u00e1k d\u00edjai \u00e9s ezekkel kapcsolatos k\u00f6zrem\u0171k\u00f6d\u0151i d\u00edjak": {},
"5597. Fizetett \u00f6szt\u00f6nd\u00edjak": {},
"5598. Reprezent\u00e1ci\u00f3s k\u00f6lts\u00e9gek, \u00e9tkez\u00e9si hozz\u00e1j\u00e1rul\u00e1s": {},
@@ -731,7 +730,7 @@
"8684. K\u00f6vetel\u00e9sek \u00e9rt\u00e9kveszt\u00e9se": {}
},
"869. K\u00fcl\u00f6nf\u00e9le egy\u00e9b r\u00e1ford\u00edt\u00e1sok": {
"8691. T\u00e1rsas\u00e1gba bevitt, \u00e9rt\u00e9kpap\u00edrnak vagy r\u00e9szesed\u00e9snek nem min\u0151s\u00fcl\u0151 vagyont. k\u00f6nyv szerinti \u00e9s l\u00e9t. okir. meghat. veszt. k\u00fcl\u00f6nb\u00f6zet": {},
"8691. T\u00e1rsas\u00e1gba bevitt, \u00e9rt\u00e9kpap\u00edrnak vagy r\u00e9szesed\u00e9snek nem min\u0151s\u00fcl\u0151 vagyont.": {},
"8692. Ellent\u00e9telez\u00e9s n\u00e9lk\u00fcl \u00e1tv\u00e1llalt k\u00f6telezetts\u00e9g szerz\u0151d\u00e9s szerinti \u00f6sszege": {},
"8693. T\u00e9r\u00edt\u00e9s n\u00e9lk\u00fcl \u00e1tadott, r\u00e9szesed\u00e9snek vagy \u00e9rt\u00e9kpap\u00edrnak nem min\u0151s\u00fcl\u0151 eszk\u00f6z\u00f6k nyilv\u00e1ntart\u00e1s szerinti \u00e9rt\u00e9ke": {},
"8694. T\u00e9r\u00edt\u00e9s n\u00e9lk\u00fcl ny\u00fajtott szolg\u00e1ltat\u00e1sok beker\u00fcl\u00e9si \u00e9rt\u00e9ke": {},
@@ -813,12 +812,7 @@
"9684. R\u00e9szesed\u00e9sek \u00e9rt\u00e9kveszt\u00e9s\u00e9nek vissza\u00edr\u00e1sa": {}
},
"969. K\u00fcl\u00f6nf\u00e9le egy\u00e9b bev\u00e9telek": {
"9691. Gazdas\u00e1gi t\u00e1rsas\u00e1gba bevitt, \u00e9rt\u00e9kp. vagy r\u00e9szesed\u00e9snek nem min\u0151s\u00fcl\u0151 vagyont. \u00e9rt\u00e9ke \u00e9s l\u00e9tes\u00edt\u0151 okir. \u00e9rt. nyer. jell . k\u00fcl\u00f6nb.": {},
"9692. El\u00e9v\u00fclt k\u00f6telezetts\u00e9g k\u00f6nyv szerinti \u00e9rt\u00e9ke": {},
"9693. T\u00e9r\u00edt\u00e9s n\u00e9lk\u00fcl \u00e1tvett, aj\u00e1nd\u00e9kk\u00e9nt, hagyat\u00e9kk\u00e9nt kapott, fellelt eszk\u00f6z\u00f6k piaci vagy jogszab\u00e1ly szerinti \u00e9rt\u00e9ke": {},
"9694. T\u00e9r\u00edt\u00e9s n\u00e9lk\u00fcl kapott szolg\u00e1ltat\u00e1sok piaci vagy jogszab\u00e1ly szerinti \u00e9rt\u00e9ke": {},
"9695. Elengedett \u00e9s ellent\u00e9telez\u00e9s n\u00e9lk\u00fcl \u00e1tv\u00e1llalt k\u00f6telezetts\u00e9g \u00e9rt\u00e9ke": {},
"9696. Egy\u00e9b, vagyonn\u00f6veked\u00e9ssel j\u00e1r\u00f3 bev\u00e9telek": {}
"is_group": 1
}
},
"97. P\u00c9NZ\u00dcGYI M\u0170VELETEK BEV\u00c9TELEI": {

View File

@@ -5,6 +5,8 @@ from __future__ import unicode_literals
import unittest
import frappe
from erpnext.stock import get_warehouse_account, get_company_default_inventory_account
from erpnext.accounts.doctype.account.account import update_account_number
from erpnext.accounts.doctype.account.account import merge_account
class TestAccount(unittest.TestCase):
def test_rename_account(self):
@@ -21,21 +23,79 @@ class TestAccount(unittest.TestCase):
self.assertEqual(account_number, "1210")
self.assertEqual(account_name, "Debtors")
frappe.rename_doc("Account", "1210 - Debtors - _TC", "1211 - Debtors 1 - _TC")
new_account_number = "1211-11-4 - 6 - "
new_account_name = "Debtors 1 - Test - "
new_acc = frappe.db.get_value("Account", "1211 - Debtors 1 - _TC",
update_account_number("1210 - Debtors - _TC", new_account_name, new_account_number)
new_acc = frappe.db.get_value("Account", "1211-11-4 - 6 - - Debtors 1 - Test - - _TC",
["account_name", "account_number"], as_dict=1)
self.assertEqual(new_acc.account_name, "Debtors 1")
self.assertEqual(new_acc.account_number, "1211")
frappe.rename_doc("Account", "1211 - Debtors 1 - _TC", "Debtors 2")
self.assertEqual(new_acc.account_name, "Debtors 1 - Test -")
self.assertEqual(new_acc.account_number, "1211-11-4 - 6 -")
new_acc = frappe.db.get_value("Account", "1211 - Debtors 2 - _TC",
["account_name", "account_number"], as_dict=1)
self.assertEqual(new_acc.account_name, "Debtors 2")
self.assertEqual(new_acc.account_number, "1211")
frappe.delete_doc("Account", "1211-11-4 - 6 - Debtors 1 - Test - - _TC")
frappe.delete_doc("Account", "1211 - Debtors 2 - _TC")
def test_merge_account(self):
if not frappe.db.exists("Account", "Current Assets - _TC"):
acc = frappe.new_doc("Account")
acc.account_name = "Current Assets"
acc.is_group = 1
acc.parent_account = "Application of Funds (Assets) - _TC"
acc.company = "_Test Company"
acc.insert()
if not frappe.db.exists("Account", "Securities and Deposits - _TC"):
acc = frappe.new_doc("Account")
acc.account_name = "Securities and Deposits"
acc.parent_account = "Current Assets - _TC"
acc.is_group = 1
acc.company = "_Test Company"
acc.insert()
if not frappe.db.exists("Account", "Earnest Money - _TC"):
acc = frappe.new_doc("Account")
acc.account_name = "Earnest Money"
acc.parent_account = "Securities and Deposits - _TC"
acc.company = "_Test Company"
acc.insert()
if not frappe.db.exists("Account", "Cash In Hand - _TC"):
acc = frappe.new_doc("Account")
acc.account_name = "Cash In Hand"
acc.is_group = 1
acc.parent_account = "Current Assets - _TC"
acc.company = "_Test Company"
acc.insert()
if not frappe.db.exists("Account", "Accumulated Depreciation - _TC"):
acc = frappe.new_doc("Account")
acc.account_name = "Accumulated Depreciation"
acc.parent_account = "Fixed Assets - _TC"
acc.company = "_Test Company"
acc.insert()
doc = frappe.get_doc("Account", "Securities and Deposits - _TC")
parent = frappe.db.get_value("Account", "Earnest Money - _TC", "parent_account")
self.assertEqual(parent, "Securities and Deposits - _TC")
merge_account("Securities and Deposits - _TC", "Cash In Hand - _TC", doc.is_group, doc.root_type, doc.company)
parent = frappe.db.get_value("Account", "Earnest Money - _TC", "parent_account")
# Parent account of the child account changes after merging
self.assertEqual(parent, "Cash In Hand - _TC")
# Old account doesn't exist after merging
self.assertFalse(frappe.db.exists("Account", "Securities and Deposits - _TC"))
doc = frappe.get_doc("Account", "Current Assets - _TC")
# Raise error as is_group property doesn't match
self.assertRaises(frappe.ValidationError, merge_account, "Current Assets - _TC",\
"Accumulated Depreciation - _TC", doc.is_group, doc.root_type, doc.company)
doc = frappe.get_doc("Account", "Capital Stock - _TC")
# Raise error as root_type property doesn't match
self.assertRaises(frappe.ValidationError, merge_account, "Capital Stock - _TC",\
"Softwares - _TC", doc.is_group, doc.root_type, doc.company)
def _make_test_records(verbose):
from frappe.test_runner import make_test_objects

View File

@@ -159,6 +159,36 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "include_pos_transactions",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Include POS Transactions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -292,7 +322,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2017-04-21 16:58:26.902732",
"modified": "2018-03-07 18:58:48.658687",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation",

View File

@@ -53,10 +53,26 @@ class BankReconciliation(Document):
posting_date ASC, name DESC
""".format(condition),
{"account":self.bank_account, "from":self.from_date, "to":self.to_date}, as_dict=1)
entries = sorted(list(payment_entries)+list(journal_entries),
pos_entries = []
if self.include_pos_transactions:
pos_entries = frappe.db.sql("""
select
"Sales Invoice Payment" as payment_document, sip.name as payment_entry, sip.amount as debit,
si.posting_date, si.debit_to as against_account, sip.clearance_date,
account.account_currency, 0 as credit
from `tabSales Invoice Payment` sip, `tabSales Invoice` si, `tabAccount` account
where
sip.account=%(account)s and si.docstatus=1 and sip.parent = si.name
and account.name = sip.account and si.posting_date >= %(from)s and si.posting_date <= %(to)s {0}
order by
si.posting_date ASC, si.name DESC
""".format(condition),
{"account":self.bank_account, "from":self.from_date, "to":self.to_date}, as_dict=1)
entries = sorted(list(payment_entries)+list(journal_entries+list(pos_entries)),
key=lambda k: k['posting_date'] or getdate(nowdate()))
self.set('payment_entries', [])
self.total_amount = 0.0

View File

@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
class TestBankReconciliation(unittest.TestCase):
pass

View File

@@ -27,13 +27,21 @@ class Budget(Document):
def validate_duplicate(self):
budget_against_field = frappe.scrub(self.budget_against)
budget_against = self.get(budget_against_field)
existing_budget = frappe.db.get_value("Budget", {budget_against_field: budget_against,
"fiscal_year": self.fiscal_year, "company": self.company,
"name": ["!=", self.name], "docstatus": ["!=", 2]})
if existing_budget:
frappe.throw(_("Another Budget record '{0}' already exists against {1} '{2}' for fiscal year {3}")
.format(existing_budget, self.budget_against, budget_against, self.fiscal_year), DuplicateBudgetError)
accounts = [d.account for d in self.accounts] or []
existing_budget = frappe.db.sql("""
select
b.name, ba.account from `tabBudget` b, `tabBudget Account` ba
where
ba.parent = b.name and b.docstatus < 2 and b.company = %s and %s=%s and
b.fiscal_year=%s and b.name != %sand ba.account in (%s) """
% ('%s', budget_against_field, '%s', '%s', '%s', ','.join(['%s'] * len(accounts))),
(self.company, budget_against, self.fiscal_year, self.name) + tuple(accounts), as_dict=1)
for d in existing_budget:
frappe.throw(_("Another Budget record '{0}' already exists against {1} '{2}' and account '{3}' for fiscal year {4}")
.format(d.name, self.budget_against, budget_against, d.account, self.fiscal_year), DuplicateBudgetError)
def validate_accounts(self):
account_list = []
for d in self.get('accounts'):

View File

@@ -27,22 +27,32 @@ def create_or_update_cheque_print_format(template_name):
doc = frappe.get_doc("Cheque Print Template", template_name)
cheque_print.html = """
<style>
.print-format {
padding: 0px;
}
@media screen {
.print-format {
padding: 0in;
}
}
</style>
<div style="position: relative; top:%(starting_position_from_top_edge)scm">
<div style="width:%(cheque_width)scm;height:%(cheque_height)scm;">
<span style="top: {{ %(acc_pay_dist_from_top_edge)s }}cm; left: {{ %(acc_pay_dist_from_left_edge)s }}cm;
border-bottom: solid 1px;border-top:solid 1px; position: absolute;">
<span style="top:%(acc_pay_dist_from_top_edge)scm; left:%(acc_pay_dist_from_left_edge)scm;
border-bottom: solid 1px;border-top:solid 1px; width:2cm;text-align: center; position: absolute;">
%(message_to_show)s
</span>
<span style="top:%(date_dist_from_top_edge)s cm; left:%(date_dist_from_left_edge)scm;
<span style="top:%(date_dist_from_top_edge)scm; left:%(date_dist_from_left_edge)scm;
position: absolute;">
{{ frappe.utils.formatdate(doc.reference_date) or '' }}
</span>
<span style="top:%(acc_no_dist_from_top_edge)scm;left:%(acc_no_dist_from_left_edge)scm;
position: absolute;">
position: absolute; min-width: 6cm;">
{{ doc.account_no or '' }}
</span>
<span style="top:%(payer_name_from_top_edge)scm;left: %(payer_name_from_left_edge)scm;
position: absolute;">
position: absolute; min-width: 6cm;">
{{doc.party_name}}
</span>
<span style="top:%(amt_in_words_from_top_edge)scm; left:%(amt_in_words_from_left_edge)scm;
@@ -51,11 +61,11 @@ def create_or_update_cheque_print_format(template_name):
{{frappe.utils.money_in_words(doc.base_paid_amount or doc.base_received_amount)}}
</span>
<span style="top:%(amt_in_figures_from_top_edge)scm;left: %(amt_in_figures_from_left_edge)scm;
position: absolute;">
position: absolute; min-width: 4cm;">
{{doc.get_formatted("base_paid_amount") or doc.get_formatted("base_received_amount")}}
</span>
<span style="top:%(signatory_from_top_edge)scm;left: %(signatory_from_left_edge)scm;
position: absolute;">
position: absolute; min-width: 6cm;">
{{doc.company}}
</span>
</div>

View File

@@ -48,5 +48,10 @@ frappe.treeview_settings["Cost Center"] = {
}, __('Budget'));
},
onrender: function(node) {
if(node.is_root){
node.hide_add = true;
}
}
}

View File

@@ -132,7 +132,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -702,7 +702,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
}
@@ -718,7 +718,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-12-20 12:40:09.611951",
"modified": "2018-08-10 16:16:53.019380",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",
@@ -794,4 +794,4 @@
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0
}
}

View File

@@ -3,9 +3,8 @@
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:hub_category_name",
"beta": 0,
"creation": "2017-08-22 11:31:10.410322",
"creation": "2018-01-02 15:48:58.768352",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
@@ -19,8 +18,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "hub_category_name",
"fieldtype": "Data",
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -28,9 +27,10 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Category Name",
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -49,19 +49,19 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "parent_hub_category",
"fieldname": "cgst_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Parent Category",
"label": "CGST Account",
"length": 0,
"no_copy": 0,
"options": "Hub Category",
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -69,7 +69,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -80,18 +80,19 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_group",
"fieldtype": "Check",
"fieldname": "sgst_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Is Group",
"label": "SGST Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -99,7 +100,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -110,18 +111,19 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description",
"fieldtype": "Text Editor",
"fieldname": "igst_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Description",
"label": "IGST Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -129,7 +131,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -140,78 +142,19 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "lft",
"fieldtype": "Int",
"fieldname": "cess_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Left",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "rgt",
"fieldtype": "Int",
"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": "Right",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "old_parent",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Old Parent",
"label": "CESS Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -233,43 +176,21 @@
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-09-03 22:04:22.958831",
"modified": "2018-01-02 15:52:22.335988",
"modified_by": "Administrator",
"module": "Hub Node",
"name": "Hub Category",
"module": "Accounts",
"name": "GST Account",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
}
],
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "hub_category_name",
"track_changes": 1,
"track_seen": 0
}

View File

@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import NestedSet
from frappe.model.document import Document
class HubCategory(NestedSet):
class GSTAccount(Document):
pass

View File

@@ -82,8 +82,8 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
$.each(this.frm.doc.accounts || [], function(i, jvd) {
frappe.model.set_default_values(jvd);
});
if(!this.frm.doc.amended_from) this.frm.doc.posting_date = this.frm.posting_date || frappe.datetime.get_today();
var posting_date = this.frm.posting_date;
if(!this.frm.doc.amended_from) this.frm.set_value('posting_date', posting_date || frappe.datetime.get_today());
}
},

View File

@@ -381,7 +381,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -1443,7 +1443,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2017-08-31 11:21:09.442695",
"modified": "2018-08-10 16:35:31.361030",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",

View File

@@ -82,7 +82,7 @@ class JournalEntry(AccountsController):
d.reference_type = ''
d.reference_name = ''
d.db_update()
def unlink_asset_reference(self):
for d in self.get("accounts"):
if d.reference_type=="Asset" and d.reference_name:
@@ -125,7 +125,7 @@ class JournalEntry(AccountsController):
if (d.party_type == 'Customer' and flt(d.credit) > 0) or \
(d.party_type == 'Supplier' and flt(d.debit) > 0):
if d.is_advance=="No":
msgprint(_("Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.").format(d.idx, d.account))
msgprint(_("Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.").format(d.idx, d.account), alert=1)
elif d.reference_type in ("Sales Order", "Purchase Order") and d.is_advance != "Yes":
frappe.throw(_("Row {0}: Payment against Sales/Purchase Order should always be marked as advance").format(d.idx))

View File

@@ -199,7 +199,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -661,7 +661,7 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -795,7 +795,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-12-07 19:54:19.851534",
"modified": "2018-08-10 16:35:42.833549",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",

View File

@@ -138,7 +138,8 @@ class OpeningInvoiceCreationTool(Document):
income_expense_account_field = "expense_account"
item = get_item_dict()
return frappe._dict({
args = frappe._dict({
"items": [item],
"is_opening": "Yes",
"set_posting_time": 1,
@@ -150,6 +151,11 @@ class OpeningInvoiceCreationTool(Document):
"currency": frappe.db.get_value("Company", self.company, "default_currency")
})
if self.invoice_type == "Sales":
args["is_pos"] = 0
return args
@frappe.whitelist()
def get_temporary_opening_account(company=None):
if not company:

View File

@@ -145,13 +145,13 @@ frappe.ui.form.on('Payment Entry', {
frm.doc.paid_amount : frm.doc.received_amount;
frm.toggle_display("write_off_difference_amount", (frm.doc.difference_amount && frm.doc.party &&
(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) &&
(frm.doc.total_allocated_amount > party_amount)));
frm.toggle_display("set_exchange_gain_loss",
(frm.doc.paid_amount && frm.doc.received_amount && frm.doc.difference_amount &&
(frm.doc.paid_from_account_currency != company_currency ||
frm.doc.paid_to_account_currency != company_currency)));
((frm.doc.paid_from_account_currency != company_currency ||
frm.doc.paid_to_account_currency != company_currency) &&
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency)));
frm.refresh_fields();
},
@@ -300,7 +300,15 @@ frappe.ui.form.on('Payment Entry', {
if(frm.doc.payment_type == "Pay") {
frm.events.get_outstanding_documents(frm);
} else if (frm.doc.payment_type == "Receive") {
frm.events.received_amount(frm);
if(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
if(frm.doc.source_exchange_rate) {
frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
}
frm.set_value("received_amount", frm.doc.paid_amount);
} else {
frm.events.received_amount(frm);
}
}
}
);
@@ -317,26 +325,31 @@ frappe.ui.form.on('Payment Entry', {
},
callback: function(r, rt) {
if(r.message) {
frm.set_value(currency_field, r.message['account_currency']);
frm.set_value(balance_field, r.message['account_balance']);
frappe.run_serially([
() => frm.set_value(currency_field, r.message['account_currency']),
() => {
frm.set_value(balance_field, r.message['account_balance']);
if(frm.doc.payment_type=="Receive" && currency_field=="paid_to_account_currency") {
frm.toggle_reqd(["reference_no", "reference_date"],
(r.message['account_type'] == "Bank" ? 1 : 0));
if(!frm.doc.received_amount && frm.doc.paid_amount)
frm.events.paid_amount(frm);
} else if(frm.doc.payment_type=="Pay" && currency_field=="paid_from_account_currency") {
frm.toggle_reqd(["reference_no", "reference_date"],
(r.message['account_type'] == "Bank" ? 1 : 0));
if(frm.doc.payment_type=="Receive" && currency_field=="paid_to_account_currency") {
frm.toggle_reqd(["reference_no", "reference_date"],
(r.message['account_type'] == "Bank" ? 1 : 0));
if(!frm.doc.received_amount && frm.doc.paid_amount)
frm.events.paid_amount(frm);
} else if(frm.doc.payment_type=="Pay" && currency_field=="paid_from_account_currency") {
frm.toggle_reqd(["reference_no", "reference_date"],
(r.message['account_type'] == "Bank" ? 1 : 0));
if(!frm.doc.paid_amount && frm.doc.received_amount)
frm.events.received_amount(frm);
}
if(!frm.doc.paid_amount && frm.doc.received_amount)
frm.events.received_amount(frm);
}
},
() => {
if(callback_function) callback_function(frm);
if(callback_function) callback_function(frm);
frm.events.hide_unhide_fields(frm);
frm.events.set_dynamic_labels(frm);
frm.events.hide_unhide_fields(frm);
frm.events.set_dynamic_labels(frm);
}
]);
}
}
});
@@ -405,7 +418,7 @@ frappe.ui.form.on('Payment Entry', {
frm.set_value("base_received_amount", frm.doc.base_paid_amount);
}
frm.events.set_difference_amount(frm);
frm.events.set_unallocated_amount(frm);
}
// Make read only if Accounts Settings doesn't allow stale rates
@@ -425,7 +438,7 @@ frappe.ui.form.on('Payment Entry', {
frm.set_value("base_paid_amount", frm.doc.base_received_amount);
}
frm.events.set_difference_amount(frm);
frm.events.set_unallocated_amount(frm);
}
frm.set_paid_amount_based_on_received_amount = false;
@@ -456,7 +469,7 @@ frappe.ui.form.on('Payment Entry', {
if(frm.doc.payment_type == "Pay")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount);
else
frm.events.set_difference_amount(frm);
frm.events.set_unallocated_amount(frm);
frm.set_paid_amount_based_on_received_amount = false;
},
@@ -476,7 +489,7 @@ frappe.ui.form.on('Payment Entry', {
if(frm.doc.payment_type == "Receive")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount);
else
frm.events.set_difference_amount(frm);
frm.events.set_unallocated_amount(frm);
},
get_outstanding_documents: function(frm) {
@@ -565,13 +578,20 @@ frappe.ui.form.on('Payment Entry', {
if(frm.doc.references.length == 0){
frm.events.get_outstanding_documents(frm);
}
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount);
if(frm.doc.payment_type == 'Internal Transfer') {
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount);
} else {
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount);
}
},
allocate_party_amount_against_ref_docs: function(frm, paid_amount) {
var total_positive_outstanding_including_order = 0;
var total_negative_outstanding = 0;
var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
function(d) { return flt(d.amount) }));
paid_amount -= total_deductions;
$.each(frm.doc.references || [], function(i, row) {
if(flt(row.outstanding_amount) > 0)
@@ -651,28 +671,32 @@ frappe.ui.form.on('Payment Entry', {
frm.set_value("total_allocated_amount", Math.abs(total_allocated_amount));
frm.set_value("base_total_allocated_amount", Math.abs(base_total_allocated_amount));
frm.events.set_difference_amount(frm);
frm.events.set_unallocated_amount(frm);
},
set_difference_amount: function(frm) {
set_unallocated_amount: function(frm) {
var unallocated_amount = 0;
var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
function(d) { return flt(d.amount) }));
if(frm.doc.party) {
var party_amount = frm.doc.payment_type=="Receive" ?
frm.doc.paid_amount : frm.doc.received_amount;
if(frm.doc.total_allocated_amount < party_amount) {
if(frm.doc.payment_type == "Receive") {
unallocated_amount = party_amount - (frm.doc.total_allocated_amount - total_deductions);
} else {
unallocated_amount = party_amount - (frm.doc.total_allocated_amount + total_deductions);
}
if(frm.doc.payment_type == "Receive"
&& frm.doc.base_total_allocated_amount < frm.doc.base_received_amount + total_deductions
&& frm.doc.total_allocated_amount < frm.doc.paid_amount + (total_deductions / frm.doc.source_exchange_rate)) {
unallocated_amount = (frm.doc.base_received_amount + total_deductions
- frm.doc.base_total_allocated_amount) / frm.doc.source_exchange_rate;
} else if (frm.doc.payment_type == "Pay"
&& frm.doc.base_total_allocated_amount < frm.doc.base_paid_amount - total_deductions
&& frm.doc.total_allocated_amount < frm.doc.received_amount + (total_deductions / frm.doc.target_exchange_rate)) {
unallocated_amount = (frm.doc.base_paid_amount - (total_deductions
+ frm.doc.base_total_allocated_amount)) / frm.doc.target_exchange_rate;
}
}
frm.set_value("unallocated_amount", unallocated_amount);
frm.trigger("set_difference_amount");
},
set_difference_amount: function(frm) {
var difference_amount = 0;
var base_unallocated_amount = flt(frm.doc.unallocated_amount) *
(frm.doc.payment_type=="Receive" ? frm.doc.source_exchange_rate : frm.doc.target_exchange_rate);
@@ -687,11 +711,18 @@ frappe.ui.form.on('Payment Entry', {
difference_amount = flt(frm.doc.base_paid_amount) - flt(frm.doc.base_received_amount);
}
var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
function(d) { return flt(d.amount) }));
frm.set_value("difference_amount", difference_amount - total_deductions);
frm.events.hide_unhide_fields(frm);
},
unallocated_amount: function(frm) {
frm.trigger("set_difference_amount");
},
check_mandatory_to_fetch: function(frm) {
$.each(["Company", "Party Type", "Party", "payment_type"], function(i, field) {
if(!frm.doc[frappe.model.scrub(field)]) {
@@ -771,7 +802,7 @@ frappe.ui.form.on('Payment Entry', {
row.amount = flt(row.amount) + flt(frm.doc.difference_amount);
refresh_field("deductions");
frm.events.set_difference_amount(frm);
frm.events.set_unallocated_amount(frm);
}
}
})
@@ -788,23 +819,30 @@ frappe.ui.form.on('Payment Entry Reference', {
reference_name: function(frm, cdt, cdn) {
var row = locals[cdt][cdn];
return frappe.call({
method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_reference_details",
args: {
reference_doctype: row.reference_doctype,
reference_name: row.reference_name,
party_account_currency: frm.doc.payment_type=="Receive" ?
frm.doc.paid_from_account_currency : frm.doc.paid_to_account_currency
},
callback: function(r, rt) {
if(r.message) {
$.each(r.message, function(field, value) {
frappe.model.set_value(cdt, cdn, field, value);
})
frm.refresh_fields();
if (row.reference_name && row.reference_doctype) {
return frappe.call({
method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_reference_details",
args: {
reference_doctype: row.reference_doctype,
reference_name: row.reference_name,
party_account_currency: frm.doc.payment_type=="Receive" ?
frm.doc.paid_from_account_currency : frm.doc.paid_to_account_currency
},
callback: function(r, rt) {
if(r.message) {
$.each(r.message, function(field, value) {
frappe.model.set_value(cdt, cdn, field, value);
})
let allocated_amount = frm.doc.unallocated_amount > row.outstanding_amount ?
row.outstanding_amount : frm.doc.unallocated_amount;
frappe.model.set_value(cdt, cdn, 'allocated_amount', allocated_amount);
frm.refresh_fields();
}
}
}
})
})
}
},
allocated_amount: function(frm) {
@@ -818,10 +856,10 @@ frappe.ui.form.on('Payment Entry Reference', {
frappe.ui.form.on('Payment Entry Deduction', {
amount: function(frm) {
frm.events.set_difference_amount(frm);
frm.events.set_unallocated_amount(frm);
},
deductions_remove: function(frm) {
frm.events.set_difference_amount(frm);
frm.events.set_unallocated_amount(frm);
}
})

View File

@@ -286,7 +286,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -1188,7 +1188,7 @@
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
@@ -1439,7 +1439,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -1555,7 +1555,7 @@
"in_standard_filter": 0,
"label": "Remarks",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -1791,7 +1791,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-08-31 11:20:37.578469",
"modified": "2018-08-10 16:34:46.771275",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",

View File

@@ -20,6 +20,11 @@ class InvalidPaymentEntry(ValidationError):
class PaymentEntry(AccountsController):
def __init__(self, *args, **kwargs):
super(PaymentEntry, self).__init__(*args, **kwargs)
if not self.is_new():
self.setup_party_account_field()
def setup_party_account_field(self):
self.party_account_field = None
self.party_account = None
@@ -58,16 +63,21 @@ class PaymentEntry(AccountsController):
if self.difference_amount:
frappe.throw(_("Difference Amount must be zero"))
self.make_gl_entries()
self.update_outstanding_amounts()
self.update_advance_paid()
self.update_expense_claim()
def on_cancel(self):
self.setup_party_account_field()
self.make_gl_entries(cancel=1)
self.update_outstanding_amounts()
self.update_advance_paid()
self.update_expense_claim()
self.delink_advance_entry_references()
def update_outstanding_amounts(self):
self.set_missing_ref_details(force=True)
def validate_duplicate_entry(self):
reference_names = []
for d in self.get("references"):
@@ -129,14 +139,14 @@ class PaymentEntry(AccountsController):
self.set_missing_ref_details()
def set_missing_ref_details(self):
def set_missing_ref_details(self, force=False):
for d in self.get("references"):
if d.allocated_amount:
ref_details = get_reference_details(d.reference_doctype,
d.reference_name, self.party_account_currency)
for field, value in ref_details.items():
if not d.get(field):
if not d.get(field) or force:
d.set(field, value)
def validate_payment_type(self):
@@ -281,17 +291,19 @@ class PaymentEntry(AccountsController):
self.base_total_allocated_amount = abs(base_total_allocated_amount)
def set_unallocated_amount(self):
self.unallocated_amount = 0;
self.unallocated_amount = 0
if self.party:
party_amount = self.paid_amount if self.payment_type=="Receive" else self.received_amount
total_deductions = sum([flt(d.amount) for d in self.get("deductions")])
if self.total_allocated_amount < party_amount:
if self.payment_type == "Receive":
self.unallocated_amount = party_amount - (self.total_allocated_amount - total_deductions)
else:
self.unallocated_amount = party_amount - (self.total_allocated_amount + total_deductions)
if self.payment_type == "Receive" \
and self.base_total_allocated_amount < self.base_received_amount + total_deductions \
and self.total_allocated_amount < self.paid_amount + (total_deductions / self.source_exchange_rate):
self.unallocated_amount = (self.base_received_amount + total_deductions -
self.base_total_allocated_amount) / self.source_exchange_rate
elif self.payment_type == "Pay" \
and self.base_total_allocated_amount < (self.base_paid_amount - total_deductions) \
and self.total_allocated_amount < self.received_amount + (total_deductions / self.target_exchange_rate):
self.unallocated_amount = (self.base_paid_amount - (total_deductions +
self.base_total_allocated_amount)) / self.target_exchange_rate
def set_difference_amount(self):
base_unallocated_amount = flt(self.unallocated_amount) * (flt(self.source_exchange_rate)
@@ -325,14 +337,15 @@ class PaymentEntry(AccountsController):
total_negative_outstanding = sum([abs(flt(d.outstanding_amount))
for d in self.get("references") if flt(d.outstanding_amount) < 0])
party_amount = self.paid_amount if self.payment_type=="Receive" else self.received_amount
paid_amount = self.paid_amount if self.payment_type=="Receive" else self.received_amount
additional_charges = sum([flt(d.amount) for d in self.deductions])
if not total_negative_outstanding:
frappe.throw(_("Cannot {0} {1} {2} without any negative outstanding invoice")
.format(self.payment_type, ("to" if self.party_type=="Customer" else "from"),
self.party_type), InvalidPaymentEntry)
elif party_amount > total_negative_outstanding:
elif paid_amount - additional_charges > total_negative_outstanding:
frappe.throw(_("Paid Amount cannot be greater than total negative outstanding amount {0}")
.format(total_negative_outstanding), InvalidPaymentEntry)
@@ -660,6 +673,24 @@ def get_company_defaults(company):
return ret
def get_outstanding_on_journal_entry(name):
res = frappe.db.sql(
'SELECT '
'CASE WHEN party_type IN ("Customer", "Student") '
'THEN ifnull(sum(debit_in_account_currency - credit_in_account_currency), 0) '
'ELSE ifnull(sum(credit_in_account_currency - debit_in_account_currency), 0) '
'END as outstanding_amount '
'FROM `tabGL Entry` WHERE (voucher_no=%s OR against_voucher=%s) '
'AND party_type IS NOT NULL '
'AND party_type != ""',
(name, name), as_dict=1
)
outstanding_amount = res[0].get('outstanding_amount', 0) if res else 0
return outstanding_amount
@frappe.whitelist()
def get_reference_details(reference_doctype, reference_name, party_account_currency):
total_amount = outstanding_amount = exchange_rate = None
@@ -670,6 +701,13 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
total_amount = ref_doc.get("grand_total")
exchange_rate = 1
outstanding_amount = ref_doc.get("outstanding_amount")
elif reference_doctype == "Journal Entry" and ref_doc.docstatus == 1:
total_amount = ref_doc.get("total_amount")
if ref_doc.multi_currency:
exchange_rate = get_exchange_rate(party_account_currency, company_currency, ref_doc.posting_date)
else:
exchange_rate = 1
outstanding_amount = get_outstanding_on_journal_entry(reference_name)
elif reference_doctype != "Journal Entry":
if party_account_currency == company_currency:
if ref_doc.doctype == "Expense Claim":
@@ -687,8 +725,11 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
exchange_rate = ref_doc.get("conversion_rate") or \
get_exchange_rate(party_account_currency, company_currency, ref_doc.posting_date)
if reference_doctype in ("Sales Invoice", "Purchase Invoice", "Expense Claim"):
if reference_doctype in ("Sales Invoice", "Purchase Invoice"):
outstanding_amount = ref_doc.get("outstanding_amount")
elif reference_doctype == "Expense Claim":
outstanding_amount = flt(ref_doc.get("total_sanctioned_amount")) \
- flt(ref_doc.get("total_amount+reimbursed")) - flt(ref_doc.get("total_advance_amount"))
elif reference_doctype == "Employee Advance":
outstanding_amount = ref_doc.advance_amount - flt(ref_doc.paid_amount)
else:
@@ -731,6 +772,8 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
party_account = doc.receivable_account
elif dt == "Employee Advance":
party_account = doc.advance_account
elif dt == "Expense Claim":
party_account = doc.payable_account
else:
party_account = get_party_account(party_type, doc.get(party_type.lower()), doc.company)

View File

@@ -141,7 +141,6 @@ class TestPaymentEntry(unittest.TestCase):
def test_payment_entry_retrieves_last_exchange_rate(self):
from erpnext.setup.doctype.currency_exchange.test_currency_exchange import test_records, save_new_records
test_records = test_records
save_new_records(test_records)
pe = frappe.new_doc("Payment Entry")
@@ -151,6 +150,7 @@ class TestPaymentEntry(unittest.TestCase):
pe.paid_from = "_Test Bank USD - _TC"
pe.paid_to = "_Test Bank - _TC"
pe.paid_amount = 100
pe.received_amount = 100
pe.reference_no = "3"
pe.reference_date = "2016-01-10"
pe.party_type = "Supplier"

View File

@@ -98,7 +98,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:28:03.420683",
"modified": "2018-02-21 03:28:03.420683",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Deduction",

View File

@@ -3,9 +3,26 @@
frappe.provide("erpnext.accounts");
frappe.ui.form.on("Payment Reconciliation Payment", {
invoice_number: function(frm, cdt, cdn) {
var row = locals[cdt][cdn];
if(row.invoice_number) {
var parts = row.invoice_number.split(' | ');
var invoice_type = parts[0];
var invoice_number = parts[1];
var invoice_amount = frm.doc.invoices.filter(function(d) {
return d.invoice_type === invoice_type && d.invoice_number === invoice_number;
})[0].outstanding_amount;
frappe.model.set_value(cdt, cdn, "allocated_amount", Math.min(invoice_amount, row.amount));
}
}
});
erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.extend({
onload: function() {
var me = this
var me = this;
this.frm.set_query("party_type", function() {
return{
query: "erpnext.setup.doctype.party_type.party_type.get_party_type"

View File

@@ -55,6 +55,7 @@ class PaymentReconciliation(Document):
THEN 1=1
ELSE {bank_account_condition}
END)
order by t1.posting_date
""".format(**{
"dr_or_cr": dr_or_cr,
"bank_account_condition": bank_account_condition,

View File

@@ -78,6 +78,9 @@ class PaymentRequest(Document):
controller = get_payment_gateway_controller(self.payment_gateway)
controller.validate_transaction_currency(self.currency)
if hasattr(controller, 'validate_minimum_transaction_amount'):
controller.validate_minimum_transaction_amount(self.currency, self.grand_total)
return controller.get_payment_url(**{
"amount": flt(self.grand_total, self.precision("grand_total")),
"title": data.company.encode("utf-8"),

View File

@@ -61,13 +61,11 @@ class TestPaymentRequest(unittest.TestCase):
self.assertEquals(pr.currency, "USD")
def test_payment_entry(self):
frappe.db.set_value("Company", "_Test Company",
frappe.db.set_value("Company", "_Test Company",
"exchange_gain_loss_account", "_Test Exchange Gain/Loss - _TC")
frappe.db.set_value("Company", "_Test Company",
"write_off_account", "_Test Write Off - _TC")
frappe.db.set_value("Company", "_Test Company",
"cost_center", "_Test Cost Center - _TC")
frappe.db.set_value("Company", "_Test Company", "write_off_account", "_Test Write Off - _TC")
frappe.db.set_value("Company", "_Test Company", "cost_center", "_Test Cost Center - _TC")
so_inr = make_sales_order(currency="INR")
pr = make_payment_request(dt="Sales Order", dn=so_inr.name, recipient_id="saurabh@erpnext.com",
mute_email=1, submit_doc=1, return_doc=1)
@@ -82,15 +80,15 @@ class TestPaymentRequest(unittest.TestCase):
pr = make_payment_request(dt="Sales Invoice", dn=si_usd.name, recipient_id="saurabh@erpnext.com",
mute_email=1, payment_gateway="_Test Gateway - USD", submit_doc=1, return_doc=1)
pe = pr.set_as_paid()
expected_gle = dict((d[0], d) for d in [
["_Test Receivable USD - _TC", 0, 5000, si_usd.name],
[pr.payment_account, 6290.0, 0, None],
["_Test Exchange Gain/Loss - _TC", 0, 1290, None]
])
gl_entries = frappe.db.sql("""select account, debit, credit, against_voucher
from `tabGL Entry` where voucher_type='Payment Entry' and voucher_no=%s
order by account asc""", pe.name, as_dict=1)

View File

@@ -1,8 +1,8 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:payment_term_name",
"beta": 0,
"creation": "2017-08-10 15:24:54.876365",
@@ -265,7 +265,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-08-10 16:26:03.581501",
"modified": "2018-01-24 11:13:42.800048",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Term",

View File

@@ -1,8 +1,8 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:template_name",
"beta": 0,
"creation": "2017-08-10 15:34:28.058054",
@@ -85,7 +85,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-08-10 15:46:33.877884",
"modified": "2018-01-24 11:13:31.158613",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Terms Template",

View File

@@ -254,6 +254,36 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "allow_user_to_edit_discount",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allow user to edit Discount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -1476,7 +1506,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-01-03 17:30:45.198147",
"modified": "2018-01-31 19:33:11.765731",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",

View File

@@ -32,7 +32,7 @@ class POSProfile(Document):
.format(res[0][0], row.user), raise_exception=1)
elif not row.default and not res:
msgprint(_("User {0} doesn't have any default POS Profile. Check Default at Row {1} for this User.")
.format(row.user, row.idx), raise_exception=1)
.format(row.user, row.idx))
def validate_all_link_fields(self):
accounts = {"Account": [self.income_account,

View File

@@ -111,8 +111,8 @@ def apply_pricing_rule(args):
item_list = args.get("items")
args.pop("items")
set_serial_nos_based_on_fifo = frappe.db.get_single_value("Stock Settings",
set_serial_nos_based_on_fifo = frappe.db.get_single_value("Stock Settings",
"automatically_set_serial_nos_based_on_fifo")
for item in item_list:
@@ -122,7 +122,7 @@ def apply_pricing_rule(args):
if set_serial_nos_based_on_fifo and not args.get('is_return'):
out.append(get_serial_no_for_item(args_copy))
return out
def get_serial_no_for_item(args):
from erpnext.stock.get_item_details import get_serial_no
@@ -131,7 +131,7 @@ def get_serial_no_for_item(args):
"name": args.name,
"serial_no": args.serial_no
})
if args.get("parenttype") in ("Sales Invoice", "Delivery Note") and args.stock_qty > 0:
if args.get("parenttype") in ("Sales Invoice", "Delivery Note") and flt(args.stock_qty) > 0:
item_details.serial_no = get_serial_no(args)
return item_details
@@ -143,7 +143,7 @@ def get_pricing_rule_for_item(args):
"name": args.name,
"pricing_rule": None
})
if args.ignore_pricing_rule or not args.item_code:
if frappe.db.exists(args.doctype, args.name) and args.get("pricing_rule"):
item_details = remove_pricing_rule_for_item(args.get("pricing_rule"), item_details)
@@ -180,7 +180,7 @@ def get_pricing_rule_for_item(args):
item_details.margin_rate_or_amount = pricing_rule.margin_rate_or_amount
if pricing_rule.price_or_discount == "Price":
item_details.update({
"price_list_rate": (pricing_rule.price/flt(args.conversion_rate)) * args.conversion_factor or 1.0 \
"price_list_rate": (pricing_rule.price/flt(args.conversion_rate)) * (args.conversion_factor or 1.0) \
if args.conversion_rate else 0.0,
"discount_percentage": 0.0
})
@@ -192,7 +192,7 @@ def get_pricing_rule_for_item(args):
return item_details
def remove_pricing_rule_for_item(pricing_rule, item_details):
pricing_rule = frappe.db.get_value('Pricing Rule', pricing_rule,
pricing_rule = frappe.db.get_value('Pricing Rule', pricing_rule,
['price_or_discount', 'margin_type'], as_dict=1)
if pricing_rule and pricing_rule.price_or_discount == 'Discount Percentage':
item_details.discount_percentage = 0.0
@@ -209,14 +209,14 @@ def remove_pricing_rule_for_item(pricing_rule, item_details):
def remove_pricing_rules(item_list):
if isinstance(item_list, basestring):
item_list = json.loads(item_list)
out = []
out = []
for item in item_list:
item = frappe._dict(item)
out.append(remove_pricing_rule_for_item(item.get("pricing_rule"), item))
return out
def get_pricing_rules(args):
def _get_tree_conditions(parenttype, allow_blank=True):
field = frappe.scrub(parenttype)

View File

@@ -8,6 +8,10 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
setup: function(doc) {
this.setup_posting_date_time_check();
this._super(doc);
// formatter for material request item
this.frm.set_indicator_formatter('item_code',
function(doc) { return (doc.qty<=doc.received_qty) ? "green" : "orange" })
},
onload: function() {
this._super();
@@ -17,13 +21,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
if(!this.frm.doc.supplier && this.frm.doc.credit_to) {
this.frm.set_df_property("credit_to", "print_hide", 0);
}
} else {
this.frm.set_value("disable_rounded_total", frappe.sys_defaults.disable_rounded_total);
}
// formatter for material request item
this.frm.set_indicator_formatter('item_code',
function(doc) { return (doc.qty<=doc.received_qty) ? "green" : "orange" })
},
refresh: function(doc) {

View File

@@ -1239,7 +1239,7 @@
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_bulk_edit": 1,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -3410,6 +3410,65 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "group_same_items",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Group same items",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_112",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "select_print_heading",
"fieldtype": "Link",
"hidden": 0,
@@ -3914,7 +3973,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2017-12-20 17:49:51.230092",
"modified": "2018-07-06 02:38:40.310899",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -96,7 +96,7 @@ class PurchaseInvoice(BuyingController):
if not self.credit_to:
self.credit_to = get_party_account("Supplier", self.supplier, self.company)
if not self.due_date:
self.due_date = get_due_date(self.posting_date, "Supplier", self.supplier)
self.due_date = get_due_date(self.posting_date, "Supplier", self.supplier, self.company)
super(PurchaseInvoice, self).set_missing_values(for_validate)
@@ -350,7 +350,6 @@ class PurchaseInvoice(BuyingController):
self.negative_expense_to_be_booked = 0.0
gl_entries = []
self.make_supplier_gl_entry(gl_entries)
self.make_item_gl_entries(gl_entries)
self.make_tax_gl_entries(gl_entries)
@@ -389,16 +388,20 @@ class PurchaseInvoice(BuyingController):
expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
warehouse_account = get_warehouse_account_map()
voucher_wise_stock_value = {}
if self.update_stock:
for d in frappe.get_all('Stock Ledger Entry',
fields = ["voucher_detail_no", "stock_value_difference"], filters={'voucher_no': self.name}):
voucher_wise_stock_value.setdefault(d.voucher_detail_no, d.stock_value_difference)
for item in self.get("items"):
if flt(item.base_net_amount):
account_currency = get_account_currency(item.expense_account)
if self.update_stock and self.auto_accounting_for_stock and item.item_code in stock_items:
val_rate_db_precision = 6 if cint(item.precision("valuation_rate")) <= 6 else 9
# warehouse account
warehouse_debit_amount = flt(flt(item.valuation_rate, val_rate_db_precision)
* flt(item.qty) * flt(item.conversion_factor), item.precision("base_net_amount"))
warehouse_debit_amount = self.make_stock_adjustment_entry(gl_entries,
item, voucher_wise_stock_value, account_currency)
gl_entries.append(
self.get_gl_dict({
@@ -424,7 +427,10 @@ class PurchaseInvoice(BuyingController):
# sub-contracting warehouse
if flt(item.rm_supp_cost):
supplier_warehouse_account = warehouse_account[self.supplier_warehouse]["name"]
supplier_warehouse_account = warehouse_account[self.supplier_warehouse]["account"]
if not supplier_warehouse_account:
frappe.throw(_("Please set account in Warehouse {0}")
.format(self.supplier_warehouse))
gl_entries.append(self.get_gl_dict({
"account": supplier_warehouse_account,
"against": item.expense_account,
@@ -467,6 +473,36 @@ class PurchaseInvoice(BuyingController):
self.negative_expense_to_be_booked += flt(item.item_tax_amount, \
item.precision("item_tax_amount"))
def make_stock_adjustment_entry(self, gl_entries, item, voucher_wise_stock_value, account_currency):
net_amt_precision = item.precision("base_net_amount")
val_rate_db_precision = 6 if cint(item.precision("valuation_rate")) <= 6 else 9
warehouse_debit_amount = flt(flt(item.valuation_rate, val_rate_db_precision)
* flt(item.qty) * flt(item.conversion_factor), net_amt_precision)
# Stock ledger value is not matching with the warehouse amount
if (self.update_stock and voucher_wise_stock_value.get(item.name) and
warehouse_debit_amount != flt(voucher_wise_stock_value.get(item.name), net_amt_precision)):
cost_of_goods_sold_account = self.get_company_default("default_expense_account")
stock_amount = flt(voucher_wise_stock_value.get(item.name), net_amt_precision)
stock_adjustment_amt = warehouse_debit_amount - stock_amount
gl_entries.append(
self.get_gl_dict({
"account": cost_of_goods_sold_account,
"against": item.expense_account,
"debit": stock_adjustment_amt,
"remarks": self.get("remarks") or _("Stock Adjustment"),
"cost_center": item.cost_center,
"project": item.project
}, account_currency)
)
warehouse_debit_amount = stock_amount
return warehouse_debit_amount
def make_tax_gl_entries(self, gl_entries):
# tax table gl entries
valuation_tax = {}

View File

@@ -585,6 +585,38 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "discount_percentage",
"fieldname": "discount_amount",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Discount Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -2156,7 +2188,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-11-30 14:21:00.962126",
"modified": "2018-08-06 05:17:38.205356",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -506,6 +506,7 @@ def save_invoice(doc, name, name_list):
frappe.db.commit()
name_list.append(name)
except Exception:
frappe.db.rollback()
frappe.log_error(frappe.get_traceback())
return name_list

View File

@@ -106,6 +106,10 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
on_submit: function(doc, dt, dn) {
var me = this;
if (frappe.get_route()[0] != 'Form') {
return
}
$.each(doc["items"], function(i, row) {
if(row.delivery_note) frappe.model.clear_doc("Delivery Note", row.delivery_note)
})
@@ -315,6 +319,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
},
pos_profile: function() {
this.frm.doc.taxes = []
this.set_pos_data();
},

View File

@@ -639,6 +639,186 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_21",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval: doc.is_return && doc.return_against",
"fieldname": "update_billed_amount_in_sales_order",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Update Billed Amount in Sales Order",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "po_no",
"columns": 0,
"fieldname": "customer_po_details",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer PO Details",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "po_no",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Customer's Purchase Order",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_23",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "po_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": "Customer's Purchase Order Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -1339,7 +1519,7 @@
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_bulk_edit": 1,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -3622,12 +3802,12 @@
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "language",
"fieldtype": "Data",
"fieldname": "group_same_items",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -3635,14 +3815,14 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Language",
"label": "Group same items",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
@@ -3711,6 +3891,36 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "language",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Print Language",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -4563,7 +4773,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2017-12-20 17:36:05.216046",
"modified": "2018-07-17 13:46:52.449142",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
@@ -4654,7 +4864,7 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 1,
"search_fields": "posting_date, due_date, customer, base_grand_total, outstanding_amount",
"search_fields": "posting_date,due_date,customer,base_grand_total,outstanding_amount",
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",

View File

@@ -101,6 +101,8 @@ class SalesInvoice(SellingController):
self.set_billing_hours_and_amount()
self.update_timesheet_billing_for_project()
self.set_status()
if self.is_pos and not self.is_return:
self.verify_payment_amount_is_positive()
def before_save(self):
set_account_for_mode_of_payment(self)
@@ -114,7 +116,7 @@ class SalesInvoice(SellingController):
self.check_prev_docstatus()
if self.is_return:
if self.is_return and not self.update_billed_amount_in_sales_order:
# NOTE status updating bypassed for is_return
self.status_updater = []
@@ -142,7 +144,7 @@ class SalesInvoice(SellingController):
self.update_time_sheet(self.name)
self.update_current_month_sales()
update_company_current_month_sales(self.company)
self.update_project()
def validate_pos_paid_amount(self):
@@ -159,7 +161,7 @@ class SalesInvoice(SellingController):
if frappe.db.get_single_value('Accounts Settings', 'unlink_payment_on_cancellation_of_invoice'):
unlink_ref_doc_from_payment_entries(self)
if self.is_return:
if self.is_return and not self.update_billed_amount_in_sales_order:
# NOTE status updating bypassed for is_return
self.status_updater = []
@@ -181,16 +183,9 @@ class SalesInvoice(SellingController):
self.make_gl_entries_on_cancel()
frappe.db.set(self, 'status', 'Cancelled')
self.update_current_month_sales()
update_company_current_month_sales(self.company)
self.update_project()
def update_current_month_sales(self):
if frappe.flags.in_test:
update_company_current_month_sales(self.company)
else:
frappe.enqueue('erpnext.setup.doctype.company.company.update_company_current_month_sales',
company=self.company)
def update_status_updater_args(self):
if cint(self.update_stock):
self.status_updater.extend([{
@@ -231,12 +226,17 @@ class SalesInvoice(SellingController):
from erpnext.selling.doctype.customer.customer import check_credit_limit
validate_against_credit_limit = False
bypass_credit_limit_check_at_sales_order = cint(frappe.db.get_value("Customer", self.customer,
"bypass_credit_limit_check_at_sales_order"))
if bypass_credit_limit_check_at_sales_order:
validate_against_credit_limit = True
for d in self.get("items"):
if not (d.sales_order or d.delivery_note):
validate_against_credit_limit = True
break
if validate_against_credit_limit:
check_credit_limit(self.customer, self.company)
check_credit_limit(self.customer, self.company, bypass_credit_limit_check_at_sales_order)
def set_missing_values(self, for_validate=False):
pos = self.set_pos_fields(for_validate)
@@ -244,12 +244,16 @@ class SalesInvoice(SellingController):
if not self.debit_to:
self.debit_to = get_party_account("Customer", self.customer, self.company)
if not self.due_date and self.customer:
self.due_date = get_due_date(self.posting_date, "Customer", self.customer)
self.due_date = get_due_date(self.posting_date, "Customer", self.customer, self.company)
super(SalesInvoice, self).set_missing_values(for_validate)
if pos:
return {"print_format": pos.get("print_format_for_online") }
return {
"print_format": pos.get("print_format_for_online"),
"allow_edit_rate": pos.get("allow_user_to_edit_rate"),
"allow_edit_discount": pos.get("allow_user_to_edit_discount")
}
def update_time_sheet(self, sales_invoice):
for d in self.timesheets:
@@ -314,6 +318,7 @@ class SalesInvoice(SellingController):
if not for_validate and not self.customer:
self.customer = pos.customer
self.ignore_pricing_rule = pos.ignore_pricing_rule
if pos.get('account_for_change_amount'):
self.account_for_change_amount = pos.get('account_for_change_amount')
@@ -330,7 +335,7 @@ class SalesInvoice(SellingController):
for item in self.get("items"):
if item.get('item_code'):
for fname, val in get_pos_profile_item_details(pos,
frappe._dict(item.as_dict()), pos).items():
frappe._dict(item.as_dict()), pos, True).items():
if (not for_validate) or (for_validate and not item.get(fname)):
item.set(fname, val)
@@ -675,28 +680,28 @@ class SalesInvoice(SellingController):
# income account gl entries
for item in self.get("items"):
if flt(item.base_net_amount):
account_currency = get_account_currency(item.income_account)
gl_entries.append(
self.get_gl_dict({
"account": item.income_account,
"against": self.customer,
"credit": item.base_net_amount,
"credit_in_account_currency": item.base_net_amount \
if account_currency==self.company_currency else item.net_amount,
"cost_center": item.cost_center
}, account_currency)
)
if item.is_fixed_asset:
asset = frappe.get_doc("Asset", item.asset)
fixed_asset_gl_entries = get_gl_entries_on_asset_disposal(asset, is_sale=True)
fixed_asset_gl_entries = get_gl_entries_on_asset_disposal(asset, item.base_net_amount)
for gle in fixed_asset_gl_entries:
gle["against"] = self.customer
gl_entries.append(self.get_gl_dict(gle))
asset.db_set("disposal_date", self.posting_date)
asset.set_status("Sold" if self.docstatus==1 else None)
else:
account_currency = get_account_currency(item.income_account)
gl_entries.append(
self.get_gl_dict({
"account": item.income_account,
"against": self.customer,
"credit": item.base_net_amount,
"credit_in_account_currency": item.base_net_amount \
if account_currency==self.company_currency else item.net_amount,
"cost_center": item.cost_center
}, account_currency)
)
# expense account gl entries
if cint(self.update_stock) and \
@@ -901,6 +906,11 @@ class SalesInvoice(SellingController):
project.update_billed_amount()
project.save()
def verify_payment_amount_is_positive(self):
for entry in self.payments:
if entry.amount < 0:
frappe.throw(_("Row #{0} (Payment Table): Amount must be positive").format(entry.idx))
def get_list_context(context=None):
from erpnext.controllers.website_list_for_contact import get_list_context
list_context = get_list_context(context)

View File

@@ -227,6 +227,36 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "clearance_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": "Clearance Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"has_web_view": 0,
@@ -239,7 +269,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-07-24 17:25:03.765856",
"modified": "2018-03-07 18:34:39.552769",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Payment",

View File

@@ -232,6 +232,8 @@ def get_next_date(dt, mcount, day=None):
def send_notification(new_rv, subscription_doc, print_format='Standard'):
"""Notify concerned persons about recurring document generation"""
print_format = print_format
subject = subscription_doc.subject or ''
message = subscription_doc.message or ''
if not subscription_doc.subject:
subject = _("New {0}: #{1}").format(new_rv.doctype, new_rv.name)

View File

@@ -39,18 +39,20 @@ frappe.ui.form.on("Tax Rule", "customer", function(frm) {
});
frappe.ui.form.on("Tax Rule", "supplier", function(frm) {
frappe.call({
method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
args: {
"party": frm.doc.supplier,
"party_type": "supplier"
},
callback: function(r) {
if(!r.exc) {
$.each(r.message, function(k, v) {
frm.set_value(k, v);
});
if(frm.doc.supplier) {
frappe.call({
method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
args: {
"party": frm.doc.supplier,
"party_type": "supplier"
},
callback: function(r) {
if(!r.exc) {
$.each(r.message, function(k, v) {
frm.set_value(k, v);
});
}
}
}
});
});
}
});

View File

@@ -130,8 +130,8 @@ def get_party_details(party, party_type, args=None):
def get_tax_template(posting_date, args):
"""Get matching tax rule"""
args = frappe._dict(args)
conditions = ["""(from_date is null or from_date = '' or from_date <= '{0}')
and (to_date is null or to_date = '' or to_date >= '{0}')""".format(posting_date)]
conditions = ["""(from_date is null or from_date <= '{0}')
and (to_date is null or to_date >= '{0}')""".format(posting_date)]
for key, value in args.iteritems():
if key=="use_for_shopping_cart":

View File

@@ -191,8 +191,9 @@ def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None,
for entry in gl_entries:
validate_frozen_account(entry["account"], adv_adj)
validate_balance_type(entry["account"], adv_adj)
validate_expense_against_budget(entry)
if not adv_adj:
validate_expense_against_budget(entry)
if entry.get("against_voucher") and update_outstanding == 'Yes':
if entry.get("against_voucher") and update_outstanding == 'Yes' and not adv_adj:
update_outstanding_amt(entry["account"], entry.get("party_type"), entry.get("party"), entry.get("against_voucher_type"),
entry.get("against_voucher"), on_cancel=True)

View File

@@ -15,6 +15,7 @@ frappe.pages['pos'].on_page_load = function (wrapper) {
cur_pos = wrapper.pos;
} else {
// online
frappe.flags.is_online = true
frappe.set_route('point-of-sale');
}
});
@@ -24,6 +25,10 @@ frappe.pages['pos'].refresh = function (wrapper) {
window.onbeforeunload = function () {
return wrapper.pos.beforeunload()
}
if (frappe.flags.is_online) {
frappe.set_route('point-of-sale');
}
}
erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
@@ -388,7 +393,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.frm = {}
this.frm.doc = this.doc
this.set_transaction_defaults("Customer");
this.frm.doc["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false,
this.frm.doc["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false;
this.frm.doc["allow_user_to_edit_discount"] = this.pos_profile_data["allow_user_to_edit_discount"] ? true : false;
this.wrapper.html(frappe.render_template("pos", this.frm.doc));
this.make_search();
this.make_customer();
@@ -1172,8 +1178,17 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
$(this.wrapper).on("change", ".pos-item-disc", function () {
var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code");
var discount = $(this).val();
me.update_discount(item_code, discount)
me.update_value()
if(discount > 100){
discount = $(this).val('');
frappe.show_alert({
indicator: 'red',
message: __('Discount amount cannot be greater than 100%')
});
me.update_discount(item_code, discount);
}else{
me.update_discount(item_code, discount);
me.update_value();
}
})
},
@@ -1242,6 +1257,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
$(this.wrapper).find('.selected-item').empty();
if(this.child_doc.length) {
this.child_doc[0]["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false,
this.child_doc[0]["allow_user_to_edit_discount"] = this.pos_profile_data["allow_user_to_edit_discount"] ? true : false;
this.selected_row = $(frappe.render_template("pos_selected_item", this.child_doc[0]))
$(this.wrapper).find('.selected-item').html(this.selected_row)
}
@@ -1669,7 +1685,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
setInterval(function () {
me.freeze_screen = false;
me.sync_sales_invoice()
}, 60000)
}, 180000)
},
sync_sales_invoice: function () {
@@ -2001,4 +2017,4 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
frappe.throw(__("LocalStorage is full , did not save"))
}
}
})
})

View File

@@ -4,12 +4,11 @@
from __future__ import unicode_literals
import frappe
import datetime
from frappe import _, msgprint, scrub
from frappe.defaults import get_user_permissions
from frappe.model.utils import get_fetch_values
from frappe.utils import (add_days, getdate, formatdate, get_first_day, date_diff,
add_years, get_timestamp, nowdate, flt, add_months, get_last_day)
from frappe.utils import (add_days, getdate, formatdate, date_diff,
add_years, get_timestamp, nowdate, flt, add_months, get_last_day)
from frappe.contacts.doctype.address.address import (get_address_display,
get_default_address, get_company_address)
from frappe.contacts.doctype.contact.contact import get_contact_details, get_default_contact
@@ -21,8 +20,8 @@ from erpnext import get_default_currency, get_company_currency
class DuplicatePartyAccountError(frappe.ValidationError): pass
@frappe.whitelist()
def get_party_details(party=None, account=None, party_type="Customer", company=None,
posting_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False):
def get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True):
if not party:
return {}
@@ -31,10 +30,10 @@ def get_party_details(party=None, account=None, party_type="Customer", company=N
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
return _get_party_details(party, account, party_type,
company, posting_date, price_list, currency, doctype, ignore_permissions)
company, posting_date, price_list, currency, doctype, ignore_permissions, fetch_payment_terms_template)
def _get_party_details(party=None, account=None, party_type="Customer", company=None,
posting_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False):
def _get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True):
out = frappe._dict(set_account_and_due_date(party, account, party_type, company, posting_date, doctype))
@@ -51,7 +50,9 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
set_other_values(out, party, party_type)
set_price_list(out, party, party_type, price_list)
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group, out.supplier_type)
out["payment_terms_template"] = get_pyt_term_template(party.name, party_type)
if fetch_payment_terms_template:
out["payment_terms_template"] = get_pyt_term_template(party.name, party_type, company)
if not out.get("currency"):
out["currency"] = currency
@@ -164,7 +165,7 @@ def set_account_and_due_date(party, account, party_type, company, posting_date,
out = {
party_type.lower(): party,
account_fieldname : account,
"due_date": get_due_date(posting_date, party_type, party)
"due_date": get_due_date(posting_date, party_type, party, company)
}
return out
@@ -267,12 +268,13 @@ def validate_party_accounts(doc):
@frappe.whitelist()
def get_due_date(posting_date, party_type, party):
def get_due_date(posting_date, party_type, party, company=None):
"""Get due date from `Payment Terms Template`"""
due_date = None
if posting_date and party:
due_date = posting_date
template_name = get_pyt_term_template(party, party_type)
template_name = get_pyt_term_template(party, party_type, company)
if template_name:
due_date = get_due_date_from_template(template_name, posting_date).strftime("%Y-%m-%d")
else:
@@ -305,12 +307,13 @@ def get_due_date_from_template(template_name, posting_date):
return due_date
def validate_due_date(posting_date, due_date, party_type, party):
def validate_due_date(posting_date, due_date, party_type, party, company=None, template_name=None):
if getdate(due_date) < getdate(posting_date):
frappe.throw(_("Due Date cannot be before Posting Date"))
else:
default_due_date = get_due_date(posting_date, party_type, party)
if not template_name: return
default_due_date = get_due_date_from_template(template_name, posting_date).strftime("%Y-%m-%d")
if not default_due_date:
return
@@ -360,14 +363,32 @@ def set_taxes(party, party_type, posting_date, company, customer_group=None, sup
@frappe.whitelist()
def get_pyt_term_template(party_name, party_type):
def get_pyt_term_template(party_name, party_type, company=None):
if party_type not in ("Customer", "Supplier"):
return
template = None
if party_type in ('Customer', 'Supplier'):
template = frappe.db.get_value(party_type, party_name, fieldname='payment_terms')
if party_type == 'Customer':
customer = frappe.db.get_value("Customer", party_name,
fieldname=['payment_terms', "customer_group"], as_dict=1)
template = customer.payment_terms
if not template and customer.customer_group:
template = frappe.db.get_value("Customer Group",
customer.customer_group, fieldname='payment_terms')
else:
supplier = frappe.db.get_value("Supplier", party_name,
fieldname=['payment_terms', "supplier_type"], as_dict=1)
template = supplier.payment_terms
if not template and supplier.supplier_type:
template = frappe.db.get_value("Supplier Type", supplier.supplier_type, fieldname='payment_terms')
if not template and company:
template = frappe.db.get_value("Company", company, fieldname='payment_terms')
return template
def validate_party_frozen_disabled(party_type, party_name):
if party_type and party_name:
if party_type in ("Customer", "Supplier"):
@@ -388,10 +409,21 @@ def get_timeline_data(doctype, name):
from frappe.desk.form.load import get_communication_data
out = {}
fields = 'date(creation), count(name)'
after = add_years(None, -1).strftime('%Y-%m-%d')
group_by='group by date(creation)'
data = get_communication_data(doctype, name,
fields = 'date(creation), count(name)',
after = add_years(None, -1).strftime('%Y-%m-%d'),
group_by='group by date(creation)', as_dict=False)
fields=fields, after=after, group_by=group_by, as_dict=False)
# fetch and append data from Activity Log
data += frappe.db.sql("""select {fields}
from `tabActivity Log`
where reference_doctype="{doctype}" and reference_name="{name}"
and status!='Success' and creation > {after}
{group_by} order by creation desc
""".format(doctype=frappe.db.escape(doctype), name=frappe.db.escape(name), fields=fields,
group_by=group_by, after=after), as_dict=False)
timeline_items = dict(data)

View File

@@ -7,10 +7,10 @@
"docstatus": 0,
"doctype": "Print Format",
"font": "Default",
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ doc.company }}<br>\n\t{% if doc.company_address_display %}\n\t\t{% set company_address = doc.company_address_display.replace(\"\\n\", \" \").replace(\"<br>\", \" \") %}\n\t\t{% if \"GSTIN\" not in company_address %}\n\t\t\t{{ company_address }}\n\t\t\t<b>{{ _(\"GSTIN\") }}:</b>{{ doc.company_gstin }}\n\t\t{% else %}\n\t\t\t{{ company_address.replace(\"GSTIN\", \"<br>GSTIN\") }}\n\t\t{% endif %}\n\t{% endif %}\n\t<br>\n\t<b>{{ doc.select_print_heading or _(\"Invoice\") }}</b><br>\n</p>\n<p>\n\t<b>{{ _(\"Receipt No\") }}:</b> {{ doc.name }}<br>\n\t<b>{{ _(\"Date\") }}:</b> {{ doc.get_formatted(\"posting_date\") }}<br>\n\t{% if doc.grand_total > 50000 %}\n\t\t{% set customer_address = doc.address_display.replace(\"\\n\", \" \").replace(\"<br>\", \" \") %}\n\t\t<b>{{ _(\"Customer\") }}:</b><br>\n\t\t{{ doc.customer_name }}<br>\n\t\t{{ customer_address }}\n\t{% endif %}\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"40%\">{{ _(\"Item\") }}</b></th>\n\t\t\t<th width=\"30%\" class=\"text-right\">{{ _(\"Qty\") }}</th>\n\t\t\t<th width=\"30%\" class=\"text-right\">{{ _(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{%- for item in doc.items -%}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t<br>{{ item.item_name }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.gst_hsn_code -%}\n\t\t\t\t\t<br><b>{{ _(\"HSN/SAC\") }}:</b> {{ item.gst_hsn_code }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.serial_no -%}\n\t\t\t\t\t<br><b>{{ _(\"Serial No\") }}:</b> {{ item.serial_no }}\n\t\t\t\t{%- endif -%}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ item.qty }}<br>@ {{ item.rate }}</td>\n\t\t\t<td class=\"text-right\">{{ item.get_formatted(\"amount\") }}</td>\n\t\t</tr>\n\t\t{%- endfor -%}\n\t</tbody>\n</table>\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t{% if doc.flags.show_inclusive_tax_in_print %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total Excl. Tax\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"net_total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% else %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% endif %}\n\t\t</tr>\n\t\t{%- for row in doc.taxes -%}\n\t\t {%- if not row.included_in_print_rate or doc.flags.show_inclusive_tax_in_print -%}\n\t\t\t<tr>\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ row.description }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t\t</td>\n\t\t\t<tr>\n\t\t {%- endif -%}\n\t\t{%- endfor -%}\n\t\t{%- if doc.discount_amount -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"grand_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- if doc.rounded_total -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Rounded Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"rounded_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t</tbody>\n</table>\n<p><b>Tax Breakup:</b></p>\n<div style=\"font-size: 8px\">\n\t{{ doc.other_charges_calculation }}\n</div>\n<p>{{ doc.terms or \"\" }}</p>\n<p class=\"text-center\">{{ _(\"Thank you, please visit again.\") }}</p>",
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ doc.company }}<br>\n\t{% if doc.company_address_display %}\n\t\t{% set company_address = doc.company_address_display.replace(\"\\n\", \" \").replace(\"<br>\", \" \") %}\n\t\t{% if \"GSTIN\" not in company_address %}\n\t\t\t{{ company_address }}\n\t\t\t<b>{{ _(\"GSTIN\") }}:</b>{{ doc.company_gstin }}\n\t\t{% else %}\n\t\t\t{{ company_address.replace(\"GSTIN\", \"<br>GSTIN\") }}\n\t\t{% endif %}\n\t{% endif %}\n\t<br>\n\t<b>{{ doc.select_print_heading or _(\"Invoice\") }}</b><br>\n</p>\n<p>\n\t<b>{{ _(\"Receipt No\") }}:</b> {{ doc.name }}<br>\n\t<b>{{ _(\"Date\") }}:</b> {{ doc.get_formatted(\"posting_date\") }}<br>\n\t{% if doc.grand_total > 50000 %}\n\t\t{% set customer_address = doc.address_display.replace(\"\\n\", \" \").replace(\"<br>\", \" \") %}\n\t\t<b>{{ _(\"Customer\") }}:</b><br>\n\t\t{{ doc.customer_name }}<br>\n\t\t{{ customer_address }}\n\t{% endif %}\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"40%\">{{ _(\"Item\") }}</b></th>\n\t\t\t<th width=\"30%\" class=\"text-right\">{{ _(\"Qty\") }}</th>\n\t\t\t<th width=\"30%\" class=\"text-right\">{{ _(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{%- for item in doc.items -%}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t<br>{{ item.item_name }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.gst_hsn_code -%}\n\t\t\t\t\t<br><b>{{ _(\"HSN/SAC\") }}:</b> {{ item.gst_hsn_code }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.serial_no -%}\n\t\t\t\t\t<br><b>{{ _(\"Serial No\") }}:</b> {{ item.serial_no }}\n\t\t\t\t{%- endif -%}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ item.qty }}<br>@ {{ item.rate }}</td>\n\t\t\t<td class=\"text-right\">{{ item.get_formatted(\"amount\") }}</td>\n\t\t</tr>\n\t\t{%- endfor -%}\n\t</tbody>\n</table>\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t{% if doc.flags.show_inclusive_tax_in_print %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total Excl. Tax\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"net_total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% else %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% endif %}\n\t\t</tr>\n\t\t{%- for row in doc.taxes -%}\n\t\t {%- if not row.included_in_print_rate or doc.flags.show_inclusive_tax_in_print -%}\n\t\t\t<tr>\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ row.description }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t\t</td>\n\t\t\t<tr>\n\t\t {%- endif -%}\n\t\t{%- endfor -%}\n\t\t{%- if doc.discount_amount -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"grand_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- if doc.rounded_total -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Rounded Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"rounded_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"paid_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t{%- if doc.change_amount -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Change Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"change_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t{%- endif -%}\n\t</tbody>\n</table>\n<p><b>Tax Breakup:</b></p>\n<div style=\"font-size: 8px\">\n\t{{ doc.other_charges_calculation }}\n</div>\n<p>{{ doc.terms or \"\" }}</p>\n<p class=\"text-center\">{{ _(\"Thank you, please visit again.\") }}</p>",
"idx": 0,
"line_breaks": 0,
"modified": "2018-01-12 11:19:17.432600",
"modified": "2018-03-20 14:24:08.167930",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GST POS Invoice",

View File

@@ -6,10 +6,10 @@
"doc_type": "Sales Invoice",
"docstatus": 0,
"doctype": "Print Format",
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ doc.company }}<br>\n\t{{ doc.select_print_heading or _(\"Invoice\") }}<br>\n</p>\n<p>\n\t<b>{{ _(\"Receipt No\") }}:</b> {{ doc.name }}<br>\n\t<b>{{ _(\"Date\") }}:</b> {{ doc.get_formatted(\"posting_date\") }}<br>\n\t<b>{{ _(\"Customer\") }}:</b> {{ doc.customer_name }}\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ _(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ _(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ _(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{%- for item in doc.items -%}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t<br>{{ item.item_name }}{%- endif -%}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ item.qty }}<br>@ {{ item.get_formatted(\"rate\") }}</td>\n\t\t\t<td class=\"text-right\">{{ item.get_formatted(\"amount\") }}</td>\n\t\t</tr>\n\t\t{%- endfor -%}\n\t</tbody>\n</table>\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t{% if doc.flags.show_inclusive_tax_in_print %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total Excl. Tax\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"net_total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% else %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% endif %}\n\t\t</tr>\n\t\t{%- for row in doc.taxes -%}\n\t\t {%- if not row.included_in_print_rate or doc.flags.show_inclusive_tax_in_print -%}\n\t\t\t<tr>\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ row.description }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t\t</td>\n\t\t\t<tr>\n\t\t {%- endif -%}\n\t\t{%- endfor -%}\n\n\t\t{%- if doc.discount_amount -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"grand_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- if doc.rounded_total -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Rounded Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"rounded_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t</tbody>\n</table>\n<hr>\n<p>{{ doc.terms or \"\" }}</p>\n<p class=\"text-center\">{{ _(\"Thank you, please visit again.\") }}</p>",
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ doc.company }}<br>\n\t{{ doc.select_print_heading or _(\"Invoice\") }}<br>\n</p>\n<p>\n\t<b>{{ _(\"Receipt No\") }}:</b> {{ doc.name }}<br>\n\t<b>{{ _(\"Date\") }}:</b> {{ doc.get_formatted(\"posting_date\") }}<br>\n\t<b>{{ _(\"Customer\") }}:</b> {{ doc.customer_name }}\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ _(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ _(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ _(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{%- for item in doc.items -%}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t<br>{{ item.item_name }}{%- endif -%}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ item.qty }}<br>@ {{ item.get_formatted(\"rate\") }}</td>\n\t\t\t<td class=\"text-right\">{{ item.get_formatted(\"amount\") }}</td>\n\t\t</tr>\n\t\t{%- endfor -%}\n\t</tbody>\n</table>\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t{% if doc.flags.show_inclusive_tax_in_print %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total Excl. Tax\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"net_total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% else %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% endif %}\n\t\t</tr>\n\t\t{%- for row in doc.taxes -%}\n\t\t {%- if not row.included_in_print_rate or doc.flags.show_inclusive_tax_in_print -%}\n\t\t\t<tr>\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ row.description }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t\t</td>\n\t\t\t<tr>\n\t\t {%- endif -%}\n\t\t{%- endfor -%}\n\n\t\t{%- if doc.discount_amount -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"grand_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- if doc.rounded_total -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Rounded Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"rounded_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"paid_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- if doc.change_amount -%}\n\t\t\t<tr>\n\t\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t\t<b>{{ _(\"Change Amount\") }}</b>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"change_amount\") }}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t{%- endif -%}\n\t</tbody>\n</table>\n<hr>\n<p>{{ doc.terms or \"\" }}</p>\n<p class=\"text-center\">{{ _(\"Thank you, please visit again.\") }}</p>",
"idx": 1,
"line_breaks": 0,
"modified": "2018-01-12 11:18:54.229254",
"modified": "2018-03-20 14:24:12.394354",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@@ -14,7 +14,13 @@ frappe.query_reports["Accounts Payable"] = {
"fieldname":"supplier",
"label": __("Supplier"),
"fieldtype": "Link",
"options": "Supplier"
"options": "Supplier",
on_change: () => {
var supplier = frappe.query_report_filters_by_name.supplier.get_value();
frappe.db.get_value('Supplier', supplier, "tax_id", function(value) {
frappe.query_report_filters_by_name.tax_id.set_value(value["tax_id"]);
});
}
},
{
"fieldname":"report_date",
@@ -26,7 +32,7 @@ frappe.query_reports["Accounts Payable"] = {
"fieldname":"ageing_based_on",
"label": __("Ageing Based On"),
"fieldtype": "Select",
"options": 'Posting Date\nDue Date',
"options": 'Posting Date\nDue Date\nSupplier Invoice Date',
"default": "Posting Date"
},
{
@@ -52,6 +58,12 @@ frappe.query_reports["Accounts Payable"] = {
"fieldtype": "Int",
"default": "90",
"reqd": 1
},
{
"fieldname":"tax_id",
"label": __("Tax Id"),
"fieldtype": "Data",
"hidden": 1
}
],
onload: function(report) {

View File

@@ -1,22 +1,129 @@
{% if(filters.show_pdc_in_print) { %}
<style>
@media screen {
.print-format {
padding: 4mm;
font-size: 8.0pt !important;
font-family: Tahoma, sans-serif;
}
}
</style>
{% } %}
<style>
.print-format {
padding: 4mm;
font-size: 8.0pt !important;
font-family: Tahoma, sans-serif;
}
</style>
<h2 class="text-center">{%= __(report.report_name) %}</h2>
<h4 class="text-center">{%= filters.customer || filters.supplier %} </h4>
<h4 class="text-center">
{% if (filters.customer_name) { %}
{%= filters.customer_name %}
{% } else { %}
{%= filters.customer || filters.supplier %}
{% } %}
</h4>
<h6 class="text-center">
{% if (filters.tax_id) { %}
{%= __("Tax Id: ")%} {%= filters.tax_id %}
{% } %}
</h6>
<h5 class="text-center">
{%= __(filters.ageing_based_on) %}
{%= __("Until") %}
{%= dateutil.str_to_user(filters.report_date) %}
</h5>
<hr>
{% if(filters.show_pdc_in_print) { %}
{% var balance_row = data.slice(-1).pop();
var range1 = report.columns[11].label;
var range2 = report.columns[12].label;
var range3 = report.columns[13].label;
var range4 = report.columns[14].label;
%}
{% if(balance_row) { %}
<table class="table table-bordered table-condensed">
<caption class="text-right">(Amount in {%= data[0][__("currency")] || "" %})</caption>
<colgroup>
<col style="width: 30mm;">
<col style="width: 18mm;">
<col style="width: 18mm;">
<col style="width: 18mm;">
<col style="width: 18mm;">
<col style="width: 18mm;">
<col style="width: 18mm;">
</colgroup>
<thead>
<tr>
<th>{%= __(" ") %}</th>
<th>{%= __(range1) %}</th>
<th>{%= __(range2) %}</th>
<th>{%= __(range3) %}</th>
<th>{%= __(range4) %}</th>
<th>{%= __("Total") %}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{%= __("Total Outstanding") %}</td>
<td class="text-right">{%= format_currency(balance_row[range1]) %}</td>
<td class="text-right">{%= format_currency(balance_row[range2]) %}</td>
<td class="text-right">{%= format_currency(balance_row[range3]) %}</td>
<td class="text-right">{%= format_currency(balance_row[range4]) %}</td>
<td class="text-right">
{%= format_currency(flt(balance_row[__("Outstanding Amount")]), data[data.length-1]["currency"]) %}
</td>
</tr>
<td>{%= __("PDC/LC") %}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="text-right">
{%= format_currency(flt(balance_row[__("PDC/LC Amount")]), data[data.length-1]["currency"]) %}
</td>
<tr class="cvs-footer">
<th class="text-left">{%= __("Cheques Required") %}</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th class="text-right">
{%= format_currency(flt(balance_row[__("Outstanding Amount")]-balance_row[__("PDC/LC Amount")]), data[data.length-1]["currency"]) %}</th>
</tr>
</tbody>
</table>
{% } %}
{% } %}
<table class="table table-bordered">
<thead>
<tr>
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
<th style="width: 14%">{%= __("Date") %}</th>
<th style="width: 16%">{%= __("Ref") %}</th>
<th style="width: 30%">{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}</th>
<th style="width: 18%">{%= __("Date") %}</th>
<th style="width: 17%">{%= __("Reference") %}</th>
{% if(!filters.show_pdc_in_print) { %}
<th style="width: 20%">{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}</th>
{% } %}
<th style="width: 10%">{%= __("Invoiced Amount") %}</th>
<th style="width: 10%">{%= __("Paid Amount") %}</th>
<th style="width: 10%">{%= report.report_name === "Accounts Receivable" ? __('Credit Note') : __('Debit Note') %}</th>
<th style="width: 10%">{%= __("Outstanding Amount") %}</th>
{% if(!filters.show_pdc_in_print) { %}
<th style="width: 10%">{%= __("Paid Amount") %}</th>
<th style="width: 10%">{%= report.report_name === "Accounts Receivable" ? __('Credit Note') : __('Debit Note') %}</th>
{% } %}
<th style="width: 15%">{%= __("Outstanding Amount") %}</th>
{% if(filters.show_pdc_in_print) { %}
{% if(report.report_name === "Accounts Receivable") { %}
<th style="width: 10%">{%= __("Customer LPO No.") %}</th>
{% } %}
<th style="width: 10%">{%= __("PDC/LC Date") %}</th>
<th style="width: 10%">{%= __("PDC/LC Ref") %}</th>
<th style="width: 10%">{%= __("PDC/LC Amount") %}</th>
<th style="width: 10%">{%= __("Remaining Balance") %}</th>
{% } %}
{% } else { %}
<th style="width: 40%">{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}</th>
<th style="width: 15%">{%= __("Total Invoiced Amount") %}</th>
@@ -31,9 +138,15 @@
<tr>
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
{% if(data[i][__("Customer")] || data[i][__("Supplier")]) { %}
<td>{%= dateutil.str_to_user(data[i][__("Posting Date")]) %}</td>
<td>{%= data[i][__("Voucher Type")] %}
<br>{%= data[i][__("Voucher No")] %}</td>
<td>{%= dateutil.str_to_user(data[i]["posting_date"]) %}</td>
<td>
{% if(!filters.show_pdc_in_print) { %}
{%= data[i]["voucher_type"] %}
<br>
{% } %}
{%= data[i]["voucher_no"] %}
</td>
{% if(!filters.show_pdc_in_print) { %}
<td>
{% if(!(filters.customer || filters.supplier)) { %}
{%= data[i][__("Customer")] || data[i][__("Supplier")] %}
@@ -46,25 +159,56 @@
<br>{%= __("Remarks") %}:
{%= data[i][__("Remarks")] %}
</td>
{% } %}
<td style="text-align: right">
{%= format_currency(data[i]["Invoiced Amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">
{%= format_currency(data[i]["Paid Amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">
{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["Credit Note"], data[i]["currency"]) : format_currency(data[i]["Debit Note"], data[i]["currency"]) %}</td>
{% if(!filters.show_pdc_in_print) { %}
<td style="text-align: right">
{%= format_currency(data[i]["Paid Amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">
{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["Credit Note"], data[i]["currency"]) : format_currency(data[i]["Debit Note"], data[i]["currency"]) %}</td>
{% } %}
<td style="text-align: right">
{%= format_currency(data[i]["Outstanding Amount"], data[i]["currency"]) %}</td>
{% if(filters.show_pdc_in_print) { %}
{% if(report.report_name === "Accounts Receivable") { %}
<td style="text-align: right">
{%= data[i][__("Customer LPO")] %}</td>
{% } %}
<td style="text-align: right">{%= frappe.datetime.str_to_user(data[i][__("PDC/LC Date")]) %}</td>
<td style="text-align: right">{%= data[i][__("PDC/LC Ref")] %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("PDC/LC Amount")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Remaining Balance")], data[i]["currency"]) %}</td>
{% } %}
{% } else { %}
<td></td>
{% if(!filters.show_pdc_in_print) { %}
<td></td>
{% } %}
<td><b>{%= __("Total") %}</b></td>
<td style="text-align: right">
{%= format_currency(data[i]["Invoiced Amount"], data[i]["currency"] ) %}</td>
<td style="text-align: right">
{%= format_currency(data[i]["Paid Amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["Credit Note"], data[i]["currency"]) : format_currency(data[i]["Debit Note"], data[i]["currency"]) %} </td>
{% if(!filters.show_pdc_in_print) { %}
<td style="text-align: right">
{%= format_currency(data[i]["Paid Amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["Credit Note"], data[i]["currency"]) : format_currency(data[i]["Debit Note"], data[i]["currency"]) %} </td>
{% } %}
<td style="text-align: right">
{%= format_currency(data[i]["Outstanding Amount"], data[i]["currency"]) %}</td>
{% if(filters.show_pdc_in_print) { %}
{% if(report.report_name === "Accounts Receivable") { %}
<td style="text-align: right">
{%= data[i][__("Customer LPO")] %}</td>
{% } %}
<td style="text-align: right">{%= frappe.datetime.str_to_user(data[i][__("PDC/LC Date")]) %}</td>
<td style="text-align: right">{%= data[i][__("PDC/LC Ref")] %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("PDC/LC Amount")], data[i]["currency"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Remaining Balance")], data[i]["currency"]) %}</td>
{% } %}
{% } %}
{% } else { %}
{% if(data[i][__("Customer")] || data[i][__("Supplier")]|| "&nbsp;") { %}
@@ -94,4 +238,4 @@
{% } %}
</tbody>
</table>
<p class="text-right text-muted">{{ __("Printed On") }}{%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p>
<p class="text-right text-muted">{{ __("Printed On ") }}{%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p>

View File

@@ -14,7 +14,14 @@ frappe.query_reports["Accounts Receivable"] = {
"fieldname":"customer",
"label": __("Customer"),
"fieldtype": "Link",
"options": "Customer"
"options": "Customer",
on_change: () => {
var customer = frappe.query_report_filters_by_name.customer.get_value();
frappe.db.get_value('Customer', customer, ["tax_id", "customer_name"], function(value) {
frappe.query_report_filters_by_name.tax_id.set_value(value["tax_id"]);
frappe.query_report_filters_by_name.customer_name.set_value(value["customer_name"]);
});
}
},
{
"fieldname":"customer_group",
@@ -64,6 +71,23 @@ frappe.query_reports["Accounts Receivable"] = {
"fieldtype": "Int",
"default": "90",
"reqd": 1
},
{
"fieldname":"show_pdc_in_print",
"label": __("Show PDC in Print"),
"fieldtype": "Check",
},
{
"fieldname":"tax_id",
"label": __("Tax Id"),
"fieldtype": "Data",
"hidden": 1
},
{
"fieldname":"customer_name",
"label": __("Customer Name"),
"fieldtype": "Data",
"hidden": 1
}
],

View File

@@ -22,13 +22,35 @@ class ReceivablePayableReport(object):
return columns, data, None, chart
def get_columns(self, party_naming_by, args):
columns = [_("Posting Date") + ":Date:80", _(args.get("party_type")) + ":Link/" + args.get("party_type") + ":200"]
columns = []
columns.append({
"label": _("Posting Date"),
"fieldtype": "Date",
"fieldname": "posting_date",
"width": 90
})
columns += [_(args.get("party_type")) + ":Link/" + args.get("party_type") + ":200"]
if party_naming_by == "Naming Series":
columns += [args.get("party_type") + " Name::110"]
columns += [_("Voucher Type") + "::110", _("Voucher No") + ":Dynamic Link/"+_("Voucher Type")+":120",
_("Due Date") + ":Date:80"]
columns.append({
"label": _("Voucher Type"),
"fieldtype": "Data",
"fieldname": "voucher_type",
"width": 110
})
columns.append({
"label": _("Voucher No"),
"fieldtype": "Dynamic Link",
"fieldname": "voucher_no",
"width": 110,
"options": "voucher_type",
})
columns += [_("Due Date") + ":Date:80"]
if args.get("party_type") == "Supplier":
columns += [_("Bill No") + "::80", _("Bill Date") + ":Date:80"]
@@ -72,6 +94,18 @@ class ReceivablePayableReport(object):
"options": "Currency",
"width": 100
})
columns += [
_("PDC/LC Date") + ":Date:110",
_("PDC/LC Ref") + ":Data:110",
_("PDC/LC Amount") + ":Currency/currency:130",
_("Remaining Balance") + ":Currency/currency:130"
]
if args.get('party_type') == 'Customer':
columns += [_("Customer LPO") + ":Data:100"]
columns += [_("Delivery Note") + ":Data:100"]
if args.get("party_type") == "Customer":
columns += [
_("Territory") + ":Link/Territory:80",
@@ -89,8 +123,6 @@ class ReceivablePayableReport(object):
currency_precision = get_currency_precision() or 2
dr_or_cr = "debit" if args.get("party_type") == "Customer" else "credit"
voucher_details = self.get_voucher_details(args.get("party_type"))
future_vouchers = self.get_entries_after(self.filters.report_date, args.get("party_type"))
if not self.filters.get("company"):
@@ -101,7 +133,16 @@ class ReceivablePayableReport(object):
return_entries = self.get_return_entries(args.get("party_type"))
data = []
for gle in self.get_entries_till(self.filters.report_date, args.get("party_type")):
pdc_details = get_pdc_details(args.get("party_type"), self.filters.report_date)
gl_entries_data = self.get_entries_till(self.filters.report_date, args.get("party_type"))
if gl_entries_data:
voucher_nos = [d.voucher_no for d in gl_entries_data] or []
dn_details = get_dn_details(args.get("party_type"), voucher_nos)
voucher_details = get_voucher_details(args.get("party_type"), voucher_nos, dn_details)
for gle in gl_entries_data:
if self.is_receivable_or_payable(gle, dr_or_cr, future_vouchers):
outstanding_amount, credit_note_amount = self.get_outstanding_amount(gle,
self.filters.report_date, dr_or_cr, return_entries, currency_precision)
@@ -114,6 +155,7 @@ class ReceivablePayableReport(object):
# get due date
due_date = voucher_details.get(gle.voucher_no, {}).get("due_date", "")
bill_date = voucher_details.get(gle.voucher_no, {}).get("bill_date", "")
row += [gle.voucher_type, gle.voucher_no, due_date]
@@ -130,20 +172,43 @@ class ReceivablePayableReport(object):
row += [invoiced_amount, paid_amt, credit_note_amount, outstanding_amount]
# ageing data
entry_date = due_date if self.filters.ageing_based_on == "Due Date" else gle.posting_date
if self.filters.ageing_based_on == "Due Date":
entry_date = due_date
elif self.filters.ageing_based_on == "Supplier Invoice Date":
entry_date = bill_date
else:
entry_date = gle.posting_date
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
# issue 6371-Ageing buckets should not have amounts if due date is not reached
if self.filters.ageing_based_on == "Due Date" \
and getdate(due_date) > getdate(self.filters.report_date):
row[-1]=row[-2]=row[-3]=row[-4]=0
if self.filters.ageing_based_on == "Supplier Invoice Date" \
and getdate(bill_date) > getdate(self.filters.report_date):
row[-1]=row[-2]=row[-3]=row[-4]=0
if self.filters.get(scrub(args.get("party_type"))):
row.append(gle.account_currency)
else:
row.append(company_currency)
pdc = pdc_details.get((gle.voucher_no, gle.party), {})
remaining_balance = outstanding_amount - flt(pdc.get("pdc_amount"))
row += [pdc.get("pdc_date"), pdc.get("pdc_ref"),
flt(pdc.get("pdc_amount")), remaining_balance]
if args.get('party_type') == 'Customer':
# customer LPO
row += [voucher_details.get(gle.voucher_no, {}).get("po_no")]
# Delivery Note
row += [voucher_details.get(gle.voucher_no, {}).get("delivery_note")]
# customer territory / supplier type
if args.get("party_type") == "Customer":
row += [self.get_territory(gle.party), self.get_customer_group(gle.party)]
@@ -157,12 +222,11 @@ class ReceivablePayableReport(object):
def get_entries_after(self, report_date, party_type):
# returns a distinct list
return list(set([(e.voucher_type, e.voucher_no) for e in self.get_gl_entries(party_type)
if getdate(e.posting_date) > report_date]))
return list(set([(e.voucher_type, e.voucher_no) for e in self.get_gl_entries(party_type, report_date, for_future=True)]))
def get_entries_till(self, report_date, party_type):
# returns a generator
return (e for e in self.get_gl_entries(party_type) if getdate(e.posting_date) <= report_date)
return self.get_gl_entries(party_type, report_date)
def is_receivable_or_payable(self, gle, dr_or_cr, future_vouchers):
return (
@@ -189,14 +253,16 @@ class ReceivablePayableReport(object):
for e in self.get_gl_entries_for(gle.party, gle.party_type, gle.voucher_type, gle.voucher_no):
if getdate(e.posting_date) <= report_date and e.name!=gle.name:
amount = flt(e.get(reverse_dr_or_cr)) - flt(e.get(dr_or_cr))
amount = flt(e.get(reverse_dr_or_cr), currency_precision) - flt(e.get(dr_or_cr), currency_precision)
if e.voucher_no not in return_entries:
payment_amount += amount
else:
credit_note_amount += amount
outstanding_amount = flt((flt(gle.get(dr_or_cr)) - flt(gle.get(reverse_dr_or_cr)) \
- payment_amount - credit_note_amount), currency_precision)
outstanding_amount = (flt((flt(gle.get(dr_or_cr), currency_precision)
- flt(gle.get(reverse_dr_or_cr), currency_precision)
- payment_amount - credit_note_amount), currency_precision))
credit_note_amount = flt(credit_note_amount, currency_precision)
return outstanding_amount, credit_note_amount
@@ -225,38 +291,31 @@ class ReceivablePayableReport(object):
return self.party_map
def get_voucher_details(self, party_type):
voucher_details = frappe._dict()
def get_gl_entries(self, party_type, date=None, for_future=False):
conditions, values = self.prepare_conditions(party_type)
if party_type == "Customer":
for si in frappe.db.sql("""select name, due_date
from `tabSales Invoice` where docstatus=1""", as_dict=1):
voucher_details.setdefault(si.name, si)
if self.filters.get(scrub(party_type)):
select_fields = "sum(debit_in_account_currency) as debit, sum(credit_in_account_currency) as credit"
else:
select_fields = "sum(debit) as debit, sum(credit) as credit"
if party_type == "Supplier":
for pi in frappe.db.sql("""select name, due_date, bill_no, bill_date
from `tabPurchase Invoice` where docstatus=1""", as_dict=1):
voucher_details.setdefault(pi.name, pi)
if date and not for_future:
conditions += " and posting_date <= '%s'" % date
return voucher_details
if date and for_future:
conditions += " and posting_date > '%s'" % date
def get_gl_entries(self, party_type):
if not hasattr(self, "gl_entries"):
conditions, values = self.prepare_conditions(party_type)
if self.filters.get(scrub(party_type)):
select_fields = "sum(debit_in_account_currency) as debit, sum(credit_in_account_currency) as credit"
else:
select_fields = "sum(debit) as debit, sum(credit) as credit"
self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party,
voucher_type, voucher_no, against_voucher_type, against_voucher,
account_currency, remarks, {0}
from `tabGL Entry`
where docstatus < 2 and party_type=%s and (party is not null and party != '') {1}
self.gl_entries = frappe.db.sql("""
select
name, posting_date, account, party_type, party, voucher_type, voucher_no,
against_voucher_type, against_voucher, account_currency, remarks, {0}
from
`tabGL Entry`
where
docstatus < 2 and party_type=%s and (party is not null and party != '') {1}
group by voucher_type, voucher_no, against_voucher_type, against_voucher, party
order by posting_date, party"""
.format(select_fields, conditions), values, as_dict=True)
.format(select_fields, conditions), values, as_dict=True)
return self.gl_entries
@@ -347,3 +406,102 @@ def get_ageing_data(first_range, second_range, third_range, age_as_on, entry_dat
outstanding_range[index] = outstanding_amount
return [age] + outstanding_range
def get_pdc_details(party_type, report_date):
pdc_details = frappe._dict()
for pdc in frappe.db.sql("""
select
pref.reference_name as invoice_no, pent.party, pent.party_type,
max(pent.reference_date) as pdc_date, sum(ifnull(pref.allocated_amount,0)) as pdc_amount,
GROUP_CONCAT(pent.reference_no SEPARATOR ', ') as pdc_ref
from
`tabPayment Entry` as pent inner join `tabPayment Entry Reference` as pref
on
(pref.parent = pent.name)
where
pent.docstatus < 2 and pent.reference_date >= %s
and pent.party_type = %s
group by pent.party, pref.reference_name""", (report_date, party_type), as_dict=1):
pdc_details.setdefault((pdc.invoice_no, pdc.party), pdc)
if scrub(party_type):
amount_field = ("jea.debit_in_account_currency"
if party_type == 'Supplier' else "jea.credit_in_account_currency")
else:
amount_field = "jea.debit + jea.credit"
for pdc in frappe.db.sql("""
select
jea.reference_name as invoice_no, jea.party, jea.party_type,
max(je.cheque_date) as pdc_date, sum(ifnull({0},0)) as pdc_amount,
GROUP_CONCAT(je.cheque_no SEPARATOR ', ') as pdc_ref
from
`tabJournal Entry` as je inner join `tabJournal Entry Account` as jea
on
(jea.parent = je.name)
where
je.docstatus < 2 and je.cheque_date >= %s
and jea.party_type = %s
group by jea.party, jea.reference_name""".format(amount_field), (report_date, party_type), as_dict=1):
if (pdc.invoice_no, pdc.party) in pdc_details:
pdc_details[(pdc.invoice_no, pdc.party)]["pdc_amount"] += pdc.pdc_amount
else:
pdc_details.setdefault((pdc.invoice_no, pdc.party), pdc)
return pdc_details
def get_dn_details(party_type, voucher_nos):
dn_details = frappe._dict()
if party_type == "Customer":
for si in frappe.db.sql("""
select
parent, GROUP_CONCAT(delivery_note SEPARATOR ', ') as dn
from
`tabSales Invoice Item`
where
docstatus=1 and delivery_note is not null and delivery_note != ''
and parent in (%s) group by parent
""" %(','.join(['%s'] * len(voucher_nos))), tuple(voucher_nos) , as_dict=1):
dn_details.setdefault(si.parent, si.dn)
for si in frappe.db.sql("""
select
against_sales_invoice as parent, GROUP_CONCAT(parent SEPARATOR ', ') as dn
from
`tabDelivery Note Item`
where
docstatus=1 and against_sales_invoice is not null and against_sales_invoice != ''
and against_sales_invoice in (%s)
group by against_sales_invoice
""" %(','.join(['%s'] * len(voucher_nos))), tuple(voucher_nos) , as_dict=1):
if si.parent in dn_details:
dn_details[si.parent] += ', %s' %(si.dn)
else:
dn_details.setdefault(si.parent, si.dn)
return dn_details
def get_voucher_details(party_type, voucher_nos, dn_details):
voucher_details = frappe._dict()
if party_type == "Customer":
for si in frappe.db.sql("""select name, due_date, po_no
from `tabSales Invoice` where docstatus=1 and name in (%s)
""" %(','.join(['%s'] *len(voucher_nos))), (tuple(voucher_nos)), as_dict=1):
si['delivery_note'] = dn_details.get(si.name)
voucher_details.setdefault(si.name, si)
if party_type == "Supplier":
for pi in frappe.db.sql("""select name, due_date, bill_no, bill_date
from `tabPurchase Invoice` where docstatus = 1 and name in (%s)
""" %(','.join(['%s'] *len(voucher_nos))), (tuple(voucher_nos)), as_dict=1):
voucher_details.setdefault(pi.name, pi)
for pi in frappe.db.sql("""select name, due_date, bill_no, bill_date from
`tabJournal Entry` where docstatus = 1 and bill_no is not NULL and name in (%s)
""" %(','.join(['%s'] *len(voucher_nos))), (tuple(voucher_nos)), as_dict=1):
voucher_details.setdefault(pi.name, pi)
return voucher_details

View File

@@ -23,10 +23,10 @@ frappe.query_reports["Accounts Receivable Summary"] = {
"options": "Customer Group"
},
{
"fieldname":"credit_days_based_on",
"label": __("Credit Days Based On"),
"fieldtype": "Select",
"options": "\nFixed Days\nLast Day of the Next Month"
"fieldname":"payment_terms_template",
"label": __("Payment Terms Template"),
"fieldtype": "Link",
"options": "Payment Terms Template"
},
{
"fieldtype": "Break",

View File

@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport
class AccountsReceivableSummary(ReceivablePayableReport):
@@ -88,7 +89,8 @@ class AccountsReceivableSummary(ReceivablePayableReport):
})
)
for k in party_total[d.party].keys():
party_total[d.party][k] += d.get(k, 0)
if k != "currency":
party_total[d.party][k] += flt(d.get(k, 0))
party_total[d.party].currency = d.currency

View File

@@ -3,47 +3,75 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
def execute(filters=None):
columns, data = get_columns(), get_data(filters)
return columns, data
def get_data(filters):
data = frappe.db.sql("""
select
a.name as asset, a.asset_category, a.status,
a.depreciation_method, a.purchase_date, a.gross_purchase_amount,
ds.schedule_date as depreciation_date, ds.depreciation_amount,
ds.accumulated_depreciation_amount,
(a.gross_purchase_amount - ds.accumulated_depreciation_amount) as amount_after_depreciation,
ds.journal_entry as depreciation_entry
from
`tabAsset` a, `tabDepreciation Schedule` ds
where
a.name = ds.parent
and a.docstatus=1
and ifnull(ds.journal_entry, '') != ''
and ds.schedule_date between %(from_date)s and %(to_date)s
and a.company = %(company)s
{conditions}
order by
a.name asc, ds.schedule_date asc
""".format(conditions=get_filter_conditions(filters)), filters, as_dict=1)
return data
def get_filter_conditions(filters):
conditions = ""
data = []
depreciation_accounts = frappe.db.sql_list(""" select name from tabAccount
where ifnull(account_type, '') = 'Depreciation' """)
filters_data = [["company", "=", filters.get('company')],
["posting_date", ">=", filters.get('from_date')],
["posting_date", "<=", filters.get('to_date')],
["against_voucher_type", "=", "Asset"],
["account", "in", depreciation_accounts]]
if filters.get("asset"):
conditions += " and a.name = %(asset)s"
filters_data.append(["against_voucher", "=", filters.get("asset")])
if filters.get("asset_category"):
conditions += " and a.asset_category = %(asset_category)s"
return conditions
assets = frappe.db.sql_list("""select name from tabAsset
where asset_category = %s and docstatus=1""", filters.get("asset_category"))
filters_data.append(["against_voucher", "in", assets])
gl_entries = frappe.get_all('GL Entry',
filters= filters_data,
fields = ["against_voucher", "debit_in_account_currency as debit", "voucher_no", "posting_date"],
order_by= "against_voucher, posting_date")
if not gl_entries:
return data
assets = [d.against_voucher for d in gl_entries]
assets_details = get_assets_details(assets)
for d in gl_entries:
asset_data = assets_details.get(d.against_voucher)
if not asset_data.get("accumulated_depreciation_amount"):
asset_data.accumulated_depreciation_amount = d.debit
else:
asset_data.accumulated_depreciation_amount += d.debit
row = frappe._dict(asset_data)
row.update({
"depreciation_amount": d.debit,
"depreciation_date": d.posting_date,
"amount_after_depreciation": (flt(row.gross_purchase_amount) -
flt(row.accumulated_depreciation_amount)),
"depreciation_entry": d.voucher_no
})
data.append(row)
return data
def get_assets_details(assets):
assets_details = {}
fields = ["name as asset", "gross_purchase_amount",
"asset_category", "status", "depreciation_method", "purchase_date"]
for d in frappe.get_all("Asset", fields = fields, filters = {'name': ('in', assets)}):
assets_details.setdefault(d.asset, d)
return assets_details
def get_columns():
return [
{

View File

@@ -28,5 +28,10 @@ frappe.query_reports["Bank Reconciliation Statement"] = {
"default": frappe.datetime.get_today(),
"reqd": 1
},
{
"fieldname":"include_pos_transactions",
"label": __("Include POS Transactions"),
"fieldtype": "Check"
},
]
}
}

View File

@@ -138,7 +138,23 @@ def get_entries(filters):
and ifnull(clearance_date, '4000-01-01') > %(report_date)s
""", filters, as_dict=1)
return sorted(list(payment_entries)+list(journal_entries),
pos_entries = []
if filters.include_pos_transactions:
pos_entries = frappe.db.sql("""
select
"Sales Invoice Payment" as payment_document, sip.name as payment_entry, sip.amount as debit,
si.posting_date, si.debit_to as against_account, sip.clearance_date,
account.account_currency, 0 as credit
from `tabSales Invoice Payment` sip, `tabSales Invoice` si, `tabAccount` account
where
sip.account=%(account)s and si.docstatus=1 and sip.parent = si.name
and account.name = sip.account and si.posting_date <= %(report_date)s and
ifnull(sip.clearance_date, '4000-01-01') > %(report_date)s
order by
si.posting_date ASC, si.name DESC
""", filters, as_dict=1)
return sorted(list(payment_entries)+list(journal_entries+list(pos_entries)),
key=lambda k: k['posting_date'] or getdate(nowdate()))
def get_amounts_not_reflected_in_system(filters):

View File

@@ -39,6 +39,12 @@ frappe.query_reports["Budget Variance Report"] = {
options: ["Cost Center", "Project"],
default: "Cost Center",
reqd: 1
}
},
{
fieldname: "cost_center",
label: __("Cost Center"),
fieldtype: "Link",
options: "Cost Center"
},
]
}

View File

@@ -10,9 +10,13 @@ from erpnext.controllers.trends import get_period_date_ranges, get_period_month_
def execute(filters=None):
if not filters: filters = {}
validate_filters(filters)
columns = get_columns(filters)
cost_centers = get_cost_centers(filters)
if filters.get("cost_center"):
cost_centers = [filters.get("cost_center")]
else:
cost_centers = get_cost_centers(filters)
period_month_ranges = get_period_month_ranges(filters["period"], filters["fiscal_year"])
cam_map = get_cost_center_account_month_map(filters)
@@ -39,6 +43,10 @@ def execute(filters=None):
return columns, data
def validate_filters(filters):
if filters.get("budget_against")=="Project" and filters.get("cost_center"):
frappe.throw(_("Filter based on Cost Center is only applicable if Budget Against is selected as Cost Center"))
def get_columns(filters):
columns = [_(filters.get("budget_against")) + ":Link/%s:120"%(filters.get("budget_against")), _("Account") + ":Link/Account:120"]
@@ -66,12 +74,16 @@ def get_cost_centers(filters):
#Get cost center & target details
def get_cost_center_target_details(filters):
cond = ""
if filters.get("cost_center"):
cond += " and b.cost_center='%s'" % frappe.db.escape(filters.get("cost_center"))
return frappe.db.sql("""
select b.{budget_against} as budget_against, b.monthly_distribution, ba.account, ba.budget_amount
from `tabBudget` b, `tabBudget Account` ba
where b.name=ba.parent and b.docstatus = 1 and b.fiscal_year=%s
and b.budget_against = %s and b.company=%s
""".format(budget_against=filters.get("budget_against").replace(" ", "_").lower()),
and b.budget_against = %s and b.company=%s {cond}
""".format(budget_against=filters.get("budget_against").replace(" ", "_").lower(), cond=cond),
(filters.fiscal_year, filters.budget_against, filters.company), as_dict=True)
#Get target distribution details of accounts of cost center

View File

@@ -185,14 +185,15 @@ def prepare_data(accounts, balance_must_be, period_list, company_currency):
has_value = False
total = 0
row = frappe._dict({
"account_name": _(d.account_name),
"account": _(d.name),
"parent_account": _(d.parent_account),
"indent": flt(d.indent),
"year_start_date": year_start_date,
"year_end_date": year_end_date,
"currency": company_currency,
"opening_balance": d.get("opening_balance", 0.0) * (1 if balance_must_be=="Debit" else -1)
"opening_balance": d.get("opening_balance", 0.0) * (1 if balance_must_be=="Debit" else -1),
"account_name": ('{} - {}'.format(_(d.account_number), _(d.account_name))
if d.account_number else _(d.account_name))
})
for period in period_list:
if d.get(period.key) and balance_must_be=="Credit":
@@ -253,7 +254,7 @@ def add_total_row(out, root_type, balance_must_be, period_list, company_currency
out.append({})
def get_accounts(company, root_type):
return frappe.db.sql("""select name, parent_account, lft, rgt, root_type, report_type, account_name from `tabAccount`
return frappe.db.sql("""select name, account_number, parent_account, lft, rgt, root_type, report_type, account_name from `tabAccount`
where company=%s and root_type=%s order by lft""", (company, root_type), as_dict=True)
def filter_accounts(accounts, depth=10):

View File

@@ -8,6 +8,13 @@
{%= filters.account %}
{% } %}
</h4>
<h6 class="text-center">
{% if (filters.tax_id) { %}
{%= __("Tax Id: ")%} {%= filters.tax_id %}
{% } %}
</h6>
<h5 class="text-center">
{%= dateutil.str_to_user(filters.from_date) %}
{%= __("to") %}
@@ -17,38 +24,70 @@
<table class="table table-bordered">
<thead>
<tr>
<th style="width: 15%">{%= __("Date") %}</th>
<th style="width: 12%">{%= __("Date") %}</th>
<th style="width: 15%">{%= __("Ref") %}</th>
<th style="width: 40%">{%= __("Party") %}</th>
<th style="width: 25%">{%= __("Party") %}</th>
<th style="width: 15%">{%= __("Debit") %}</th>
<th style="width: 15%">{%= __("Credit") %}</th>
<th style="width: 18%">{%= __("Balance (Dr - Cr)") %}</th>
</tr>
</thead>
<tbody>
{% for(var i=0, l=data.length; i<l; i++) { %}
<tr>
{% if(data[i][__("Posting Date")]) { %}
<td>{%= dateutil.str_to_user(data[i][__("Posting Date")]) %}</td>
<td>{%= data[i][__("Voucher Type")] %}
<br>{%= data[i][__("Voucher No")] %}</td>
{% if(data[i].posting_date) { %}
<td>{%= dateutil.str_to_user(data[i].posting_date) %}</td>
<td>{%= data[i].voucher_type %}
<br>{%= data[i].voucher_no %}</td>
<td>
{% if(!(filters.party || filters.account)) { %}
{%= data[i][__("Party")] || data[i][__("Account")] %}
{%= data[i].party || data[i].account %}
<br>
{% } %}
{{ __("Against") }}: {%= data[i][__("Against Account")] %}
<br>{%= __("Remarks") %}: {%= data[i][__("Remarks")] %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Debit")]) %}</td>
<td style="text-align: right">{%= format_currency(data[i][__("Credit")]) %}</td>
{{ __("Against") }}: {%= data[i].against %}
<br>{%= __("Remarks") %}: {%= data[i].remarks %}
{% if(data[i].bill_no) { %}
<br>{%= __("Supplier Invoice No") %}: {%= data[i].bill_no %}
{% } %}
</td>
{% if(filters.print_in_account_currency) { %}
<td style="text-align: right">
{%= format_currency(data[i].debit_in_account_currency, data[i].account_currency) %}
</td>
<td style="text-align: right">
{%= format_currency(data[i].credit_in_account_currency, data[i].account_currency) %}
</td>
{% } else { %}
<td style="text-align: right">
{%= format_currency(data[i].debit) %}</td>
<td style="text-align: right">
{%= format_currency(data[i].credit) %}</td>
{% } %}
{% } else { %}
<td></td>
<td></td>
<td><b>{%= frappe.format(data[i][__("Account")], {fieldtype: "Link"}) || "&nbsp;" %}</b></td>
<td><b>{%= frappe.format(data[i].account, {fieldtype: "Link"}) || "&nbsp;" %}</b></td>
{% if(filters.print_in_account_currency) { %}
<td style="text-align: right">
{%= data[i].account && format_currency(data[i].debit_in_account_currency, data[i].account_currency) %}</td>
<td style="text-align: right">
{%= data[i].account && format_currency(data[i].credit_in_account_currency, data[i].account_currency) %}</td>
{% } else { %}
<td style="text-align: right">
{%= data[i].account && format_currency(data[i].debit) %}
</td>
<td style="text-align: right">
{%= data[i].account && format_currency(data[i].credit) %}
</td>
{% } %}
{% } %}
{% if(filters.print_in_account_currency) { %}
<td style="text-align: right">
{%= data[i][__("Account")] && format_currency(data[i][__("Debit")]) %}</td>
<td style="text-align: right">
{%= data[i][__("Account")] && format_currency(data[i][__("Credit")]) %}</td>
{%= format_currency(data[i].balance_in_account_currency, data[i].account_currency) %}
</td>
{% } else { %}
<td style="text-align: right">{%= format_currency(data[i].balance) %}</td>
{% } %}
</tr>
{% } %}

View File

@@ -61,7 +61,10 @@ frappe.query_reports["General Ledger"] = {
"label": __("Party Type"),
"fieldtype": "Link",
"options": "Party Type",
"default": ""
"default": "",
on_change: function() {
frappe.query_report_filters_by_name.party.set_value("");
}
},
{
"fieldname":"party",
@@ -82,11 +85,16 @@ frappe.query_reports["General Ledger"] = {
frappe.query_report_filters_by_name.party_name.set_value("");
return;
}
var fieldname = frappe.scrub(party_type) + "_name";
var fieldname = erpnext.utils.get_party_name(party_type) || "name";
frappe.db.get_value(party_type, party, fieldname, function(value) {
frappe.query_report_filters_by_name.party_name.set_value(value[fieldname]);
});
if (party_type === "Customer" || party_type === "Supplier") {
frappe.db.get_value(party_type, party, "tax_id", function(value) {
frappe.query_report_filters_by_name.tax_id.set_value(value["tax_id"]);
});
}
}
},
{
@@ -95,6 +103,12 @@ frappe.query_reports["General Ledger"] = {
"fieldtype": "Data",
"hidden": 1
},
{
"fieldname":"tax_id",
"label": __("Tax Id"),
"fieldtype": "Data",
"hidden": 1
},
{
"fieldname":"group_by_voucher",
"label": __("Group by Voucher"),
@@ -105,6 +119,11 @@ frappe.query_reports["General Ledger"] = {
"fieldname":"group_by_account",
"label": __("Group by Account"),
"fieldtype": "Check",
},
{
"fieldname":"print_in_account_currency",
"label": __("Print in Account Currency"),
"fieldtype": "Check",
}
]
}

View File

@@ -3,12 +3,17 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, cstr, flt
from frappe.utils import getdate, cstr, flt, fmt_money
from frappe import _, _dict
from erpnext.accounts.utils import get_account_currency
def execute(filters=None):
account_details = {}
if filters and filters.get('print_in_account_currency') and \
not filters.get('account'):
frappe.throw(_("Select an account to print in account currency"))
for acc in frappe.db.sql("""select name, is_group from tabAccount""", as_dict=1):
account_details.setdefault(acc.name, acc)
@@ -66,8 +71,8 @@ def set_account_currency(filters):
if gle_currency:
account_currency = gle_currency
else:
account_currency = None if filters.party_type == "Employee" else \
frappe.db.get_value(filters.party_type, filters.party, "default_currency")
account_currency = (None if filters.party_type in ["Employee", "Student", "Shareholder", "Member"] else
frappe.db.get_value(filters.party_type, filters.party, "default_currency"))
filters["account_currency"] = account_currency or filters.company_currency
@@ -76,28 +81,6 @@ def set_account_currency(filters):
return filters
def get_columns(filters):
columns = [
_("Posting Date") + ":Date:90", _("Account") + ":Link/Account:200",
_("Debit") + ":Float:100", _("Credit") + ":Float:100"
]
if filters.get("show_in_account_currency"):
columns += [
_("Debit") + " (" + filters.account_currency + ")" + ":Float:100",
_("Credit") + " (" + filters.account_currency + ")" + ":Float:100"
]
columns += [
_("Voucher Type") + "::120", _("Voucher No") + ":Dynamic Link/"+_("Voucher Type")+":160",
_("Against Account") + "::120", _("Party Type") + "::80", _("Party") + "::150",
_("Project") + ":Link/Project:100", _("Cost Center") + ":Link/Cost Center:100",
_("Against Voucher Type") + "::120", _("Against Voucher") + ":Dynamic Link/"+_("Against Voucher Type")+":160",
_("Remarks") + "::400"
]
return columns
def get_result(filters, account_details):
gl_entries = get_gl_entries(filters)
@@ -193,24 +176,6 @@ def get_data_with_opening_closing(filters, account_details, gl_entries):
# closing
data.append(totals.closing)
#total closing
total_closing = totals.total_closing
total_debit = totals.closing.get('debit', 0)
total_credit = totals.closing.get('credit', 0)
debit_in_account_currency = totals.closing.get('debit_in_account_currency', 0)
credit_in_account_currency = totals.closing.get('credit_in_account_currency', 0)
total_amount = total_debit - total_credit
if total_amount > 0:
total_closing['debit'] = total_amount
total_closing['debit_in_account_currency'] = debit_in_account_currency - credit_in_account_currency
else:
total_closing['credit'] = abs(total_amount)
total_closing['credit_in_account_currency'] = abs(debit_in_account_currency - credit_in_account_currency)
data.append(totals.total_closing)
return data
def get_totals_dict():
@@ -225,8 +190,7 @@ def get_totals_dict():
return _dict(
opening = _get_debit_credit_dict(_('Opening')),
total = _get_debit_credit_dict(_('Total')),
closing = _get_debit_credit_dict(_('Closing (Opening + Total)')),
total_closing = _get_debit_credit_dict(_('Closing Balance (Dr - Cr)'))
closing = _get_debit_credit_dict(_('Closing (Opening + Total)'))
)
def initialize_gle_map(gl_entries):
@@ -270,17 +234,163 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
return totals, entries
def get_result_as_list(data, filters):
result = []
balance, balance_in_account_currency = 0, 0
inv_details = get_supplier_invoice_details()
for d in data:
row = [d.get("posting_date"), d.get("account"), d.get("debit"), d.get("credit")]
if not d.get('posting_date'):
balance, balance_in_account_currency = 0, 0
balance = get_balance(d, balance, 'debit', 'credit')
d['balance'] = balance
if filters.get("show_in_account_currency"):
row += [d.get("debit_in_account_currency"), d.get("credit_in_account_currency")]
balance_in_account_currency = get_balance(d, balance_in_account_currency,
'debit_in_account_currency', 'credit_in_account_currency')
d['balance_in_account_currency'] = balance_in_account_currency
else:
d['debit_in_account_currency'] = d.get('debit', 0)
d['credit_in_account_currency'] = d.get('credit', 0)
d['balance_in_account_currency'] = d.get('balance')
row += [d.get("voucher_type"), d.get("voucher_no"), d.get("against"),
d.get("party_type"), d.get("party"), d.get("project"), d.get("cost_center"), d.get("against_voucher_type"), d.get("against_voucher"), d.get("remarks")
]
d['account_currency'] = filters.account_currency
d['bill_no'] = inv_details.get(d.get('against_voucher'), '')
result.append(row)
return data
return result
def get_supplier_invoice_details():
inv_details = {}
for d in frappe.db.sql(""" select name, bill_no from `tabPurchase Invoice`
where docstatus = 1 and bill_no is not null and bill_no != '' """, as_dict=1):
inv_details[d.name] = d.bill_no
return inv_details
def get_balance(row, balance, debit_field, credit_field):
balance += (row.get(debit_field, 0) - row.get(credit_field, 0))
return balance
def get_columns(filters):
columns = [
{
"label": _("Posting Date"),
"fieldname": "posting_date",
"fieldtype": "Date",
"width": 90
},
{
"label": _("Account"),
"fieldname": "account",
"fieldtype": "Link",
"options": "Account",
"width": 180
},
{
"label": _("Debit"),
"fieldname": "debit",
"fieldtype": "Float",
"width": 100
},
{
"label": _("Credit"),
"fieldname": "credit",
"fieldtype": "Float",
"width": 100
},
{
"label": _("Balance (Dr - Cr)"),
"fieldname": "balance",
"fieldtype": "Float",
"width": 130
}
]
if filters.get("show_in_account_currency"):
columns.extend([
{
"label": _("Debit") + " (" + filters.account_currency + ")",
"fieldname": "debit_in_account_currency",
"fieldtype": "Float",
"width": 100
},
{
"label": _("Credit") + " (" + filters.account_currency + ")",
"fieldname": "credit_in_account_currency",
"fieldtype": "Float",
"width": 100
},
{
"label": _("Balance") + " (" + filters.account_currency + ")",
"fieldname": "balance_in_account_currency",
"fieldtype": "Data",
"width": 100
}
])
columns.extend([
{
"label": _("Voucher Type"),
"fieldname": "voucher_type",
"width": 120
},
{
"label": _("Voucher No"),
"fieldname": "voucher_no",
"fieldtype": "Dynamic Link",
"options": "voucher_type",
"width": 180
},
{
"label": _("Against Account"),
"fieldname": "against",
"width": 120
},
{
"label": _("Party Type"),
"fieldname": "party_type",
"width": 100
},
{
"label": _("Party"),
"fieldname": "party",
"width": 100
},
{
"label": _("Project"),
"options": "Project",
"fieldname": "project",
"width": 100
},
{
"label": _("Cost Center"),
"options": "Cost Center",
"fieldname": "cost_center",
"width": 100
},
{
"label": _("Against Voucher Type"),
"fieldname": "against_voucher_type",
"width": 100
},
{
"label": _("Against Voucher"),
"fieldname": "against_voucher",
"fieldtype": "Dynamic Link",
"options": "against_voucher_type",
"width": 100
},
{
"label": _("Supplier Invoice No"),
"fieldname": "bill_no",
"fieldtype": "Data",
"width": 100
},
{
"label": _("Remarks"),
"fieldname": "remarks",
"width": 400
}
])
return columns

View File

@@ -6,7 +6,6 @@ import frappe
from frappe import _, scrub
from erpnext.stock.utils import get_incoming_rate
from erpnext.controllers.queries import get_match_cond
from erpnext.stock.stock_ledger import get_valuation_rate
from frappe.utils import flt
@@ -172,7 +171,7 @@ class GrossProfitGenerator(object):
row.qty += returned_item_row.qty
row.base_amount += returned_item_row.base_amount
row.buying_amount = row.qty * row.buying_rate
if row.qty:
if row.qty or row.base_amount:
row = self.set_average_rate(row)
self.grouped_data.append(row)
@@ -248,6 +247,7 @@ class GrossProfitGenerator(object):
return 0.0
def get_average_buying_rate(self, row, item_code):
args = row
if not item_code in self.average_buying_rate:
if item_code in self.non_stock_items:
self.average_buying_rate[item_code] = flt(frappe.db.sql("""
@@ -255,14 +255,14 @@ class GrossProfitGenerator(object):
from `tabPurchase Invoice Item`
where item_code = %s and docstatus=1""", item_code)[0][0])
else:
row.voucher_type = row.parenttype
row.voucher_no = row.parent
average_buying_rate = get_incoming_rate(row)
if not average_buying_rate:
average_buying_rate = get_valuation_rate(item_code, row.warehouse,
row.parenttype, row.parent, allow_zero_rate=row.allow_zero_valuation,
currency=self.filters.currency, company=self.filters.company)
args.update({
'voucher_type': row.parenttype,
'voucher_no': row.parent,
'allow_zero_valuation': True,
'company': self.filters.company
})
average_buying_rate = get_incoming_rate(args)
self.average_buying_rate[item_code] = flt(average_buying_rate)
return self.average_buying_rate[item_code]
@@ -311,8 +311,7 @@ class GrossProfitGenerator(object):
`tabSales Invoice Item`.brand, `tabSales Invoice Item`.dn_detail,
`tabSales Invoice Item`.delivery_note, `tabSales Invoice Item`.stock_qty as qty,
`tabSales Invoice Item`.base_net_rate, `tabSales Invoice Item`.base_net_amount,
`tabSales Invoice Item`.name as "item_row", `tabSales Invoice`.is_return,
`tabSales Invoice Item`.allow_zero_valuation_rate as "allow_zero_valuation"
`tabSales Invoice Item`.name as "item_row", `tabSales Invoice`.is_return
{sales_person_cols}
from
`tabSales Invoice` inner join `tabSales Invoice Item`

View File

@@ -49,7 +49,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
row += [
d.credit_to, d.mode_of_payment, d.project, d.company, d.purchase_order,
purchase_receipt, expense_account, d.stock_qty, d.stock_uom, d.base_net_rate, d.base_net_amount
purchase_receipt, expense_account, d.stock_qty, d.stock_uom, d.base_net_amount / d.stock_qty, d.base_net_amount
]
total_tax = 0
@@ -120,8 +120,7 @@ def get_items(filters, additional_query_columns):
`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`,
`tabPurchase Invoice Item`.`stock_uom`, `tabPurchase Invoice Item`.`base_net_rate`,
`tabPurchase Invoice Item`.`base_net_amount`,
`tabPurchase Invoice Item`.`stock_uom`, `tabPurchase Invoice Item`.`base_net_amount`,
`tabPurchase Invoice`.supplier_name, `tabPurchase Invoice`.mode_of_payment {0}
from `tabPurchase Invoice`, `tabPurchase Invoice Item`
where `tabPurchase Invoice`.name = `tabPurchase Invoice Item`.`parent` and

View File

@@ -1,7 +1,7 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.query_reports["Item-wise Sales Register"] = frappe.query_reports["Sales Register"] = {
frappe.query_reports["Item-wise Sales Register"] = {
"filters": [
{
"fieldname":"from_date",

View File

@@ -50,10 +50,12 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
row += [
d.customer_group, d.debit_to, ", ".join(mode_of_payments.get(d.parent, [])),
d.territory, d.project, d.company, d.sales_order,
delivery_note, d.income_account, d.cost_center, d.stock_qty, d.stock_uom,
d.base_net_rate, d.base_net_amount
delivery_note, d.income_account, d.cost_center, d.stock_qty, d.stock_uom
]
row += [(d.base_net_rate * d.qty)/d.stock_qty, d.base_net_amount] \
if d.stock_uom != d.uom else [d.base_net_rate, d.base_net_amount]
total_tax = 0
for tax in tax_columns:
item_tax = itemised_tax.get(d.name, {}).get(tax, {})
@@ -103,7 +105,7 @@ def get_conditions(filters):
if filters.get("mode_of_payment"):
conditions += """ and exists(select name from `tabSales Invoice Payment`
where parent=si.name
where parent=`tabSales Invoice`.name
and ifnull(`tabSales Invoice Payment`.mode_of_payment, '') = %(mode_of_payment)s)"""
return conditions
@@ -131,7 +133,7 @@ def get_items(filters, additional_query_columns):
`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 {0}
`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
and `tabSales Invoice`.docstatus = 1 %s %s
@@ -155,6 +157,9 @@ def get_delivery_notes_against_sales_order(item_list):
return so_dn_map
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"):
import json
@@ -168,15 +173,16 @@ def get_tax_accounts(item_list, columns, company_currency,
for d in item_list:
invoice_item_row.setdefault(d.parent, []).append(d)
item_row_map.setdefault(d.parent, {}).setdefault(d.item_code, []).append(d)
item_row_map.setdefault(d.parent, {}).setdefault(d.item_code or d.item_name, []).append(d)
conditions = ""
if doctype == "Purchase Invoice":
conditions = " and category in ('Total', 'Valuation and Total')"
conditions = " and category in ('Total', 'Valuation and Total') and base_tax_amount_after_discount_amount != 0"
deducted_tax = get_deducted_taxes()
tax_details = frappe.db.sql("""
select
parent, description, item_wise_tax_detail,
name, parent, description, item_wise_tax_detail,
charge_type, base_tax_amount_after_discount_amount
from `tab%s`
where
@@ -188,7 +194,7 @@ def get_tax_accounts(item_list, columns, company_currency,
""" % (tax_doctype, '%s', ', '.join(['%s']*len(invoice_item_row)), conditions),
tuple([doctype] + invoice_item_row.keys()))
for parent, description, item_wise_tax_detail, charge_type, tax_amount in tax_details:
for name, parent, description, item_wise_tax_detail, charge_type, tax_amount in tax_details:
description = handle_html(description)
if description not in tax_columns and tax_amount:
# as description is text editor earlier and markup can break the column convention in reports
@@ -217,9 +223,13 @@ def get_tax_accounts(item_list, columns, company_currency,
item_tax_amount = flt((tax_amount * d.base_net_amount) / item_net_amount) \
if item_net_amount else 0
if item_tax_amount:
tax_value = flt(item_tax_amount, tax_amount_precision)
tax_value = (tax_value * -1
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": flt(item_tax_amount, tax_amount_precision)
"tax_amount": tax_value
})
except ValueError:

View File

@@ -1,5 +1,5 @@
{
"add_total_row": 0,
"add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-06-13 18:46:55",
"disabled": 0,
@@ -7,7 +7,7 @@
"doctype": "Report",
"idx": 3,
"is_standard": "Yes",
"modified": "2017-02-24 20:16:25.027061",
"modified": "2018-02-21 01:28:31.261299",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Trends",

View File

@@ -43,7 +43,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
row += [
supplier_details.get(inv.supplier), # supplier_type
inv.credit_to, inv.mode_of_payment, ", ".join(project),
inv.tax_id, inv.credit_to, inv.mode_of_payment, ", ".join(project),
inv.bill_no, inv.bill_date, inv.remarks,
", ".join(purchase_order), ", ".join(purchase_receipt), company_currency
]
@@ -83,7 +83,7 @@ def get_columns(invoice_list, additional_table_columns):
columns += additional_table_columns
columns += [
_("Supplier Type") + ":Link/Supplier Type:120", _("Payable Account") + ":Link/Account:120",
_("Supplier Type") + ":Link/Supplier Type:120", _("Tax Id") + "::80", _("Payable Account") + ":Link/Account:120",
_("Mode of Payment") + ":Link/Mode of Payment:80", _("Project") + ":Link/Project:80",
_("Bill No") + "::120", _("Bill Date") + ":Date:80", _("Remarks") + "::150",
_("Purchase Order") + ":Link/Purchase Order:100",
@@ -143,7 +143,7 @@ def get_invoices(filters, additional_query_columns):
conditions = get_conditions(filters)
return frappe.db.sql("""
select
name, posting_date, credit_to, supplier, supplier_name, bill_no, bill_date,
name, posting_date, credit_to, supplier, supplier_name, tax_id, bill_no, bill_date,
remarks, base_net_total, base_grand_total, outstanding_amount,
mode_of_payment {0}
from `tabPurchase Invoice`
@@ -172,6 +172,7 @@ def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
else sum(base_tax_amount_after_discount_amount) * -1 end as tax_amount
from `tabPurchase Taxes and Charges`
where parent in (%s) and category in ('Total', 'Valuation and Total')
and base_tax_amount_after_discount_amount != 0
group by parent, account_head, add_deduct_tax
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)

View File

@@ -1,5 +1,5 @@
{
"add_total_row": 0,
"add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-06-13 18:44:21",
"disabled": 0,
@@ -7,7 +7,7 @@
"doctype": "Report",
"idx": 3,
"is_standard": "Yes",
"modified": "2017-02-24 20:15:12.885723",
"modified": "2018-02-21 01:28:03.622485",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Trends",

View File

@@ -33,8 +33,13 @@ frappe.query_reports["Sales Payment Summary"] = {
},
{
"fieldname":"is_pos",
"label": __("POS?"),
"label": __("Show only POS"),
"fieldtype": "Check"
}
},
{
"fieldname":"payment_detail",
"label": __("Show Payment Details"),
"fieldtype": "Check"
},
]
};

View File

@@ -14,30 +14,46 @@ def execute(filters=None):
def get_columns():
return [
_("Date") + ":Date:80",
_("Owner") + "::150",
_("Payment Mode") + "::140",
_("Owner") + ":Data:200",
_("Payment Mode") + ":Data:240",
_("Sales and Returns") + ":Currency/currency:120",
_("Taxes") + ":Currency/currency:120",
_("Payments") + ":Currency/currency:120",
_("Outstanding Amount") + ":Currency/currency:150",
_("Payments") + ":Currency/currency:120"
]
def get_sales_payment_data(filters, columns):
sales_invoice_data = get_sales_invoice_data(filters)
data = []
show_payment_detail = False
sales_invoice_data = get_sales_invoice_data(filters)
mode_of_payments = get_mode_of_payments(filters)
mode_of_payment_details = get_mode_of_payment_details(filters)
if filters.get("payment_detail"):
show_payment_detail = True
else:
show_payment_detail = False
for inv in sales_invoice_data:
mode_of_payment = inv["owner"]+cstr(inv["posting_date"])
row = [inv.posting_date, inv.owner,", ".join(mode_of_payments.get(mode_of_payment, [])),
inv.net_total,
inv.total_taxes, (inv.net_total + inv.total_taxes - inv.outstanding_amount),
inv.outstanding_amount]
data.append(row)
owner_posting_date = inv["owner"]+cstr(inv["posting_date"])
if show_payment_detail:
row = [inv.posting_date, inv.owner," ",inv.net_total,inv.total_taxes, 0]
data.append(row)
for mop_detail in mode_of_payment_details.get(owner_posting_date,[]):
row = [inv.posting_date, inv.owner,mop_detail[0],0,0,mop_detail[1],0]
data.append(row)
else:
total_payment = 0
for mop_detail in mode_of_payment_details.get(owner_posting_date,[]):
total_payment = total_payment + mop_detail[1]
row = [inv.posting_date, inv.owner,", ".join(mode_of_payments.get(owner_posting_date, [])),
inv.net_total,inv.total_taxes,total_payment]
data.append(row)
return data
def get_conditions(filters):
conditions = ""
if filters.get("from_date"): conditions += "a.posting_date >= %(from_date)s"
conditions = "1=1"
if filters.get("from_date"): conditions += " and a.posting_date >= %(from_date)s"
if filters.get("to_date"): conditions += " and a.posting_date <= %(to_date)s"
if filters.get("company"): conditions += " and a.company=%(company)s"
if filters.get("customer"): conditions += " and a.customer = %(customer)s"
@@ -73,9 +89,17 @@ def get_mode_of_payments(filters):
union
select a.owner,a.posting_date, ifnull(b.mode_of_payment, '') as mode_of_payment
from `tabSales Invoice` a, `tabPayment Entry` b,`tabPayment Entry Reference` c
where a.name = c.reference_name
where a.name = c.reference_name
and b.name = c.parent
and a.name in ({invoice_list_names})
union
select a.owner, a.posting_date,
ifnull(a.voucher_type,'') as mode_of_payment
from `tabJournal Entry` a, `tabJournal Entry Account` b
where a.name = b.parent
and a.docstatus = 1
and b.reference_type = "Sales Invoice"
and b.reference_name in ({invoice_list_names})
""".format(invoice_list_names=invoice_list_names), as_dict=1)
for d in inv_mop:
mode_of_payments.setdefault(d["owner"]+cstr(d["posting_date"]), []).append(d.mode_of_payment)
@@ -86,4 +110,37 @@ def get_invoices(filters):
return frappe.db.sql("""select a.name
from `tabSales Invoice` a
where a.docstatus = 1 and {conditions}""".format(conditions=conditions),
filters, as_dict=1)
filters, as_dict=1)
def get_mode_of_payment_details(filters):
mode_of_payment_details = {}
invoice_list = get_invoices(filters)
invoice_list_names = ",".join(['"' + invoice['name'] + '"' for invoice in invoice_list])
if invoice_list:
inv_mop_detail = frappe.db.sql("""select a.owner, a.posting_date,
ifnull(b.mode_of_payment, '') as mode_of_payment, sum(b.base_amount) as paid_amount
from `tabSales Invoice` a, `tabSales Invoice Payment` b
where a.name = b.parent
and a.name in ({invoice_list_names})
group by a.owner, a.posting_date, mode_of_payment
union
select a.owner,a.posting_date,
ifnull(b.mode_of_payment, '') as mode_of_payment, sum(b.base_paid_amount) as paid_amount
from `tabSales Invoice` a, `tabPayment Entry` b,`tabPayment Entry Reference` c
where a.name = c.reference_name
and b.name = c.parent
and a.name in ({invoice_list_names})
group by a.owner, a.posting_date, mode_of_payment
union
select a.owner, a.posting_date,
ifnull(a.voucher_type,'') as mode_of_payment, sum(b.credit)
from `tabJournal Entry` a, `tabJournal Entry Account` b
where a.name = b.parent
and a.docstatus = 1
and b.reference_type = "Sales Invoice"
and b.reference_name in ({invoice_list_names})
group by a.owner, a.posting_date, mode_of_payment
""".format(invoice_list_names=invoice_list_names), as_dict=1)
for d in inv_mop_detail:
mode_of_payment_details.setdefault(d["owner"]+cstr(d["posting_date"]), []).append((d.mode_of_payment,d.paid_amount))
return mode_of_payment_details

View File

@@ -25,8 +25,6 @@ def _execute(filters, additional_table_columns=None, additional_query_columns=No
#Cost Center & Warehouse Map
invoice_cc_wh_map = get_invoice_cc_wh_map(invoice_list)
invoice_so_dn_map = get_invoice_so_dn_map(invoice_list)
customers = list(set([inv.customer for inv in invoice_list]))
customer_map = get_customer_details(customers)
company_currency = frappe.db.get_value("Company", filters.get("company"), "default_currency")
mode_of_payments = get_mode_of_payments([inv.name for inv in invoice_list])
@@ -38,7 +36,6 @@ def _execute(filters, additional_table_columns=None, additional_query_columns=No
cost_center = list(set(invoice_cc_wh_map.get(inv.name, {}).get("cost_center", [])))
warehouse = list(set(invoice_cc_wh_map.get(inv.name, {}).get("warehouse", [])))
customer_details = customer_map.get(inv.customer, {})
row = [
inv.name, inv.posting_date, inv.customer, inv.customer_name
]
@@ -48,8 +45,9 @@ def _execute(filters, additional_table_columns=None, additional_query_columns=No
row.append(inv.get(col))
row +=[
customer_details.get("customer_group"),
customer_details.get("territory"),
inv.get("customer_group"),
inv.get("territory"),
inv.get("tax_id"),
inv.debit_to, ", ".join(mode_of_payments.get(inv.name, [])),
inv.project, inv.owner, inv.remarks,
", ".join(sales_order), ", ".join(delivery_note),", ".join(cost_center),
@@ -92,7 +90,7 @@ def get_columns(invoice_list, additional_table_columns):
columns +=[
_("Customer Group") + ":Link/Customer Group:120", _("Territory") + ":Link/Territory:80",
_("Receivable Account") + ":Link/Account:120", _("Mode of Payment") + "::120",
_("Tax Id") + "::80", _("Receivable Account") + ":Link/Account:120", _("Mode of Payment") + "::120",
_("Project") +":Link/Project:80", _("Owner") + "::150", _("Remarks") + "::150",
_("Sales Order") + ":Link/Sales Order:100", _("Delivery Note") + ":Link/Delivery Note:100",
_("Cost Center") + ":Link/Cost Center:100", _("Warehouse") + ":Link/Warehouse:100",
@@ -162,7 +160,9 @@ def get_invoices(filters, additional_query_columns):
additional_query_columns = ', ' + ', '.join(additional_query_columns)
conditions = get_conditions(filters)
return frappe.db.sql("""select name, posting_date, debit_to, project, customer, customer_name, owner, remarks,
return frappe.db.sql("""
select name, posting_date, debit_to, project, customer,
customer_name, owner, remarks, territory, tax_id, customer_group,
base_net_total, base_grand_total, base_rounded_total, outstanding_amount {0}
from `tabSales Invoice`
where docstatus = 1 %s order by posting_date desc, name desc""".format(additional_query_columns or '') %
@@ -241,15 +241,6 @@ def get_invoice_cc_wh_map(invoice_list):
return invoice_cc_wh_map
def get_customer_details(customers):
customer_map = {}
for cust in frappe.db.sql("""select name, territory, customer_group from `tabCustomer`
where name in (%s)""" % ", ".join(["%s"]*len(customers)), tuple(customers), as_dict=1):
customer_map.setdefault(cust.name, cust)
return customer_map
def get_mode_of_payments(invoice_list):
mode_of_payments = {}
if invoice_list:

View File

@@ -51,7 +51,7 @@ def validate_filters(filters):
filters.to_date = filters.year_end_date
def get_data(filters):
accounts = frappe.db.sql("""select name, parent_account, account_name, root_type, report_type, lft, rgt
accounts = frappe.db.sql("""select name, account_number, parent_account, account_name, root_type, report_type, lft, rgt
from `tabAccount` where company=%s order by lft""", filters.company, as_dict=True)
company_currency = erpnext.get_company_currency(filters.company)
@@ -162,8 +162,6 @@ def calculate_values(accounts, gl_entries_by_account, opening_balances, filters,
total_row["credit"] += d["credit"]
total_row["opening_debit"] += d["opening_debit"]
total_row["opening_credit"] += d["opening_credit"]
total_row["closing_debit"] += (d["opening_debit"] + d["debit"])
total_row["closing_credit"] += (d["opening_credit"] + d["credit"])
return total_row
@@ -176,16 +174,19 @@ def accumulate_values_into_parents(accounts, accounts_by_name):
def prepare_data(accounts, filters, total_row, parent_children_map, company_currency):
data = []
total_row["closing_debit"] = total_row["closing_credit"] = 0
for d in accounts:
has_value = False
row = {
"account_name": d.account_name,
"account": d.name,
"parent_account": d.parent_account,
"indent": d.indent,
"from_date": filters.from_date,
"to_date": filters.to_date,
"currency": company_currency
"currency": company_currency,
"account_name": ('{} - {}'.format(d.account_number, d.account_name)
if d.account_number else d.account_name)
}
prepare_opening_and_closing(d)
@@ -200,6 +201,10 @@ def prepare_data(accounts, filters, total_row, parent_children_map, company_curr
row["has_value"] = has_value
data.append(row)
if not d.parent_account:
total_row["closing_debit"] += (d["debit"] - d["credit"]) if (d["debit"] - d["credit"]) > 0 else 0
total_row["closing_credit"] += abs(d["debit"] - d["credit"]) if (d["debit"] - d["credit"]) < 0 else 0
data.extend([{},total_row])
return data

View File

@@ -252,7 +252,7 @@ def add_ac(args=None):
if not ac.parent_account:
ac.parent_account = args.get("parent")
if ac.is_root:
if getattr(ac, 'is_root', None):
ac.parent_account=''
ac.old_parent = ""

View File

@@ -5,6 +5,7 @@
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class Crop(Document):
def validate(self):
@@ -12,7 +13,7 @@ class Crop(Document):
for task in self.agriculture_task:
# validate start_day is not > end_day
if task.start_day > task.end_day:
frappe.throw("Start day is greater than end day in task '{0}'".format(task.subject))
frappe.throw(_("Start day is greater than end day in task '{0}'").format(task.task_name))
# to calculate the period of the Crop Cycle
if task.end_day > max_period: max_period = task.end_day
if max_period > self.period: self.period = max_period

View File

@@ -5,6 +5,7 @@
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class Disease(Document):
def validate(self):
@@ -12,7 +13,7 @@ class Disease(Document):
for task in self.treatment_task:
# validate start_day is not > end_day
if task.start_day > task.end_day:
frappe.throw("Start day is greater than end day in task '{0}'".format(task.task_name))
frappe.throw(_("Start day is greater than end day in task '{0}'").format(task.task_name))
# to calculate the period of the Crop Cycle
if task.end_day > max_period: max_period = task.end_day
self.treatment_period = max_period

View File

@@ -6,6 +6,7 @@ from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils import flt, cint
from frappe import _
class SoilTexture(Document):
soil_edit_order = [2, 1, 0]
@@ -20,9 +21,9 @@ class SoilTexture(Document):
self.update_soil_edit('sand_composition')
for soil_type in self.soil_types:
if self.get(soil_type) > 100 or self.get(soil_type) < 0:
frappe.throw("{0} should be a value between 0 and 100".format(soil_type))
frappe.throw(_("{0} should be a value between 0 and 100").format(soil_type))
if sum(self.get(soil_type) for soil_type in self.soil_types) != 100:
frappe.throw('Soil compositions do not add up to 100')
frappe.throw(_('Soil compositions do not add up to 100'))
def update_soil_edit(self, soil_type):
self.soil_edit_order[self.soil_types.index(soil_type)] = max(self.soil_edit_order)+1

View File

@@ -5,6 +5,7 @@
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class WaterAnalysis(Document):
def load_contents(self):
@@ -18,6 +19,6 @@ class WaterAnalysis(Document):
def validate(self):
if self.collection_datetime > self.laboratory_testing_datetime:
frappe.throw('Lab testing datetime cannot be before collection datetime')
frappe.throw(_('Lab testing datetime cannot be before collection datetime'))
if self.laboratory_testing_datetime > self.result_datetime:
frappe.throw('Lab result datetime cannot be before testing datetime')
frappe.throw(_('Lab result datetime cannot be before testing datetime'))

View File

@@ -23,6 +23,14 @@ frappe.ui.form.on('Asset', {
}
};
});
frm.set_query("cost_center", function() {
return {
"filters": {
"company": frm.doc.company,
}
};
});
},
refresh: function(frm) {
@@ -59,11 +67,33 @@ frappe.ui.form.on('Asset', {
frm.trigger("create_asset_maintenance");
}, __("Make"));
}
if (!frm.doc.calculate_depreciation) {
frm.add_custom_button(__("Depreciation Entry"), function() {
frm.trigger("make_journal_entry");
}, __("Make"));
}
frm.page.set_inner_btn_group_as_primary(__("Make"));
frm.trigger("setup_chart");
}
},
make_journal_entry: function(frm) {
frappe.call({
method: "erpnext.assets.doctype.asset.asset.make_journal_entry",
args: {
asset_name: frm.doc.name
},
callback: function(r) {
if (r.message) {
var doclist = frappe.model.sync(r.message);
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
}
}
})
},
setup_chart: function(frm) {
var x_intervals = [frm.doc.purchase_date];
var asset_values = [frm.doc.gross_purchase_amount];

View File

@@ -415,6 +415,37 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cost_center",
"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": "Cost Center",
"length": 0,
"no_copy": 0,
"options": "Cost Center",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -1221,7 +1252,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-12-19 12:58:44.137460",
"modified": "2018-07-17 06:30:25.506194",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset",

View File

@@ -51,9 +51,6 @@ class Asset(Document):
if not self.get(field):
self.set(field, value)
self.value_after_depreciation = (flt(self.gross_purchase_amount) -
flt(self.opening_accumulated_depreciation))
def validate_asset_values(self):
if flt(self.expected_value_after_useful_life) >= flt(self.gross_purchase_amount):
frappe.throw(_("Expected Value After Useful Life must be less than Gross Purchase Amount"))
@@ -61,7 +58,10 @@ class Asset(Document):
if not flt(self.gross_purchase_amount):
frappe.throw(_("Gross Purchase Amount is mandatory"), frappe.MandatoryError)
if not self.is_existing_asset and self.calculate_depreciation:
if not self.calculate_depreciation:
return
if not self.is_existing_asset:
self.opening_accumulated_depreciation = 0
self.number_of_depreciations_booked = 0
if not self.next_depreciation_date:
@@ -81,6 +81,9 @@ class Asset(Document):
if cint(self.number_of_depreciations_booked) > cint(self.total_number_of_depreciations):
frappe.throw(_("Number of Depreciations Booked cannot be greater than Total Number of Depreciations"))
self.value_after_depreciation = (flt(self.gross_purchase_amount) -
flt(self.opening_accumulated_depreciation))
if self.next_depreciation_date and getdate(self.next_depreciation_date) < getdate(nowdate()):
frappe.msgprint(_("Next Depreciation Date is entered as past date"), title=_('Warning'), indicator='red')
@@ -106,12 +109,13 @@ class Asset(Document):
n * cint(self.frequency_of_depreciation))
depreciation_amount = self.get_depreciation_amount(value_after_depreciation)
value_after_depreciation -= flt(depreciation_amount)
if depreciation_amount:
value_after_depreciation -= flt(depreciation_amount)
self.append("schedules", {
"schedule_date": schedule_date,
"depreciation_amount": depreciation_amount
})
self.append("schedules", {
"schedule_date": schedule_date,
"depreciation_amount": depreciation_amount
})
def set_accumulated_depreciation(self):
accumulated_depreciation = flt(self.opening_accumulated_depreciation)
@@ -279,3 +283,34 @@ def get_item_details(item_code):
})
return ret
@frappe.whitelist()
def make_journal_entry(asset_name):
asset = frappe.get_doc("Asset", asset_name)
fixed_asset_account, accumulated_depreciation_account, depreciation_expense_account = \
get_depreciation_accounts(asset)
depreciation_cost_center, depreciation_series = frappe.db.get_value("Company", asset.company,
["depreciation_cost_center", "series_for_depreciation_entry"])
depreciation_cost_center = asset.cost_center or depreciation_cost_center
je = frappe.new_doc("Journal Entry")
je.voucher_type = "Depreciation Entry"
je.naming_series = depreciation_series
je.company = asset.company
je.remark = "Depreciation Entry against asset {0}".format(asset_name)
je.append("accounts", {
"account": depreciation_expense_account,
"reference_type": "Asset",
"reference_name": asset.name,
"cost_center": depreciation_cost_center
})
je.append("accounts", {
"account": accumulated_depreciation_account,
"reference_type": "Asset",
"reference_name": asset.name
})
return je

View File

@@ -5,13 +5,13 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, today, getdate
from frappe.utils import flt, today, getdate, cint
def post_depreciation_entries(date=None):
# Return if automatic booking of asset depreciation is disabled
if not frappe.db.get_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically"):
if not cint(frappe.db.get_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically")):
return
if not date:
date = today()
for asset in get_depreciable_assets(date):
@@ -38,7 +38,7 @@ def make_depreciation_entry(asset_name, date=None):
depreciation_cost_center, depreciation_series = frappe.db.get_value("Company", asset.company,
["depreciation_cost_center", "series_for_depreciation_entry"])
depreciation_cost_center = asset.cost_center or depreciation_cost_center
for d in asset.get("schedules"):
if not d.journal_entry and getdate(d.schedule_date) <= getdate(date):
@@ -151,13 +151,12 @@ def restore_asset(asset_name):
asset.set_status()
@frappe.whitelist()
def get_gl_entries_on_asset_disposal(asset, is_sale=False):
def get_gl_entries_on_asset_disposal(asset, selling_amount=0):
fixed_asset_account, accumulated_depr_account, depr_expense_account = get_depreciation_accounts(asset)
accumulated_depr_amount = flt(asset.gross_purchase_amount) - flt(asset.value_after_depreciation)
disposal_account, depreciation_cost_center = get_disposal_account_and_cost_center(asset.company)
depreciation_cost_center = asset.cost_center or depreciation_cost_center
expense_account, cost_center = get_disposal_account_and_cost_center(asset.company)
if is_sale:
expense_account = depr_expense_account
accumulated_depr_amount = flt(asset.gross_purchase_amount) - flt(asset.value_after_depreciation)
gl_entries = [
{
@@ -172,12 +171,14 @@ def get_gl_entries_on_asset_disposal(asset, is_sale=False):
}
]
if flt(asset.value_after_depreciation):
profit_amount = flt(selling_amount) - flt(asset.value_after_depreciation)
if profit_amount:
debit_or_credit = "debit" if profit_amount < 0 else "credit"
gl_entries.append({
"account": expense_account,
"cost_center": cost_center,
"debit": flt(asset.value_after_depreciation),
"debit_in_account_currency": flt(asset.value_after_depreciation)
"account": disposal_account,
"cost_center": depreciation_cost_center,
debit_or_credit: abs(profit_amount),
debit_or_credit + "_in_account_currency": abs(profit_amount)
})
return gl_entries

View File

@@ -234,9 +234,8 @@ class TestAsset(unittest.TestCase):
expected_gle = (
("_Test Accumulated Depreciations - _TC", 30000.0, 0.0),
("_Test Depreciations - _TC", 70000.0, 0.0),
("_Test Fixed Asset - _TC", 0.0, 100000.0),
("_Test Gain/Loss on Asset Disposal - _TC", 0.0, 25000.0),
("_Test Gain/Loss on Asset Disposal - _TC", 45000.0, 0.0),
("Debtors - _TC", 25000.0, 0.0)
)

View File

@@ -22,7 +22,7 @@ frappe.ui.form.on('Asset Category', {
var d = locals[cdt][cdn];
return {
"filters": {
"root_type": "Asset",
"account_type": "Accumulated Depreciation",
"is_group": 0,
"company": d.company_name
}
@@ -41,4 +41,4 @@ frappe.ui.form.on('Asset Category', {
});
}
});
});

View File

@@ -3,7 +3,7 @@
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:maintenance_task",
"autoname": "",
"beta": 0,
"creation": "2017-10-20 07:10:55.903571",
"custom": 0,
@@ -42,7 +42,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 1
"unique": 0
},
{
"allow_bulk_edit": 0,
@@ -625,7 +625,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-11-28 12:22:34.151430",
"modified": "2018-06-18 16:12:04.330021",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset Maintenance Task",

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