Compare commits

...

760 Commits

Author SHA1 Message Date
Nabin Hait
67b6e2fbba Merge branch 'hotfix' 2016-12-09 15:45:45 +05:30
Nabin Hait
10de98c0be bumped to version 7.1.23 2016-12-09 16:15:45 +06:00
Nabin Hait
00ae31bd1c Merge pull request #7172 from nabinhait/hotfix
Issue fixed in Quality Inspection, P&L period and purchase register
2016-12-09 15:44:05 +05:30
Nabin Hait
6bfdd63ec8 Merge pull request #7171 from rohitwaghchaure/payment_entry_issue
[Fix] Payment entry showing wrong invoice amount
2016-12-09 15:11:38 +05:30
Nabin Hait
b00df641e0 Fixed period end date if year starts in the middle of the month 2016-12-09 15:09:11 +05:30
Nabin Hait
76a8508d2b Unlink Quality Inspection from PR while cancelling QI 2016-12-09 15:09:11 +05:30
Nabin Hait
43df804176 Fixed renamed fieldname 2016-12-09 15:09:11 +05:30
Rohit Waghchaure
e505067887 [Fix] Payment entry showing wrong invoice amount 2016-12-09 12:55:29 +05:30
Nabin Hait
a0fc404eb8 Merge pull request #7164 from KanchanChauhan/quoted-item-comparison-report-fix
[Fix] Quoted Item Comparison
2016-12-09 12:18:06 +05:30
Nabin Hait
8e885163a3 Update quoted_item_comparison.py 2016-12-09 12:17:45 +05:30
Nabin Hait
e70a284f8e Merge pull request #7167 from webonyx/fix_v7_1_20_patch
Fix patch update_status_of_po_so.py
2016-12-09 11:51:30 +05:30
Viet Pham
ddb856377c Fix patch update_status_of_po_so.py caused error: Column 'per_billed' cannot be null 2016-12-08 20:02:39 +07:00
Kanchan Chauhan
5c031a3512 [Fix] Quoted Item Comparison 2016-12-08 17:29:04 +05:30
Nabin Hait
7b91181fa0 Merge branch 'hotfix' 2016-12-08 12:33:53 +05:30
Nabin Hait
7b513891e3 bumped to version 7.1.22 2016-12-08 13:03:53 +06:00
Nabin Hait
cfe6182798 Merge pull request #7158 from rohitwaghchaure/timesheet_issue_po
minor issue
2016-12-08 12:15:44 +05:30
Rohit Waghchaure
86ed030b5c minor issue 2016-12-07 19:17:01 +05:30
Nabin Hait
07e4fd17af Merge pull request #7157 from rohitwaghchaure/timesheet_po_issue
[fix] Timesheet datetime issue
2016-12-07 18:37:02 +05:30
Rohit Waghchaure
0327b35b5e [fix] timesheet datetime issue 2016-12-07 18:32:36 +05:30
Nabin Hait
5c3564143b Merge branch 'hotfix' 2016-12-06 16:14:44 +05:30
Nabin Hait
bc2deafcf9 bumped to version 7.1.21 2016-12-06 16:44:44 +06:00
Nabin Hait
45fda8a257 Merge pull request #7149 from KanchanChauhan/salary-slip-validation-in-leave
[Minor] Validation fixes in Leave Application and Monthly Salary Register Fix for other laguages
2016-12-06 16:01:38 +05:30
Nabin Hait
67d226f491 Merge pull request #7127 from KanchanChauhan/salary-slip-fix
[Fix] lwp issue fixed for salary slip without salary structure
2016-12-06 15:48:47 +05:30
Nabin Hait
cb3f44716a Merge pull request #7139 from rohitwaghchaure/customer_billing_amount_issue
[Fix] Currecny symbol for customer's total annual billing, total unpaid amount
2016-12-06 15:42:37 +05:30
Nabin Hait
9313a7408c Merge pull request #7144 from rohitwaghchaure/report_builder_total_row_issue
[Enhancement] Total row added for report builder
2016-12-06 15:42:19 +05:30
Nabin Hait
e644ca8992 Merge pull request #7146 from RobertSchouten/digest_cache_dev
[fix] email digest cache by frequency
2016-12-06 15:41:33 +05:30
Nabin Hait
cacfb6839f Merge pull request #7138 from rohitwaghchaure/so_po_status_issue
[Fix] Status of sales order and purchase order
2016-12-06 15:40:57 +05:30
Kanchan Chauhan
dc80b35104 [Minor] Apply Salary Slip validation only if it is submitted 2016-12-06 15:37:24 +05:30
Nabin Hait
b9ebbf18f2 Merge pull request #7143 from rohitwaghchaure/customer_credit_issue
[fix] test cases for customer credit
2016-12-06 15:36:18 +05:30
robert schouten
7f72cd0f97 [fix] email digest cache by frequency 2016-12-06 08:51:40 +08:00
Rohit Waghchaure
6f6a533d66 [fix] salary slip working days 2016-12-05 23:33:02 +05:30
Rohit Waghchaure
36a01d3464 [Enhancement] Total row added for report builder 2016-12-05 18:59:59 +05:30
Rohit Waghchaure
bcc6ea450a [fix] test cases for customer credit 2016-12-05 18:32:57 +05:30
Rohit Waghchaure
c857f37f3a [fix] currecny symbol for customer's total annual billing, total unpaid amount 2016-12-05 17:44:06 +05:30
Rohit Waghchaure
82fa27c36f [Fix] Status of sales order and purchase order 2016-12-05 16:32:23 +05:30
Nabin Hait
12a396ef25 Merge pull request #7107 from RobertSchouten/timesheetdates
calc timesheet dates on validate not just submit
2016-12-05 14:23:21 +05:30
Kanchan Chauhan
4a888b4c91 [Fix] lwp issue fixed for salary slip without salary structure 2016-12-04 13:42:30 +05:30
Nabin Hait
d97ec828b5 Merge pull request #7113 from rohitwaghchaure/edit_serial_no
Allow user to edit serial no for credit note, debit note
2016-12-01 18:06:58 +05:30
Nabin Hait
1f1ffd79e2 Merge pull request #7109 from RobertSchouten/project_wise
[fix] Project wise Stock Tracking is script report
2016-12-01 16:12:46 +05:30
Nabin Hait
c92e2f9044 Update project_wise_stock_tracking.json 2016-12-01 16:12:35 +05:30
Rohit Waghchaure
2e8a94458d allow user to edit serial no for credit note, debit note 2016-12-01 16:04:41 +05:30
Nabin Hait
79f0a97431 Merge pull request #7112 from KanchanChauhan/salary-slip-issue
[Fix] Fixed condition and formula issue in Salary Slip
2016-12-01 15:56:52 +05:30
Kanchan Chauhan
faa525e4f1 [Fix] Fixed condition and formula issue in Salary Slip 2016-12-01 15:31:38 +05:30
robert schouten
81a5467c8f [fix] Project wise Stock Tracking is script report 2016-12-01 09:02:17 +08:00
robert schouten
0beb5bdea6 calc timesheet dates on validate not just submit 2016-12-01 08:51:03 +08:00
Nabin Hait
de932911b5 Merge branch 'hotfix' 2016-11-28 14:22:54 +05:30
Nabin Hait
edfca16931 bumped to version 7.1.20 2016-11-28 14:52:54 +06:00
Nabin Hait
50a240e758 Merge pull request #7061 from rohitwaghchaure/cost_center_issue
[Fix] Cost center group not showing data in the P&L report
2016-11-28 12:42:48 +05:30
Nabin Hait
96be3dd4f4 Merge pull request #7082 from rohitwaghchaure/pos_qty_issues
[Fix] Wrong actual qty showing in POS
2016-11-28 12:39:09 +05:30
Nabin Hait
1880fc46d3 Merge pull request #7084 from nabinhait/hotfix
Multiple minor fixes
2016-11-28 12:38:48 +05:30
Nabin Hait
a78c463e97 Multiple minor fixes 2016-11-27 16:32:41 +05:30
Rohit Waghchaure
80f5bb6a6c [Fix] Wrong actual qty showing in POS 2016-11-27 12:04:12 +05:30
Nabin Hait
d0839799c1 Update workstation.py 2016-11-26 09:54:00 +05:30
Rohit Waghchaure
bca0d73e1c [Fix] Cost center group not showing data in the P&L report 2016-11-25 14:54:34 +05:30
Nabin Hait
14823d0d0f Merge pull request #7066 from rohitwaghchaure/pos_barcode_search_issue
[fix] Barcode and special character issue in the search box of the POS
2016-11-25 11:20:55 +05:30
Rohit Waghchaure
9a36083095 [fix] Barcode and special character issue in the search box of the POS 2016-11-25 11:17:48 +05:30
Nabin Hait
1e3d14fda7 Merge pull request #7051 from rohitwaghchaure/v7_timesheet_cleanup
cleanup timesheet and fix sales invoice total timesheet billing amount
2016-11-24 13:06:04 +05:30
Rohit Waghchaure
8c4e45ab3d cleanup timesheet 2016-11-23 17:54:47 +05:30
Nabin Hait
6fc850d071 Merge branch 'hotfix' 2016-11-23 16:00:22 +05:30
Nabin Hait
580534a22a bumped to version 7.1.19 2016-11-23 16:30:22 +06:00
Nabin Hait
297d74a997 Unlink payment entries on cancellation of invoice 2016-11-23 15:59:00 +05:30
Nabin Hait
b8a7926464 Merge branch 'hotfix' 2016-11-23 14:53:42 +05:30
Nabin Hait
7f540af7a6 bumped to version 7.1.18 2016-11-23 15:23:42 +06:00
Nabin Hait
b18ad55e2b minor fixes 2016-11-23 14:51:30 +05:30
Nabin Hait
b439afb5e5 Merge pull request #7045 from saurabh6790/root_type_fix_and_other
[fix] Root type fix
2016-11-23 14:46:05 +05:30
Nabin Hait
cf895c220c Update account_tree.js 2016-11-23 14:44:07 +05:30
Saurabh
9342f650e0 [fix] remove root type selection while created new node and hooks call to initialize payment gateway 2016-11-23 14:06:14 +05:30
Nabin Hait
b91aed807a Merge pull request #7042 from RobertSchouten/naming_series
[fix] naming series only show non disabled role doctypes
2016-11-23 13:26:19 +05:30
robert schouten
085706bcbf [fix] naming series only show non disabled role doctypes 2016-11-23 13:57:21 +08:00
Rushabh Mehta
8685225644 Merge branch 'hotfix' 2016-11-22 23:18:28 +05:30
Rushabh Mehta
6557e37d5c bumped to version 7.1.17 2016-11-22 23:48:28 +06:00
Rushabh Mehta
698c040d21 [hot] fix quotation (#7039) 2016-11-22 23:16:40 +05:30
Nabin Hait
c381327e6e Merge pull request #7032 from rohitwaghchaure/patch_issue
fix patch
2016-11-22 13:51:51 +05:30
Rohit Waghchaure
334f032780 fix patch 2016-11-22 13:30:13 +05:30
Nabin Hait
ee874a2a36 Update student_admission.py 2016-11-22 12:42:24 +05:30
Nabin Hait
8132be288f Merge branch 'hotfix' 2016-11-21 19:10:05 +05:30
Nabin Hait
d75d3a927d bumped to version 7.1.16 2016-11-21 19:40:05 +06:00
Nabin Hait
651d8e996b Merge pull request #7020 from nabinhait/balance_sheet_fix
Provisional Loss related fix in Balance Sheet. Fixed #6918
2016-11-21 19:06:42 +05:30
Nabin Hait
d01d74cafd Merge pull request #7019 from nabinhait/fix_10014
Default warehouse is mandatory only for stock item in POS. Fixed #6893
2016-11-21 19:06:30 +05:30
Nabin Hait
9789b50ae5 Merge pull request #7018 from nabinhait/fix_10013
Set project from Sales Order while creating Material Request from PPT, fixed #6731
2016-11-21 19:06:14 +05:30
Nabin Hait
5224a04628 Merge pull request #7016 from nabinhait/fix_10012
Set WIP warehouse in Pro Order based on Manufacturing Settings. Fixed #6636
2016-11-21 19:05:50 +05:30
Nabin Hait
bdab3103e3 Merge pull request #7015 from nabinhait/fix_10011
Multiple fixes
2016-11-21 19:05:34 +05:30
Nabin Hait
376e8945f7 Merge pull request #7014 from rohitwaghchaure/rename_autoname_field
patch for rename autoname field
2016-11-21 19:04:44 +05:30
Nabin Hait
3d5ef804b2 Provisional Loss related fix in Balance Sheet. Fixed #6918 2016-11-21 18:53:05 +05:30
Nabin Hait
977eff911f Default warehouse is mandatory only for stock item in POS. Fixed #6893 2016-11-21 18:29:16 +05:30
Nabin Hait
9b797974b5 Set project from Sales Order while creating Material Request from PPT, fixed #6731 2016-11-21 18:15:50 +05:30
Nabin Hait
075e33245e Set WIP warehouse in Pro Order based on Manufacturing Settings. Fixed #6636 2016-11-21 18:09:55 +05:30
Nabin Hait
fd23fa7c0b Prifitability report link added to accounts module page 2016-11-21 16:59:03 +05:30
Nabin Hait
542bf8f7d4 Party filter and total row for opening and closing in trial balance for party report 2016-11-21 16:58:50 +05:30
Rohit Waghchaure
4810d1fa2d patch for rename autoname field 2016-11-21 16:52:50 +05:30
Nabin Hait
8d161ef2e1 Merge pull request #6899 from shreyasp/docs-update
Updated Docs for Purchase Order and Supplier Quotation
2016-11-21 15:28:27 +05:30
Nabin Hait
e60d51b74c Merge pull request #6969 from rohitwaghchaure/pos_syncing_issue_and_enhancement
User can able to add multiple item group, customer group in the POS profile.
2016-11-21 15:27:41 +05:30
Nabin Hait
b30e184f6b Merge pull request #7003 from KanchanChauhan/workstation-fix
[Fix]Workstation holiday list
2016-11-21 14:51:24 +05:30
Nabin Hait
0900407c18 Merge pull request #7010 from rmehta/duplicate-icon-patch-fix
[patch] reload desktop icon #6826
2016-11-21 14:50:36 +05:30
Nabin Hait
c16b373969 Merge pull request #6994 from nabinhait/manual_depreciation
Manual Depreciation Schedule for Asset
2016-11-21 14:49:58 +05:30
Rushabh Mehta
e9fc31168d [patch] reload desktop icon #6826 2016-11-21 14:29:31 +05:30
Kanchan Chauhan
d33c44e3a5 [Fix]Workstation holiday list 2016-11-21 11:23:01 +05:30
Rohit Waghchaure
a27c417e48 fix master data sync performance issue 2016-11-20 23:41:13 +05:30
Nabin Hait
cbd26e3b2c Manual Depreciation Schedule for Asset 2016-11-18 17:19:45 +05:30
Rohit Waghchaure
2a81960e0b test cases 2016-11-18 15:33:11 +05:30
Rohit Waghchaure
801029e055 Added item groups, customer groups in the POS profile. 2016-11-18 15:32:48 +05:30
Nabin Hait
c29c5210f9 Merge pull request #6972 from RobertSchouten/bankstatement
[fix] update bank recon statement printing for payment entries
2016-11-18 12:50:40 +05:30
Nabin Hait
a3a59ea895 Merge pull request #6973 from RobertSchouten/bankrecon
[fix] layout for bank reconciliation
2016-11-18 12:49:16 +05:30
Nabin Hait
684d44385f Merge pull request #6991 from rohitwaghchaure/delivery_note_issue
[Fix] Delivery note, show paking items in order, show serial no of the respective item in the dropdown of packing item
2016-11-18 12:45:31 +05:30
Nabin Hait
eae077e05d Merge pull request #6989 from RobertSchouten/financialprint
[fix] financial printing and add to profitability
2016-11-18 12:44:50 +05:30
Rohit Waghchaure
e887e92dd4 Minor fix in delivery note, show paking items in order, show serial no of the respective item in the dropdown of packing item 2016-11-18 12:16:22 +05:30
robert schouten
0a1f3e4058 [fix] financial printing and add to profitability 2016-11-18 10:54:01 +08:00
Nabin Hait
05d0cd9574 Merge pull request #6982 from rohitwaghchaure/pos_is_pos_default_issue
[Fix] Onload pull pos profile data for IS POS invoice
2016-11-17 18:29:22 +05:30
Rohit Waghchaure
2ef7c7ae5c [Fix] Onload pull pos profile data for IS POS invoice 2016-11-17 17:29:10 +05:30
Nabin Hait
d79cca3ba7 Merge branch 'hotfix' 2016-11-17 16:41:51 +05:30
Nabin Hait
f83302836c bumped to version 7.1.15 2016-11-17 17:11:51 +06:00
Nabin Hait
bd99a7cb5d Merge pull request #6980 from shreyasp/setup-wizard-domain
[Fix] Updated 'FR' translation to prevent setup wizard failure
2016-11-17 16:07:43 +05:30
Nabin Hait
29570d1ecb Merge branch 'hotfix' 2016-11-17 15:54:07 +05:30
Nabin Hait
f2b7ec919a bumped to version 7.1.14 2016-11-17 16:24:07 +06:00
Nabin Hait
f76aab6021 Merge pull request #6976 from saurabh6790/advance_payment_entry_cancellation_fix
[fix] on advance payment entry cancellation delink invoice and pyamen…
2016-11-17 15:41:31 +05:30
robert schouten
2b63e14089 dh drop guest from student attendance so disabling acedemic user disables all school doctypes (#6974) 2016-11-17 15:23:38 +05:30
Saurabh
1d210968de [fix] on advance payment entry cancellation delink invoice and pyament entry references 2016-11-17 15:21:46 +05:30
shreyas
0c93445be0 [Fix] Updated 'FR' translation to prevent setup wizard failure 2016-11-17 14:31:32 +05:30
Nabin Hait
7fc05d6432 Update update_missing_salary_component_type.py 2016-11-17 12:16:52 +05:30
robert schouten
a943535520 [fix] update bank recon statement printing for payment entries 2016-11-17 14:33:28 +08:00
robert schouten
60fb1b8643 [fix] layout for bank reconciliation 2016-11-17 14:30:47 +08:00
Nabin Hait
aa68058910 Updated modified_datetime in production planning tool 2016-11-16 17:41:08 +05:30
Nabin Hait
8dd859920f Merge pull request #6960 from KanchanChauhan/thumbnail-in-shoppingcart
[Fix]Product thumbnail in Shopping Cart
2016-11-16 17:34:17 +05:30
Nabin Hait
7f6b99aca4 Merge pull request #6962 from KanchanChauhan/payroll-fixes
[Fix] Filters to get employee in Payroll
2016-11-16 17:34:00 +05:30
Nabin Hait
01dc2e412d Merge pull request #6964 from mbauskar/hotfix
[minor] fixes in validate selling price
2016-11-16 17:32:11 +05:30
mbauskar
e9747a8a6e [minor] fixes in validate selling price 2016-11-16 17:19:47 +05:30
Kanchan Chauhan
7652b857c8 [Fix] Filters to get employee in Payroll 2016-11-16 15:29:01 +05:30
Kanchan Chauhan
98f499a43e [Fix]Product thumbnail in Shopping Cart 2016-11-16 15:17:55 +05:30
Nabin Hait
535462fc20 Merge pull request #6947 from saurabh6790/delink_jv_from_advance
[fix] delink jv from advance table
2016-11-16 14:22:03 +05:30
Nabin Hait
e346a499c7 Merge pull request #6956 from rohitwaghchaure/payment_entry_issue
[Fix] Payment entry, exchange rate is not set properly
2016-11-16 14:15:52 +05:30
Saurabh
8adbfa8a09 [test-case] test cases for delinking advance payments 2016-11-16 13:43:01 +05:30
Saurabh
866c295989 [fix] on jv cancel remove linkings from advance table of Sales/Purchase Invoice 2016-11-16 13:43:01 +05:30
Nabin Hait
67bceef1cb Merge branch 'hotfix' 2016-11-16 12:55:59 +05:30
Nabin Hait
38bfcaa203 bumped to version 7.1.13 2016-11-16 13:25:59 +06:00
Nabin Hait
00e841d744 update missing salary component abbr 2016-11-16 12:55:17 +05:30
Rohit Waghchaure
9b18ed4ffe [Fix] Payment entry, exchange rate is not set properly 2016-11-16 12:24:40 +05:30
Rushabh Mehta
d65d67e0a7 Merge branch 'hotfix' 2016-11-16 11:26:42 +05:30
Rushabh Mehta
a78bac61cc bumped to version 7.1.12 2016-11-16 11:56:42 +06:00
rohitwaghchaure
48cb3d89b6 [Fix] Opening balance calculation issue for balance sheet (#6945) 2016-11-16 11:18:49 +05:30
Rushabh Mehta
8dfbe7c748 [fix] patch missing salary component type based on existing salary slips (#6955) 2016-11-16 11:18:20 +05:30
Shreyas Patil
99a3593a0d [Fix] Make from_date and to_date for stock balance query report as mandatory fields (#6948) 2016-11-16 11:16:44 +05:30
rohitwaghchaure
7be942db54 [Fix] Status updater for sales order in purchase order (#6944) 2016-11-16 11:14:32 +05:30
Rushabh Mehta
24f658d633 [fix] [minor] accounts receivable not translated (#6943) 2016-11-16 11:13:46 +05:30
Rushabh Mehta
d51e1587d5 [fix] contact us page should create a opportunity by default (#6939) 2016-11-16 11:13:31 +05:30
rohitwaghchaure
b3ba7f01ef [Fix] PO status not changed as material return created against them (#6869) 2016-11-16 11:10:10 +05:30
Rushabh Mehta
e0ab64d6cc [minor] reload user for patch 2016-11-15 16:43:37 +05:30
Nabin Hait
952b1cb9a7 Merge pull request #6933 from rohitwaghchaure/remove_no_copy
disable no copy for po number, po date on sales order
2016-11-14 17:47:57 +05:30
Rohit Waghchaure
6f27f580e1 disable no copy for po number, po date on sales order 2016-11-14 16:08:18 +05:30
Rushabh Mehta
440650d4a2 [fix] view shopping cart dropdown (#6928) 2016-11-14 13:13:53 +05:30
Nabin Hait
6261745366 Merge branch 'hotfix' 2016-11-14 12:42:26 +05:30
Nabin Hait
d209f21e76 bumped to version 7.1.11 2016-11-14 13:12:25 +06:00
Nabin Hait
da4689461a Merge pull request #6926 from nabinhait/hotfix
Multiple fixes
2016-11-14 12:37:11 +05:30
Nabin Hait
a5a733630f [fix] Opportunity loading issue 2016-11-14 12:32:16 +05:30
Nabin Hait
0075c7e659 Purchase Order and Receipt links in Purchase Invoice dashboard 2016-11-14 12:32:16 +05:30
Nabin Hait
7017dc029a Editable grid columns for payment entry 2016-11-14 12:32:16 +05:30
Nabin Hait
f98835036b Merge pull request #6900 from rohitwaghchaure/account_receivable_summary_report_issue
[Report] Company not found in the filter for making auto email report
2016-11-14 12:00:48 +05:30
Nabin Hait
47c8d5fd56 Merge pull request #6924 from nabinhait/hotfix
Fixed multiple minor issues
2016-11-14 11:59:46 +05:30
Nabin Hait
6209f2f75b Merge pull request #6925 from rmehta/setup-wizard-fix
[fix] ignore duplicate names for program, academic term, academic year, course, instructor
2016-11-14 11:59:26 +05:30
Rushabh Mehta
463808ef9e [fix] ignore duplicate names for program, academic term, academic year, course, instructor 2016-11-14 11:21:11 +05:30
Nabin Hait
256a3fef95 Fixed multiple minor issues 2016-11-14 11:10:50 +05:30
Rohit Waghchaure
387c2846aa [Report] Company not found in the filter for making auto email report 2016-11-10 19:13:20 +05:30
shreyas
2cb294c8b4 [Docs] Updated docs for supplier quotation and purchase order 2016-11-10 18:14:33 +05:30
Nabin Hait
598a0c918d [fix] fixed student dashboard issue (#6897) 2016-11-10 17:25:37 +05:30
Nabin Hait
176577b549 Merge branch 'hotfix' 2016-11-10 11:25:33 +05:30
Nabin Hait
27c1f85836 bumped to version 7.1.10 2016-11-10 11:55:33 +06:00
Nabin Hait
84ecaac27d Update set_base_amount_in_invoice_payment_table.py 2016-11-10 11:24:22 +05:30
Nabin Hait
0f2e3a4e95 Merge branch 'hotfix' 2016-11-09 14:55:29 +05:30
Nabin Hait
549de70fa2 bumped to version 7.1.9 2016-11-09 15:25:29 +06:00
Nabin Hait
9e83b70ea8 Merge pull request #6860 from rohitwaghchaure/status_for_sales_invoice
Added status field in sales invoice and purchase invoice
2016-11-09 14:53:03 +05:30
Rohit Waghchaure
2285f90b64 added debit and credit note status 2016-11-09 14:47:24 +05:30
Rohit Waghchaure
2f1db57fe1 Added status field in sales invoice and purchase invoice 2016-11-08 18:49:58 +05:30
Nabin Hait
31f6436f75 [patch] Set base amount in Sales Invoice Payment table 2016-11-08 17:41:14 +05:30
Nabin Hait
cefcf165c4 Merge branch 'hotfix' 2016-11-08 15:22:54 +05:30
Nabin Hait
436d82e60b bumped to version 7.1.8 2016-11-08 15:52:54 +06:00
Nabin Hait
ed05a9928b Merge pull request #6864 from frappe/nabinhait-patch-5
Show transaction id in validation message
2016-11-08 13:23:36 +05:30
Nabin Hait
be06cde5f5 Update gl_entry.py 2016-11-08 13:13:57 +05:30
Nabin Hait
cdc895734f Merge pull request #6819 from rohitwaghchaure/hotfix_issues
cleanup and fixes
2016-11-08 12:05:47 +05:30
Nabin Hait
d2cf4eb1d2 Merge pull request #6851 from rohitwaghchaure/pricing_rule_discount_issue
[POS] Pricing rule discount issue
2016-11-08 12:02:51 +05:30
Rohit Waghchaure
619c40b04a [POS] Pricing rule discount issue 2016-11-07 19:41:10 +05:30
robert schouten
d8bdaeffe3 [fix] include cancel time logs in convert and v6 to v7.1 fix (#6840) 2016-11-07 17:16:39 +05:30
KanchanChauhan
dd01bcc485 Get employee details in Salary Slip (#6837) 2016-11-07 17:09:07 +05:30
robert schouten
27d45a244e [fix]fix name definition in old patch (#6841) 2016-11-07 17:08:37 +05:30
Rohit Waghchaure
0ecad33642 cleanup and fixes 2016-11-05 08:09:21 +05:30
Nabin Hait
dc3d9ac26c Merge branch 'hotfix' 2016-11-04 16:53:17 +05:30
Nabin Hait
a28c2d37f7 bumped to version 7.1.7 2016-11-04 17:23:17 +06:00
Nabin Hait
81f7a265bc Merge pull request #6723 from rohitwaghchaure/enhancement_remember_last_selected_value
Remember last selected value for link field
2016-11-04 16:13:49 +05:30
Nabin Hait
bd2d4762d9 Merge pull request #6817 from nabinhait/hotfix
[fix] float division by zero
2016-11-04 16:06:27 +05:30
Nabin Hait
4c46c3e94a Merge pull request #6774 from KanchanChauhan/salarystruct-process-payroll
[Fix] Error in pulling in Salary Structure fixed
2016-11-04 15:58:44 +05:30
Kanchan Chauhan
63dda84862 [Fix] Error in pulling in Salary Structure fixed 2016-11-04 12:58:05 +05:30
Nabin Hait
e593f170a3 [fix] Patch order changed 2016-11-04 11:43:58 +05:30
Nabin Hait
43d2fec78e [fix] float division by zero 2016-11-04 10:58:30 +05:30
Rohit Waghchaure
0d2f7e62c0 set remember last selected value as true for company field 2016-11-03 16:19:34 +05:30
Nabin Hait
4dc263ee12 Merge branch 'hotfix' 2016-11-03 15:17:38 +05:30
Nabin Hait
bb2ede8fab bumped to version 7.1.6 2016-11-03 15:47:38 +06:00
Nabin Hait
a3f393918d Merge pull request #6807 from nabinhait/hotfix
[fix] Get data in opportunity dashboard
2016-11-03 15:13:03 +05:30
Nabin Hait
9f5f534900 set item rate on first selection of item 2016-11-03 14:54:06 +05:30
Rohit Waghchaure
3844d2cc01 Remember last selected value for link field 2016-11-03 14:49:27 +05:30
Nabin Hait
1ac67b873c [fix] Get data in opportunity dashboard 2016-11-03 11:00:09 +05:30
Nabin Hait
ceca7fbc87 Merge pull request #6780 from rohitwaghchaure/float_issue
Change fieldtype from float to currency
2016-11-03 10:49:05 +05:30
Nabin Hait
4c5bd43ec0 Merge pull request #6794 from neilLasrado/hotfix
Documentation Cleanup
2016-11-03 10:41:23 +05:30
Neil Trini Lasrado
f905ee9f0f Updated documentation for warehouse 2016-11-01 18:58:29 +05:30
Neil Trini Lasrado
8b99a06477 Projected qty image cleanup in documentation 2016-11-01 18:48:52 +05:30
Nabin Hait
e0038b428b Merge pull request #6791 from rohitwaghchaure/documentation_issue
[Fix] jinja syntax in documentation
2016-11-01 18:10:18 +05:30
Rohit Waghchaure
c84072b16f [Fix] jinja syntax issue 2016-11-01 17:58:10 +05:30
Nabin Hait
51eed9a128 Merge branch 'hotfix' 2016-11-01 17:44:43 +05:30
Nabin Hait
74874d5785 bumped to version 7.1.5 2016-11-01 18:14:43 +06:00
Nabin Hait
06fe0c7c9d Merge pull request #6790 from neilLasrado/hotfix
Hotfixes for demo
2016-11-01 17:40:03 +05:30
Nabin Hait
8015d60e97 Merge pull request #6772 from frappe/bcornwellmott-patch-3
[fix] Change communication to Linked
2016-11-01 17:31:38 +05:30
Nabin Hait
6dc30c97bc Merge pull request #6788 from rohitwaghchaure/documentation
Article for adjust withhold amount using payment entry
2016-11-01 17:27:18 +05:30
Nabin Hait
508ca3a1ab Merge pull request #6789 from saurabh6790/hotfix
[fix] set default value as empty frappe dict
2016-11-01 17:26:16 +05:30
Nabin Hait
dec9f2558e Update purchase_receipt.py 2016-11-01 17:24:46 +05:30
Neil Trini Lasrado
6da2b08cea Fixes for demo 2016-11-01 17:05:53 +05:30
Neil Trini Lasrado
9dde085144 Fixes to demo 2016-11-01 17:05:43 +05:30
Neil Trini Lasrado
1569cf8eb3 Fix user for demo 2016-11-01 17:05:35 +05:30
Rohit Waghchaure
60e5e4ac2d change fieldtype from float to currency 2016-11-01 16:32:33 +05:30
Saurabh
0cf7f7aee0 [fix] set default value as empty frappe dict 2016-11-01 16:19:33 +05:30
Rohit Waghchaure
2647c9a6ea article for adjust withhold amount using payment entry 2016-11-01 16:04:00 +05:30
Nabin Hait
4dd76f21c9 Merge branch 'hotfix' 2016-11-01 15:05:53 +05:30
Nabin Hait
c538a55a5a bumped to version 7.1.4 2016-11-01 15:35:53 +06:00
Nabin Hait
aa7a329633 Merge pull request #6783 from rohitwaghchaure/v7_1_issue
Hotfix issues
2016-11-01 14:48:06 +05:30
Rohit Waghchaure
53bb687009 hotfix issues 2016-11-01 13:21:43 +05:30
Nabin Hait
22161566ed Update index.md 2016-11-01 12:36:03 +05:30
Nabin Hait
b8617cfdf9 Merge pull request #6777 from nabinhait/hotfix
[fix] Report GLE for Purchase Invoice with Update Stock option
2016-11-01 12:31:51 +05:30
Nabin Hait
c61892501c [fix] Report GLE for Purchase Invoice with Update Stock option 2016-11-01 11:45:32 +05:30
bcornwellmott
3af67fb2c3 Fix syntax 2016-10-31 08:53:37 -07:00
bcornwellmott
8d083f0d10 [fix] Change communication to Linked
Currently, the Request for Quotation emails are not linked to the RFQ document. This resolves that issue.

https://discuss.erpnext.com/t/open-communications-for-rfq/17184
2016-10-31 06:54:01 -07:00
Nabin Hait
07fa5f1377 Merge pull request #6769 from frappe/nabinhait-patch-4
show relevant warehouses in item dashboard
2016-10-31 17:24:25 +05:30
Nabin Hait
b9f708663c Update item.py 2016-10-31 16:52:17 +05:30
Nabin Hait
6ece870b6e Merge branch 'hotfix' 2016-10-31 16:37:29 +05:30
Nabin Hait
60aa3898c7 bumped to version 7.1.3 2016-10-31 17:07:29 +06:00
Nabin Hait
fd3aefd73d Merge pull request #6763 from rohitwaghchaure/documentation
[Fix] Documentation
2016-10-31 16:35:54 +05:30
Nabin Hait
1764da7ba8 Merge pull request #6766 from nabinhait/hotfix
repost gle for Purchase Invoice with update stock
2016-10-31 16:34:35 +05:30
Nabin Hait
f5f3ef1bae repost gle for Purchase Invoice with update stock 2016-10-31 16:17:10 +05:30
Rohit Waghchaure
4fe4f267f4 [Fix] Documentation 2016-10-31 15:40:59 +05:30
Nabin Hait
1e45ec9237 Merge branch 'hotfix' 2016-10-31 15:04:31 +05:30
Nabin Hait
9a8be357e6 bumped to version 7.1.2 2016-10-31 15:34:31 +06:00
Nabin Hait
44281b7a01 Merge pull request #6719 from frappe/bcornwellmott-patch-1
Fix calendar view for Timesheet
2016-10-29 14:41:42 +05:30
Nabin Hait
e585683db3 Merge pull request #6750 from rohitwaghchaure/country_wise_tax_issue
[Fix] country wise tax, country name issue
2016-10-29 14:37:32 +05:30
Rohit Waghchaure
7488cf1ce1 [Fix] country wise tax, country name issue 2016-10-28 18:01:43 +05:30
Nabin Hait
6f0897c258 Merge branch 'hotfix' 2016-10-27 19:14:54 +05:30
Nabin Hait
9dcb778f17 bumped to version 7.1.1 2016-10-27 19:44:54 +06:00
Nabin Hait
5ad56ef446 Merge pull request #6727 from saurabh6790/hotfix
[enhance] introduce ignore_fields param for _tree and get_query
2016-10-27 19:06:32 +05:30
Saurabh
468e41f24f [enhance] introduce ignore_fields param for _tree and get_query 2016-10-27 15:23:19 +05:30
Nabin Hait
622c05cc60 Merge pull request #6724 from rohitwaghchaure/bank_clearance_report_issue
[Fix] No permission to read report Bank Clearance Summary for account user
2016-10-27 13:48:19 +05:30
Rohit Waghchaure
53a28eb39d [Fix] No permission to read report Bank Clearance Summary for account user 2016-10-27 11:46:10 +05:30
bcornwellmott
7ef2c0fc34 Fix calendar view for Timesheet
All the calendar events for Timesheets show up on one date. This is because there was a change to the timesheet_calendar.js file when the Gantt chart was added, but the get_events for the calendar wasn't fixed at the same time. Just fixing the reference to the start and end times.
2016-10-26 11:02:48 -07:00
Nabin Hait
38c1732304 Merge branch 'develop' 2016-10-26 17:56:16 +05:30
Nabin Hait
62616a03b3 bumped to version 7.1.0 2016-10-26 18:26:16 +06:00
Nabin Hait
afa3697c7f Merge pull request #6717 from frappe/nabinhait-patch-1
Update __init__.py
2016-10-26 17:54:58 +05:30
Nabin Hait
6d1eda812d Update __init__.py 2016-10-26 17:54:47 +05:30
Nabin Hait
72cee33b3a [translations] 2016-10-26 17:45:06 +05:30
Nabin Hait
72a1943c8e Fixed version conflict 2016-10-26 16:41:21 +05:30
Nabin Hait
4c0a9f420f Merge branch 'hotfix' 2016-10-26 16:40:45 +05:30
Nabin Hait
f3882d2699 bumped to version 7.0.63 2016-10-26 17:10:44 +06:00
Nabin Hait
2e12a76d18 Merge pull request #6716 from nabinhait/develop
Change Logs for v7.1
2016-10-26 16:37:10 +05:30
Nabin Hait
7f19a24e5e Merge pull request #6705 from KanchanChauhan/get-serial-no
Fetch serial no by default
2016-10-26 16:31:11 +05:30
Nabin Hait
c5cbde273f Change Logs for v7.1 2016-10-26 16:28:54 +05:30
Kanchan Chauhan
0a3f2c818a Fetch serial no by default 2016-10-26 14:59:43 +05:30
Nabin Hait
683c4798b5 Merge pull request #6714 from KanchanChauhan/balance-sheet-error
[Fix] Error in Balance Sheet Report
2016-10-26 14:27:33 +05:30
Nabin Hait
a3c24385cf Merge pull request #6710 from frappe/bcornwellmott-patch-1
[Minor] Add details to MRs from PPT
2016-10-26 13:06:22 +05:30
Nabin Hait
e0aaea20af Merge pull request #6701 from shreyasp/modify-submit-docs
[Fix] Make purchase order item reqd_date modifiable after submit
2016-10-26 13:05:11 +05:30
Kanchan Chauhan
dc3198a11c [Fix] Error in Balance Sheet Report 2016-10-26 13:05:08 +05:30
Shreyas Patil
6c7d6e095b Update purchase_order_item.json 2016-10-26 12:47:35 +05:30
shreyas
fd04d62c2e [Minor] Added expected_delivery_date to purchase order item doctype 2016-10-26 12:38:31 +05:30
Nabin Hait
821331b3c0 Merge pull request #6712 from neilLasrado/develop
Allow rename of student doctype
2016-10-26 12:32:20 +05:30
Neil Trini Lasrado
a3f2a47020 Allow rename of student doctype 2016-10-26 12:24:27 +05:30
Revant Nandgaonkar
0bb92ab7a0 [docs] Email and Phone validation on Custom Fields (#6703) 2016-10-26 11:05:12 +05:30
bcornwellmott
30df3cd3dc Add description, stock UOM and Min Order Qty to MRs
The material requests currently do not include descriptions, stock UOM and Min Order Quantities. This fix adds them. This is especially critical in the CSV export, which currently is missing all this info.
2016-10-25 14:21:26 -07:00
shreyas
99e063f831 [Fix] Make purchase order item reqd_date modifiable after submit 2016-10-25 12:44:27 +05:30
Nabin Hait
ffd2fc5101 [fix] Validate if warehouse is not linked to any account 2016-10-24 18:54:07 +05:30
Nabin Hait
d662502f3c [fix] Validate if warehouse is not linked to any account 2016-10-24 18:17:57 +05:30
Nabin Hait
c00b17a6e0 Update project.json 2016-10-24 17:53:06 +05:30
Nabin Hait
fe86debf5d [fix] Duplicate salary components 2016-10-24 17:47:18 +05:30
Nabin Hait
7d977a243a Merge pull request #6690 from rohitwaghchaure/v7_pricing_rule_issue
[Fix] Pricing rule discount issue
2016-10-24 16:47:33 +05:30
Nabin Hait
0f9d60099d Merge pull request #6692 from neilLasrado/develop
Typo fix
2016-10-24 16:46:27 +05:30
Nabin Hait
a02fb1541a Merge pull request #6553 from saurabh6790/scrap_management
Scrap management
2016-10-24 16:46:13 +05:30
Nabin Hait
1f3771cdf1 Merge pull request #6687 from KanchanChauhan/lead-changes
Contact by and contact date validations
2016-10-24 16:44:08 +05:30
Rohit Waghchaure
43b508089e [Fix] Pricing rule discount issue 2016-10-24 16:16:24 +05:30
Neil Trini Lasrado
5ddd7acdbd Typo fix 2016-10-24 15:25:47 +05:30
Saurabh
8c3764a6ef test case for scrap item 2016-10-24 13:55:36 +05:30
Saurabh
4ae4eb0eb9 added get_scrap_items param to get_bom_items_as_dict 2016-10-24 13:55:36 +05:30
Saurabh
5a2fa8aac7 [enhance] scrap management 2016-10-24 13:55:36 +05:30
Saurabh
464c27e189 [feature] scrap management 2016-10-24 13:55:36 +05:30
Kanchan Chauhan
a1cedbc7b2 Contact by and contact date validations 2016-10-24 13:51:13 +05:30
Nabin Hait
cf397d3190 Merge pull request #6688 from frappe/umairsy-patch-5
Update domainify.py
2016-10-24 13:43:57 +05:30
Umair Sayed
a56775ce9a Update domainify.py 2016-10-24 13:00:17 +05:30
Nabin Hait
f430d73daf Merge pull request #6662 from PawanMeh/fixes_6363
[fix] #6363
2016-10-24 11:56:43 +05:30
Nabin Hait
00b3443b61 Merge pull request #6653 from shreyasp/cust-credit-limit
[Minor] Do not allow change in credit limit
2016-10-24 11:55:24 +05:30
Nabin Hait
a221f7ec5d Update test_customer.py 2016-10-24 11:27:56 +05:30
Pawan Mehta
297e725727 Update project.json 2016-10-24 11:24:38 +05:30
Nabin Hait
df366a6e9c Merge pull request #6683 from KanchanChauhan/multiple-active-salary-slio
Warning if there are mutliple active salary structures
2016-10-24 11:23:57 +05:30
Mainul Islam
a964db7821 Add multiple emoloyee in salary structure (#6621)
* Add multiple emoloyee in salary structure

* Added in Menu

* Remove Default Value from Company field

* Change Section Label

* Added Button in Salary Structure and set route_options

* Remove Single Doctype

* Add Dialog for Employee Add

* View Employee and Check or Uncheck

* Complete Multiple Employee Add in Employee Table and Neve Entry in Duplicate in Employees

* Employees View Section in Dialog Added Employe Name and set Employee Id as Title

* Delete SIngle Doctype

* Chagne  to

* Remove checkbox

* Remove add button and set primary button
2016-10-24 11:22:00 +05:30
Nabin Hait
1db35ce79a Merge pull request #6651 from shreyasp/del-company-txn
Delete Communications while Deleting Company Transactions
2016-10-24 11:20:29 +05:30
Nabin Hait
6ef8ede280 Merge pull request #6675 from KanchanChauhan/holiday-in-lwp-salaryslip
include_holiday being taken into consideration while calculating lwp
2016-10-24 11:19:43 +05:30
Nabin Hait
5ced4dfe34 Merge pull request #6673 from KanchanChauhan/max-leave-days-in-leave-application-hotfix
[Fix] leave application days should be less than max days leave allowed
2016-10-24 11:18:44 +05:30
pawan
03a77b1b65 [fix] 6363 2016-10-24 11:18:29 +05:30
pawan
46ead70be8 [fix] fixes_6363 2016-10-24 11:18:29 +05:30
pawan
9a43a2a97b [fix] #6363 2016-10-24 11:18:29 +05:30
pawan
28ad58905d [fix] #6363 2016-10-24 11:18:29 +05:30
pawan
8d187def12 [fix] #6363 2016-10-24 11:18:29 +05:30
Nabin Hait
8918dcf54e Merge pull request #6678 from KanchanChauhan/total-leave-days-updated
Total leave days gets updated on date change
2016-10-24 11:13:31 +05:30
Nabin Hait
988f850fe2 Merge pull request #6682 from KanchanChauhan/makebankentry-button-fix
[Fix] Make Bank Entry button depends_on fixed
2016-10-24 11:12:17 +05:30
Nabin Hait
0e75956f81 Merge pull request #6684 from KanchanChauhan/warehouse-based-on-company-MR
Warehouse based on selected Company
2016-10-24 11:09:42 +05:30
shreyas
f09929ea92 [Fix] Updated test cases to handle negative or zero outstanding amount against customer 2016-10-24 10:35:30 +05:30
shreyas
17f43da2a6 [Test] Added test cases to evaluate customer credit limit 2016-10-24 10:21:05 +05:30
shreyas
e05656963a [Minor] Do not allow change in credit limit 2016-10-24 10:21:04 +05:30
shreyas
c48eb45410 [Fix] Use company_fieldname as parameter to the query 2016-10-24 10:18:28 +05:30
shreyas
0f4cb55c3c [Fix] Delete communications before deleting the docs 2016-10-24 10:04:26 +05:30
shreyas
54d8590064 [Fix] Delete communications when user deletes company transactions 2016-10-24 10:04:26 +05:30
Kanchan Chauhan
55106ab66b Warehouse based on selected Company 2016-10-22 21:42:28 +05:30
Kanchan Chauhan
29ce0aab28 Warning if there are mutliple active salary structures 2016-10-22 20:48:44 +05:30
Kanchan Chauhan
c4c966691f [Fix] Make Bank Entry button depends_on fixed 2016-10-22 18:04:48 +05:30
Kanchan Chauhan
a084405bca Total leave days gets updated on date change 2016-10-22 11:55:51 +05:30
Kanchan Chauhan
a1006c0549 include_holiday being taken into consideration while calculating lwp 2016-10-21 17:53:15 +05:30
Kanchan Chauhan
24d580206a [Fix] leave application days should be less than max days leave allowed 2016-10-21 13:01:33 +05:30
Nabin Hait
44e9195378 Merge branch 'DigiThinkIT-develop' into develop 2016-10-20 17:01:44 +05:30
Nabin Hait
db88bd66b0 Merge branch 'develop' of https://github.com/DigiThinkIT/erpnext into DigiThinkIT-develop 2016-10-20 16:59:40 +05:30
Nabin Hait
376449ff41 Merge pull request #6659 from shreyasp/selling-price-validation
[Minor] Validate purchase price against selling price
2016-10-20 16:46:35 +05:30
Nabin Hait
9f26bc16b7 Update selling_controller.py 2016-10-20 16:45:53 +05:30
Nabin Hait
05aa1712ff Merge branch 'rohitwaghchaure-stock_entry_total_amount_issue' into develop 2016-10-20 16:39:35 +05:30
Rohit Waghchaure
69be01aa1b [Stock Entry] Show total amount for purpose Material Issue/Receipt/Transfer 2016-10-20 16:38:30 +05:30
Nabin Hait
725b547641 Merge pull request #6657 from rohitwaghchaure/invoice_unlink_feature
[Feature] Provision to allow unlink the payment against the invoice
2016-10-20 16:36:57 +05:30
Rohit Waghchaure
18fa0d8691 patch to set default value as 1 2016-10-20 16:16:28 +05:30
Nabin Hait
938c858720 Merge pull request #6513 from KanchanChauhan/group-similar-item-in-po
Group similar items in PO
2016-10-20 16:11:24 +05:30
Rohit Waghchaure
7917ff6936 Test cases 2016-10-20 16:11:22 +05:30
Rohit Waghchaure
8055bd39ba [Feature] Provision to allow unlink the payment against the invoice 2016-10-20 16:11:22 +05:30
Nabin Hait
05245d6328 Merge pull request #6661 from KanchanChauhan/demo-fixed-processpayroll-ss
Demo fixed for Process Payroll and Salary Structure
2016-10-20 16:05:08 +05:30
Kanchan Chauhan
1c1e2e9cbe Demo fixed for Process Payroll and Salary Structure 2016-10-20 16:04:09 +05:30
shreyas
e8aaa92816 [Minor] Some more fixes to the code 2016-10-20 15:57:45 +05:30
shreyas
edcba51c8b [Fix] Added check to validate selling price against valuation rate 2016-10-20 15:57:45 +05:30
shreyas
1cfe2d7b45 [Minor] Validate purchase price against selling price 2016-10-20 15:57:45 +05:30
Nabin Hait
6fb7b162e8 Create tax template based on country 2016-10-20 15:56:07 +05:30
Rohit Waghchaure
d23835be84 [Feature] Countrywise sales tax template 2016-10-20 15:56:07 +05:30
Kanchan Chauhan
cce16b29b0 Group similar items in PO 2016-10-20 14:31:34 +05:30
Saurabh
bc0783b527 [fix] duplicate columns in monthly salary report #6623 2016-10-20 12:55:23 +05:30
Kanchan Chauhan
025fbd8f14 Customer group added to Gross Profit report 2016-10-20 12:54:06 +05:30
Nabin Hait
3126c88da2 Merge pull request #6658 from nabinhait/develop
Set prefered contact email in Employee
2016-10-20 12:40:03 +05:30
Nabin Hait
97fa119b37 Set prefered contact email in Employee 2016-10-19 18:26:01 +05:30
Nabin Hait
0702fa2fc6 Fixed version conflict 2016-10-19 16:49:36 +05:30
Nabin Hait
d5e52bc251 Merge branch 'hotfix' 2016-10-19 16:48:05 +05:30
Nabin Hait
13a07c2029 bumped to version 7.0.62 2016-10-19 17:18:04 +06:00
Nabin Hait
9ef4f0dc30 Merge pull request #6640 from rohitwaghchaure/item_projected_qty_issue
[Fix] total projected qty in item master
2016-10-19 16:45:28 +05:30
Rohit Waghchaure
aa8abfa5b3 Test cases added in sales order to check total projected qty 2016-10-19 15:26:10 +05:30
Rohit Waghchaure
ac9172f6df [Fix] total projected qty 2016-10-19 15:06:30 +05:30
Nabin Hait
44b4e5eef3 Merge pull request #6648 from saurabh6790/hotfix
[fix] calculate variance only for submitted budgets
2016-10-19 15:05:11 +05:30
Nabin Hait
ff183eedb9 Fixes for testcases 2016-10-19 14:23:02 +05:30
Nabin Hait
184f6d42cc Merge pull request #6647 from netchampfaris/hotfix
[hotfix] print format image size
2016-10-19 13:05:04 +05:30
Saurabh
afceac620c [fix] calculate variance only for submitted budgets 2016-10-19 12:49:48 +05:30
Faris Ansari
2acbb11923 [fix] print format image size 2016-10-19 12:08:00 +05:30
Nabin Hait
2b03d8f696 Merge pull request #6641 from JayVora-SerpentCS/develop
Pythonic corrections
2016-10-19 10:47:01 +05:30
Nabin Hait
a7a3a497d5 Fixed version conflict 2016-10-18 18:35:42 +05:30
Nabin Hait
b33695138c Merge branch 'hotfix' 2016-10-18 18:35:18 +05:30
Nabin Hait
8872842edf bumped to version 7.0.61 2016-10-18 19:05:18 +06:00
Rushabh Mehta
7791ed845f [hot] [fix] student_dashboard.py 2016-10-18 18:33:19 +05:30
Nabin Hait
a943ec8ff5 Merge pull request #6642 from neilLasrado/develop
Fixes to Schools Module
2016-10-18 18:16:29 +05:30
Neil Trini Lasrado
377da58378 Set Student Name in Program Enrollment 2016-10-18 18:11:52 +05:30
Serpent Consulting Services Pvt Ltd
8b231f7256 Pythonic corrections 2016-10-18 17:30:24 +05:30
Nabin Hait
6cb44133c3 Fixed version conflict 2016-10-18 16:18:34 +05:30
Nabin Hait
498cc1b7e1 Merge branch 'hotfix' 2016-10-18 16:18:17 +05:30
Nabin Hait
170b0cc83c bumped to version 7.0.60 2016-10-18 16:48:17 +06:00
Nabin Hait
d5c4a5c802 Hotfix 2016-10-18 16:17:37 +05:30
Nabin Hait
fa1cdd5bf0 Fixed merge conflict 2016-10-18 15:37:33 +05:30
Nabin Hait
a1099d28b8 Merge branch 'hotfix' 2016-10-18 15:25:31 +05:30
Nabin Hait
7b9e8368ea bumped to version 7.0.59 2016-10-18 15:55:31 +06:00
Nabin Hait
f32547a414 Merge pull request #6637 from nabinhait/cost_center_fix
Set cost center while creating invoice from SO/PO
2016-10-18 15:18:16 +05:30
Rushabh Mehta
17f6874450 [minor] [fix] doctype_dasboard.py files, move data to get_data 2016-10-18 14:54:39 +05:30
Nabin Hait
55a8797919 Set cost center while creating invoice from SO/PO 2016-10-18 14:54:17 +05:30
Neil Trini Lasrado
8b3dd8fdf2 Changed nationality in student master from link to data field 2016-10-18 12:55:38 +05:30
Nabin Hait
2dcee15e50 Merge pull request #6634 from KanchanChauhan/employee-patch-fixed
Patch fixed for Employee
2016-10-18 12:14:16 +05:30
Kanchan Chauhan
dc86964e91 Patch fixed for Employee 2016-10-18 11:29:41 +05:30
Nabin Hait
f5be103d57 Merge branch 'RobertSchouten-pref_email' into develop 2016-10-17 17:43:10 +05:30
Nabin Hait
b3b1219109 Fixed merge conflict 2016-10-17 17:42:53 +05:30
Nabin Hait
fcd10f2e08 Merge pull request #6335 from RobertSchouten/stock_entry
[fix] warning for creating stock entry after sales invoice (causing missing gl entries)
2016-10-17 17:39:57 +05:30
Nabin Hait
e5eed00aa5 Update stock_entry.py 2016-10-17 17:37:35 +05:30
Pawan Mehta
1a96cc1e8d Fixes 6171 (#6417)
* [fix] #6171

* [fix] #6171

* [fix] #6171

* [fix] #6171

* [fix] #6171

* [fix] #6171

* [fix] #6171

* [fix] #6171
2016-10-17 17:02:12 +05:30
KanchanChauhan
81581c669f No Leave allocation for Leave Type for which Leave Without Pay is checked (#6626) 2016-10-17 17:01:29 +05:30
Nabin Hait
5ea16640fe Merge branch 'RobertSchouten-unclosed_finance1' into develop 2016-10-17 16:58:25 +05:30
Nabin Hait
437b32d32c Added filter to show unclosed fiscal year's P&L balances in trail balance 2016-10-17 16:57:52 +05:30
Nabin Hait
425bdee0ec Merge branch 'unclosed_finance' of https://github.com/RobertSchouten/erpnext into RobertSchouten-unclosed_finance1 2016-10-17 16:46:54 +05:30
Nabin Hait
c48ad8430f Merge branch 'KanchanChauhan-process-payroll-changes' into develop 2016-10-17 16:43:06 +05:30
Nabin Hait
395d757c5a Fixed merge conflict 2016-10-17 16:42:49 +05:30
KanchanChauhan
9cb69ca0e3 Posting Date cannot be future date (#6628) 2016-10-17 16:40:16 +05:30
Saurabh
048ee48475 [fix] #6573 Material Request Required Date auto set (#6627) 2016-10-17 16:24:20 +05:30
Faris Ansari
e1416c3dda Update sales-invoice.md frappe/erpnext#6507 (#6629)
* Update sales-invoice.md

* add pos-invoice screenshot
2016-10-17 16:22:43 +05:30
Nabin Hait
401be3f49b Merge pull request #6577 from PawanMeh/fixes_6566
[fix #6566]
2016-10-16 14:28:26 +05:30
Nabin Hait
a9ce406c48 Merge pull request #6579 from PawanMeh/fixes_6567
[fix] #6567
2016-10-16 14:28:00 +05:30
Nabin Hait
0b1b8afc3c Merge pull request #6611 from nabinhait/hotfix
Always calculate additional discount amount if percentage is mentioned
2016-10-16 14:25:28 +05:30
Nabin Hait
e040510545 Always calculate additional discount amount if percentage is mentioned 2016-10-13 12:14:47 +05:30
Rushabh Mehta
b62ed7a603 [fix] install issue 2016-10-13 11:00:00 +05:30
Rushabh Mehta
257bbbe588 [refactor] has_website_permission parameters 2016-10-12 10:53:34 +05:30
RobertSchouten
bb7308bbc1 [fix] email digest date range starting with opening balance of day one not closing (#6524)
ie monthly currently get's balance at the end of 1st of september to the 30th of september instead of the beginning of the 1st aka the end of the 31st fo august
2016-10-10 17:17:39 +05:30
Saurabh
afa14fc402 [fix][minor] (#6449) 2016-10-10 17:17:17 +05:30
Nabin Hait
1765259043 Merge pull request #6591 from vrms/patch-4
Update managing-fixed-assets.md
2016-10-10 17:12:58 +05:30
Nabin Hait
efd7c3e22b Merge pull request #6592 from rohitwaghchaure/production_planning_issue
[Fix] making of production order from material request with sales order, restirct validation validate_production_order_against_so in production order
2016-10-10 17:10:49 +05:30
Rushabh Mehta
2757d8ef03 [minor] [perm] allow owner to read student applicant 2016-10-10 16:46:24 +05:30
Rohit Waghchaure
8e881cc7b9 [Fix] making of production order from material request with sales order, restirct validation validate_production_order_against_so in production order 2016-10-10 14:58:33 +05:30
Faris Ansari
a0608d463a [gantt] Gantt fixes (#6490)
* [gantt] fix Gantt Chart link in Modules

* [gantt] added field for Task dependent
2016-10-10 14:32:35 +05:30
vrms
e4e8bfae9f Update managing-fixed-assets.md
Sale an asset > Sell and Asset
2016-10-10 15:33:27 +08:00
Nabin Hait
fc90758932 Merge pull request #6589 from rohitwaghchaure/purchase_invoice_validation_issue
[Fix] Purchase invoice validation issue
2016-10-10 11:51:00 +05:30
Nabin Hait
1ca7a27b2f Merge pull request #6587 from rohitwaghchaure/pos_wildcard_search_issue
[Fix] wildcard search for pos not working
2016-10-10 11:50:01 +05:30
Rohit Waghchaure
3485d2467a [Fix] Purchase invoice validation issue 2016-10-09 18:05:17 +05:30
Rohit Waghchaure
6f33dfbc56 [Fix] wildcard search for pos not working 2016-10-09 15:32:56 +05:30
Rushabh Mehta
ac5b193100 [minor] direct student admission to the list page 2016-10-09 15:19:23 +05:30
Pawan Mehta
8d62af627a Update fiscal-year.md 2016-10-09 09:20:12 +05:30
pawan
1c0ecede06 [fix] #6567 2016-10-09 09:06:49 +05:30
pawan
896c731a46 [fix] #6566 2016-10-09 08:44:40 +05:30
pawan
05790d1b38 [fix] #6566 2016-10-09 08:30:29 +05:30
pawan
5655ce936b [fix] #6567 2016-10-08 08:02:08 +05:30
pawan
361739ffb6 [fix #6566] 2016-10-07 19:00:30 +05:30
Nabin Hait
fc2a9e64fc Fixed version conflict 2016-10-07 17:09:28 +05:30
Nabin Hait
8fa2a04024 Merge branch 'hotfix' 2016-10-07 17:08:57 +05:30
Nabin Hait
89326b366d bumped to version 7.0.58 2016-10-07 17:38:57 +06:00
Nabin Hait
6aaa7d7742 Added missing file extension 2016-10-07 17:08:03 +05:30
Nabin Hait
df61513037 Fixed merge conflict 2016-10-07 17:05:00 +05:30
Nabin Hait
05ba967a45 Merge branch 'hotfix' 2016-10-07 17:04:36 +05:30
Nabin Hait
d17bbdeb4d bumped to version 7.0.57 2016-10-07 17:34:35 +06:00
Nabin Hait
2f3a68b8d6 Added missing file extension 2016-10-07 17:03:37 +05:30
Nabin Hait
cd9c45f816 Fixed merge conflict 2016-10-07 16:53:07 +05:30
Nabin Hait
f69edb3fa3 Merge branch 'hotfix' 2016-10-07 16:47:17 +05:30
Nabin Hait
06195de812 bumped to version 7.0.56 2016-10-07 17:17:17 +06:00
Nabin Hait
ad8218e5ac minor fix 2016-10-07 16:39:30 +05:30
Nabin Hait
9bfef84545 Merge branch 'notification-center' of https://github.com/shreyasp/erpnext into shreyasp-notification-center 2016-10-07 16:37:10 +05:30
Nabin Hait
cf8438d153 Delete patches.txt 2016-10-07 16:11:21 +05:30
Nabin Hait
81754954cb Update update_timesheet_communications 2016-10-07 16:08:44 +05:30
Nabin Hait
2907881dfb Update update_timesheet_communications 2016-10-07 16:07:11 +05:30
Nabin Hait
0799969063 Update set_portal_settings.py 2016-10-07 14:55:17 +05:30
Nabin Hait
20e96b77bd Update set_portal_settings.py 2016-10-07 14:54:28 +05:30
shreyas
c1b7104126 [Fix] Minor changes to logic 2016-10-07 14:20:51 +05:30
Nabin Hait
ee25cf7ead Merge branch 'rohitwaghchaure-sales_order_status_issue' into hotfix 2016-10-07 14:16:36 +05:30
Nabin Hait
2f75b7b42e Fixed merge conflict 2016-10-07 14:16:17 +05:30
Nabin Hait
1915214518 Merge pull request #6576 from rohitwaghchaure/item_rename_issue
[Fix] Issue in merging duplicate item
2016-10-07 14:11:49 +05:30
Nabin Hait
eb08d632b3 Merge pull request #6565 from saurabh6790/warehouse_group_account_rename_fix
[fix] warehouse account rename fix #6526
2016-10-07 14:11:14 +05:30
Rohit Waghchaure
770d04e633 [Fix] sales order status showing completed, while it's status was to bill 2016-10-07 13:55:48 +05:30
Rohit Waghchaure
022d87969d [Fix] Issue in merging duplicate item 2016-10-07 13:40:45 +05:30
shreyas
a1d7646e70 [Fix] Allow user to save Notification Control without selecting transaction 2016-10-07 12:58:58 +05:30
Nabin Hait
bd2a1c3553 Merge pull request #6572 from RobertSchouten/patch-33
[fix] update timestamps and relink communication for timesheet
2016-10-07 12:54:54 +05:30
Nabin Hait
16f3f378f6 Update patches.txt 2016-10-07 12:54:27 +05:30
Nabin Hait
1885207eca Update and rename update_timesheet_modified_created to update_timesheet_communications 2016-10-07 12:54:04 +05:30
RobertSchouten
e0a636c081 [fix] update timestamps and relink communication for timesheet 2016-10-07 11:03:04 +08:00
RobertSchouten
ef4e41380b [fix] update timestamps and relink communication for timesheet 2016-10-07 11:01:12 +08:00
Saurabh
a2a25abfa5 [fix] warehouse account rename fix #6526 2016-10-06 18:20:53 +05:30
Nabin Hait
77ede941b0 Merge pull request #6550 from rohitwaghchaure/make_payment_using_journal_entry
[Enhancement] Option to make payment via Journal Entry
2016-10-06 17:07:11 +05:30
Rohit Waghchaure
7d5298997b Documentation for payments 2016-10-06 16:49:39 +05:30
Nabin Hait
60a099cd85 Merge pull request #6557 from vrms/patch-3
Update product-bundle.md
2016-10-06 15:34:42 +05:30
Nabin Hait
1397159bc1 Merge pull request #6561 from rohitwaghchaure/remove_sales_invoice_from_scheduler_log
removed sales invoice from scheduler log
2016-10-06 15:32:55 +05:30
Nabin Hait
ec08a50af1 Merge pull request #6564 from rohitwaghchaure/expense_claim_issue
[Fix] Expense Claim, sanctioned amount not auto-populated from claim amount
2016-10-06 15:32:37 +05:30
Nabin Hait
4eb196905b Merge pull request #6562 from saurabh6790/hotfix
[fix] sales order translation for language code: fr
2016-10-06 15:28:41 +05:30
Rohit Waghchaure
370e711f48 [Fix] Expense Claim, sanctioned amount not auto-populated from claim amount 2016-10-06 15:19:53 +05:30
Saurabh
3ae5672e27 [fix] sales order translation for language code: fr 2016-10-06 12:57:21 +05:30
Rohit Waghchaure
297fbcd388 removed sales invoice from scheduler log 2016-10-06 12:40:09 +05:30
Rohit Waghchaure
b7a5502b97 [Enhancement] Option to make payment via Journal Entry 2016-10-06 12:04:52 +05:30
vrms
bbe7a1062e Update product-bundle.md
tried to work out the mechanics of Parent and Child items a little clearer
2016-10-06 07:40:21 +08:00
Rushabh Mehta
4dacaa103c [minor] do not submit after accpeting payment 2016-10-05 19:20:37 +05:30
Rushabh Mehta
a47652624a [minor] student applicant fixes 2016-10-05 18:04:35 +05:30
Nabin Hait
558f526a68 Fixed version conflict 2016-10-05 17:18:36 +05:30
Nabin Hait
7dcab89321 Merge branch 'hotfix' 2016-10-05 17:18:11 +05:30
Nabin Hait
a162b3f0cd bumped to version 7.0.55 2016-10-05 17:48:11 +06:00
Nabin Hait
2f163ef360 Merge pull request #6552 from nabinhait/hotfix
Don't throw expense account validation on fetching item details
2016-10-05 17:17:05 +05:30
Nabin Hait
cccc45edc5 Don't throw expense account validation on fetching item details 2016-10-05 17:15:53 +05:30
Nabin Hait
7b9638c93a Merge pull request #6551 from nabinhait/hotfix
Set warranty claim resolution date as today only if it is not set
2016-10-05 16:45:25 +05:30
Nabin Hait
33fafb7728 Set warranty claim resolution date as today only if it is not set 2016-10-05 16:43:20 +05:30
Nabin Hait
2704a4a8fc Update production_order.py 2016-10-05 16:14:42 +05:30
Nabin Hait
7c0fe7d9d3 Merge pull request #6534 from rohitwaghchaure/rfq_added_links_of_quotations
[Enhancement] Added supplier quotation link on rfq
2016-10-05 15:44:51 +05:30
Nabin Hait
55c328348f Merge pull request #6547 from rohitwaghchaure/pos_issue_for_wildcard_seacrh
[Fix] POS wildcard search for customers, items.
2016-10-05 15:43:45 +05:30
Rohit Waghchaure
a26f685b9f [Enhancement] Added supplier quotation link on rfq 2016-10-05 15:04:50 +05:30
Rohit Waghchaure
e86eaf543c removed sync master data onload of the pos page 2016-10-05 14:45:15 +05:30
Rohit Waghchaure
163e3598c7 [Fix] POS wildcard search for customers, items 2016-10-05 13:52:17 +05:30
Nabin Hait
babafb8d01 Merge pull request #6531 from saurabh6790/je_currency_symbol_fix
[fix] currency symbol for total amount in JE
2016-10-05 13:12:59 +05:30
Nabin Hait
7229b64128 Merge pull request #6516 from bcornwellmott/patch-6
Update request_for_quotation.html
2016-10-05 13:12:09 +05:30
Nabin Hait
8db8a91d2e Minor fixes 2016-10-05 13:11:19 +05:30
Kanchan Chauhan
f6f8ec68ad Total and difference added for amount and qty 2016-10-05 13:11:19 +05:30
Rohit Waghchaure
712b871f06 Change project location in sales invoice 2016-10-05 12:45:56 +05:30
Nabin Hait
4784495db2 Merge pull request #6545 from neilLasrado/develop
Field rearrange in student applicant
2016-10-05 12:38:04 +05:30
Neil Trini Lasrado
d5035e05b3 Field rearrange in student applicant 2016-10-05 12:35:55 +05:30
Nabin Hait
9501b38e8b Update remove_doctypes_and_reports.py 2016-10-05 12:35:11 +05:30
Nabin Hait
09adc10543 Merge pull request #6544 from nabinhait/hotfix
Sales Personwise transaction summary - total row
2016-10-05 12:27:21 +05:30
Nabin Hait
219148d23d Sales Personwise transaction summary - total row 2016-10-05 12:26:51 +05:30
Nabin Hait
9ac2fc932d Validate dates, fixes #6542 2016-10-05 12:20:25 +05:30
Nabin Hait
86da020dcd Merge pull request #6543 from nabinhait/rate_precision
Fixed precision of rate field
2016-10-05 11:59:20 +05:30
Nabin Hait
6c49fa20b5 Fixed precision of rate field 2016-10-05 11:28:02 +05:30
Rushabh Mehta
bb89f6e151 [minor] student applications to be submitted after payment 2016-10-05 09:24:52 +05:30
Nabin Hait
efa68fb6b8 Fixed version conflict 2016-10-04 17:27:02 +05:30
Nabin Hait
9e64f07540 Merge branch 'hotfix' 2016-10-04 17:26:33 +05:30
Nabin Hait
d5cebd7bb4 bumped to version 7.0.54 2016-10-04 17:56:33 +06:00
Rushabh Mehta
6a1742abc8 [minor] status for student applicant 2016-10-04 16:26:32 +05:30
Nabin Hait
80de91776d Merge pull request #6539 from rohitwaghchaure/stock_entry_grid_issue
[Fix] Source / Target warehouse does not toggle properly, if we change the purpose after saving a stock entry record
2016-10-04 16:20:47 +05:30
Nabin Hait
cf87027422 Merge pull request #6537 from rohitwaghchaure/pos_multi_company_issue
[Fix] Multi company issue for POS
2016-10-04 16:20:24 +05:30
Rohit Waghchaure
661db8ba71 [Fix] Source / Target warehouse does not toggle properly, if we change the purpose after saving a stock entry record 2016-10-04 14:46:34 +05:30
Rohit Waghchaure
82be020ae9 sync offline sales invoices from the POS 2016-10-04 12:58:48 +05:30
Nabin Hait
66d49565d2 Merge pull request #6536 from frappe/umairsy-patch-4
Update supplier.md
2016-10-04 12:25:45 +05:30
Rushabh Mehta
3af3d7abe3 [fixes] admission-applicant link and student applicant fixes 2016-10-04 12:20:47 +05:30
Rohit Waghchaure
6f1d012b65 [Fix] Multi company issue for POS 2016-10-04 12:18:59 +05:30
Umair Sayed
06b88a464d Update supplier.md 2016-10-04 12:10:08 +05:30
Rushabh Mehta
aedad64445 [minor] fixes 2016-10-04 11:41:42 +05:30
Saurabh
f24d523fc9 [fix] currency symbol for total amount in JE 2016-10-04 11:29:26 +05:30
Nabin Hait
7fb79d175f Fixed version conflict 2016-10-03 18:05:34 +05:30
Nabin Hait
112827ee86 Merge branch 'hotfix' 2016-10-03 18:05:11 +05:30
Nabin Hait
e2b8ae56e1 bumped to version 7.0.53 2016-10-03 18:35:10 +06:00
Nabin Hait
a65c223428 Merge pull request #6533 from nabinhait/hotfix
GL Entries for Purchase Invoices with Update Stock option checked and having non-stock items
2016-10-03 18:03:33 +05:30
Nabin Hait
d114aca20d GL Entries for Purchase Invoices with Update Stock option checked and having non-stock items 2016-10-03 17:36:28 +05:30
Nabin Hait
5a431127c5 Merge pull request #6532 from netchampfaris/hotfix
print format fix
2016-10-03 17:32:55 +05:30
Faris Ansari
69ca382529 [fix] image size fix in print format 2016-10-03 17:15:42 +05:30
Neil Trini Lasrado
93d314c573 Merged introduction and eligibility into a single text field in Student Admission. (#6529) 2016-10-03 15:50:47 +05:30
Nabin Hait
5fd5a77750 Fixed version conflict 2016-10-03 14:13:50 +05:30
bcornwellmott
47863a3049 Update request_for_quotation.html
Fixing spelling mistakes
2016-09-30 15:45:20 -07:00
Nabin Hait
25e62fc4bb Merge pull request #6497 from frappe/umairsy-patch-3
Update data-import-tool.md
2016-09-29 20:44:36 +05:30
Umair Sayed
6c1c03efe7 Update data-import-tool.md 2016-09-29 16:34:39 +05:30
Nabin Hait
2ad07f4912 Merge pull request #6491 from neilLasrado/develop
Removed  Website Roles from Install Fixtures
2016-09-29 15:39:15 +05:30
Nabin Hait
80499bb657 Fixed merge conflict 2016-09-29 14:18:53 +05:30
Neil Trini Lasrado
3da7354ba4 removed supplier role from Request for Quotation 2016-09-29 11:57:23 +05:30
Neil Trini Lasrado
84154f546a Removed Website Roles from Install Fixtures 2016-09-29 11:36:55 +05:30
Nabin Hait
443ac7bf30 Test case fix 2016-09-28 16:54:23 +05:30
Kanchan Chauhan
b40c0a917d [WIP] Process Payroll Changes 2016-09-28 15:14:41 +05:30
Nabin Hait
1e97fc8687 Merge pull request #6460 from KanchanChauhan/salary-slip-fixes
[Fix]Salary Slip can be created without salary structure
2016-09-28 12:55:04 +05:30
Nabin Hait
ba03ef775d Fixed merge conflict 2016-09-28 10:47:41 +05:30
paurosello
a4d19b4c03 change to link of gantt in project (#6469) 2016-09-27 09:56:17 +05:30
Faris Ansari
70b7d3280b added required fields in doctypes for gantt (#6466) 2016-09-26 18:20:14 +05:30
Nabin Hait
706612bcd4 Fixed version conflict 2016-09-26 18:11:56 +05:30
Kanchan Chauhan
273c5e71fd [Fix]Salary Slip can be created without salary structure 2016-09-24 18:56:56 +05:30
Rushabh Mehta
1f53aaf093 [minor] [patch] ignore_validate in update_portal_role 2016-09-24 00:21:53 +05:30
Rushabh Mehta
63cdbf08f9 [minor] [patch] ignore_validate in update_portal_role 2016-09-24 00:07:31 +05:30
Rushabh Mehta
82921f7d65 [minor] add paid field in Student Applicant 2016-09-23 23:50:55 +05:30
Felipe Orellana
2ade5e02e3 Merge pull request #1 from DigiThinkIT/forellana-digithinkit-patch-1
[FIX] Issue with customer doctype not allowing name series past 10
2016-09-23 14:12:14 -04:00
Rushabh Mehta
fc800b3f2f [enhance] added roles for portal users frappe/frappe#2091 (#6452) 2016-09-23 21:51:51 +05:30
Felipe Orellana
51082006a9 [FIX] Issue with customer doctype not allowing name series past 10
Query used to fetch mast number in series breaks due to sql MAX function handing string and number ordering differently. This causes the last "[name] - 9" series to be picked up as last in the series instead of "[name] - 10". Fix is to cast value to unsigned to MAX handles ordering correctly.
2016-09-23 11:58:11 -04:00
Nabin Hait
5f825deadd Fixed version conflict 2016-09-23 17:25:23 +05:30
Nabin Hait
6b4eb7f77f Fixed version conflict 2016-09-23 12:16:31 +05:30
Rushabh Mehta
2d4f3bb04a [fix] space 2016-09-22 15:17:04 +05:30
Nabin Hait
d64454b1c1 Merge pull request #6433 from RobertSchouten/validate_sale_ware
[fix] si validate warehouse if is_stock item
2016-09-22 11:41:36 +05:30
Nabin Hait
e5c7d4b987 Fixed version conflict 2016-09-22 11:33:51 +05:30
robert schouten
f91ca3a450 [fix] si validate warehouse if is_stock item 2016-09-22 13:07:00 +08:00
robert schouten
147c727743 changed from label based to fieldname based 2016-09-22 08:32:54 +08:00
Nabin Hait
be4c527453 Merge pull request #6426 from rohitwaghchaure/supplier_portal_enhancement
[Enhancement] Supplier quotation added on supplier portal
2016-09-21 18:41:21 +05:30
Nabin Hait
96d38eaac7 Merge pull request #6429 from rohitwaghchaure/minor_fix
[Fix] Image is copied when duplicate supplier, employee
2016-09-21 18:40:47 +05:30
Nabin Hait
0eb8eddef5 Merge pull request #6427 from KanchanChauhan/salary-slip-indentation
[Fix] Indentation fixed
2016-09-21 18:40:21 +05:30
Rohit Waghchaure
a7e3d11077 [Fix] Image is copied when duplicate supplier, employee 2016-09-21 18:13:16 +05:30
Kanchan Chauhan
2142a0ab37 [Fix] Indentation fixed 2016-09-21 17:28:42 +05:30
Rohit Waghchaure
21499e820d [Enhancement] Supplier quotation added on supplier portal 2016-09-21 17:07:25 +05:30
Nabin Hait
0be6073f10 Fixed version conflict 2016-09-21 13:06:19 +05:30
Nabin Hait
521b34c03b Merge pull request #6413 from KanchanChauhan/salaryslip-docfield-in-condition
Salary Slip fields in Condition and Formula
2016-09-21 12:55:27 +05:30
Nabin Hait
081eab147f Update salary_slip.py 2016-09-21 12:55:16 +05:30
Rushabh Mehta
0c4597f7a0 [fix] license to the latest markdown format, github seems to consider this as agpl 2016-09-21 12:10:54 +05:30
Rushabh Mehta
301c8a94b8 [fix] [patch] update_lead_source 2016-09-21 12:00:58 +05:30
Rushabh Mehta
989a4849fe [minor] patch fix for 6-7 2016-09-21 12:00:58 +05:30
robert schouten
d7721a605d preferred email for payroll 2016-09-21 11:36:01 +08:00
Nabin Hait
5cf5019b89 minor patch fix 2016-09-20 18:19:59 +05:30
Nabin Hait
9f4ca1fb9e set posting date in salalry slip 2016-09-20 18:19:59 +05:30
Nabin Hait
158ac5a844 Merge pull request #6416 from KanchanChauhan/minor-fix
[Fix] filters_by_name changed to query_report_filters_by_name
2016-09-20 18:14:00 +05:30
Nabin Hait
a36325c6e5 Merge pull request #6403 from saurabh6790/treeview_quick_entry_fix
[fix] minor fix to accomodate custom fields in tree popup
2016-09-20 18:06:49 +05:30
Kanchan Chauhan
77aaa70734 [Fix] filters_by_name changed to query_report_filters_by_name 2016-09-20 17:54:07 +05:30
Nabin Hait
b015f1b647 Fixed version conflict 2016-09-20 16:53:02 +05:30
Kanchan Chauhan
e5057c8c35 Salary Slip fields in Condition and Formula 2016-09-20 14:59:42 +05:30
RobertSchouten
8d43b32c2c improvements to email digest (#6323) 2016-09-20 11:11:39 +05:30
Nabin Hait
b8eef64e5d Merge pull request #6325 from RobertSchouten/patch-26
fix allow negatives in leave type check
2016-09-20 11:00:31 +05:30
Nabin Hait
79fe1fad5d Merge pull request #6374 from RobertSchouten/salary_register
print formatting for monthly Salary register
2016-09-20 10:58:53 +05:30
Nabin Hait
33ea19d616 Merge pull request #6395 from RobertSchouten/payroll_date
[minor] adding Payroll date field to process payroll and salary slip
2016-09-20 10:57:32 +05:30
robert schouten
5c41c77c7e added posting date to process payroll and salary slip 2016-09-20 08:19:05 +08:00
Nabin Hait
383cb43135 Merge pull request #6393 from KanchanChauhan/gl-fix
Against Voucher Type and Against Voucher added to GL
2016-09-19 19:35:55 +05:30
Nabin Hait
b20c83de46 Merge pull request #6397 from neilLasrado/develop
Added ability to Import Data via Data Import Tool in Instructor Doctype
2016-09-19 19:25:41 +05:30
Nabin Hait
fe15fd622d Merge pull request #6398 from mainul94/Issue#6370
Update Production Status Options
2016-09-19 19:25:24 +05:30
Nabin Hait
902bcc07b5 Merge pull request #6401 from rmehta/fix-lead-link
[fix] connect customer to Quotation, Opportunity if created from lead, fixes #6051
2016-09-19 19:22:34 +05:30
Nabin Hait
acc3f43666 Merge pull request #6406 from rohitwaghchaure/add_sq_in_opportunity
Opportunity, added supplier quotation in the dashboard
2016-09-19 19:14:39 +05:30
Neil Trini Lasrado
93424e95f4 Added ability to Import Data via Data Import Tool in Instructor Doctype 2016-09-19 18:40:35 +05:30
Rohit Waghchaure
5b5f3743dd Opportunity, added supplier quotation in the dashboard 2016-09-19 18:36:21 +05:30
Saurabh
9aacf46c51 [fix] minor fix to accomodate custom fields in tree popup 2016-09-19 16:45:35 +05:30
Rushabh Mehta
559aa3ab7c [enhance] show customer, supplier billing and outstanding, fixes #6078 2016-09-19 16:04:58 +05:30
Rushabh Mehta
5a58d8a11e [minor] production order link in material request, fixes #6197 2016-09-19 15:33:46 +05:30
Rushabh Mehta
bd15e31ea1 [minor] [enhance] fixes #6222 2016-09-19 15:27:09 +05:30
Rushabh Mehta
e35dbca01b [fix] connect customer to Quotation, Opportunity if created from lead, fixes #6051 2016-09-19 15:03:57 +05:30
Kanchan Chauhan
006a0e68bf Against Voucher Type and Against Voucher added to GL 2016-09-19 13:44:52 +05:30
Nabin Hait
17c43cd799 Merge pull request #6392 from KanchanChauhan/actual-qty-in-mri
Actual Qty added to Material Request Item
2016-09-19 13:32:31 +05:30
Nabin Hait
284cc200b7 Merge pull request #6396 from strixaluco/patch-4
Update stock-entry.md
2016-09-19 13:27:07 +05:30
strixaluco
71073e1730 Update stock-entry.md
Stock Reconciliation hyperlink added
2016-09-19 15:38:38 +08:00
Nabin Hait
79a3e632ed Merge pull request #6391 from rohitwaghchaure/pos_print_format_new_changes
[Fix] Added base_url, print_css in pos
2016-09-19 12:31:15 +05:30
Mainul Islam
dbf2ce67a6 Fixed Issue#6370 2016-09-19 12:49:01 +06:00
Kanchan Chauhan
d1d129edf0 Actual Qty added to Material Request Item 2016-09-19 00:22:37 +05:30
Rohit Waghchaure
3c4cdd2a94 [Fix] Added base_url, print_css in pos 2016-09-19 00:17:32 +05:30
Rushabh Mehta
cf7a36ac26 [fix] fix patch to clear lead customization 2016-09-16 23:01:41 +05:30
Nabin Hait
5bab04fead Merge pull request #6381 from rmehta/lead-source
[enhance] added Lead Source master, fixes #6231
2016-09-16 16:58:40 +05:30
Nabin Hait
c4bf8c5493 Merge pull request #6383 from nabinhait/article_max_cols
Article on maximum number of fields
2016-09-16 16:58:15 +05:30
Nabin Hait
b1bb1727ff Merge pull request #6384 from saurabh6790/v7.1_Journal_Entry_Opening_Entry
[fix] #5992
2016-09-16 16:58:05 +05:30
Saurabh
9919a0a9db [fix] #5992 2016-09-16 16:47:03 +05:30
Rushabh Mehta
39b5d39df6 [fix] remove campaign depends on 2016-09-16 15:55:34 +05:30
Nabin Hait
86e660f6c3 Article on maximum number of fields 2016-09-16 14:51:45 +05:30
Rushabh Mehta
59dc0ece9f [enhance] added Lead Source master, fixes #6231 2016-09-16 11:44:49 +05:30
Nabin Hait
56700ae148 Merge pull request #6356 from KanchanChauhan/job-application-webform
Job Application web form
2016-09-15 17:20:43 +05:30
Nabin Hait
f3fd2ce382 Merge pull request #6366 from rohitwaghchaure/opportunity_enhancement
[Enhancement] Make supplier quotation from opportunity
2016-09-15 17:18:51 +05:30
Nabin Hait
f79adfddf1 Merge pull request #6351 from RobertSchouten/patch-29
PPT material request non-stock items
2016-09-15 17:01:20 +05:30
Nabin Hait
3cef7d5ae9 Update production_planning_tool.py 2016-09-15 17:01:00 +05:30
Neil Trini Lasrado
bb5eb7d6f4 Added title to Student Admission (#6379) 2016-09-15 16:44:25 +05:30
Nabin Hait
b267673b8e Merge pull request #6373 from vrms/patch-2
Patch 2
2016-09-15 16:11:56 +05:30
Nabin Hait
756467c872 Merge pull request #6372 from vrms/patch-1
Patch 1
2016-09-15 16:11:45 +05:30
Neil Trini Lasrado
7e1b516103 fixes for student admission (#6377)
* fixes for student admission

* Added Application Route to Student Admission
2016-09-15 15:36:14 +05:30
Rushabh Mehta
769dda0874 [translation] [fixes] #5860 2016-09-15 15:17:04 +05:30
Neil Trini Lasrado
83d81203b2 Added Student Admissions (#6359)
* Added Student Admissions

* Fixes for Student Application
2016-09-15 14:48:13 +05:30
Rushabh Mehta
33d18dbc9a [docs] for auto email 2016-09-15 13:57:43 +05:30
robert schouten
32c366508a add print format and id to monthly salary register 2016-09-15 14:21:15 +08:00
vrms
05e33789aa Update index.md 2016-09-15 14:11:06 +08:00
vrms
6d34033c3f Update item-variants.md
tried to bring out the implications and meaning of Variants (compared to a regular item) a little more detailed
2016-09-15 14:05:13 +08:00
Nabin Hait
d5ebd79ad7 Fixed version conflict 2016-09-14 15:50:22 +05:30
Rohit Waghchaure
00295f2b8d make supplier quotation from opportunity 2016-09-14 15:36:40 +05:30
Nabin Hait
e9fa81c286 Merge pull request #6327 from rohitwaghchaure/timesheet_enhancement
[Enhancement] Timesheet billing based on project
2016-09-14 15:31:54 +05:30
Nabin Hait
2e8eff3456 Merge pull request #6352 from superlack/patch-1
Activity Summary to not show cancelled timesheets on click
2016-09-14 15:27:02 +05:30
Nabin Hait
9d095dcec2 Merge pull request #6364 from rohitwaghchaure/financial_statements_report_issue
[Fix] Financial Statements reports are running very slow
2016-09-14 15:25:26 +05:30
Rohit Waghchaure
b78eb2b6f2 [Fix] Financial Statements reports are running very slow 2016-09-14 13:33:27 +05:30
robert schouten
7157b2f286 warnings for prevent stock entries after sales invoice 2016-09-14 08:48:52 +08:00
Rushabh Mehta
b6bca567ce [fixes] [style] for web-form 2016-09-13 14:40:13 +05:30
Kanchan Chauhan
122d0791a3 Job Application web form 2016-09-13 14:29:02 +05:30
superlack
1579565e52 Activity Summary to not show cancelled timesheets on click
Clicking an Activity Type in the Activity summary portion of project will add filter of "Status" != "Cancelled"
2016-09-12 21:18:41 -07:00
RobertSchouten
4ca64c33eb Update production_planning_tool.json 2016-09-13 08:36:05 +08:00
RobertSchouten
5414725fd6 PPT material request non-stock items 2016-09-13 08:27:51 +08:00
Rohit Waghchaure
0568238786 rename total_billing_hours to total_billable_hours in timesheet doctype 2016-09-12 23:00:24 +05:30
Rohit Waghchaure
7b6fdb77d0 rename total_billing_amount to total_billable_amount in timesheet doctype 2016-09-12 19:06:41 +05:30
Nabin Hait
fcbb7692fa Merge pull request #6322 from RobertSchouten/patch-23
leave balance now fy not calendar
2016-09-12 18:53:16 +05:30
Nabin Hait
b7c5b76ed1 Merge pull request #6321 from RobertSchouten/patch-22
allow users without employee with hr permission to view all calendars
2016-09-12 18:52:45 +05:30
Nabin Hait
9d9d1dceeb Merge pull request #6314 from bcornwellmott/bom_desription
Fixed spelling
2016-09-12 18:45:21 +05:30
Nabin Hait
cd23530d24 Merge pull request #6324 from RobertSchouten/patch-24
stock entries from production_order dont fetch serial number of project
2016-09-12 18:35:13 +05:30
Nabin Hait
6c08f5caf9 Update stock_entry.py 2016-09-12 18:34:46 +05:30
Nabin Hait
d7b95267b3 Update production_planning_tool.py 2016-09-12 18:33:17 +05:30
Nabin Hait
ee3be536cb Merge pull request #6349 from rohitwaghchaure/so_dn_required_issue
[Invoice] Fixed so_dn_required for is pos and update stock
2016-09-12 18:31:30 +05:30
Rohit Waghchaure
97a82714de [Fix] so_dn_required for pos and stock update invoice 2016-09-12 18:04:17 +05:30
Nabin Hait
0a2c7a9a66 Merge pull request #6329 from bcornwellmott/quotecomp_add_supplier
Added supplier quotation filter for Quoted Item Comparison
2016-09-12 17:55:19 +05:30
Nabin Hait
97b661f995 Merge pull request #6334 from RobertSchouten/patch-27
[fix] itemwise sales register add sales invoice to delivery note when…
2016-09-12 17:53:10 +05:30
Nabin Hait
1d8d93d9ad Update balance_sheet.py 2016-09-12 17:43:14 +05:30
Nabin Hait
9821816e6c Merge pull request #6337 from RobertSchouten/patch-28
[fix] status updater percent when qty is minus value
2016-09-12 17:37:48 +05:30
Nabin Hait
0a7c0f4418 Merge pull request #6338 from RobertSchouten/report_names
add customer and supplier names to some reports
2016-09-12 17:36:46 +05:30
Nabin Hait
014c30c90d Merge pull request #6339 from rohitwaghchaure/pos_enhancement
[Enhancement] POS changes and fixes
2016-09-12 17:35:40 +05:30
Nabin Hait
d220298e69 Merge pull request #6343 from PawanMeh/fixes_6195
[fix] #6195
2016-09-12 17:34:40 +05:30
bcornwellmott
6594c841a7 Added color coding to timesheet calendars (#6269) 2016-09-12 16:43:23 +05:30
pawan
af111e9c43 [fix] #6195 2016-09-12 15:16:23 +05:30
Rohit Waghchaure
4eb908fc76 Doc updated for timesheet 2016-09-12 13:27:28 +05:30
Rohit Waghchaure
e1d59d6dde test cases and minor changes 2016-09-12 13:27:28 +05:30
Rohit Waghchaure
1d0e8ea9c6 minor changes 2016-09-12 13:27:27 +05:30
Rohit Waghchaure
c940440fbe patch and rearrangement of fields 2016-09-12 13:27:27 +05:30
Rohit Waghchaure
3815ebff8a Added %billed in timesheet 2016-09-12 13:27:27 +05:30
Rohit Waghchaure
a6927e05ba set project wise timesheet data 2016-09-12 13:27:27 +05:30
Rohit Waghchaure
cc8644f86e [Timesheet] Field rearrange 2016-09-12 13:27:27 +05:30
Rohit Waghchaure
60a05324ce POS changes and fixes 2016-09-12 13:11:10 +05:30
Nabin Hait
294664b24c Merge pull request #6267 from PawanMeh/fixes_6254
[fix] #6254
2016-09-12 13:03:14 +05:30
robert schouten
4fc70d962b add customer and supplier names to some reports 2016-09-12 15:23:51 +08:00
RobertSchouten
db33ebb0ff [fix] status updater percent when qty is minus value 2016-09-12 14:54:46 +08:00
robert schouten
ea3b342dde fix display unclosed values for trial/balance/sheet 2016-09-12 14:37:58 +08:00
robert schouten
6465711ca6 [fix] missing gl entries warnings 2016-09-12 11:17:14 +08:00
RobertSchouten
bd979ec1ed [fix] itemwise sales register add sales invoice to delivery note when update stock
in item wise sales register put sales invoice into delivery note field when delivery note is null and update stock ticked
2016-09-12 09:46:10 +08:00
Ben Cornwell-Mott
8d0b826840 Added supplier quotation filter for Quoted Item Comparison 2016-09-09 08:00:54 -07:00
Saurabh
b835fef8ac [enhancement] modify payment request to get payment url (#6097)
* [enhancement] modify payment request to get payment url

* redirect to payment url if payment initiated via shopping cart
2016-09-09 11:19:22 +05:30
RobertSchouten
f4498307c6 fix allow negatives in leave type check 2016-09-09 11:35:51 +08:00
RobertSchouten
b64fc33be1 stock entries from production_order dont fetch serial number of project 2016-09-09 11:08:39 +08:00
RobertSchouten
2efe20bd9a stock entries from production_order dont fetch serial number of project 2016-09-09 11:05:22 +08:00
RobertSchouten
b7fc4b76e4 stock entries from production_order dont fetch serial number of project
stock entries from production_order dont fetch serial number of project
2016-09-09 11:02:33 +08:00
RobertSchouten
2ecddf58d2 leave balance now fy not calendar
changed the default from_date and to_date of Leave Balance Report to FY
2016-09-09 10:48:34 +08:00
RobertSchouten
93c095bf16 allow users without employee with hr permission to view all calendars 2016-09-09 10:15:56 +08:00
RobertSchouten
e4d3809c87 allow users without employee with hr permission to view all calendars 2016-09-09 10:14:07 +08:00
Nabin Hait
e5d13f3156 Update set_student_guardian.py 2016-09-08 17:57:55 +05:30
Nabin Hait
fff6e19479 Merge pull request #6318 from neilLasrado/develop
Rearranged fields in Student Applicant & Student, Split address field
2016-09-08 16:51:30 +05:30
Neil Trini Lasrado
1e060e98c5 Rearranged feilds in Student Applicant & Student, Split address feild 2016-09-08 16:12:39 +05:30
Nabin Hait
d97200cb5a fixed version conflict 2016-09-07 17:20:45 +05:30
Nabin Hait
7c9d981614 Update convert_timelog_to_timesheet.py 2016-09-07 17:17:47 +05:30
Nabin Hait
0a0df2e433 fixed version conflict 2016-09-07 17:01:47 +05:30
Ben Cornwell-Mott
0261889c0f Fixed spelling 2016-09-07 02:28:50 -07:00
pawan
7b2bd20a09 [fix] #6254 2016-09-06 18:28:41 +05:30
Nabin Hait
b8b228ed14 Fixed version conflict 2016-09-06 17:56:32 +05:30
Nabin Hait
e5480f4545 Merge pull request #6300 from neilLasrado/develop
Fixed Student Guardian patch - reload issue
2016-09-06 17:54:06 +05:30
Neil Trini Lasrado
52891b55d2 Fixed Student Guardian patch - reload issue 2016-09-06 17:50:42 +05:30
Nabin Hait
1830675481 Merge pull request #6295 from rohitwaghchaure/supplier_quotation_uom_conversion_issue
[Issue] Fixed, supplier quotation item uom conversion
2016-09-06 17:30:08 +05:30
Rohit Waghchaure
b44efef094 [Issue] Fixed, supplier quotation item uom conversion 2016-09-06 17:21:38 +05:30
Nabin Hait
541e8504a6 Merge pull request #6294 from neilLasrado/develop
Fixed Student Guardian patch - permission issue
2016-09-06 17:20:12 +05:30
Neil Trini Lasrado
6a95723a70 Fixed Student Guardian patch - permission issue 2016-09-06 17:11:13 +05:30
Nabin Hait
194fbaca13 Merge pull request #6291 from RobertSchouten/patch-21
fix for closing balance typo
2016-09-06 17:06:56 +05:30
Nabin Hait
06792a93cd Merge pull request #6289 from KanchanChauhan/barcode-in-stock-reconciliation
Barcode added to Stock Reconciliation
2016-09-06 17:06:06 +05:30
Nabin Hait
b830ffc7d5 Merge pull request #6245 from neilLasrado/develop
Forms redesign for Schools Module.
2016-09-06 17:05:02 +05:30
Neil Trini Lasrado
49da25dd57 Added patch 2016-09-06 15:45:17 +05:30
RobertSchouten
5ae21053bd fix for closing balance typo 2016-09-06 15:44:09 +08:00
Neil Trini Lasrado
c20adb532f Added student Category 2016-09-06 13:08:07 +05:30
Neil Trini Lasrado
d878b66936 Updated Student Doctype 2016-09-06 13:08:07 +05:30
Neil Trini Lasrado
a477e411aa Updated Guardian Doctype; Added new fields 2016-09-06 13:08:07 +05:30
Kanchan Chauhan
366ba04823 Barcode added to Stock Reconciliation 2016-09-06 12:44:57 +05:30
Nabin Hait
406f0a38de Fixed merge conflicts 2016-09-05 15:44:18 +05:30
Nabin Hait
a58431a9a7 Merge pull request #6210 from rohitwaghchaure/purchase_return_issue
[Enhancement] Purchase return for rejected qty
2016-09-05 12:48:43 +05:30
Rohit Waghchaure
cc1c7ad2df added test cases 2016-09-05 00:43:17 +05:30
Rohit Waghchaure
560ba391f9 [Enhancement] Purchase return for rejected qty 2016-09-05 00:43:17 +05:30
manqala
b2b238323b Suggested Changes to School (#6223)
* Linkage of academic term to academic year

* School improvements. Modifications to Academic Term, Assessment, Fees, Student Batch, Student Group. Addition of Grading System.

* Removed Grading System from Assessment and put it on Program

* Removed the field Grading System from Program and added it back to Assessment. Added some validations for dates in controller of Academic Term and Academic Year

* Added validation comparing term start dates with academic year start dates and term end dates with academic year end dates where both are available.

* Renamed Grading System to Grading Structure. Implemented the code in Assessment.js to derive the Grade Code from the result entered for the student. Assumes that result is always a number. Will rename the field result in Results to score.

* Added validation to check if any grade intervals were overlapping when a Grading Structure is being saved.

* Corrections to error in autonaming for Academic Term

* Correction in white_list method get_grade in Assessment. Solves problem with grades not being derived when the score is at the boundaries of a grade interval

* Correction to setup_wizard.py to make sure that creation of academic terms in create_academic_term includes the academic_year which is now mandatory

* Corrections to test_records.json for doctype Academic Term

* Correction of test_records.json in doctype Student Groups

* Correction of test_records.json for doctype Student Group 2

* Correction to test_course_schedule.py in doctype Course Schedule

* More corrections to test_course_schedule.py in doctype Course Schedule

* Corrections to test_course_schedule.py

* Updates to Student DocType. Enrollment date, Nationality

* Linkage of academic term to academic year

* School improvements. Modifications to Academic Term, Assessment, Fees, Student Batch, Student Group. Addition of Grading System.

* Removed Grading System from Assessment and put it on Program

* Removed the field Grading System from Program and added it back to Assessment. Added some validations for dates in controller of Academic Term and Academic Year

* Added validation comparing term start dates with academic year start dates and term end dates with academic year end dates where both are available.

* Renamed Grading System to Grading Structure. Implemented the code in Assessment.js to derive the Grade Code from the result entered for the student. Assumes that result is always a number. Will rename the field result in Results to score.

* Added validation to check if any grade intervals were overlapping when a Grading Structure is being saved.

* Corrections to error in autonaming for Academic Term
2016-09-03 21:05:06 +05:30
pawan
bd9a275d5f [fix] #6254 2016-09-02 16:51:22 +05:30
Nabin Hait
23d79b7059 fixed version conflict 2016-09-02 16:19:54 +05:30
Nabin Hait
15b26d8b1a Fixed merge conflicts 2016-09-02 14:29:57 +05:30
Rushabh Mehta
b2f0920346 [minor] new global for query report filters 2016-09-01 17:53:42 +05:30
Nabin Hait
5a101ef4c6 Fixed merge conflict 2016-09-01 12:43:24 +05:30
Nabin Hait
2490ea0b91 Fixed merge conflict 2016-09-01 12:29:31 +05:30
Nabin Hait
48914b47b7 Merge branch 'strixaluco-patch-2' into develop 2016-08-31 12:36:18 +05:30
Nabin Hait
c0c2f75159 fixed conflict 2016-08-31 12:36:03 +05:30
Nabin Hait
566759acae Merge pull request #6211 from rohitwaghchaure/v7.1_fixes
[Fix] Billing Hours showing blank on sales invoice
2016-08-31 12:12:48 +05:30
Nabin Hait
88e3487f03 Merge pull request #6206 from neilLasrado/docs
Updated Docs for Schools Module
2016-08-31 12:12:17 +05:30
Nabin Hait
fa3146b444 Merge pull request #6218 from RobertSchouten/patch-20
fix for duplicate to bill status comment on submit
2016-08-31 11:09:47 +05:30
Nabin Hait
385e8edd3c Merge pull request #6216 from rohitwaghchaure/update_component_patch_fix
[Patch] Fixed error unknown column 'type' in 'field list'
2016-08-30 09:51:23 +05:30
RobertSchouten
ba4456b42b dont run duplicate set status on submit 2016-08-30 08:21:20 +08:00
Rohit Waghchaure
da7fb70009 [Patch] Fixed error unknown column 'type' in 'field list' 2016-08-30 01:41:35 +05:30
Nabin Hait
d260602cae Merge pull request #6202 from KanchanChauhan/component-type-added
'Type' field added to Salary Component
2016-08-29 16:19:05 +05:30
Kanchan Chauhan
145f87c068 'Type' field added to Salary Component 2016-08-29 15:26:57 +05:30
Rohit Waghchaure
a2bf16bfaa [Fix] Billing Hours showing blank on sales invoice 2016-08-29 13:37:13 +05:30
Nabin Hait
338e63c448 Fixed version conflict 2016-08-29 11:47:50 +05:30
Rushabh Mehta
955b979a97 Merge pull request #6183 from KanchanChauhan/columns-added-deleted
Coded columns deleted, columns added from UI
2016-08-26 14:34:50 +05:30
Kanchan Chauhan
dd96cbd012 Coded column deleted, column added from UI 2016-08-26 14:32:38 +05:30
Nabin Hait
4403cf71b5 Merge pull request #6152 from rohitwaghchaure/profitability_report
[Report] Profitability Analysis
2016-08-26 13:21:01 +05:30
Rohit Waghchaure
69aebf4db5 fixes test cases, added patch 2016-08-26 13:18:14 +05:30
Rohit Waghchaure
0cb171feb2 [Enhancement] Added billing hours for account user in timesheet 2016-08-26 13:17:46 +05:30
Nabin Hait
e334813daf Merge pull request #6166 from neilLasrado/demo
Merged Schools Demo into ERPNext
2016-08-26 13:05:43 +05:30
Rohit Waghchaure
6462ba4e0b minor changes 2016-08-26 12:42:52 +05:30
Nabin Hait
0da75aede3 Fixed merge conflict 2016-08-26 12:40:02 +05:30
Nabin Hait
0a99b4347b Party mandatory message 2016-08-26 12:30:45 +05:30
Nabin Hait
e244cde9c3 Merge pull request #6158 from KanchanChauhan/salary-structure-layout
Layout changes in Salary Structure
2016-08-26 12:00:29 +05:30
Nabin Hait
c97f7cac80 Merge pull request #6162 from strixaluco/patch-1
[minor] docs typo fix
2016-08-26 11:59:11 +05:30
Nabin Hait
6b8435c902 Merge pull request #6172 from joopdorresteijn/patch-1
Update user-restriction.md
2016-08-26 10:50:54 +05:30
Neil Trini Lasrado
067245933e Fixed Demo 2016-08-25 18:31:42 +05:30
Rushabh Mehta
cdfd35c9ca New Languages added:
frappe/translations/am.csv
       	frappe/translations/en-US.csv
       	frappe/translations/en.csv
       	frappe/translations/es-AR.csv
       	frappe/translations/es-CL.csv
       	frappe/translations/es-GT.csv
       	frappe/translations/es-MX.csv
       	frappe/translations/es-NI.csv
       	frappe/translations/fr-CA.csv
       	frappe/translations/ku.csv
       	frappe/translations/lo.csv
       	frappe/translations/lt.csv
       	frappe/translations/ps.csv
       	frappe/translations/rw.csv
       	frappe/translations/sr-SP.csv
2016-08-25 15:23:40 +05:30
joopdorresteijn
8da1e9eeb8 Update user-restriction.md
Sales user also doesn't exist
2016-08-25 15:46:24 +08:00
strixaluco
5380a1c56a Update price-lists.md
Repetitive sentence removed.
2016-08-25 10:40:42 +08:00
Rohit Waghchaure
1e8732abc2 removed old report 2016-08-24 19:20:58 +05:30
Rohit Waghchaure
5794ffd43d added filters project and cost center in profit and loss statement, open profit and loss statement on click of cost center/project in profitability analysis 2016-08-24 19:12:14 +05:30
Rohit Waghchaure
1255a6627e project based profitability Analysis 2016-08-24 18:01:39 +05:30
Rohit Waghchaure
78e08b8af5 [Report] Profitability Analysis 2016-08-24 18:00:22 +05:30
Rohit Waghchaure
fb432821bf [Report] Cost center wise profitability 2016-08-24 18:00:22 +05:30
Rushabh Mehta
b9b36a2062 [minor] update salary structure company if not set 2016-08-24 15:20:43 +05:30
Rushabh Mehta
caeb9dc025 [minor] update salary structure company if not set 2016-08-24 15:14:48 +05:30
Rushabh Mehta
5fb2bc2b87 [fix] [versioning] 2016-08-24 12:51:45 +05:30
Rushabh Mehta
547dff5d5b [version] 7.1-beta 2016-08-24 12:44:32 +05:30
strixaluco
7d60dd7e21 Update price-lists.md 2016-08-24 09:42:07 +08:00
strixaluco
a623a59f9e [minor] docs typo fix
availale → available
2016-08-24 09:36:17 +08:00
Rushabh Mehta
fcb793e4dd [minor] language fields are now links 2016-08-23 16:51:18 +05:30
Kanchan Chauhan
22073f3a7f Layout changes in Salary Structure 2016-08-23 16:14:04 +05:30
Nabin Hait
cfbd0199eb Merge branch 'master' into develop 2016-08-23 12:10:56 +05:30
Nabin Hait
26f9673ad9 Merge pull request #6126 from rohitwaghchaure/multiyear_financial_statements
[Enhancement] Multi year financial statements
2016-08-23 11:32:08 +05:30
Nabin Hait
423f39b4f0 Merge pull request #6101 from bcornwellmott/ppt_test2
Upgraded PPT for more variety of MR creation options. Added tests
2016-08-23 11:31:17 +05:30
Rushabh Mehta
3d93ddc606 [fix] docs links 2016-08-22 18:48:04 +05:30
Nabin Hait
c525449c13 Merge pull request #6139 from PawanMeh/fixes_6089
[fix] #6089
2016-08-22 18:10:14 +05:30
Rohit Waghchaure
ca4d9b54cd fixed accumulated values for cash flow 2016-08-22 17:51:58 +05:30
Pawan Mehta
bee3b40725 Update gross_profit.py 2016-08-22 17:47:13 +05:30
pawan
18bb431baa [fix] #6089 2016-08-22 17:27:22 +05:30
Nabin Hait
c95a3180c2 Merge pull request #6127 from KanchanChauhan/demo-fixes-salary
Demo updated for new salary structure
2016-08-22 15:22:41 +05:30
Rushabh Mehta
114cb9f1dc Merge pull request #6145 from netchampfaris/help-feature
Added help links
2016-08-22 15:02:59 +05:30
Faris Ansari
3a6155b1b9 add help_links.js 2016-08-22 14:37:22 +05:30
Nabin Hait
64e0d16e6d Merge pull request #6141 from frappe/revert-6140-timesheet_patch_fix
Revert "Ignore validating mandatory fields on converting timelogs to timesheets"
2016-08-22 14:36:55 +05:30
Nabin Hait
5c9a2b39bc Revert "Ignore validating mandatory fields on converting timelogs to timesheets" 2016-08-22 14:36:33 +05:30
Nabin Hait
1b9f8006c2 Merge pull request #6140 from nabinhait/timesheet_patch_fix
Ignore validating mandatory fields on converting timelogs to timesheets
2016-08-22 14:36:08 +05:30
pawan
851e05672c [fix] #6089 2016-08-22 14:25:17 +05:30
Nabin Hait
17824c74cf Merge pull request #6135 from KanchanChauhan/minor-salary-fixes
[Minor]Fixes
2016-08-22 12:12:02 +05:30
Kanchan Chauhan
681a86d70e [Minor]Fixes 2016-08-22 00:28:20 +05:30
Rohit Waghchaure
26b646f8a3 Added validation for fiscal year 2016-08-21 17:14:12 +05:30
Kanchan Chauhan
db197d593a Demo updated for new salary structure 2016-08-20 00:30:59 +05:30
Rohit Waghchaure
4275c30059 [Enhancement] Multi year financial statements 2016-08-19 18:04:32 +05:30
Nabin Hait
4cda566139 Merge pull request #6120 from KanchanChauhan/images-for-salary-doc
Better images for redesigned salary docs
2016-08-19 12:50:25 +05:30
Kanchan Chauhan
3769996dfd Images for redesigned salary docs 2016-08-18 23:06:16 +05:30
Nabin Hait
6b3706aef8 Update move_employee_parent_to_child_in_salary_structure.py 2016-08-18 17:32:53 +05:30
Rushabh Mehta
69349f2672 [fix] [patch] column conversion before item reload 2016-08-18 17:06:55 +05:30
Nabin Hait
b5951b72f3 Merge pull request #5924 from KanchanChauhan/salary-structure-changes
Formula based Salary Structure
2016-08-18 16:39:58 +05:30
Kanchan Chauhan
bccf0fa041 [WIP] Formula based Salary Structure and multiple employees for same Salary Structure 2016-08-18 13:02:39 +05:30
Ben Cornwell-Mott
a7c98ba0fe More formatting adjustments 2016-08-17 05:56:00 -07:00
Ben Cornwell-Mott
d5a9d475e7 Adjusted formatting 2016-08-17 05:45:43 -07:00
Ben Cornwell-Mott
06bfecea73 Fixed formatting of code and repositioned checkboxes in PPT. 2016-08-17 05:42:25 -07:00
Ben Cornwell-Mott
e977fc5dee Upgraded PPT for more variety of MR creation options. Added tests 2016-08-16 06:01:52 -07:00
Neil Trini Lasrado
999f34a568 Updated Docs for Schools Module 2016-08-16 17:50:08 +05:30
690 changed files with 112372 additions and 47402 deletions

View File

@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
__version__ = '7.0.52'
__version__ = '7.1.23'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -9,11 +9,13 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "properties",
"fieldtype": "Section Break",
"hidden": 0,
@@ -29,6 +31,7 @@
"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,
@@ -39,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
@@ -52,6 +56,7 @@
"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,
@@ -63,6 +68,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "account_name",
"fieldtype": "Data",
"hidden": 0,
@@ -79,6 +85,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -89,6 +96,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0",
"fieldname": "is_group",
"fieldtype": "Check",
@@ -105,6 +113,7 @@
"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,
@@ -115,6 +124,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -132,6 +142,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -142,6 +153,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "root_type",
"fieldtype": "Select",
"hidden": 0,
@@ -157,6 +169,7 @@
"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,
@@ -167,6 +180,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "report_type",
"fieldtype": "Select",
"hidden": 0,
@@ -182,6 +196,7 @@
"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,
@@ -192,6 +207,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.is_group==0",
"fieldname": "account_currency",
"fieldtype": "Link",
@@ -209,6 +225,7 @@
"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,
@@ -219,6 +236,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -232,6 +250,7 @@
"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,
@@ -243,6 +262,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "parent_account",
"fieldtype": "Link",
"hidden": 0,
@@ -260,6 +280,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@@ -270,6 +291,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Setting Account Type helps in selecting this Account in transactions.",
"fieldname": "account_type",
"fieldtype": "Select",
@@ -288,6 +310,7 @@
"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,
@@ -298,6 +321,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Rate at which this tax is applied",
"fieldname": "tax_rate",
"fieldtype": "Float",
@@ -315,6 +339,7 @@
"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,
@@ -325,6 +350,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "If the account is frozen, entries are allowed to restricted users.",
"fieldname": "freeze_account",
"fieldtype": "Select",
@@ -343,6 +369,7 @@
"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,
@@ -353,6 +380,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "warehouse",
"fieldtype": "Link",
"hidden": 0,
@@ -368,6 +396,7 @@
"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,
@@ -378,6 +407,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "balance_must_be",
"fieldtype": "Select",
"hidden": 0,
@@ -393,6 +423,7 @@
"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,
@@ -403,6 +434,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "lft",
"fieldtype": "Int",
"hidden": 1,
@@ -417,6 +449,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@@ -427,6 +460,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "rgt",
"fieldtype": "Int",
"hidden": 1,
@@ -441,6 +475,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@@ -451,6 +486,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "old_parent",
"fieldtype": "Data",
"hidden": 1,
@@ -465,6 +501,7 @@
"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,
@@ -483,7 +520,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-06-24 13:33:45.504882",
"modified": "2016-11-03 14:58:35.124421",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",
@@ -499,6 +536,7 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -519,6 +557,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -539,6 +578,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -559,6 +599,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -579,6 +620,7 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View File

@@ -1,3 +1,5 @@
frappe.provide("frappe.treeview_settings")
frappe.treeview_settings["Account"] = {
breadcrumbs: "Accounts",
title: __("Chart Of Accounts"),
@@ -25,7 +27,8 @@ frappe.treeview_settings["Account"] = {
{fieldtype:'Check', fieldname:'is_group', label:__('Is Group'),
description: __('Further accounts can be made under Groups, but entries can be made against non-Groups')},
{fieldtype:'Select', fieldname:'root_type', label:__('Root Type'),
options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'].join('\n')},
options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'].join('\n'),
depends_on: 'eval:doc.is_group && !doc.parent_account'},
{fieldtype:'Select', fieldname:'account_type', label:__('Account Type'),
options: ['', 'Bank', 'Cash', 'Stock', 'Tax', 'Chargeable', 'Fixed Asset'].join('\n'),
description: __("Optional. This setting will be used to filter in various transactions.")
@@ -33,10 +36,19 @@ frappe.treeview_settings["Account"] = {
{fieldtype:'Float', fieldname:'tax_rate', label:__('Tax Rate'),
depends_on: 'eval:doc.is_group==1&&doc.account_type=="Tax"'},
{fieldtype:'Link', fieldname:'warehouse', label:__('Warehouse'), options:"Warehouse",
depends_on: 'eval:(!doc.is_group&&doc.account_type=="Warehouse")'},
depends_on: 'eval:(!doc.is_group&&doc.account_type=="Stock")',
get_query: function() {
return {
filters:{
"company": frappe.treeview_settings.filters["company"]
}
}
}
},
{fieldtype:'Link', fieldname:'account_currency', label:__('Currency'), options:"Currency",
description: __("Optional. Sets company's default currency, if not specified.")}
],
ignore_fields:["parent_account"],
onrender: function(node) {
var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr";
if (node.data && node.data.balance!==undefined) {
@@ -68,4 +80,4 @@ frappe.treeview_settings["Account"] = {
}
],
extend_toolbar: true
}
}

View File

@@ -10,11 +10,13 @@
"doctype": "DocType",
"document_type": "Other",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"description": "If enabled, the system will post accounting entries for inventory automatically.",
"fieldname": "auto_accounting_for_stock",
@@ -41,6 +43,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.",
"fieldname": "acc_frozen_upto",
"fieldtype": "Date",
@@ -66,6 +69,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts",
"fieldname": "frozen_accounts_modifier",
"fieldtype": "Link",
@@ -92,6 +96,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_4",
"fieldtype": "Column Break",
"hidden": 0,
@@ -116,6 +121,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Role that is allowed to submit transactions that exceed credit limits set.",
"fieldname": "credit_controller",
"fieldtype": "Link",
@@ -142,6 +148,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "check_supplier_invoice_uniqueness",
"fieldtype": "Check",
"hidden": 0,
@@ -162,6 +169,59 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "make_payment_via_journal_entry",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Make Payment via Journal Entry",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"fieldname": "unlink_payment_on_cancellation_of_invoice",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Unlink Payment on Cancellation of Invoice",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
@@ -175,7 +235,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-14 14:32:06.056888",
"modified": "2016-10-20 16:12:38.595075",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",
@@ -191,6 +251,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View File

@@ -28,6 +28,7 @@ frappe.ui.form.on('Asset', {
refresh: function(frm) {
frappe.ui.form.trigger("Asset", "is_existing_asset");
frm.toggle_display("next_depreciation_date", frm.doc.docstatus < 1);
frm.events.make_schedules_editable(frm);
if (frm.doc.docstatus==1) {
if (frm.doc.status=='Submitted' && !frm.doc.is_existing_asset && !frm.doc.purchase_invoice) {
@@ -141,6 +142,22 @@ frappe.ui.form.on('Asset', {
frm.toggle_enable("supplier", frm.doc.is_existing_asset);
frm.toggle_reqd("next_depreciation_date", !frm.doc.is_existing_asset);
},
opening_accumulated_depreciation: function(frm) {
erpnext.asset.set_accululated_depreciation(frm);
},
depreciation_method: function(frm) {
frm.events.make_schedules_editable(frm);
},
make_schedules_editable: function(frm) {
var is_editable = frm.doc.depreciation_method==="Manual" ? true : false;
frm.toggle_enable("schedules", is_editable);
frm.fields_dict["schedules"].grid.toggle_enable("schedule_date", is_editable);
frm.fields_dict["schedules"].grid.toggle_enable("depreciation_amount", is_editable);
}
});
frappe.ui.form.on('Depreciation Schedule', {
@@ -159,9 +176,25 @@ frappe.ui.form.on('Depreciation Schedule', {
}
})
}
},
depreciation_amount: function(frm, cdt, cdn) {
erpnext.asset.set_accululated_depreciation(frm);
}
})
erpnext.asset.set_accululated_depreciation = function(frm) {
if(frm.doc.depreciation_method != "Manual") return;
accumulated_depreciation = flt(frm.doc.opening_accumulated_depreciation);
$.each(frm.doc.schedules || [], function(i, row) {
accumulated_depreciation += flt(row.depreciation_amount);
frappe.model.set_value(row.doctype, row.name,
"accumulated_depreciation_amount", accumulated_depreciation);
})
}
erpnext.asset.make_purchase_invoice = function(frm) {
frappe.call({
args: {

View File

@@ -9,11 +9,13 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "asset_name",
"fieldtype": "Data",
"hidden": 0,
@@ -29,6 +31,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -39,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "item_code",
"fieldtype": "Link",
"hidden": 0,
@@ -55,6 +59,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -65,6 +70,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "asset_category",
"fieldtype": "Link",
"hidden": 0,
@@ -81,6 +87,7 @@
"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,
@@ -91,6 +98,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
@@ -108,6 +116,7 @@
"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,
@@ -118,6 +127,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "image",
"fieldtype": "Attach Image",
"hidden": 1,
@@ -133,6 +143,7 @@
"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,
@@ -143,6 +154,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -157,6 +169,7 @@
"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,
@@ -167,6 +180,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -183,6 +197,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -193,6 +208,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "warehouse",
"fieldtype": "Link",
"hidden": 0,
@@ -209,6 +225,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -219,6 +236,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_existing_asset",
"fieldtype": "Check",
"hidden": 0,
@@ -234,6 +252,7 @@
"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,
@@ -244,6 +263,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "purchase_date",
"fieldtype": "Date",
"hidden": 0,
@@ -259,6 +279,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -269,6 +290,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "supplier",
"fieldtype": "Link",
"hidden": 0,
@@ -285,6 +307,7 @@
"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,
@@ -295,6 +318,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "purchase_invoice",
"fieldtype": "Link",
"hidden": 0,
@@ -311,6 +335,7 @@
"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,
@@ -321,6 +346,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "disposal_date",
"fieldtype": "Date",
"hidden": 0,
@@ -336,6 +362,7 @@
"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,
@@ -346,6 +373,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "journal_entry_for_scrap",
"fieldtype": "Link",
"hidden": 0,
@@ -362,6 +390,7 @@
"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,
@@ -372,6 +401,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_5",
"fieldtype": "Section Break",
"hidden": 0,
@@ -386,6 +416,7 @@
"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,
@@ -396,6 +427,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "gross_purchase_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -412,6 +444,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -422,6 +455,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "expected_value_after_useful_life",
"fieldtype": "Currency",
@@ -439,6 +473,7 @@
"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,
@@ -449,6 +484,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "is_existing_asset",
"fieldname": "opening_accumulated_depreciation",
"fieldtype": "Currency",
@@ -466,6 +502,7 @@
"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,
@@ -476,9 +513,10 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "value_after_depreciation",
"fieldtype": "Currency",
"hidden": 0,
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
@@ -492,6 +530,7 @@
"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,
@@ -502,6 +541,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_11",
"fieldtype": "Column Break",
"hidden": 0,
@@ -516,6 +556,7 @@
"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,
@@ -526,6 +567,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
"depends_on": "",
"fieldname": "depreciation_method",
@@ -538,12 +580,13 @@
"label": "Depreciation Method",
"length": 0,
"no_copy": 0,
"options": "\nStraight Line\nDouble Declining Balance",
"options": "\nStraight Line\nDouble Declining Balance\nManual",
"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,
@@ -554,6 +597,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_number_of_depreciations",
"fieldtype": "Int",
"hidden": 0,
@@ -569,6 +613,7 @@
"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,
@@ -579,6 +624,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:(doc.is_existing_asset && doc.opening_accumulated_depreciation)",
"fieldname": "number_of_depreciations_booked",
"fieldtype": "Int",
@@ -595,6 +641,7 @@
"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,
@@ -605,6 +652,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "frequency_of_depreciation",
"fieldtype": "Int",
"hidden": 0,
@@ -620,6 +668,7 @@
"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,
@@ -630,6 +679,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "next_depreciation_date",
"fieldtype": "Date",
@@ -646,6 +696,7 @@
"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,
@@ -656,6 +707,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_14",
"fieldtype": "Section Break",
"hidden": 0,
@@ -671,6 +723,7 @@
"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,
@@ -681,6 +734,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "schedules",
"fieldtype": "Table",
"hidden": 0,
@@ -696,7 +750,8 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -707,6 +762,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -722,6 +778,7 @@
"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,
@@ -740,7 +797,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-05 12:54:38.585259",
"modified": "2016-11-18 15:59:19.774500",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset",
@@ -757,6 +814,7 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View File

@@ -18,6 +18,7 @@ class Asset(Document):
self.set_missing_values()
self.validate_asset_values()
self.make_depreciation_schedule()
self.set_accumulated_depreciation()
self.validate_expected_value_after_useful_life()
# Validate depreciation related accounts
get_depreciation_accounts(self)
@@ -48,7 +49,7 @@ class Asset(Document):
for field, value in item_details.items():
if not self.get(field):
self.set(field, value)
self.value_after_depreciation = (flt(self.gross_purchase_amount) -
flt(self.opening_accumulated_depreciation))
@@ -87,9 +88,10 @@ class Asset(Document):
frappe.throw(_("Please set Next Depreciation Date"))
def make_depreciation_schedule(self):
self.schedules = []
if self.depreciation_method != 'Manual':
self.schedules = []
if not self.get("schedules") and self.next_depreciation_date:
accumulated_depreciation = flt(self.opening_accumulated_depreciation)
value_after_depreciation = flt(self.value_after_depreciation)
number_of_pending_depreciations = cint(self.total_number_of_depreciations) - \
@@ -100,18 +102,21 @@ class Asset(Document):
n * cint(self.frequency_of_depreciation))
depreciation_amount = self.get_depreciation_amount(value_after_depreciation)
accumulated_depreciation += flt(depreciation_amount)
value_after_depreciation -= flt(depreciation_amount)
self.append("schedules", {
"schedule_date": schedule_date,
"depreciation_amount": depreciation_amount,
"accumulated_depreciation_amount": accumulated_depreciation
"depreciation_amount": depreciation_amount
})
def set_accumulated_depreciation(self):
accumulated_depreciation = flt(self.opening_accumulated_depreciation)
for d in self.get("schedules"):
accumulated_depreciation += flt(d.depreciation_amount)
d.accumulated_depreciation_amount = accumulated_depreciation
def get_depreciation_amount(self, depreciable_value):
if self.depreciation_method == "Straight Line":
if self.depreciation_method in ("Straight Line", "Manual"):
depreciation_amount = (flt(self.value_after_depreciation) -
flt(self.expected_value_after_useful_life)) / (cint(self.total_number_of_depreciations) -
cint(self.number_of_depreciations_booked))
@@ -126,16 +131,15 @@ class Asset(Document):
return depreciation_amount
def validate_expected_value_after_useful_life(self):
if self.depreciation_method == "Double Declining Balance":
accumulated_depreciation_after_full_schedule = \
max([d.accumulated_depreciation_amount for d in self.get("schedules")])
asset_value_after_full_schedule = (flt(self.gross_purchase_amount) -
flt(accumulated_depreciation_after_full_schedule))
if self.expected_value_after_useful_life < asset_value_after_full_schedule:
frappe.throw(_("Expected value after useful life must be greater than or equal to {0}")
.format(asset_value_after_full_schedule))
accumulated_depreciation_after_full_schedule = \
max([d.accumulated_depreciation_amount for d in self.get("schedules")])
asset_value_after_full_schedule = (flt(self.gross_purchase_amount) -
flt(accumulated_depreciation_after_full_schedule))
if self.expected_value_after_useful_life < asset_value_after_full_schedule:
frappe.throw(_("Expected value after useful life must be greater than or equal to {0}")
.format(asset_value_after_full_schedule))
def validate_cancellation(self):
if self.status not in ("Submitted", "Partially Depreciated", "Fully Depreciated"):

View File

@@ -119,6 +119,30 @@ class TestAsset(unittest.TestCase):
for d in asset.get("schedules")]
self.assertEqual(schedules, expected_schedules)
def test_schedule_for_manual_method(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1")
asset.depreciation_method = "Manual"
asset.schedules = []
for schedule_date, amount in [["2020-12-31", 40000], ["2021-06-30", 30000], ["2021-10-31", 20000]]:
asset.append("schedules", {
"schedule_date": schedule_date,
"depreciation_amount": amount
})
asset.save()
self.assertEqual(asset.status, "Draft")
expected_schedules = [
["2020-12-31", 40000, 40000],
["2021-06-30", 30000, 70000],
["2021-10-31", 20000, 90000]
]
schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
for d in asset.get("schedules")]
self.assertEqual(schedules, expected_schedules)
def test_depreciation(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1")

View File

@@ -2,15 +2,6 @@
// For license information, please see license.txt
frappe.ui.form.on('Asset Category', {
setup: function(frm) {
frm.get_field('accounts').grid.editable_fields = [
{fieldname: 'company_name', columns: 3},
{fieldname: 'fixed_asset_account', columns: 3},
{fieldname: 'accumulated_depreciation_account', columns: 2},
{fieldname: 'depreciation_expense_account', columns: 2}
];
},
onload: function(frm) {
frm.add_fetch('company_name', 'accumulated_depreciation_account', 'accumulated_depreciation_account');
frm.add_fetch('company_name', 'depreciation_expense_account', 'accumulated_depreciation_account');

View File

@@ -14,6 +14,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 3,
"fieldname": "company_name",
"fieldtype": "Link",
"hidden": 0,
@@ -30,6 +31,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -40,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 3,
"fieldname": "fixed_asset_account",
"fieldtype": "Link",
"hidden": 0,
@@ -56,6 +59,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -66,6 +70,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "accumulated_depreciation_account",
"fieldtype": "Link",
"hidden": 0,
@@ -82,6 +87,7 @@
"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,
@@ -92,6 +98,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "depreciation_expense_account",
"fieldtype": "Link",
"hidden": 0,
@@ -108,6 +115,7 @@
"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,
@@ -125,7 +133,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:27:58.048060",
"modified": "2016-11-03 15:12:55.775239",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset Category Account",

View File

@@ -3,16 +3,19 @@
"allow_import": 1,
"allow_rename": 0,
"autoname": "AM-.#####",
"beta": 0,
"creation": "2016-04-25 18:00:23.559973",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "asset",
"fieldtype": "Link",
"hidden": 0,
@@ -29,6 +32,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -39,6 +43,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "transaction_date",
"fieldtype": "Datetime",
"hidden": 0,
@@ -54,6 +59,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -64,6 +70,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -80,6 +87,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -90,6 +98,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_4",
"fieldtype": "Column Break",
"hidden": 0,
@@ -104,6 +113,7 @@
"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,
@@ -114,6 +124,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "source_warehouse",
"fieldtype": "Link",
"hidden": 0,
@@ -130,6 +141,7 @@
"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,
@@ -140,6 +152,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "target_warehouse",
"fieldtype": "Link",
"hidden": 0,
@@ -156,6 +169,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -166,6 +180,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -181,6 +196,7 @@
"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,
@@ -191,13 +207,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-04-25 19:14:08.853429",
"modified": "2016-11-03 15:13:55.990844",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset Movement",
@@ -214,6 +231,7 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -234,6 +252,7 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -254,6 +273,7 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View File

@@ -5,13 +5,6 @@ frappe.ui.form.on("Bank Reconciliation", {
setup: function(frm) {
frm.get_docfield("payment_entries").allow_bulk_edit = 1;
frm.add_fetch("bank_account", "account_currency", "account_currency");
frm.get_field('payment_entries').grid.editable_fields = [
{fieldname: 'against_account', columns: 3},
{fieldname: 'amount', columns: 2},
{fieldname: 'cheque_number', columns: 3},
{fieldname: 'clearance_date', columns: 2}
];
},
onload: function(frm) {
@@ -53,6 +46,12 @@ frappe.ui.form.on("Bank Reconciliation", {
callback: function(r, rt) {
frm.refresh_field("payment_entries");
frm.refresh_fields();
$(frm.fields_dict.payment_entries.wrapper).find("[data-fieldname=amount]").each(function(i,v){
if (i !=0){
$(v).addClass("text-right")
}
})
}
});
}

View File

@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, getdate, nowdate
from frappe.utils import flt, getdate, nowdate, fmt_money
from frappe import msgprint, _
from frappe.model.document import Document
@@ -26,8 +26,8 @@ class BankReconciliation(Document):
select
"Journal Entry" as payment_document, t1.name as payment_entry,
t1.cheque_no as cheque_number, t1.cheque_date,
abs(t2.debit_in_account_currency - t2.credit_in_account_currency) as amount,
t1.posting_date, t2.against_account, t1.clearance_date
t2.debit_in_account_currency as debit, t2.credit_in_account_currency as credit,
t1.posting_date, t2.against_account, t1.clearance_date, t2.account_currency
from
`tabJournal Entry` t1, `tabJournal Entry Account` t2
where
@@ -36,21 +36,23 @@ class BankReconciliation(Document):
and ifnull(t1.is_opening, 'No') = 'No' {0}
order by t1.posting_date ASC, t1.name DESC
""".format(condition), (self.bank_account, self.from_date, self.to_date), as_dict=1)
payment_entries = frappe.db.sql("""
select
"Payment Entry" as payment_document, name as payment_entry,
reference_no as cheque_number, reference_date as cheque_date,
if(paid_from=%s, paid_amount, received_amount) as amount,
posting_date, party as against_account, clearance_date
if(paid_from=%(account)s, paid_amount, "") as credit,
if(paid_from=%(account)s, "", received_amount) as debit,
posting_date, ifnull(party,if(paid_from=%(account)s,paid_to,paid_from)) as against_account, clearance_date,
if(paid_to=%(account)s, paid_to_account_currency, paid_from_account_currency) as account_currency
from `tabPayment Entry`
where
(paid_from=%s or paid_to=%s) and docstatus=1
and posting_date >= %s and posting_date <= %s {0}
(paid_from=%(account)s or paid_to=%(account)s) and docstatus=1
and posting_date >= %(from)s and posting_date <= %(to)s {0}
order by
posting_date ASC, name DESC
""".format(condition),
(self.bank_account, self.bank_account, self.bank_account, self.from_date, self.to_date), as_dict=1)
{"account":self.bank_account, "from":self.from_date, "to":self.to_date}, as_dict=1)
entries = sorted(list(payment_entries)+list(journal_entries),
key=lambda k: k['posting_date'] or getdate(nowdate()))
@@ -60,6 +62,11 @@ class BankReconciliation(Document):
for d in entries:
row = self.append('payment_entries', {})
d.amount = fmt_money(d.debit if d.debit else d.credit, 2, d.account_currency) + " " + (_("Dr") if d.debit else _("Cr"))
d.pop("credit")
d.pop("debit")
d.pop("account_currency")
row.update(d)
self.total_amount += flt(d.amount)

View File

@@ -13,6 +13,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "payment_document",
"fieldtype": "Link",
"hidden": 0,
@@ -39,6 +40,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 1,
"fieldname": "payment_entry",
"fieldtype": "Dynamic Link",
"hidden": 0,
@@ -67,6 +69,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "against_account",
"fieldtype": "Data",
"hidden": 0,
@@ -94,8 +97,9 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "amount",
"fieldtype": "Currency",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -106,7 +110,7 @@
"no_copy": 0,
"oldfieldname": "debit",
"oldfieldtype": "Currency",
"options": "account_currency",
"options": "",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
@@ -121,6 +125,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_5",
"fieldtype": "Column Break",
"hidden": 0,
@@ -146,6 +151,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "posting_date",
"fieldtype": "Date",
"hidden": 0,
@@ -172,6 +178,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 1,
"fieldname": "cheque_number",
"fieldtype": "Data",
"hidden": 0,
@@ -198,6 +205,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cheque_date",
"fieldtype": "Date",
"hidden": 0,
@@ -224,6 +232,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "clearance_date",
"fieldtype": "Date",
"hidden": 0,
@@ -258,7 +267,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-07-11 03:27:58.139117",
"modified": "2016-11-17 11:39:00.308624",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation Detail",

View File

@@ -14,6 +14,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cost_center",
"fieldtype": "Link",
"hidden": 0,
@@ -30,6 +31,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -40,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "fiscal_year",
"fieldtype": "Link",
"hidden": 0,
@@ -56,6 +59,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -66,6 +70,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -82,6 +87,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -92,6 +98,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -106,6 +113,7 @@
"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,
@@ -116,6 +124,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Stop",
"fieldname": "action_if_annual_budget_exceeded",
"fieldtype": "Select",
@@ -133,6 +142,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -143,6 +153,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Warn",
"description": "",
"fieldname": "action_if_accumulated_monthly_budget_exceeded",
@@ -161,6 +172,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -171,6 +183,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:in_list([\"Stop\", \"Warn\"], doc.action_if_accumulated_monthly_budget_exceeded)",
"fieldname": "monthly_distribution",
"fieldtype": "Link",
@@ -188,6 +201,7 @@
"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,
@@ -198,6 +212,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -213,6 +228,7 @@
"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,
@@ -223,6 +239,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
@@ -237,6 +254,7 @@
"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,
@@ -247,6 +265,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "accounts",
"fieldtype": "Table",
"hidden": 0,
@@ -263,6 +282,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -280,7 +300,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-08-18 14:46:02.653081",
"modified": "2016-11-03 15:14:19.113302",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Budget",
@@ -297,6 +317,7 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View File

@@ -3,15 +3,18 @@
"allow_import": 1,
"allow_rename": 0,
"autoname": "naming_series:",
"beta": 0,
"creation": "2013-03-07 11:55:06",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
@@ -26,6 +29,7 @@
"print_hide_if_no_value": 0,
"print_width": "50%",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -37,6 +41,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@@ -52,6 +57,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -62,6 +68,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "c_form_no",
"fieldtype": "Data",
"hidden": 0,
@@ -76,6 +83,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -86,6 +94,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "received_date",
"fieldtype": "Date",
"hidden": 0,
@@ -100,6 +109,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -110,6 +120,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
@@ -125,6 +136,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -135,6 +147,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -149,6 +162,7 @@
"print_hide_if_no_value": 0,
"print_width": "50%",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -160,6 +174,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -175,6 +190,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -185,6 +201,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "quarter",
"fieldtype": "Select",
"hidden": 0,
@@ -200,6 +217,7 @@
"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,
@@ -210,6 +228,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -225,6 +244,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -235,6 +255,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "state",
"fieldtype": "Data",
"hidden": 0,
@@ -249,6 +270,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -259,6 +281,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break0",
"fieldtype": "Section Break",
"hidden": 0,
@@ -272,6 +295,7 @@
"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,
@@ -282,6 +306,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "invoices",
"fieldtype": "Table",
"hidden": 0,
@@ -297,6 +322,7 @@
"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,
@@ -307,6 +333,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_invoiced_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -322,6 +349,7 @@
"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,
@@ -332,6 +360,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -347,6 +376,7 @@
"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,
@@ -358,13 +388,14 @@
"hide_toolbar": 0,
"icon": "icon-file-text",
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 3,
"modified": "2016-03-03 04:31:05.340444",
"modified": "2016-11-03 15:50:37.408315",
"modified_by": "Administrator",
"module": "Accounts",
"name": "C-Form",
@@ -380,6 +411,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -400,6 +432,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -420,6 +453,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 0,
"read": 1,
@@ -431,8 +465,10 @@
"write": 0
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_order": "DESC",
"timeline_field": "customer"
"timeline_field": "customer",
"track_seen": 0
}

View File

@@ -10,11 +10,13 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sb0",
"fieldtype": "Section Break",
"hidden": 0,
@@ -29,6 +31,7 @@
"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,
@@ -39,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cost_center_name",
"fieldtype": "Data",
"hidden": 0,
@@ -55,6 +59,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -65,6 +70,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "parent_cost_center",
"fieldtype": "Link",
"hidden": 0,
@@ -82,6 +88,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -92,6 +99,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -109,6 +117,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -119,6 +128,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cb0",
"fieldtype": "Column Break",
"hidden": 0,
@@ -132,6 +142,7 @@
"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,
@@ -143,6 +154,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0",
"fieldname": "is_group",
"fieldtype": "Check",
@@ -159,6 +171,7 @@
"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,
@@ -169,6 +182,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "lft",
"fieldtype": "Int",
"hidden": 1,
@@ -185,6 +199,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 1,
@@ -195,6 +210,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "rgt",
"fieldtype": "Int",
"hidden": 1,
@@ -211,6 +227,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 1,
@@ -221,6 +238,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "old_parent",
"fieldtype": "Link",
"hidden": 1,
@@ -238,6 +256,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
@@ -249,14 +268,15 @@
"hide_toolbar": 0,
"icon": "icon-money",
"idx": 1,
"in_create": 0,
"image_view": 0,
"in_create": 1,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-05-16 15:23:14.770933",
"modified": "2016-11-03 15:50:55.467294",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cost Center",
@@ -272,6 +292,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -292,6 +313,7 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -312,6 +334,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -332,6 +355,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -352,6 +376,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -368,6 +393,5 @@
"read_only_onload": 0,
"search_fields": "parent_cost_center, is_group",
"sort_order": "ASC",
"track_seen": 0,
"version": 0
"track_seen": 0
}

View File

@@ -22,5 +22,6 @@ frappe.treeview_settings["Cost Center"] = {
{fieldtype:'Data', fieldname:'cost_center_name', label:__('New Cost Center Name'), reqd:true},
{fieldtype:'Check', fieldname:'is_group', label:__('Is Group'),
description:__('Further cost centers can be made under Groups but entries can be made against non-Groups')}
]
],
ignore_fields:["parent_cost_center"]
}

View File

@@ -10,11 +10,13 @@
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "schedule_date",
"fieldtype": "Date",
"hidden": 0,
@@ -29,7 +31,8 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -40,6 +43,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "depreciation_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -55,7 +59,8 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -66,6 +71,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -80,6 +86,7 @@
"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,
@@ -90,6 +97,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "accumulated_depreciation_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -106,8 +114,9 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -116,6 +125,8 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.docstatus==1",
"fieldname": "journal_entry",
"fieldtype": "Link",
"hidden": 0,
@@ -132,6 +143,7 @@
"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,
@@ -142,7 +154,8 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:(!doc.journal_entry && doc.schedule_date <= get_today())",
"columns": 0,
"depends_on": "eval:(doc.docstatus==1 && !doc.journal_entry && doc.schedule_date <= get_today())",
"fieldname": "make_depreciation_entry",
"fieldtype": "Button",
"hidden": 0,
@@ -158,6 +171,7 @@
"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,
@@ -175,7 +189,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:27:59.603924",
"modified": "2016-11-18 16:42:19.543657",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Depreciation Schedule",

View File

@@ -44,18 +44,24 @@ class GLEntry(Document):
frappe.throw(_("{0} is required").format(_(self.meta.get_label(k))))
account_type = frappe.db.get_value("Account", self.account, "account_type")
if account_type in ["Receivable", "Payable"] and not (self.party_type and self.party):
frappe.throw(_("Party Type and Party is required for Receivable / Payable account {0}").format(self.account))
if not (self.party_type and self.party):
if account_type == "Receivable":
frappe.throw(_("{0} {1}: Customer is required against Receivable account {2}")
.format(self.voucher_type, self.voucher_no, self.account))
elif account_type == "Payable":
frappe.throw(_("{0} {1}: Supplier is required against Payable account {2}")
.format(self.voucher_type, self.voucher_no, self.account))
# Zero value transaction is not allowed
if not (flt(self.debit) or flt(self.credit)):
frappe.throw(_("Either debit or credit amount is required for {0}").format(self.account))
frappe.throw(_("{0} {1}: Either debit or credit amount is required for {2}")
.format(self.voucher_type, self.voucher_no, self.account))
def pl_must_have_cost_center(self):
if frappe.db.get_value("Account", self.account, "report_type") == "Profit and Loss":
if not self.cost_center and self.voucher_type != 'Period Closing Voucher':
frappe.throw(_("Cost Center is required for 'Profit and Loss' account {0}")
.format(self.account))
frappe.throw(_("{0} {1}: Cost Center is required for 'Profit and Loss' account {2}. Please set up a default Cost Center for the Company.")
.format(self.voucher_type, self.voucher_no, self.account))
else:
if self.cost_center:
self.cost_center = None
@@ -65,7 +71,8 @@ class GLEntry(Document):
def check_pl_account(self):
if self.is_opening=='Yes' and \
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss":
frappe.throw(_("'Profit and Loss' type account {0} not allowed in Opening Entry").format(self.account))
frappe.throw(_("{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry")
.format(self.voucher_type, self.voucher_no, self.account))
def validate_account_details(self, adv_adj):
"""Account must be ledger, active and not freezed"""
@@ -74,13 +81,16 @@ class GLEntry(Document):
from tabAccount where name=%s""", self.account, as_dict=1)[0]
if ret.is_group==1:
frappe.throw(_("Account {0} cannot be a Group").format(self.account))
frappe.throw(_("{0} {1}: Account {2} cannot be a Group")
.format(self.voucher_type, self.voucher_no, self.account))
if ret.docstatus==2:
frappe.throw(_("Account {0} is inactive").format(self.account))
frappe.throw(_("{0} {1}: Account {2} is inactive")
.format(self.voucher_type, self.voucher_no, self.account))
if ret.company != self.company:
frappe.throw(_("Account {0} does not belong to Company {1}").format(self.account, self.company))
frappe.throw(_("{0} {1}: Account {2} does not belong to Company {3}")
.format(self.voucher_type, self.voucher_no, self.account, self.company))
def validate_cost_center(self):
if not hasattr(self, "cost_center_company"):
@@ -94,7 +104,8 @@ class GLEntry(Document):
return self.cost_center_company[self.cost_center]
if self.cost_center and _get_cost_center_company() != self.company:
frappe.throw(_("Cost Center {0} does not belong to Company {1}").format(self.cost_center, self.company))
frappe.throw(_("{0} {1}: Cost Center {2} does not belong to Company {3}")
.format(self.voucher_type, self.voucher_no, self.cost_center, self.company))
def validate_party(self):
validate_party_frozen_disabled(self.party_type, self.party)
@@ -107,8 +118,9 @@ class GLEntry(Document):
self.account_currency = company_currency
if account_currency != self.account_currency:
frappe.throw(_("Accounting Entry for {0} can only be made in currency: {1}")
.format(self.account, (account_currency or company_currency)), InvalidAccountCurrency)
frappe.throw(_("{0} {1}: Accounting Entry for {2} can only be made in currency: {3}")
.format(self.voucher_type, self.voucher_no, self.account,
(account_currency or company_currency)), InvalidAccountCurrency)
if self.party_type and self.party:
validate_party_gle_currency(self.party_type, self.party, self.company, self.account_currency)
@@ -183,6 +195,7 @@ def update_outstanding_amt(account, party_type, party, against_voucher_type, aga
if against_voucher_type in ["Sales Invoice", "Purchase Invoice"]:
ref_doc = frappe.get_doc(against_voucher_type, against_voucher)
ref_doc.db_set('outstanding_amount', bal)
ref_doc.set_status(update=True)
def validate_frozen_account(account, adv_adj=None):
frozen_account = frappe.db.get_value("Account", account, "freeze_account")

View File

@@ -6,15 +6,6 @@ frappe.provide("erpnext.journal_entry");
frappe.ui.form.on("Journal Entry", {
setup: function(frm) {
frm.get_field('accounts').grid.editable_fields = [
{fieldname: 'account', columns: 3},
{fieldname: 'party', columns: 3},
{fieldname: 'debit_in_account_currency', columns: 2},
{fieldname: 'credit_in_account_currency', columns: 2}
];
},
refresh: function(frm) {
erpnext.toggle_naming_series();
frm.cscript.voucher_type(frm.doc);
@@ -268,7 +259,6 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
if(!doc.company) return;
var update_jv_details = function(doc, r) {
var jvdetail = frappe.model.add_child(doc, "Journal Entry Account", "accounts");
$.each(r, function(i, d) {
var row = frappe.model.add_child(doc, "Journal Entry Account", "accounts");
row.account = d.account;
@@ -276,8 +266,8 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
});
refresh_field("accounts");
}
if(!(doc.accounts || []).length) {
if((!(doc.accounts || []).length) || ((doc.accounts || []).length==1 && !doc.accounts[0].account)) {
if(in_list(["Bank Entry", "Cash Entry"], doc.voucher_type)) {
return frappe.call({
type: "GET",

View File

@@ -3,16 +3,19 @@
"allow_import": 1,
"allow_rename": 0,
"autoname": "naming_series:",
"beta": 0,
"creation": "2013-03-25 10:53:52",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "entry_type_and_date",
"fieldtype": "Section Break",
"hidden": 0,
@@ -28,6 +31,7 @@
"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,
@@ -38,6 +42,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
"fieldname": "title",
"fieldtype": "Data",
@@ -54,6 +59,7 @@
"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,
@@ -64,6 +70,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Journal Entry",
"fieldname": "voucher_type",
"fieldtype": "Select",
@@ -82,6 +89,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@@ -92,6 +100,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@@ -109,6 +118,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -119,6 +129,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -133,6 +144,7 @@
"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,
@@ -144,6 +156,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "posting_date",
"fieldtype": "Date",
"hidden": 0,
@@ -160,6 +173,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@@ -170,6 +184,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -187,6 +202,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@@ -197,6 +213,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "2_add_edit_gl_entries",
"fieldtype": "Section Break",
"hidden": 0,
@@ -213,6 +230,7 @@
"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,
@@ -223,6 +241,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "accounts",
"fieldtype": "Table",
"hidden": 0,
@@ -240,6 +259,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -250,6 +270,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break99",
"fieldtype": "Section Break",
"hidden": 0,
@@ -263,6 +284,7 @@
"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,
@@ -273,6 +295,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "cheque_no",
"fieldtype": "Data",
@@ -290,6 +313,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@@ -300,6 +324,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cheque_date",
"fieldtype": "Date",
"hidden": 0,
@@ -316,6 +341,7 @@
"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,
@@ -326,6 +352,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "user_remark",
"fieldtype": "Small Text",
"hidden": 0,
@@ -342,6 +369,7 @@
"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,
@@ -352,6 +380,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break99",
"fieldtype": "Column Break",
"hidden": 0,
@@ -365,6 +394,7 @@
"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,
@@ -375,6 +405,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_debit",
"fieldtype": "Currency",
"hidden": 0,
@@ -392,6 +423,7 @@
"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,
@@ -402,6 +434,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_credit",
"fieldtype": "Currency",
"hidden": 0,
@@ -419,6 +452,7 @@
"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,
@@ -429,6 +463,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "difference",
"fieldname": "difference",
"fieldtype": "Currency",
@@ -447,6 +482,7 @@
"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,
@@ -457,6 +493,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "difference",
"fieldname": "get_balance",
"fieldtype": "Button",
@@ -473,6 +510,7 @@
"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,
@@ -483,6 +521,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "multi_currency",
"fieldtype": "Check",
"hidden": 0,
@@ -498,16 +537,46 @@
"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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_amount_currency",
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Amount Currency",
"length": 0,
"no_copy": 1,
"options": "Currency",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "total_amount",
"fieldtype": "Currency",
"hidden": 1,
@@ -518,11 +587,12 @@
"label": "Total Amount",
"length": 0,
"no_copy": 1,
"options": "Company:company:default_currency",
"options": "total_amount_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
@@ -533,6 +603,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_amount_in_words",
"fieldtype": "Data",
"hidden": 1,
@@ -547,6 +618,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
@@ -557,6 +629,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "reference",
"fieldtype": "Section Break",
"hidden": 0,
@@ -572,6 +645,7 @@
"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,
@@ -582,6 +656,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "clearance_date",
"fieldtype": "Date",
"hidden": 0,
@@ -598,6 +673,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@@ -608,6 +684,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "remark",
"fieldtype": "Small Text",
@@ -625,6 +702,7 @@
"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,
@@ -635,6 +713,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break98",
"fieldtype": "Column Break",
"hidden": 0,
@@ -648,6 +727,7 @@
"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,
@@ -658,6 +738,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "bill_no",
"fieldtype": "Data",
"hidden": 0,
@@ -674,6 +755,7 @@
"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,
@@ -684,6 +766,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "bill_date",
"fieldtype": "Date",
"hidden": 0,
@@ -700,6 +783,7 @@
"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,
@@ -710,6 +794,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "due_date",
"fieldtype": "Date",
"hidden": 0,
@@ -726,6 +811,7 @@
"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,
@@ -736,6 +822,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
"fieldname": "write_off",
"fieldtype": "Section Break",
@@ -752,6 +839,7 @@
"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,
@@ -762,6 +850,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Accounts Receivable",
"depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
"fieldname": "write_off_based_on",
@@ -779,6 +868,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
@@ -789,6 +879,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
"fieldname": "get_outstanding_invoices",
"fieldtype": "Button",
@@ -805,6 +896,7 @@
"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,
@@ -815,6 +907,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_30",
"fieldtype": "Column Break",
"hidden": 0,
@@ -829,6 +922,7 @@
"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,
@@ -839,6 +933,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.voucher_type == 'Write Off Entry'",
"fieldname": "write_off_amount",
"fieldtype": "Currency",
@@ -855,6 +950,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
@@ -865,6 +961,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "printing_settings",
"fieldtype": "Section Break",
"hidden": 0,
@@ -880,6 +977,7 @@
"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,
@@ -890,6 +988,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "pay_to_recd_from",
"fieldtype": "Data",
"hidden": 0,
@@ -904,6 +1003,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
@@ -914,6 +1014,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_35",
"fieldtype": "Column Break",
"hidden": 0,
@@ -928,6 +1029,7 @@
"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,
@@ -938,6 +1040,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "letter_head",
"fieldtype": "Link",
"hidden": 0,
@@ -953,6 +1056,7 @@
"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,
@@ -963,6 +1067,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "select_print_heading",
"fieldtype": "Link",
"hidden": 0,
@@ -980,6 +1085,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
@@ -990,6 +1096,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "addtional_info",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1006,6 +1113,7 @@
"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,
@@ -1016,6 +1124,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1030,6 +1139,7 @@
"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,
@@ -1041,6 +1151,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "No",
"description": "",
"fieldname": "is_opening",
@@ -1060,6 +1171,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@@ -1070,6 +1182,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:inList([\"Credit Note\", \"Debit Note\"], doc.voucher_type)",
"fieldname": "stock_entry",
"fieldtype": "Link",
@@ -1087,6 +1200,7 @@
"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,
@@ -1097,6 +1211,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -1114,6 +1229,7 @@
"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,
@@ -1125,6 +1241,7 @@
"hide_toolbar": 0,
"icon": "icon-file-text",
"idx": 176,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -1132,7 +1249,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-04-06 05:33:21.851581",
"modified": "2016-11-03 15:52:10.053886",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",
@@ -1148,6 +1265,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -1168,6 +1286,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -1188,6 +1307,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -1199,6 +1319,7 @@
"write": 0
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 1,
"search_fields": "voucher_type,posting_date, due_date, cheque_no",

View File

@@ -62,11 +62,22 @@ class JournalEntry(AccountsController):
def on_cancel(self):
from erpnext.accounts.utils import unlink_ref_doc_from_payment_entries
unlink_ref_doc_from_payment_entries(self.doctype, self.name)
from erpnext.hr.doctype.salary_slip.salary_slip import unlink_ref_doc_from_salary_slip
unlink_ref_doc_from_payment_entries(self)
unlink_ref_doc_from_salary_slip(self.name)
self.make_gl_entries(1)
self.update_advance_paid()
self.update_expense_claim()
self.unlink_advance_entry_reference()
def unlink_advance_entry_reference(self):
for d in self.get("accounts"):
if d.is_advance and d.reference_type in ("Sales Invoice", "Purchase Invoice"):
doc = frappe.get_doc(d.reference_type, d.reference_name)
doc.delink_advance_entries(self.name)
d.reference_type = ''
d.reference_name = ''
d.db_update()
def validate_party(self):
for d in self.get("accounts"):
@@ -381,6 +392,7 @@ class JournalEntry(AccountsController):
def set_total_amount(self, amt, currency):
self.total_amount = amt
self.total_amount_currency = currency
from frappe.utils import money_in_words
self.total_amount_in_words = money_in_words(amt, currency)
@@ -760,7 +772,8 @@ def get_party_account_and_balance(company, party_type, party):
return {
"account": account,
"balance": account_balance,
"party_balance": party_balance
"party_balance": party_balance,
"account_currency": frappe.db.get_value("Account", account, "account_currency")
}
@frappe.whitelist()

View File

@@ -14,6 +14,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 3,
"fieldname": "account",
"fieldtype": "Link",
"hidden": 0,
@@ -43,6 +44,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "account_type",
"fieldtype": "Data",
"hidden": 1,
@@ -68,6 +70,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "balance",
"fieldtype": "Currency",
"hidden": 0,
@@ -95,6 +98,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": ":Company",
"description": "If Income or Expense",
"fieldname": "cost_center",
@@ -126,6 +130,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -149,6 +154,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "party_type",
"fieldtype": "Link",
"hidden": 0,
@@ -174,6 +180,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 3,
"fieldname": "party",
"fieldtype": "Dynamic Link",
"hidden": 0,
@@ -199,6 +206,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "party_balance",
"fieldtype": "Currency",
"hidden": 0,
@@ -226,6 +234,7 @@
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": "",
"columns": 0,
"depends_on": "",
"fieldname": "currency_section",
"fieldtype": "Section Break",
@@ -252,6 +261,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "account_currency",
"fieldtype": "Link",
"hidden": 0,
@@ -278,6 +288,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_10",
"fieldtype": "Column Break",
"hidden": 0,
@@ -302,6 +313,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "exchange_rate",
"fieldtype": "Float",
"hidden": 0,
@@ -327,6 +339,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sec_break1",
"fieldtype": "Section Break",
"hidden": 0,
@@ -351,6 +364,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 2,
"fieldname": "debit_in_account_currency",
"fieldtype": "Currency",
"hidden": 0,
@@ -377,6 +391,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "debit",
"fieldtype": "Currency",
"hidden": 0,
@@ -405,6 +420,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -428,6 +444,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 2,
"fieldname": "credit_in_account_currency",
"fieldtype": "Currency",
"hidden": 0,
@@ -454,6 +471,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "credit",
"fieldtype": "Currency",
"hidden": 0,
@@ -482,6 +500,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference",
"fieldtype": "Section Break",
"hidden": 0,
@@ -506,6 +525,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_type",
"fieldtype": "Select",
"hidden": 0,
@@ -532,6 +552,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"hidden": 0,
@@ -558,6 +579,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "project",
"fieldtype": "Link",
"hidden": 0,
@@ -584,6 +606,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -607,6 +630,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_advance",
"fieldtype": "Select",
"hidden": 0,
@@ -634,6 +658,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "against_account",
"fieldtype": "Text",
"hidden": 1,
@@ -667,7 +692,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:28:01.575159",
"modified": "2016-08-26 01:54:32.267927",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",

View File

@@ -9,11 +9,14 @@
"description": "**Monthly Distribution** helps you distribute the Budget/Target across months if you have seasonality in your business.",
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Name of the Monthly Distribution",
"fieldname": "distribution_id",
"fieldtype": "Data",
@@ -31,6 +34,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -41,6 +45,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "fiscal_year",
"fieldtype": "Link",
"hidden": 0,
@@ -58,6 +63,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@@ -68,6 +74,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "percentages",
"fieldtype": "Table",
"hidden": 0,
@@ -85,6 +92,7 @@
"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,
@@ -96,13 +104,14 @@
"hide_toolbar": 0,
"icon": "icon-bar-chart",
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-05-16 16:35:20.349194",
"modified": "2016-11-21 14:54:35.998761",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Monthly Distribution",
@@ -119,6 +128,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -139,6 +149,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 2,
"print": 0,
"read": 1,
@@ -150,7 +161,7 @@
"write": 0
}
],
"quick_entry": 1,
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",

View File

@@ -11,13 +11,6 @@ frappe.ui.form.on('Payment Entry', {
},
setup: function(frm) {
frm.get_field('references').grid.editable_fields = [
{fieldname: 'reference_doctype', columns: 2},
{fieldname: 'reference_name', columns: 2},
{fieldname: 'outstanding_amount', columns: 3},
{fieldname: 'allocated_amount', columns: 3}
];
var party_account_type = frm.doc.party_type=="Customer" ? "Receivable" : "Payable";
frm.set_query("paid_from", function() {
@@ -413,7 +406,10 @@ frappe.ui.form.on('Payment Entry', {
if(!frm.doc.paid_amount && frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
frm.set_value("paid_amount", frm.doc.received_amount);
frm.set_value("source_exchange_rate", frm.doc.target_exchange_rate);
if(frm.doc.target_exchange_rate) {
frm.set_value("source_exchange_rate", frm.doc.target_exchange_rate);
}
frm.set_value("base_paid_amount", frm.doc.base_received_amount);
}
@@ -433,7 +429,10 @@ frappe.ui.form.on('Payment Entry', {
(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency)) {
frm.set_value("received_amount", frm.doc.paid_amount);
frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
if(frm.doc.source_exchange_rate) {
frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
}
frm.set_value("base_received_amount", frm.doc.base_paid_amount);
}

View File

@@ -31,6 +31,7 @@
"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,
@@ -58,6 +59,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -85,6 +87,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -113,6 +116,7 @@
"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,
@@ -141,6 +145,7 @@
"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,
@@ -167,6 +172,7 @@
"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,
@@ -192,6 +198,7 @@
"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,
@@ -219,6 +226,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -246,6 +254,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -273,6 +282,7 @@
"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,
@@ -299,6 +309,7 @@
"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,
@@ -326,6 +337,7 @@
"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,
@@ -354,6 +366,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -382,6 +395,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -410,6 +424,7 @@
"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,
@@ -435,6 +450,7 @@
"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,
@@ -463,6 +479,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -491,6 +508,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -519,6 +537,7 @@
"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,
@@ -547,6 +566,7 @@
"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,
@@ -575,6 +595,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -602,6 +623,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -630,6 +652,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -655,6 +678,7 @@
"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,
@@ -683,6 +707,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -710,6 +735,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -738,6 +764,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -766,6 +793,7 @@
"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,
@@ -794,6 +822,7 @@
"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,
@@ -822,6 +851,7 @@
"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,
@@ -849,6 +879,7 @@
"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,
@@ -876,6 +907,7 @@
"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,
@@ -904,6 +936,7 @@
"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,
@@ -930,6 +963,7 @@
"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,
@@ -955,6 +989,7 @@
"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,
@@ -982,6 +1017,7 @@
"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,
@@ -1010,6 +1046,7 @@
"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,
@@ -1037,6 +1074,7 @@
"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,
@@ -1065,6 +1103,7 @@
"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,
@@ -1092,6 +1131,7 @@
"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,
@@ -1118,6 +1158,7 @@
"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,
@@ -1145,6 +1186,7 @@
"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,
@@ -1170,6 +1212,7 @@
"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,
@@ -1197,6 +1240,7 @@
"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,
@@ -1224,6 +1268,7 @@
"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,
@@ -1252,6 +1297,7 @@
"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,
@@ -1280,6 +1326,7 @@
"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,
@@ -1306,6 +1353,7 @@
"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,
@@ -1331,6 +1379,7 @@
"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,
@@ -1358,6 +1407,7 @@
"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,
@@ -1385,6 +1435,7 @@
"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,
@@ -1411,6 +1462,7 @@
"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,
@@ -1437,6 +1489,7 @@
"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,
@@ -1454,7 +1507,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-09-28 18:20:47.625383",
"modified": "2016-11-03 15:52:35.329427",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",
@@ -1471,6 +1524,7 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -1491,6 +1545,7 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View File

@@ -60,7 +60,14 @@ class PaymentEntry(AccountsController):
self.setup_party_account_field()
self.make_gl_entries(cancel=1)
self.update_advance_paid()
self.delink_advance_entry_references()
def delink_advance_entry_references(self):
for reference in self.references:
if reference.reference_doctype in ("Sales Invoice", "Purchase Invoice"):
doc = frappe.get_doc(reference.reference_doctype, reference.reference_name)
doc.delink_advance_entries(self.name)
def set_missing_values(self):
if self.payment_type == "Internal Transfer":
for field in ("party", "party_balance", "total_allocated_amount",
@@ -632,7 +639,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
if party_amount:
grand_total = outstanding_amount = party_amount
elif dt in ("Sales Invoice", "Purchase Invoice"):
grand_total = doc.grand_total
grand_total = doc.base_grand_total if party_account_currency == doc.company_currency else doc.grand_total
outstanding_amount = doc.outstanding_amount
else:
total_field = "base_grand_total" if party_account_currency == doc.company_currency else "grand_total"

View File

@@ -14,13 +14,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "reference_doctype",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Type",
"length": 0,
"no_copy": 0,
@@ -30,6 +31,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -40,6 +42,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"hidden": 0,
@@ -56,6 +59,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -66,6 +70,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "due_date",
"fieldtype": "Date",
"hidden": 0,
@@ -81,6 +86,7 @@
"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,
@@ -91,6 +97,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_4",
"fieldtype": "Column Break",
"hidden": 0,
@@ -105,6 +112,7 @@
"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,
@@ -115,6 +123,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "total_amount",
"fieldtype": "Float",
"hidden": 0,
@@ -130,6 +139,7 @@
"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,
@@ -140,6 +150,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "outstanding_amount",
"fieldtype": "Float",
"hidden": 0,
@@ -155,6 +166,7 @@
"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,
@@ -165,6 +177,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "allocated_amount",
"fieldtype": "Float",
"hidden": 0,
@@ -180,6 +193,7 @@
"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,
@@ -190,6 +204,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "exchange_rate",
"fieldtype": "Float",
"hidden": 0,
@@ -205,6 +220,7 @@
"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,
@@ -222,7 +238,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-14 14:48:13.356944",
"modified": "2016-11-14 12:28:51.822341",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Reference",

View File

@@ -4,15 +4,6 @@
frappe.provide("erpnext.accounts");
erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.extend({
setup: function() {
this.frm.get_field('payments').grid.editable_fields = [
{fieldname: 'reference_name', columns: 3},
{fieldname: 'invoice_number', columns: 3},
{fieldname: 'amount', columns: 2},
{fieldname: 'allocated_amount', columns: 2}
];
},
onload: function() {
var me = this
this.frm.set_query('party_type', function() {

View File

@@ -14,6 +14,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_type",
"fieldtype": "Link",
"hidden": 0,
@@ -39,6 +40,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 3,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"hidden": 0,
@@ -65,13 +67,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "posting_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Posting Date",
"length": 0,
"no_copy": 0,
@@ -89,30 +92,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "amount",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_advance",
"fieldtype": "Data",
"hidden": 1,
@@ -137,6 +117,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_row",
"fieldtype": "Data",
"hidden": 1,
@@ -161,6 +142,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -185,6 +167,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 3,
"fieldname": "invoice_number",
"fieldtype": "Select",
"hidden": 0,
@@ -210,6 +193,32 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "amount",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "allocated_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -235,6 +244,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sec_break1",
"fieldtype": "Section Break",
"hidden": 0,
@@ -259,6 +269,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "remark",
"fieldtype": "Small Text",
"hidden": 0,
@@ -291,7 +302,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-07-11 03:28:03.672936",
"modified": "2016-08-26 02:08:35.879133",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Payment",

View File

@@ -2,7 +2,7 @@
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "PR.######",
"autoname": "naming_series:",
"beta": 0,
"creation": "2015-12-15 22:23:24.745065",
"custom": 0,
@@ -15,6 +15,34 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
"length": 0,
"no_copy": 1,
"options": "PR",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "recipient_and_message",
"fieldtype": "Section Break",
"hidden": 0,
@@ -40,6 +68,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
"fieldname": "print_format",
"fieldtype": "Select",
@@ -67,6 +96,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "email_to",
"fieldtype": "Data",
"hidden": 0,
@@ -92,6 +122,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "subject",
"fieldtype": "Data",
"hidden": 0,
@@ -117,6 +148,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_9",
"fieldtype": "Column Break",
"hidden": 0,
@@ -141,6 +173,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "payment_gateway_account",
"fieldtype": "Link",
"hidden": 0,
@@ -167,6 +200,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "currency",
"fieldtype": "Link",
"hidden": 0,
@@ -193,6 +227,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Amount in customer's currency",
"fieldname": "grand_total",
"fieldtype": "Currency",
@@ -220,6 +255,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
@@ -247,6 +283,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.reference_doctype==\"Sales Order\"",
"fieldname": "make_sales_invoice",
"fieldtype": "Check",
@@ -273,6 +310,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_10",
"fieldtype": "Section Break",
"hidden": 0,
@@ -297,6 +335,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "message",
"fieldtype": "Small Text",
"hidden": 0,
@@ -322,6 +361,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "message_examples",
"fieldtype": "HTML",
"hidden": 0,
@@ -348,6 +388,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "mute_email",
"fieldtype": "Check",
"hidden": 1,
@@ -373,6 +414,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "payment_url",
"fieldtype": "Data",
"hidden": 1,
@@ -399,6 +441,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "doc.payment_gateway_account",
"columns": 0,
"fieldname": "section_break_7",
"fieldtype": "Section Break",
"hidden": 0,
@@ -424,6 +467,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "payment_gateway",
"fieldtype": "Read Only",
"hidden": 0,
@@ -450,6 +494,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "payment_account",
"fieldtype": "Read Only",
"hidden": 0,
@@ -476,6 +521,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_details",
"fieldtype": "Section Break",
"hidden": 0,
@@ -501,6 +547,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_doctype",
"fieldtype": "Link",
"hidden": 0,
@@ -527,6 +574,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"hidden": 0,
@@ -553,6 +601,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -585,7 +634,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-25 01:34:44.372161",
"modified": "2016-09-02 04:07:15.279949",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",

View File

@@ -6,10 +6,11 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt, get_url, nowdate
from frappe.utils import flt, nowdate, get_url
from erpnext.accounts.party import get_party_account
from erpnext.accounts.utils import get_account_currency
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry, get_company_defaults
from frappe.integration_broker.doctype.integration_service.integration_service import get_integration_controller
class PaymentRequest(Document):
def validate(self):
@@ -25,7 +26,7 @@ class PaymentRequest(Document):
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
if self.payment_account and ref_doc.currency != frappe.db.get_value("Account", self.payment_account, "account_currency"):
frappe.throw(_("Transaction currency must be same as Payment Gateway currency"))
def on_submit(self):
send_mail = True
self.make_communication_entry()
@@ -35,17 +36,13 @@ class PaymentRequest(Document):
send_mail = False
if send_mail and not self.flags.mute_email:
self.send_payment_request()
self.set_payment_request_url()
self.send_email()
def on_cancel(self):
self.check_if_payment_entry_exists()
self.set_as_cancelled()
def get_payment_url(self):
""" This is blanck method to trigger hooks call from individual payment gateway app
which will return respective payment gateway"""
pass
def make_invoice(self):
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
if hasattr(ref_doc, "order_type") and getattr(ref_doc, "order_type") == "Shopping Cart":
@@ -54,20 +51,39 @@ class PaymentRequest(Document):
si = si.insert(ignore_permissions=True)
si.submit()
def send_payment_request(self):
def set_payment_request_url(self):
if self.payment_account:
self.payment_url = get_url("/api/method/erpnext.accounts.doctype.payment_request.payment_request.generate_payment_request?name={0}".format(self.name))
self.payment_url = self.get_payment_url()
if self.payment_url:
self.db_set('payment_url', self.payment_url)
if self.payment_url or not self.payment_gateway_account:
self.db_set('status', 'Initiated')
def get_payment_url(self):
data = frappe.db.get_value(self.reference_doctype, self.reference_name,
["company", "customer_name"], as_dict=1)
controller = get_integration_controller(self.payment_gateway)
controller.validate_transaction_currency(self.currency)
return controller.get_payment_url(**{
"amount": self.grand_total,
"title": data.company,
"description": self.subject,
"reference_doctype": "Payment Request",
"reference_docname": self.name,
"payer_email": self.email_to or frappe.session.user,
"payer_name": data.customer_name,
"order_id": self.name,
"currency": self.currency
})
def set_as_paid(self):
if frappe.session.user == "Guest":
frappe.set_user("Administrator")
payment_entry = self.create_payment_entry()
self.make_invoice()
@@ -141,6 +157,13 @@ class PaymentRequest(Document):
def set_as_cancelled(self):
self.db_set("status", "Cancelled")
def check_if_payment_entry_exists(self):
if self.status == "Paid":
payment_entry = frappe.db.sql_list("""select parent from `tabPayment Entry Reference`
where reference_name=%s""", self.reference_name)
if payment_entry:
frappe.throw(_("Payment Entry already exists"), title=_('Error'))
def make_communication_entry(self):
"""Make communication entry"""
@@ -156,7 +179,33 @@ class PaymentRequest(Document):
def get_payment_success_url(self):
return self.payment_success_url
def on_payment_authorized(self, status=None):
if not status:
return
shopping_cart_settings = frappe.get_doc("Shopping Cart Settings")
if status in ["Authorized", "Completed"]:
redirect_to = None
self.run_method("set_as_paid")
# if shopping cart enabled and in session
if (shopping_cart_settings.enabled and hasattr(frappe.local, "session")
and frappe.local.session.user != "Guest"):
success_url = shopping_cart_settings.payment_success_url
if success_url:
redirect_to = ({
"Orders": "orders",
"Invoices": "invoices",
"My Account": "me"
}).get(success_url, "me")
else:
redirect_to = get_url("/orders/{0}".format(self.reference_name))
return redirect_to
@frappe.whitelist(allow_guest=True)
def make_payment_request(**args):
"""Make payment request"""
@@ -201,8 +250,9 @@ def make_payment_request(**args):
pr.submit()
if hasattr(ref_doc, "order_type") and getattr(ref_doc, "order_type") == "Shopping Cart":
generate_payment_request(pr.name)
frappe.db.commit()
frappe.local.response["type"] = "redirect"
frappe.local.response["location"] = pr.get_payment_url()
if not args.cart:
return pr
@@ -255,10 +305,6 @@ def get_print_format_list(ref_doctype):
"print_format": print_format_list
}
@frappe.whitelist(allow_guest=True)
def generate_payment_request(name):
frappe.get_doc("Payment Request", name).run_method("get_payment_url")
@frappe.whitelist(allow_guest=True)
def resend_payment_email(docname):
return frappe.get_doc("Payment Request", docname).send_email()
@@ -278,6 +324,7 @@ def make_status_as_paid(doc, method):
doc = frappe.get_doc("Payment Request", payment_request_name)
if doc.status != "Paid":
doc.db_set('status', 'Paid')
frappe.db.commit()
def get_dummy_message(use_dummy_message=True):
return """

View File

@@ -0,0 +1,66 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2016-11-16 15:27:16.413449",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer_group",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Customer Group",
"length": 0,
"no_copy": 0,
"options": "Customer Group",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-11-16 15:27:25.730507",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Customer Group",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_seen": 0
}

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class POSCustomerGroup(Document):
pass

View File

@@ -0,0 +1,66 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2016-11-16 15:26:47.706713",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "item_group",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Group",
"length": 0,
"no_copy": 0,
"options": "Item Group",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-11-16 15:27:32.263630",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Item Group",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_seen": 0
}

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class POSItemGroup(Document):
pass

View File

@@ -26,6 +26,30 @@ frappe.ui.form.on("POS Profile", "onload", function(frm) {
});
});
frappe.ui.form.on("POS Profile", {
setup: function(frm) {
frm.trigger("get_query_for_groups")
},
get_query_for_groups: function(frm) {
frm.fields_dict['item_groups'].grid.get_field('item_group').get_query = function(frm, cdt, cdn) {
return{
filters: {
'is_group': 0
}
}
}
frm.fields_dict['customer_groups'].grid.get_field('customer_group').get_query = function(frm, cdt, cdn) {
return{
filters: {
'is_group': 0
}
}
}
}
})
// Income Account
// --------------------------------
cur_frm.fields_dict['income_account'].get_query = function(doc,cdt,cdn) {

View File

@@ -14,6 +14,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "user",
"fieldtype": "Link",
"hidden": 0,
@@ -31,6 +32,7 @@
"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,
@@ -41,6 +43,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@@ -58,6 +61,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -68,6 +72,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"description": "",
"fieldname": "update_stock",
@@ -84,6 +89,7 @@
"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,
@@ -94,6 +100,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "update_stock",
"fieldname": "warehouse",
"fieldtype": "Link",
@@ -112,6 +119,7 @@
"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,
@@ -122,6 +130,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "campaign",
"fieldtype": "Link",
"hidden": 0,
@@ -138,6 +147,7 @@
"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,
@@ -148,6 +158,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ignore_pricing_rule",
"fieldtype": "Check",
"hidden": 0,
@@ -163,6 +174,7 @@
"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,
@@ -173,6 +185,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_4",
"fieldtype": "Column Break",
"hidden": 0,
@@ -187,6 +200,7 @@
"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,
@@ -197,6 +211,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
@@ -214,6 +229,7 @@
"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,
@@ -224,6 +240,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -241,6 +258,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -251,6 +269,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "currency",
"fieldtype": "Link",
"hidden": 0,
@@ -268,6 +287,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -278,6 +298,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "allow_partial_payment",
"fieldtype": "Check",
"hidden": 0,
@@ -293,6 +314,7 @@
"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,
@@ -303,6 +325,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_11",
"fieldtype": "Section Break",
"hidden": 0,
@@ -317,6 +340,7 @@
"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,
@@ -327,6 +351,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "payments",
"fieldtype": "Table",
"hidden": 0,
@@ -343,6 +368,7 @@
"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,
@@ -353,6 +379,115 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_14",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "item_groups",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Groups",
"length": 0,
"no_copy": 0,
"options": "POS Item Group",
"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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_16",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer_groups",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Groups",
"length": 0,
"no_copy": 0,
"options": "POS Customer Group",
"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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_16",
"fieldtype": "Section Break",
"hidden": 0,
@@ -367,6 +502,7 @@
"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,
@@ -377,6 +513,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Point of Sale",
"fieldname": "print_format",
"fieldtype": "Link",
@@ -394,6 +531,7 @@
"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,
@@ -404,6 +542,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "letter_head",
"fieldtype": "Link",
"hidden": 0,
@@ -421,6 +560,7 @@
"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,
@@ -431,6 +571,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "select_print_heading",
"fieldtype": "Link",
"hidden": 0,
@@ -448,6 +589,7 @@
"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,
@@ -458,6 +600,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "tc_name",
"fieldtype": "Link",
"hidden": 0,
@@ -475,6 +618,7 @@
"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,
@@ -485,6 +629,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"hidden": 0,
@@ -499,6 +644,7 @@
"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,
@@ -509,32 +655,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "customer_group",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Group",
"length": 0,
"no_copy": 0,
"options": "Customer Group",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "territory",
"fieldtype": "Link",
@@ -553,6 +674,7 @@
"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,
@@ -563,6 +685,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "selling_price_list",
"fieldtype": "Link",
"hidden": 0,
@@ -580,6 +703,7 @@
"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,
@@ -590,6 +714,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "apply_discount",
"fieldtype": "Check",
"hidden": 0,
@@ -605,6 +730,7 @@
"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,
@@ -615,6 +741,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Grand Total",
"depends_on": "apply_discount",
"fieldname": "apply_discount_on",
@@ -633,6 +760,7 @@
"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,
@@ -643,6 +771,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_19",
"fieldtype": "Section Break",
"hidden": 0,
@@ -657,6 +786,7 @@
"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,
@@ -667,6 +797,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "write_off_account",
"fieldtype": "Link",
@@ -684,6 +815,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -694,6 +826,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "write_off_cost_center",
"fieldtype": "Link",
"hidden": 0,
@@ -710,6 +843,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -720,6 +854,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "account_for_change_amount",
"fieldtype": "Link",
"hidden": 0,
@@ -736,6 +871,7 @@
"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,
@@ -746,6 +882,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes_and_charges",
"fieldtype": "Link",
"hidden": 0,
@@ -763,6 +900,7 @@
"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,
@@ -773,6 +911,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_23",
"fieldtype": "Column Break",
"hidden": 0,
@@ -787,6 +926,7 @@
"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,
@@ -797,6 +937,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "income_account",
"fieldtype": "Link",
"hidden": 0,
@@ -814,6 +955,7 @@
"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,
@@ -824,6 +966,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
"fieldname": "expense_account",
"fieldtype": "Link",
@@ -840,6 +983,7 @@
"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,
@@ -850,6 +994,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cost_center",
"fieldtype": "Link",
"hidden": 0,
@@ -867,6 +1012,7 @@
"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,
@@ -885,8 +1031,8 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-08-17 15:12:56.713748",
"modified_by": "Administrator",
"modified": "2016-11-17 00:20:51.377850",
"modified_by": "rohit@erpnext.com",
"module": "Accounts",
"name": "POS Profile",
"owner": "Administrator",
@@ -901,6 +1047,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -921,6 +1068,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View File

@@ -13,6 +13,7 @@ class POSProfile(Document):
def validate(self):
self.check_for_duplicate()
self.validate_all_link_fields()
self.validate_duplicate_groups()
def check_for_duplicate(self):
res = frappe.db.sql("""select name, user from `tabPOS Profile`
@@ -37,6 +38,16 @@ class POSProfile(Document):
"company": self.company, "name": link_dn}):
frappe.throw(_("{0} does not belong to Company {1}").format(link_dn, self.company))
def validate_duplicate_groups(self):
item_groups = [d.item_group for d in self.item_groups]
customer_groups = [d.customer_group for d in self.customer_groups]
if len(item_groups) != len(set(item_groups)):
frappe.throw(_("Duplicate item group found in the item group table"), title = "Duplicate Item Group")
if len(customer_groups) != len(set(customer_groups)):
frappe.throw(_("Duplicate customer group found in the cutomer group table"), title = "Duplicate Customer Group")
def before_save(self):
set_account_for_mode_of_payment(self)

View File

@@ -5,8 +5,47 @@ from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('POS Profile')
from erpnext.stock.get_item_details import get_pos_profile
from erpnext.accounts.doctype.sales_invoice.pos import get_items_list, get_customers_list
class TestPOSProfile(unittest.TestCase):
pass
def test_pos_profile(self):
make_pos_profile()
pos_profile = get_pos_profile("_Test Company") or {}
if pos_profile:
doc = frappe.get_doc("POS Profile", pos_profile.get("name"))
doc.append('item_groups', {'item_group': '_Test Item Group'})
doc.append('customer_groups', {'customer_group': '_Test Customer Group'})
doc.save()
items = get_items_list(doc)
customers = get_customers_list(doc)
products_count = frappe.db.sql(""" select count(name) from tabItem where item_group = '_Test Item Group'""", as_list=1)
customers_count = frappe.db.sql(""" select count(name) from tabCustomer where customer_group = '_Test Customer Group'""")
self.assertEquals(len(items), products_count[0][0])
self.assertEquals(len(customers), customers_count[0][0])
frappe.db.sql("delete from `tabPOS Profile`")
def make_pos_profile():
pos_profile = frappe.get_doc({
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"currency": "INR",
"doctype": "POS Profile",
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"income_account": "Sales - _TC",
"name": "_Test POS Profile",
"naming_series": "_T-POS Profile-",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory",
"warehouse": "_Test Warehouse - _TC",
"write_off_account": "_Test Write Off - _TC",
"write_off_cost_center": "_Test Write Off Cost Center - _TC"
})
if not frappe.db.exists("POS Profile", "_Test POS Profile"):
pos_profile.insert()

View File

@@ -3,16 +3,19 @@
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:title",
"beta": 0,
"creation": "2014-02-21 15:02:51",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "applicability_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -27,6 +30,7 @@
"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,
@@ -37,6 +41,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title",
"fieldtype": "Data",
"hidden": 0,
@@ -52,6 +57,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -62,6 +68,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Item Code",
"fieldname": "apply_on",
"fieldtype": "Select",
@@ -78,6 +85,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -88,6 +96,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.apply_on==\"Item Code\"",
"fieldname": "item_code",
"fieldtype": "Link",
@@ -104,6 +113,7 @@
"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,
@@ -114,6 +124,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.apply_on==\"Brand\"",
"fieldname": "brand",
"fieldtype": "Link",
@@ -130,6 +141,7 @@
"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,
@@ -140,6 +152,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.apply_on==\"Item Group\"",
"fieldname": "item_group",
"fieldtype": "Link",
@@ -156,6 +169,7 @@
"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,
@@ -166,6 +180,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_7",
"fieldtype": "Column Break",
"hidden": 0,
@@ -180,6 +195,7 @@
"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,
@@ -190,6 +206,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Higher the number, higher the priority",
"fieldname": "priority",
"fieldtype": "Select",
@@ -206,6 +223,7 @@
"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,
@@ -216,6 +234,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "disable",
"fieldtype": "Check",
"hidden": 0,
@@ -230,6 +249,7 @@
"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,
@@ -240,6 +260,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_7",
"fieldtype": "Section Break",
"hidden": 0,
@@ -254,6 +275,7 @@
"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,
@@ -264,6 +286,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "selling",
"fieldtype": "Check",
"hidden": 0,
@@ -278,6 +301,7 @@
"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,
@@ -288,6 +312,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "buying",
"fieldtype": "Check",
"hidden": 0,
@@ -302,6 +327,7 @@
"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,
@@ -312,6 +338,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_11",
"fieldtype": "Column Break",
"hidden": 0,
@@ -326,6 +353,7 @@
"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,
@@ -336,6 +364,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval: doc.buying || doc.selling",
"fieldname": "applicable_for",
"fieldtype": "Select",
@@ -352,6 +381,7 @@
"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,
@@ -362,6 +392,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.applicable_for==\"Customer\"",
"fieldname": "customer",
"fieldtype": "Link",
@@ -378,6 +409,7 @@
"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,
@@ -388,6 +420,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.applicable_for==\"Customer Group\"",
"fieldname": "customer_group",
"fieldtype": "Link",
@@ -404,6 +437,7 @@
"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,
@@ -414,6 +448,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.applicable_for==\"Territory\"",
"fieldname": "territory",
"fieldtype": "Link",
@@ -430,6 +465,7 @@
"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,
@@ -440,6 +476,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.applicable_for==\"Sales Partner\"",
"fieldname": "sales_partner",
"fieldtype": "Link",
@@ -456,6 +493,7 @@
"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,
@@ -466,6 +504,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.applicable_for==\"Campaign\"",
"fieldname": "campaign",
"fieldtype": "Link",
@@ -482,6 +521,7 @@
"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,
@@ -492,6 +532,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.applicable_for==\"Supplier\"",
"fieldname": "supplier",
"fieldtype": "Link",
@@ -508,6 +549,7 @@
"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,
@@ -518,6 +560,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.applicable_for==\"Supplier Type\"",
"fieldname": "supplier_type",
"fieldtype": "Link",
@@ -534,6 +577,7 @@
"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,
@@ -544,6 +588,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_19",
"fieldtype": "Section Break",
"hidden": 0,
@@ -558,6 +603,7 @@
"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,
@@ -568,6 +614,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "min_qty",
"fieldtype": "Float",
"hidden": 0,
@@ -582,6 +629,7 @@
"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,
@@ -592,6 +640,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_21",
"fieldtype": "Column Break",
"hidden": 0,
@@ -606,6 +655,7 @@
"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,
@@ -616,6 +666,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "max_qty",
"fieldtype": "Float",
"hidden": 0,
@@ -630,6 +681,7 @@
"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,
@@ -640,6 +692,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_23",
"fieldtype": "Section Break",
"hidden": 0,
@@ -654,6 +707,7 @@
"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,
@@ -664,6 +718,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "valid_from",
"fieldtype": "Date",
@@ -679,6 +734,7 @@
"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,
@@ -689,6 +745,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "valid_upto",
"fieldtype": "Date",
"hidden": 0,
@@ -703,6 +760,7 @@
"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,
@@ -713,6 +771,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -726,6 +785,7 @@
"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,
@@ -736,6 +796,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -751,6 +812,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -761,6 +823,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval: doc.selling == 1",
"fieldname": "margin",
"fieldtype": "Section Break",
@@ -777,6 +840,7 @@
"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,
@@ -787,6 +851,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Percentage",
"fieldname": "margin_type",
"fieldtype": "Select",
@@ -804,6 +869,7 @@
"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,
@@ -814,6 +880,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_33",
"fieldtype": "Column Break",
"hidden": 0,
@@ -828,6 +895,7 @@
"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,
@@ -838,6 +906,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0",
"depends_on": "eval:doc.margin_type",
"fieldname": "margin_rate_or_amount",
@@ -855,6 +924,7 @@
"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,
@@ -865,6 +935,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "price_discount_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -879,6 +950,7 @@
"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,
@@ -889,6 +961,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Discount Percentage",
"fieldname": "price_or_discount",
"fieldtype": "Select",
@@ -905,6 +978,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -915,6 +989,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -928,6 +1003,7 @@
"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,
@@ -938,6 +1014,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.price_or_discount==\"Price\"",
"fieldname": "price",
"fieldtype": "Float",
@@ -953,6 +1030,7 @@
"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,
@@ -963,6 +1041,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
"fieldname": "discount_percentage",
"fieldtype": "Float",
@@ -978,6 +1057,7 @@
"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,
@@ -988,6 +1068,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
"fieldname": "for_price_list",
"fieldtype": "Link",
@@ -1004,6 +1085,7 @@
"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,
@@ -1014,6 +1096,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "help_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1029,6 +1112,7 @@
"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,
@@ -1039,6 +1123,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "pricing_rule_help",
"fieldtype": "HTML",
"hidden": 0,
@@ -1053,6 +1138,7 @@
"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,
@@ -1064,13 +1150,14 @@
"hide_toolbar": 0,
"icon": "icon-gift",
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-03-16 17:35:25.935271",
"modified": "2016-11-03 15:54:12.674744",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
@@ -1086,6 +1173,7 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -1106,6 +1194,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -1126,6 +1215,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -1146,6 +1236,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -1166,6 +1257,7 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -1177,9 +1269,11 @@
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": ""
"title_field": "",
"track_seen": 0
}

View File

@@ -165,6 +165,13 @@ def get_pricing_rule_for_item(args):
})
else:
item_details.discount_percentage = pricing_rule.discount_percentage
elif args.get('pricing_rule'):
if frappe.db.get_value('Pricing Rule', args.get('pricing_rule'), 'price_or_discount') == 'Discount Percentage':
item_details.discount_percentage = 0.0
item_details.margin_rate_or_amount = 0.0
item_details.margin_type = None
return item_details
def get_pricing_rules(args):

View File

@@ -198,7 +198,7 @@ function hide_fields(doc) {
item_fields_stock = ['warehouse_section', 'received_qty', 'rejected_qty'];
cur_frm.fields_dict['items'].grid.set_column_disp(item_fields_stock,
(cint(doc.update_stock)==1 ? true : false));
(cint(doc.update_stock)==1 || cint(doc.is_return)==1 ? true : false));
cur_frm.refresh_fields();
}

View File

@@ -32,6 +32,7 @@
"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,
@@ -60,6 +61,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -88,6 +90,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
@@ -116,6 +119,7 @@
"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,
@@ -144,6 +148,7 @@
"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,
@@ -170,6 +175,7 @@
"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,
@@ -197,6 +203,7 @@
"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,
@@ -222,6 +229,7 @@
"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,
@@ -251,6 +259,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@@ -278,6 +287,7 @@
"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,
@@ -305,6 +315,7 @@
"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,
@@ -333,6 +344,7 @@
"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,
@@ -359,6 +371,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -387,6 +400,7 @@
"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,
@@ -413,6 +427,7 @@
"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,
@@ -439,6 +454,7 @@
"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,
@@ -465,6 +481,7 @@
"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,
@@ -491,6 +508,7 @@
"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,
@@ -516,6 +534,7 @@
"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,
@@ -541,6 +560,7 @@
"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,
@@ -566,6 +586,7 @@
"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,
@@ -591,6 +612,7 @@
"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,
@@ -619,6 +641,7 @@
"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,
@@ -645,6 +668,7 @@
"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,
@@ -671,6 +695,7 @@
"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,
@@ -699,6 +724,7 @@
"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,
@@ -728,6 +754,7 @@
"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,
@@ -752,6 +779,7 @@
"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,
@@ -778,6 +806,7 @@
"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,
@@ -804,6 +833,7 @@
"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,
@@ -830,6 +860,7 @@
"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,
@@ -855,6 +886,7 @@
"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,
@@ -882,6 +914,7 @@
"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,
@@ -909,6 +942,7 @@
"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,
@@ -937,6 +971,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -961,6 +996,7 @@
"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,
@@ -988,6 +1024,7 @@
"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,
@@ -1017,6 +1054,7 @@
"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,
@@ -1041,6 +1079,7 @@
"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,
@@ -1068,6 +1107,7 @@
"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,
@@ -1096,6 +1136,7 @@
"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,
@@ -1123,6 +1164,7 @@
"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,
@@ -1151,6 +1193,7 @@
"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,
@@ -1179,6 +1222,7 @@
"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,
@@ -1205,6 +1249,7 @@
"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,
@@ -1232,6 +1277,7 @@
"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,
@@ -1260,6 +1306,7 @@
"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,
@@ -1288,6 +1335,7 @@
"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,
@@ -1316,6 +1364,7 @@
"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,
@@ -1341,6 +1390,7 @@
"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,
@@ -1369,6 +1419,7 @@
"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,
@@ -1397,6 +1448,7 @@
"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,
@@ -1424,6 +1476,7 @@
"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,
@@ -1451,6 +1504,7 @@
"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,
@@ -1479,6 +1533,7 @@
"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,
@@ -1506,6 +1561,7 @@
"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,
@@ -1531,6 +1587,7 @@
"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,
@@ -1557,6 +1614,7 @@
"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,
@@ -1584,6 +1642,7 @@
"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,
@@ -1609,6 +1668,7 @@
"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,
@@ -1637,6 +1697,7 @@
"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,
@@ -1665,6 +1726,7 @@
"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,
@@ -1690,6 +1752,7 @@
"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,
@@ -1719,6 +1782,7 @@
"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,
@@ -1746,6 +1810,7 @@
"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,
@@ -1774,6 +1839,7 @@
"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,
@@ -1802,6 +1868,7 @@
"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,
@@ -1830,6 +1897,7 @@
"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,
@@ -1857,6 +1925,7 @@
"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,
@@ -1884,6 +1953,7 @@
"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,
@@ -1909,6 +1979,7 @@
"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,
@@ -1937,6 +2008,7 @@
"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,
@@ -1964,6 +2036,7 @@
"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,
@@ -1992,6 +2065,7 @@
"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,
@@ -2018,6 +2092,7 @@
"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,
@@ -2045,6 +2120,7 @@
"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,
@@ -2070,6 +2146,7 @@
"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,
@@ -2097,6 +2174,7 @@
"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,
@@ -2124,6 +2202,7 @@
"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,
@@ -2152,6 +2231,7 @@
"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,
@@ -2179,6 +2259,7 @@
"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,
@@ -2207,6 +2288,7 @@
"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,
@@ -2234,6 +2316,7 @@
"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,
@@ -2260,6 +2343,7 @@
"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,
@@ -2285,6 +2369,7 @@
"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,
@@ -2311,6 +2396,7 @@
"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,
@@ -2339,6 +2425,7 @@
"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,
@@ -2367,6 +2454,7 @@
"print_hide_if_no_value": 0,
"print_width": "50px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -2395,6 +2483,7 @@
"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,
@@ -2421,6 +2510,7 @@
"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,
@@ -2448,6 +2538,7 @@
"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,
@@ -2476,6 +2567,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
@@ -2502,6 +2594,7 @@
"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,
@@ -2529,6 +2622,7 @@
"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,
@@ -2558,6 +2652,7 @@
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
@@ -2585,6 +2680,7 @@
"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,
@@ -2615,6 +2711,7 @@
"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,
@@ -2642,6 +2739,7 @@
"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,
@@ -2666,6 +2764,36 @@
"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_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Status",
"length": 0,
"no_copy": 0,
"options": "\nDraft\nReturn\nDebit Note Issued\nSubmitted\nPaid\nUnpaid\nOverdue\nCancelled",
"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,
@@ -2693,6 +2821,7 @@
"print_hide_if_no_value": 0,
"print_width": "100px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -2721,6 +2850,7 @@
"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,
@@ -2749,6 +2879,7 @@
"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,
@@ -2777,6 +2908,7 @@
"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,
@@ -2804,6 +2936,7 @@
"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,
@@ -2832,6 +2965,7 @@
"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,
@@ -2859,6 +2993,7 @@
"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,
@@ -2886,6 +3021,7 @@
"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,
@@ -2913,6 +3049,7 @@
"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,
@@ -2941,6 +3078,7 @@
"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,
@@ -2968,6 +3106,7 @@
"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,
@@ -2995,6 +3134,7 @@
"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,
@@ -3019,6 +3159,7 @@
"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,
@@ -3047,6 +3188,7 @@
"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,
@@ -3074,6 +3216,7 @@
"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,
@@ -3101,6 +3244,7 @@
"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,
@@ -3129,6 +3273,7 @@
"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,
@@ -3148,7 +3293,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-09-23 18:02:45.349273",
"modified": "2016-11-09 14:18:47.094777",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
@@ -3164,6 +3309,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -3184,6 +3330,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -3204,6 +3351,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -3224,6 +3372,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -3244,6 +3393,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 0,
"read": 1,

View File

@@ -58,20 +58,21 @@ class PurchaseInvoice(BuyingController):
self.check_for_closed_status()
self.validate_with_previous_doc()
self.validate_uom_is_integer("uom", "qty")
self.set_expense_account()
self.set_expense_account(for_validate=True)
self.set_against_expense_account()
self.validate_write_off_account()
self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount", "items")
self.validate_fixed_asset()
self.validate_fixed_asset_account()
self.create_remarks()
self.set_status()
def validate_cash(self):
if not self.cash_bank_account and flt(self.paid_amount):
frappe.throw(_("Cash or Bank Account is mandatory for making payment entry"))
if flt(self.paid_amount) + flt(self.write_off_amount) \
- flt(self.base_grand_total) > 1/(10**(self.precision("base_grand_total") + 1)):
- flt(self.grand_total) > 1/(10**(self.precision("base_grand_total") + 1)):
frappe.throw(_("""Paid amount + Write Off Amount can not be greater than Grand Total"""))
def create_remarks(self):
@@ -155,7 +156,7 @@ class PurchaseInvoice(BuyingController):
super(PurchaseInvoice, self).validate_warehouse()
def set_expense_account(self):
def set_expense_account(self, for_validate=False):
auto_accounting_for_stock = cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
if auto_accounting_for_stock:
@@ -181,7 +182,7 @@ class PurchaseInvoice(BuyingController):
else:
item.expense_account = stock_not_billed_account
elif not item.expense_account:
elif not item.expense_account and for_validate:
throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name))
def set_against_expense_account(self):
@@ -305,25 +306,8 @@ class PurchaseInvoice(BuyingController):
if not self.grand_total:
return
self.auto_accounting_for_stock = \
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
self.expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
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)
gl_entries = merge_similar_entries(gl_entries)
self.make_payment_gl_entries(gl_entries)
self.make_write_off_gl_entry(gl_entries)
gl_entries = self.get_gl_entries()
if gl_entries:
update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes"
@@ -342,6 +326,26 @@ class PurchaseInvoice(BuyingController):
elif self.docstatus == 2 and cint(self.update_stock) and self.auto_accounting_for_stock:
delete_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
def get_gl_entries(self, warehouse_account=None):
self.auto_accounting_for_stock = \
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
self.expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
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)
gl_entries = merge_similar_entries(gl_entries)
self.make_payment_gl_entries(gl_entries)
self.make_write_off_gl_entry(gl_entries)
return gl_entries
def make_supplier_gl_entry(self, gl_entries):
if self.grand_total:
@@ -372,7 +376,7 @@ class PurchaseInvoice(BuyingController):
if flt(item.base_net_amount):
account_currency = get_account_currency(item.expense_account)
if self.update_stock and self.auto_accounting_for_stock:
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
@@ -578,7 +582,8 @@ class PurchaseInvoice(BuyingController):
if not self.is_return:
from erpnext.accounts.utils import unlink_ref_doc_from_payment_entries
unlink_ref_doc_from_payment_entries(self.doctype, self.name)
if frappe.db.get_single_value('Accounts Settings', 'unlink_payment_on_cancellation_of_invoice'):
unlink_ref_doc_from_payment_entries(self)
self.update_prevdoc_status()
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
@@ -592,6 +597,7 @@ class PurchaseInvoice(BuyingController):
self.make_gl_entries_on_cancel()
self.update_project()
self.update_fixed_asset()
frappe.db.set(self, 'status', 'Cancelled')
def update_project(self):
project_list = []

View File

@@ -1,31 +1,31 @@
from frappe import _
data = {
'fieldname': 'purchase_invoice',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_invoice',
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Landed Cost Voucher': 'receipt_document',
'Purchase Invoice': 'return_against'
},
'internal_links': {
'Purchase Order': ['items', 'sales_order'],
'Purchase Receipt': ['items', 'delivery_note'],
},
'transactions': [
{
'label': _('Payment'),
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
def get_data():
return {
'fieldname': 'purchase_invoice',
'non_standard_fieldnames': {
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Landed Cost Voucher': 'receipt_document',
'Purchase Invoice': 'return_against'
},
{
'label': _('Reference'),
'items': ['Purchase Order', 'Purchase Receipt', 'Asset', 'Landed Cost Voucher']
'internal_links': {
'Purchase Order': ['items', 'purchase_order'],
'Purchase Receipt': ['items', 'purchase_receipt'],
},
{
'label': _('Returns'),
'items': ['Purchase Invoice']
},
]
}
'transactions': [
{
'label': _('Payment'),
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
},
{
'label': _('Reference'),
'items': ['Purchase Order', 'Purchase Receipt', 'Asset', 'Landed Cost Voucher']
},
{
'label': _('Returns'),
'items': ['Purchase Invoice']
},
]
}

View File

@@ -14,7 +14,9 @@ frappe.listview_settings['Purchase Invoice'] = {
} else {
return [__("Unpaid"), "orange", "outstanding_amount,>,0|due,>=,Today"];
}
} else if(flt(doc.outstanding_amount)==0 && doc.docstatus==1) {
} else if(flt(doc.outstanding_amount) < 0 && doc.docstatus == 1) {
return [__("Debit Note Issued"), "darkgrey", "outstanding_amount,<,0"]
}else if(flt(doc.outstanding_amount)==0 && doc.docstatus==1) {
return [__("Paid"), "green", "outstanding_amount,=,0"];
}
}

View File

@@ -6,7 +6,7 @@ from __future__ import unicode_literals
import unittest
import frappe
import frappe.model
from frappe.utils import cint, flt, today
from frappe.utils import cint, flt, today, nowdate
import frappe.defaults
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory, \
test_records as pr_test_records
@@ -17,6 +17,12 @@ test_dependencies = ["Item", "Cost Center"]
test_ignore = ["Serial No"]
class TestPurchaseInvoice(unittest.TestCase):
def setUp(self):
unlink_payment_on_cancel_of_invoice()
def tearDown(self):
unlink_payment_on_cancel_of_invoice(0)
def test_gl_entries_without_auto_accounting_for_stock(self):
set_perpetual_inventory(0)
self.assertTrue(not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")))
@@ -55,6 +61,27 @@ class TestPurchaseInvoice(unittest.TestCase):
set_perpetual_inventory(0)
def test_payment_entry_unlink_against_purchase_invoice(self):
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
unlink_payment_on_cancel_of_invoice(0)
pi_doc = make_purchase_invoice()
pe = get_payment_entry("Purchase Invoice", pi_doc.name, bank_account="_Test Bank - _TC")
pe.reference_no = "1"
pe.reference_date = nowdate()
pe.paid_from_account_currency = pi_doc.currency
pe.paid_to_account_currency = pi_doc.currency
pe.source_exchange_rate = 1
pe.target_exchange_rate = 1
pe.paid_amount = pi_doc.grand_total
pe.save(ignore_permissions=True)
pe.submit()
pi_doc = frappe.get_doc('Purchase Invoice', pi_doc.name)
self.assertRaises(frappe.LinkExistsError, pi_doc.cancel)
def test_gl_entries_with_auto_accounting_for_stock_against_pr(self):
set_perpetual_inventory(1)
self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1)
@@ -410,6 +437,90 @@ class TestPurchaseInvoice(unittest.TestCase):
self.assertEquals(frappe.db.get_value("Serial No", pi.get("items")[0].rejected_serial_no,
"warehouse"), pi.get("items")[0].rejected_warehouse)
def test_outstanding_amount_after_advance_jv_cancelation(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry \
import test_records as jv_test_records
jv = frappe.copy_doc(jv_test_records[1])
jv.insert()
jv.submit()
pi = frappe.copy_doc(test_records[0])
pi.append("advances", {
"reference_type": "Journal Entry",
"reference_name": jv.name,
"reference_row": jv.get("accounts")[0].name,
"advance_amount": 400,
"allocated_amount": 300,
"remarks": jv.remark
})
pi.insert()
pi.submit()
pi.load_from_db()
#check outstanding after advance allocation
self.assertEqual(flt(pi.outstanding_amount), flt(pi.grand_total - pi.total_advance))
#added to avoid Document has been modified exception
jv = frappe.get_doc("Journal Entry", jv.name)
jv.cancel()
pi.load_from_db()
#check outstanding after advance cancellation
self.assertEqual(flt(pi.outstanding_amount), flt(pi.grand_total + pi.total_advance))
def test_outstanding_amount_after_advance_payment_entry_cancelation(self):
pe = frappe.get_doc({
"doctype": "Payment Entry",
"payment_type": "Pay",
"party_type": "Supplier",
"party": "_Test Supplier",
"company": "_Test Company",
"paid_from_account_currency": "INR",
"paid_to_account_currency": "INR",
"source_exchange_rate": 1,
"target_exchange_rate": 1,
"reference_no": "1",
"reference_date": nowdate(),
"received_amount": 300,
"paid_amount": 300,
"paid_from": "_Test Cash - _TC",
"paid_to": "_Test Payable - _TC"
})
pe.insert()
pe.submit()
pi = frappe.copy_doc(test_records[0])
pi.is_pos = 0
pi.append("advances", {
"doctype": "Purchase Invoice Advance",
"reference_type": "Payment Entry",
"reference_name": pe.name,
"advance_amount": 300,
"allocated_amount": 300,
"remarks": pe.remarks
})
pi.insert()
pi.submit()
pi.load_from_db()
#check outstanding after advance allocation
self.assertEqual(flt(pi.outstanding_amount), flt(pi.grand_total - pi.total_advance))
#added to avoid Document has been modified exception
pe = frappe.get_doc("Payment Entry", pe.name)
pe.cancel()
pi.load_from_db()
#check outstanding after advance cancellation
self.assertEqual(flt(pi.outstanding_amount), flt(pi.grand_total + pi.total_advance))
def unlink_payment_on_cancel_of_invoice(enable=1):
accounts_settings = frappe.get_doc("Accounts Settings")
accounts_settings.unlink_payment_on_cancellation_of_invoice = enable
accounts_settings.save()
def make_purchase_invoice(**args):
pi = frappe.new_doc("Purchase Invoice")
@@ -455,4 +566,4 @@ def make_purchase_invoice(**args):
pi.submit()
return pi
test_records = frappe.get_test_records('Purchase Invoice')
test_records = frappe.get_test_records('Purchase Invoice')

View File

@@ -14,6 +14,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_type",
"fieldtype": "Link",
"hidden": 0,
@@ -43,6 +44,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 3,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"hidden": 0,
@@ -69,6 +71,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 3,
"fieldname": "remarks",
"fieldtype": "Text",
"hidden": 0,
@@ -97,6 +100,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_row",
"fieldtype": "Data",
"hidden": 1,
@@ -125,6 +129,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -148,6 +153,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "advance_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -177,6 +183,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "allocated_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -214,7 +221,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-07-18 05:13:42.137419",
"modified": "2016-08-26 02:30:54.407138",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Advance",

View File

@@ -15,6 +15,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 3,
"fieldname": "item_code",
"fieldtype": "Link",
"hidden": 0,
@@ -42,6 +43,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -65,13 +67,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "item_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Item Name",
"length": 0,
"no_copy": 0,
@@ -91,6 +94,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "description_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -116,6 +120,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description",
"fieldtype": "Text Editor",
"hidden": 0,
@@ -144,6 +149,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "image",
"fieldtype": "Attach",
"hidden": 1,
@@ -169,6 +175,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "image_view",
"fieldtype": "Image",
"hidden": 0,
@@ -195,6 +202,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "quantity_and_rate",
"fieldtype": "Section Break",
"hidden": 0,
@@ -219,6 +227,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "received_qty",
"fieldtype": "Float",
"hidden": 0,
@@ -244,6 +253,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 2,
"fieldname": "qty",
"fieldtype": "Float",
"hidden": 0,
@@ -270,6 +280,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "rejected_qty",
"fieldtype": "Float",
"hidden": 0,
@@ -295,6 +306,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -318,13 +330,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "uom",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "UOM",
"length": 0,
"no_copy": 0,
@@ -343,6 +356,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "conversion_factor",
"fieldtype": "Float",
"hidden": 0,
@@ -367,6 +381,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sec_break1",
"fieldtype": "Section Break",
"hidden": 0,
@@ -390,6 +405,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "price_list_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -415,6 +431,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "price_list_rate",
"fieldname": "discount_percentage",
"fieldtype": "Percent",
@@ -422,7 +439,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Discount on Price List Rate (%)",
"length": 0,
"no_copy": 0,
@@ -440,6 +457,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -463,6 +481,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_price_list_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -488,6 +507,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sec_break2",
"fieldtype": "Section Break",
"hidden": 0,
@@ -511,6 +531,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 3,
"fieldname": "rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -538,6 +559,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -565,6 +587,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break4",
"fieldtype": "Column Break",
"hidden": 0,
@@ -588,6 +611,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -615,6 +639,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -642,6 +667,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "pricing_rule",
"fieldtype": "Link",
"hidden": 0,
@@ -667,6 +693,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_22",
"fieldtype": "Section Break",
"hidden": 0,
@@ -691,6 +718,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "net_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -717,6 +745,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "net_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -743,6 +772,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_25",
"fieldtype": "Column Break",
"hidden": 0,
@@ -767,6 +797,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_net_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -793,6 +824,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_net_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -819,6 +851,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "warehouse_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -844,6 +877,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
"fieldname": "warehouse",
"fieldtype": "Link",
@@ -871,6 +905,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
"hidden": 0,
@@ -897,6 +932,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "batch_no",
"fieldtype": "Link",
"hidden": 0,
@@ -923,6 +959,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_br_wh",
"fieldtype": "Column Break",
"hidden": 0,
@@ -948,6 +985,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "serial_no",
"fieldtype": "Text",
"hidden": 0,
@@ -973,6 +1011,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "rejected_serial_no",
"fieldtype": "Text",
"hidden": 0,
@@ -998,6 +1037,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "accounting",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1022,6 +1062,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "expense_account",
"fieldtype": "Link",
"hidden": 0,
@@ -1051,6 +1092,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break5",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1074,6 +1116,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "project",
"fieldtype": "Link",
"hidden": 0,
@@ -1099,6 +1142,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": ":Company",
"depends_on": "eval:!doc.is_fixed_asset",
"fieldname": "cost_center",
@@ -1130,6 +1174,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1154,6 +1199,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "brand",
"fieldtype": "Data",
"hidden": 1,
@@ -1180,6 +1226,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "item_group",
"fieldtype": "Link",
@@ -1208,6 +1255,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
"fieldname": "item_tax_rate",
"fieldtype": "Code",
@@ -1235,6 +1283,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "item_tax_amount",
"fieldtype": "Currency",
"hidden": 1,
@@ -1262,6 +1311,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "purchase_order",
"fieldtype": "Link",
"hidden": 0,
@@ -1289,6 +1339,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "bom",
"fieldtype": "Link",
"hidden": 0,
@@ -1315,6 +1366,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break6",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1338,6 +1390,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_fixed_asset",
"fieldtype": "Check",
"hidden": 1,
@@ -1363,6 +1416,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "is_fixed_asset",
"fieldname": "asset",
"fieldtype": "Link",
@@ -1390,6 +1444,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "po_detail",
"fieldtype": "Data",
"hidden": 1,
@@ -1416,6 +1471,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "purchase_receipt",
"fieldtype": "Link",
"hidden": 0,
@@ -1443,6 +1499,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "page_break",
"fieldtype": "Check",
"hidden": 0,
@@ -1467,6 +1524,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "pr_detail",
"fieldtype": "Data",
"hidden": 1,
@@ -1493,6 +1551,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "valuation_rate",
"fieldtype": "Currency",
"hidden": 1,
@@ -1518,6 +1577,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "rm_supp_cost",
"fieldtype": "Currency",
"hidden": 1,
@@ -1543,6 +1603,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "landed_cost_voucher_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1575,7 +1636,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:28:04.932212",
"modified": "2016-08-26 04:37:23.737537",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -8,12 +8,14 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 1,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Valuation and Total",
"fieldname": "category",
"fieldtype": "Select",
@@ -42,6 +44,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Add",
"fieldname": "add_deduct_tax",
"fieldtype": "Select",
@@ -70,6 +73,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "charge_type",
"fieldtype": "Select",
"hidden": 0,
@@ -97,6 +101,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
"fieldname": "row_id",
"fieldtype": "Data",
@@ -124,6 +129,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
"fieldname": "included_in_print_rate",
"fieldtype": "Check",
@@ -150,6 +156,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -173,13 +180,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "account_head",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Account Head",
"length": 0,
"no_copy": 0,
@@ -200,6 +208,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": ":Company",
"fieldname": "cost_center",
"fieldtype": "Link",
@@ -228,13 +237,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description",
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
@@ -256,6 +266,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_10",
"fieldtype": "Section Break",
"hidden": 0,
@@ -280,6 +291,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "rate",
"fieldtype": "Float",
"hidden": 0,
@@ -306,6 +318,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_9",
"fieldtype": "Section Break",
"hidden": 0,
@@ -330,6 +343,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "tax_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -357,6 +371,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "tax_amount_after_discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -383,13 +398,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "total",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Total",
"length": 0,
"no_copy": 0,
@@ -410,6 +426,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_14",
"fieldtype": "Column Break",
"hidden": 0,
@@ -434,6 +451,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_tax_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -460,6 +478,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total",
"fieldtype": "Currency",
"hidden": 1,
@@ -486,6 +505,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_tax_amount_after_discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -512,6 +532,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "item_wise_tax_detail",
"fieldtype": "Code",
"hidden": 1,
@@ -538,6 +559,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "parenttype",
"fieldtype": "Data",
"hidden": 1,
@@ -571,7 +593,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:28:06.117769",
"modified": "2016-08-26 03:20:22.118330",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges",

View File

@@ -3,21 +3,25 @@
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:title",
"beta": 0,
"creation": "2013-01-10 16:34:08",
"custom": 0,
"description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Title",
@@ -27,7 +31,9 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -38,10 +44,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_default",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Default",
@@ -49,7 +57,9 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -60,10 +70,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "disabled",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Disabled",
@@ -72,7 +84,9 @@
"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,
@@ -83,10 +97,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break4",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -95,7 +111,9 @@
"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,
@@ -106,10 +124,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Company",
@@ -118,7 +138,9 @@
"options": "Company",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -129,10 +151,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break6",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -141,7 +165,9 @@
"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,
@@ -152,10 +178,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "taxes",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Purchase Taxes and Charges",
@@ -166,7 +194,9 @@
"options": "Purchase Taxes and Charges",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -178,13 +208,14 @@
"hide_toolbar": 0,
"icon": "icon-money",
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-11-16 06:29:54.729312",
"modified": "2016-11-03 15:55:01.611520",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges Template",
@@ -200,6 +231,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -220,6 +252,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -240,6 +273,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@@ -251,6 +285,9 @@
"write": 0
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0
"read_only_onload": 0,
"sort_order": "DESC",
"track_seen": 0
}

View File

@@ -0,0 +1,92 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2016-07-27 17:24:24.956896",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Default Bank / Cash account will be automatically updated in Salary Journal Entry when this mode is selected.",
"fieldname": "default_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Default Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-09-02 07:49:06.567389",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Salary Component Account",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_seen": 0
}

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class SalaryComponentAccount(Document):
pass

View File

@@ -15,13 +15,11 @@ def get_pos_data():
doc = frappe.new_doc('Sales Invoice')
doc.is_pos = 1;
pos_profile = get_pos_profile(doc.company) or {}
if not doc.company: doc.company = pos_profile.get('company')
doc.update_stock = pos_profile.get('update_stock')
if pos_profile.get('name'):
pos_profile = frappe.get_doc('POS Profile', pos_profile.get('name'))
else:
frappe.msgprint('<a href="#List/POS Profile">'
+ _("Welcome to POS: Create your POS Profile") + '</a>');
company_data = get_company_data(doc.company)
update_pos_profile_data(doc, pos_profile, company_data)
@@ -32,10 +30,16 @@ def get_pos_data():
return {
'doc': doc,
'default_customer': pos_profile.get('customer'),
'items': get_items(doc, pos_profile),
'customers': get_customers(pos_profile, doc, company_data.default_currency),
'pricing_rules': get_pricing_rules(doc),
'items': get_items_list(pos_profile),
'customers': get_customers_list(pos_profile),
'serial_no_data': get_serial_no_data(pos_profile, doc.company),
'batch_no_data': get_batch_no_data(),
'tax_data': get_item_tax_data(),
'price_list_data': get_price_list_data(doc.selling_price_list),
'bin_data': get_bin_data(pos_profile),
'pricing_rules': get_pricing_rule_data(doc),
'print_template': print_template,
'pos_profile': pos_profile,
'meta': {
'invoice': frappe.get_meta('Sales Invoice'),
'items': frappe.get_meta('Sales Invoice Item'),
@@ -106,63 +110,117 @@ def update_tax_table(doc):
for tax in taxes:
doc.append('taxes', tax)
def get_items(doc, pos_profile):
item_list = []
for item in frappe.get_all("Item", fields=["*"], filters={'disabled': 0, 'has_variants': 0, 'is_sales_item': 1}):
item_doc = frappe.get_doc('Item', item.name)
if item_doc.taxes:
item.taxes = json.dumps(dict(([d.tax_type, d.tax_rate] for d in
item_doc.get("taxes"))))
def get_items_list(pos_profile):
cond = "1=1"
item_groups = []
if pos_profile.get('item_groups'):
# Get items based on the item groups defined in the POS profile
item.price_list_rate = frappe.db.get_value('Item Price', {'item_code': item.name,
'price_list': doc.selling_price_list}, 'price_list_rate') or 0
item.default_warehouse = pos_profile.get('warehouse') or \
get_item_warehouse_for_company(doc.company, item.default_warehouse) or None
item.expense_account = pos_profile.get('expense_account') or item.expense_account
item.income_account = pos_profile.get('income_account') or item_doc.income_account
item.cost_center = pos_profile.get('cost_center') or item_doc.selling_cost_center
item.actual_qty = frappe.db.get_value('Bin', {'item_code': item.name,
'warehouse': item.default_warehouse}, 'actual_qty') or 0
item.serial_nos = get_serial_nos(item, pos_profile, doc.company)
item.batch_nos = frappe.db.sql_list("""select name from `tabBatch` where ifnull(expiry_date, '4000-10-10') > curdate()
and item = %(item_code)s""", {'item_code': item.item_code})
cond = "item_group in (%s)"%(', '.join(['%s']*len(pos_profile.get('item_groups'))))
item_groups = [d.item_group for d in pos_profile.get('item_groups')]
item_list.append(item)
return frappe.db.sql("""
select
name, item_code, item_name, description, item_group, expense_account, has_batch_no,
has_serial_no, expense_account, selling_cost_center, stock_uom, image,
default_warehouse, is_stock_item, barcode
from
tabItem
where
disabled = 0 and has_variants = 0 and is_sales_item = 1 and {cond}
""".format(cond=cond), tuple(item_groups), as_dict=1)
return item_list
def get_customers_list(pos_profile):
cond = "1=1"
customer_groups = []
if pos_profile.get('customer_groups'):
# Get customers based on the customer groups defined in the POS profile
def get_item_warehouse_for_company(company, warehouse):
if frappe.db.get_value('Warehouse', warehouse, 'company') != company:
warehouse = None
return warehouse
cond = "customer_group in (%s)"%(', '.join(['%s']*len(pos_profile.get('customer_groups'))))
customer_groups = [d.customer_group for d in pos_profile.get('customer_groups')]
return frappe.db.sql(""" select name, customer_name, customer_group,
territory from tabCustomer where disabled = 0
and {cond}""".format(cond=cond), tuple(customer_groups), as_dict=1) or {}
def get_serial_no_data(pos_profile, company):
# get itemwise serial no data
# example {'Nokia Lumia 1020': {'SN0001': 'Pune'}}
# where Nokia Lumia 1020 is item code, SN0001 is serial no and Pune is warehouse
def get_serial_nos(item, pos_profile, company):
cond = "1=1"
if pos_profile.get('update_stock') and pos_profile.get('warehouse'):
cond = "warehouse = '{0}'".format(pos_profile.get('warehouse'))
serial_nos = frappe.db.sql("""select name, warehouse from `tabSerial No` where {0}
and item_code = %(item_code)s and company = %(company)s
""".format(cond), {'item_code': item.item_code, 'company': company}, as_dict=1)
serial_nos = frappe.db.sql("""select name, warehouse, item_code from `tabSerial No` where {0}
and company = %(company)s """.format(cond), {'company': company}, as_dict=1)
serial_no_list = {}
for serial_no in serial_nos:
serial_no_list[serial_no.name] = serial_no.warehouse
itemwise_serial_no = {}
for sn in serial_nos:
if sn.item_code not in itemwise_serial_no:
itemwise_serial_no.setdefault(sn.item_code, {})
itemwise_serial_no[sn.item_code][sn.name] = sn.warehouse
return serial_no_list
return itemwise_serial_no
def get_customers(pos_profile, doc, company_currency):
filters = {'disabled': 0}
customer_list = []
customers = frappe.get_all("Customer", fields=["*"], filters = filters)
def get_batch_no_data():
# get itemwise batch no data
# exmaple: {'LED-GRE': [Batch001, Batch002]}
# where LED-GRE is item code, SN0001 is serial no and Pune is warehouse
for customer in customers:
customer_currency = get_party_account_currency('Customer', customer.name, doc.company) or doc.currency
if customer_currency == doc.currency or customer_currency == company_currency:
customer_list.append(customer)
return customer_list
itemwise_batch = {}
batches = frappe.db.sql("""select name, item from `tabBatch`
where ifnull(expiry_date, '4000-10-10') >= curdate()""", as_dict=1)
def get_pricing_rules(doc):
for batch in batches:
if batch.item not in itemwise_batch:
itemwise_batch.setdefault(batch.item, [])
itemwise_batch[batch.item].append(batch.name)
return itemwise_batch
def get_item_tax_data():
# get default tax of an item
# example: {'Consulting Services': {'Excise 12 - TS': '12.000'}}
itemwise_tax = {}
taxes = frappe.db.sql(""" select parent, tax_type, tax_rate from `tabItem Tax`""", as_dict=1)
for tax in taxes:
if tax.parent not in itemwise_tax:
itemwise_tax.setdefault(tax.parent, {})
itemwise_tax[tax.parent][tax.tax_type] = tax.tax_rate
return itemwise_tax
def get_price_list_data(selling_price_list):
itemwise_price_list = {}
price_lists = frappe.db.sql("""Select ifnull(price_list_rate, 0) as price_list_rate,
item_code from `tabItem Price` ip where price_list = %(price_list)s""",
{'price_list': selling_price_list}, as_dict=1)
for item in price_lists:
itemwise_price_list[item.item_code] = item.price_list_rate
return itemwise_price_list
def get_bin_data(pos_profile):
itemwise_bin_data = {}
cond = "1=1"
if pos_profile.get('warehouse'):
cond = "warehouse = '{0}'".format(pos_profile.get('warehouse'))
bin_data = frappe.db.sql(""" select item_code, warehouse, actual_qty from `tabBin`
where actual_qty > 0 and {cond}""".format(cond=cond), as_dict=1)
for bins in bin_data:
if bins.item_code not in itemwise_bin_data:
itemwise_bin_data.setdefault(bins.item_code, {})
itemwise_bin_data[bins.item_code][bins.warehouse] = bins.actual_qty
return itemwise_bin_data
def get_pricing_rule_data(doc):
pricing_rules = ""
if doc.ignore_pricing_rule == 0:
pricing_rules = frappe.db.sql(""" Select * from `tabPricing Rule` where docstatus < 2
@@ -238,10 +296,3 @@ def save_invoice(e, si_doc, name):
si_doc.docstatus = 0
si_doc.flags.ignore_mandatory = True
si_doc.insert()
make_scheduler_log(e, si_doc.name)
def make_scheduler_log(e, sales_invoice):
scheduler_log = frappe.new_doc('Scheduler Log')
scheduler_log.error = e
scheduler_log.sales_invoice = sales_invoice
scheduler_log.save(ignore_permissions=True)

View File

@@ -20,6 +20,13 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
erpnext.queries.setup_queries(this.frm, "Warehouse", function() {
return erpnext.queries.warehouse(me.frm.doc);
});
if(this.frm.doc.__islocal && this.frm.doc.is_pos) {
//Load pos profile data on the invoice if the default value of Is POS is 1
me.frm.script_manager.trigger("is_pos");
me.frm.refresh_fields();
}
},
refresh: function(doc, dt, dn) {
@@ -300,7 +307,7 @@ cur_frm.cscript.hide_fields = function(doc) {
item_fields_stock = ['serial_no', 'batch_no', 'actual_qty', 'expense_account', 'warehouse', 'expense_account', 'warehouse']
cur_frm.fields_dict['items'].grid.set_column_disp(item_fields_stock,
(cint(doc.update_stock)==1 ? true : false));
(cint(doc.update_stock)==1 || cint(doc.is_return)==1 ? true : false));
// India related fields
if (frappe.boot.sysdefaults.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']);
@@ -462,25 +469,57 @@ cur_frm.set_query("asset", "items", function(doc, cdt, cdn) {
frappe.ui.form.on('Sales Invoice', {
setup: function(frm){
frm.fields_dict["timesheets"].grid.get_field("time_sheet").get_query = function(doc, cdt, cdn){
return {
filters: [
["Timesheet", "status", "in", ["Submitted", "Payslip"]]
]
return{
query: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet",
filters: {'project': doc.project}
}
}
}
})
},
frappe.ui.form.on('Sales Invoice Timesheet', {
time_sheet: function(frm){
project: function(frm){
frm.call({
method: "calculate_billing_amount_from_timesheet",
method: "add_timesheet_data",
doc: frm.doc,
callback: function(r, rt) {
refresh_field('total_billing_amount')
refresh_field(['timesheets'])
}
})
}
})
cur_frm.add_fetch("time_sheet", "total_billing_amount", "billing_amount");
frappe.ui.form.on('Sales Invoice Timesheet', {
time_sheet: function(frm, cdt, cdn){
var d = locals[cdt][cdn];
if(d.time_sheet) {
frappe.call({
method: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet_data",
args: {
'name': d.time_sheet,
'project': frm.doc.project || null
},
callback: function(r, rt) {
if(r.message){
data = r.message;
frappe.model.set_value(cdt, cdn, "billing_hours", data.billing_hours);
frappe.model.set_value(cdt, cdn, "billing_amount", data.billing_amount);
frappe.model.set_value(cdt, cdn, "timesheet_detail", data.timesheet_detail);
calculate_total_billing_amount(frm)
}
}
})
}
}
})
var calculate_total_billing_amount = function(frm) {
var doc = frm.doc;
doc.total_billing_amount = 0.0
if(doc.timesheets) {
$.each(doc.timesheets, function(index, data){
doc.total_billing_amount += data.billing_amount
})
}
refresh_field('total_billing_amount')
}

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,7 @@ from erpnext.accounts.doctype.sales_invoice.pos import update_multi_mode_option
from erpnext.controllers.selling_controller import SellingController
from erpnext.accounts.utils import get_account_currency
from erpnext.stock.doctype.delivery_note.delivery_note import update_billed_amount_based_on_so
from erpnext.projects.doctype.timesheet.timesheet import get_projectwise_timesheet_data
from erpnext.accounts.doctype.asset.depreciation \
import get_disposal_account_and_cost_center, get_gl_entries_on_asset_disposal
@@ -83,7 +84,9 @@ class SalesInvoice(SellingController):
self.validate_time_sheets_are_submitted()
self.validate_multiple_billing("Delivery Note", "dn_detail", "amount", "items")
self.update_packing_list()
self.calculate_billing_amount_from_timesheet()
self.set_billing_hours_and_amount()
self.update_timesheet_billing_for_project()
self.set_status()
def before_save(self):
set_account_for_mode_of_payment(self)
@@ -134,7 +137,8 @@ class SalesInvoice(SellingController):
self.check_close_sales_order("sales_order")
from erpnext.accounts.utils import unlink_ref_doc_from_payment_entries
unlink_ref_doc_from_payment_entries(self.doctype, self.name)
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:
# NOTE status updating bypassed for is_return
@@ -155,6 +159,7 @@ class SalesInvoice(SellingController):
self.update_stock_ledger()
self.make_gl_entries_on_cancel()
frappe.db.set(self, 'status', 'Cancelled')
def update_status_updater_args(self):
if cint(self.update_stock):
@@ -220,11 +225,21 @@ class SalesInvoice(SellingController):
for d in self.timesheets:
if d.time_sheet:
timesheet = frappe.get_doc("Timesheet", d.time_sheet)
timesheet.sales_invoice = sales_invoice
self.update_time_sheet_detail(timesheet, d, sales_invoice)
timesheet.calculate_total_amounts()
timesheet.calculate_percentage_billed()
timesheet.flags.ignore_validate_update_after_submit = True
timesheet.set_status()
timesheet.save()
def update_time_sheet_detail(self, timesheet, args, sales_invoice):
for data in timesheet.time_logs:
if (self.project and args.timesheet_detail == data.name) or \
(not self.project and not data.sales_invoice) or \
(not sales_invoice and data.sales_invoice == self.name):
data.sales_invoice = sales_invoice
if self.project: return
def on_update(self):
self.set_paid_amount()
@@ -350,19 +365,18 @@ class SalesInvoice(SellingController):
against_acc.append(d.income_account)
self.against_income_account = ','.join(against_acc)
def add_remarks(self):
if not self.remarks: self.remarks = 'No Remarks'
def so_dn_required(self):
"""check in manage account if sales order / delivery note required or not."""
dic = {'Sales Order':'so_required','Delivery Note':'dn_required'}
dic = {'Sales Order':['so_required', 'is_pos'],'Delivery Note':['dn_required', 'update_stock']}
for i in dic:
if frappe.db.get_value('Selling Settings', None, dic[i]) == 'Yes':
if frappe.db.get_value('Selling Settings', None, dic[i][0]) == 'Yes':
for d in self.get('items'):
if frappe.db.get_value('Item', d.item_code, 'is_stock_item') == 1 \
and not d.get(i.lower().replace(' ','_')):
and not d.get(i.lower().replace(' ','_')) and not self.get(dic[i][1]):
msgprint(_("{0} is mandatory for Item {1}").format(i,d.item_code), raise_exception=1)
@@ -390,7 +404,7 @@ class SalesInvoice(SellingController):
super(SalesInvoice, self).validate_warehouse()
for d in self.get('items'):
if not d.warehouse:
if not d.warehouse and frappe.db.get_value("Item", d.item_code, "is_stock_item"):
frappe.throw(_("Warehouse required at Row No {0}").format(d.idx))
def validate_delivery_note(self):
@@ -447,7 +461,35 @@ class SalesInvoice(SellingController):
else:
self.set('packed_items', [])
def calculate_billing_amount_from_timesheet(self):
def set_billing_hours_and_amount(self):
for timesheet in self.timesheets:
ts_doc = frappe.get_doc('Timesheet', timesheet.time_sheet)
if not timesheet.billing_hours and ts_doc.total_billable_hours:
timesheet.billing_hours = ts_doc.total_billable_hours
if not timesheet.billing_amount and ts_doc.total_billable_amount:
timesheet.billing_amount = ts_doc.total_billable_amount
def update_timesheet_billing_for_project(self):
if not self.timesheets and self.project:
self.add_timesheet_data()
else:
self.calculate_billing_amount_for_timesheet()
def add_timesheet_data(self):
self.set('timesheets', [])
if self.project:
for data in get_projectwise_timesheet_data(self.project):
self.append('timesheets', {
'time_sheet': data.parent,
'billing_hours': data.billing_hours,
'billing_amount': data.billing_amt,
'timesheet_detail': data.name
})
self.calculate_billing_amount_for_timesheet()
def calculate_billing_amount_for_timesheet(self):
total_billing_amount = 0.0
for data in self.timesheets:
if data.billing_amount:

View File

@@ -1,30 +1,31 @@
from frappe import _
data = {
'fieldname': 'sales_invoice',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_invoice',
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Sales Invoice': 'return_against'
},
'internal_links': {
'Sales Order': ['items', 'sales_order'],
'Delivery Note': ['items', 'delivery_note'],
},
'transactions': [
{
'label': _('Payment'),
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
def get_data():
return {
'fieldname': 'sales_invoice',
'non_standard_fieldnames': {
'Delivery Note': 'against_sales_invoice',
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Sales Invoice': 'return_against'
},
{
'label': _('Reference'),
'items': ['Timesheet', 'Delivery Note', 'Sales Order']
'internal_links': {
'Sales Order': ['items', 'sales_order'],
'Delivery Note': ['items', 'delivery_note'],
},
{
'label': _('Returns'),
'items': ['Sales Invoice']
},
]
}
'transactions': [
{
'label': _('Payment'),
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
},
{
'label': _('Reference'),
'items': ['Timesheet', 'Delivery Note', 'Sales Order']
},
{
'label': _('Returns'),
'items': ['Sales Invoice']
},
]
}

View File

@@ -10,9 +10,11 @@ frappe.listview_settings['Sales Invoice'] = {
return [__("Return"), "darkgrey", "is_return,=,Yes"];
} else if(flt(doc.outstanding_amount)==0) {
return [__("Paid"), "green", "outstanding_amount,=,0"]
} else if (flt(doc.outstanding_amount) > 0 && doc.due_date > frappe.datetime.get_today()) {
} else if(flt(doc.outstanding_amount) < 0) {
return [__("Credit Note Issued"), "darkgrey", "outstanding_amount,<,0"]
}else if (flt(doc.outstanding_amount) > 0 && doc.due_date >= frappe.datetime.get_today()) {
return [__("Unpaid"), "orange", "outstanding_amount,>,0|due_date,>,Today"]
} else if (flt(doc.outstanding_amount) > 0 && doc.due_date <= frappe.datetime.get_today()) {
} else if (flt(doc.outstanding_amount) > 0 && doc.due_date < frappe.datetime.get_today()) {
return [__("Overdue"), "red", "outstanding_amount,>,0|due_date,<=,Today"]
}
},

View File

@@ -4,8 +4,10 @@ from __future__ import unicode_literals
import frappe
import unittest, copy
from frappe.utils import nowdate, add_days, flt
from frappe.utils import nowdate, add_days, flt, nowdate
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry, get_qty_after_transaction
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import unlink_payment_on_cancel_of_invoice
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory
from erpnext.exceptions import InvalidAccountCurrency, InvalidCurrency
from erpnext.stock.doctype.serial_no.serial_no import SerialNoWarehouseError
@@ -19,6 +21,12 @@ class TestSalesInvoice(unittest.TestCase):
w.submit()
return w
def setUp(self):
unlink_payment_on_cancel_of_invoice()
def tearDown(self):
unlink_payment_on_cancel_of_invoice(0)
def test_timestamp_change(self):
w = frappe.copy_doc(test_records[0])
w.docstatus = 0
@@ -78,6 +86,28 @@ class TestSalesInvoice(unittest.TestCase):
self.assertEquals(si.base_grand_total, 1627.05)
self.assertEquals(si.grand_total, 1627.05)
def test_payment_entry_unlink_against_invoice(self):
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
si = frappe.copy_doc(test_records[0])
si.is_pos = 0
si.insert()
si.submit()
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank - _TC")
pe.reference_no = "1"
pe.reference_date = nowdate()
pe.paid_from_account_currency = si.currency
pe.paid_to_account_currency = si.currency
pe.source_exchange_rate = 1
pe.target_exchange_rate = 1
pe.paid_amount = si.grand_total
pe.insert()
pe.submit()
unlink_payment_on_cancel_of_invoice(0)
si = frappe.get_doc('Sales Invoice', si.name)
self.assertRaises(frappe.LinkExistsError, si.cancel)
def test_sales_invoice_calculation_export_currency(self):
si = frappe.copy_doc(test_records[2])
si.currency = "USD"
@@ -438,7 +468,7 @@ class TestSalesInvoice(unittest.TestCase):
def test_pos_gl_entry_with_perpetual_inventory(self):
set_perpetual_inventory()
self.make_pos_profile()
make_pos_profile()
self._insert_purchase_receipt()
pos = copy.deepcopy(test_records[1])
@@ -457,7 +487,7 @@ class TestSalesInvoice(unittest.TestCase):
def test_pos_change_amount(self):
set_perpetual_inventory()
self.make_pos_profile()
make_pos_profile()
self._insert_purchase_receipt()
pos = copy.deepcopy(test_records[1])
@@ -479,7 +509,7 @@ class TestSalesInvoice(unittest.TestCase):
set_perpetual_inventory()
self.make_pos_profile()
make_pos_profile()
self._insert_purchase_receipt()
pos = copy.deepcopy(test_records[1])
@@ -543,80 +573,6 @@ class TestSalesInvoice(unittest.TestCase):
frappe.db.sql("delete from `tabPOS Profile`")
def make_pos_profile(self):
pos_profile = frappe.get_doc({
"company": "_Test Company",
"cost_center": "_Test Cost Center - _TC",
"currency": "INR",
"doctype": "POS Profile",
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"income_account": "Sales - _TC",
"name": "_Test POS Profile",
"naming_series": "_T-POS Profile-",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory",
"warehouse": "_Test Warehouse - _TC",
"write_off_account": "_Test Write Off - _TC",
"write_off_cost_center": "_Test Write Off Cost Center - _TC"
})
if not frappe.db.exists("POS Profile", "_Test POS Profile"):
pos_profile.insert()
def test_si_gl_entry_with_perpetual_inventory_and_update_stock_with_warehouse_but_no_account(self):
set_perpetual_inventory()
frappe.delete_doc("Account", "_Test Warehouse No Account - _TC")
# insert purchase receipt
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \
as pr_test_records
pr = frappe.copy_doc(pr_test_records[0])
pr.naming_series = "_T-Purchase Receipt-"
pr.get("items")[0].warehouse = "_Test Warehouse No Account - _TC"
pr.insert()
pr.submit()
si_doc = copy.deepcopy(test_records[1])
si_doc["update_stock"] = 1
# si_doc["posting_time"] = "12:05"
si_doc.get("items")[0]["warehouse"] = "_Test Warehouse No Account - _TC"
si = frappe.copy_doc(si_doc)
si.insert()
si.submit()
# check stock ledger entries
sle = frappe.db.sql("""select * from `tabStock Ledger Entry`
where voucher_type = 'Sales Invoice' and voucher_no = %s""",
si.name, as_dict=1)[0]
self.assertTrue(sle)
self.assertEquals([sle.item_code, sle.warehouse, sle.actual_qty],
["_Test Item", "_Test Warehouse No Account - _TC", -1.0])
# check gl entries
gl_entries = frappe.db.sql("""select account, debit, credit
from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s
order by account asc, debit asc""", si.name, as_dict=1)
self.assertTrue(gl_entries)
expected_gl_entries = dict((d[0], d) for d in [
[si.debit_to, 630.0, 0.0],
[si_doc.get("items")[0]["income_account"], 0.0, 500.0],
[si_doc.get("taxes")[0]["account_head"], 0.0, 80.0],
[si_doc.get("taxes")[1]["account_head"], 0.0, 50.0],
])
for i, gle in enumerate(gl_entries):
self.assertEquals(expected_gl_entries[gle.account][0], gle.account)
self.assertEquals(expected_gl_entries[gle.account][1], gle.debit)
self.assertEquals(expected_gl_entries[gle.account][2], gle.credit)
si.cancel()
gle = frappe.db.sql("""select * from `tabGL Entry`
where voucher_type='Sales Invoice' and voucher_no=%s""", si.name)
self.assertFalse(gle)
set_perpetual_inventory(0)
def test_sales_invoice_gl_entry_with_perpetual_inventory_no_item_code(self):
set_perpetual_inventory()
@@ -1005,6 +961,86 @@ class TestSalesInvoice(unittest.TestCase):
pe.submit()
self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active')
def test_outstanding_amount_after_advance_jv_cancelation(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry \
import test_records as jv_test_records
jv = frappe.copy_doc(jv_test_records[0])
jv.insert()
jv.submit()
si = frappe.copy_doc(test_records[0])
si.append("advances", {
"doctype": "Sales Invoice Advance",
"reference_type": "Journal Entry",
"reference_name": jv.name,
"reference_row": jv.get("accounts")[0].name,
"advance_amount": 400,
"allocated_amount": 300,
"remarks": jv.remark
})
si.insert()
si.submit()
si.load_from_db()
#check outstanding after advance allocation
self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total - si.total_advance, si.precision("outstanding_amount")))
#added to avoid Document has been modified exception
jv = frappe.get_doc("Journal Entry", jv.name)
jv.cancel()
si.load_from_db()
#check outstanding after advance cancellation
self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total + si.total_advance, si.precision("outstanding_amount")))
def test_outstanding_amount_after_advance_payment_entry_cancelation(self):
pe = frappe.get_doc({
"doctype": "Payment Entry",
"payment_type": "Receive",
"party_type": "Customer",
"party": "_Test Customer",
"company": "_Test Company",
"paid_from_account_currency": "INR",
"paid_to_account_currency": "INR",
"source_exchange_rate": 1,
"target_exchange_rate": 1,
"reference_no": "1",
"reference_date": nowdate(),
"received_amount": 300,
"paid_amount": 300,
"paid_from": "_Test Receivable - _TC",
"paid_to": "_Test Cash - _TC"
})
pe.insert()
pe.submit()
si = frappe.copy_doc(test_records[0])
si.is_pos = 0
si.append("advances", {
"doctype": "Sales Invoice Advance",
"reference_type": "Payment Entry",
"reference_name": pe.name,
"advance_amount": 300,
"allocated_amount": 300,
"remarks": pe.remarks
})
si.insert()
si.submit()
si.load_from_db()
#check outstanding after advance allocation
self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total - si.total_advance, si.precision("outstanding_amount")))
#added to avoid Document has been modified exception
pe = frappe.get_doc("Payment Entry", pe.name)
pe.cancel()
si.load_from_db()
#check outstanding after advance cancellation
self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total + si.total_advance, si.precision("outstanding_amount")))
def create_sales_invoice(**args):
si = frappe.new_doc("Sales Invoice")

View File

@@ -14,6 +14,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_type",
"fieldtype": "Link",
"hidden": 0,
@@ -43,6 +44,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 3,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"hidden": 0,
@@ -69,6 +71,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 3,
"fieldname": "remarks",
"fieldtype": "Text",
"hidden": 0,
@@ -97,6 +100,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "reference_row",
"fieldtype": "Data",
"hidden": 1,
@@ -125,6 +129,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -148,6 +153,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "advance_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -177,6 +183,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "allocated_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -214,7 +221,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-07-18 05:13:21.819598",
"modified": "2016-08-26 02:36:10.718057",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Advance",

View File

@@ -15,6 +15,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "barcode",
"fieldtype": "Data",
"hidden": 0,
@@ -39,6 +40,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 4,
"fieldname": "item_code",
"fieldtype": "Link",
"hidden": 0,
@@ -66,6 +68,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -89,13 +92,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "item_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Item Name",
"length": 0,
"no_copy": 0,
@@ -115,6 +119,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer_item_code",
"fieldtype": "Data",
"hidden": 1,
@@ -139,6 +144,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
@@ -164,6 +170,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description",
"fieldtype": "Text Editor",
"hidden": 0,
@@ -192,6 +199,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_8",
"fieldtype": "Column Break",
"hidden": 0,
@@ -216,6 +224,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "image_view",
"fieldtype": "Image",
"hidden": 0,
@@ -242,6 +251,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "image",
"fieldtype": "Attach",
"hidden": 1,
@@ -267,6 +277,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "quantity_and_rate",
"fieldtype": "Section Break",
"hidden": 0,
@@ -291,6 +302,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 2,
"fieldname": "qty",
"fieldtype": "Float",
"hidden": 0,
@@ -317,6 +329,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "price_list_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -344,6 +357,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -367,13 +381,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "stock_uom",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "UOM",
"length": 0,
"no_copy": 0,
@@ -392,6 +407,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_price_list_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -419,6 +435,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "discount_and_margin",
"fieldtype": "Section Break",
"hidden": 0,
@@ -444,6 +461,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "price_list_rate",
"fieldname": "discount_percentage",
"fieldtype": "Percent",
@@ -451,7 +469,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Discount on Price List Rate (%)",
"length": 0,
"no_copy": 0,
@@ -471,6 +489,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_19",
"fieldtype": "Column Break",
"hidden": 0,
@@ -495,6 +514,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "price_list_rate",
"fieldname": "margin_type",
"fieldtype": "Select",
@@ -522,6 +542,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.margin_type && doc.price_list_rate",
"fieldname": "margin_rate_or_amount",
"fieldtype": "Float",
@@ -548,9 +569,10 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.margin_type && doc.price_list_rate",
"fieldname": "total_margin",
"fieldtype": "Float",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -574,6 +596,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break1",
"fieldtype": "Section Break",
"hidden": 0,
@@ -597,6 +620,7 @@
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"columns": 2,
"fieldname": "rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -624,6 +648,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -651,6 +676,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -674,6 +700,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -701,6 +728,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -728,6 +756,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "pricing_rule",
"fieldtype": "Link",
"hidden": 0,
@@ -753,6 +782,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_21",
"fieldtype": "Section Break",
"hidden": 0,
@@ -777,6 +807,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "net_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -803,6 +834,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "net_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -829,6 +861,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_24",
"fieldtype": "Column Break",
"hidden": 0,
@@ -853,6 +886,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_net_rate",
"fieldtype": "Currency",
"hidden": 0,
@@ -879,6 +913,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_net_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -906,6 +941,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "eval:doc.delivered_by_supplier==1",
"columns": 0,
"fieldname": "drop_ship",
"fieldtype": "Section Break",
"hidden": 0,
@@ -931,6 +967,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "delivered_by_supplier",
"fieldtype": "Check",
"hidden": 0,
@@ -956,6 +993,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "accounting",
"fieldtype": "Section Break",
"hidden": 0,
@@ -980,6 +1018,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "income_account",
"fieldtype": "Link",
"hidden": 0,
@@ -1009,6 +1048,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "expense_account",
"fieldtype": "Link",
"hidden": 0,
@@ -1035,6 +1075,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break4",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1058,6 +1099,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": ":Company",
"fieldname": "cost_center",
"fieldtype": "Link",
@@ -1089,6 +1131,7 @@
"bold": 0,
"collapsible": 1,
"collapsible_depends_on": "eval:doc.serial_no || doc.batch_no",
"columns": 0,
"fieldname": "warehouse_and_reference",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1113,6 +1156,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "warehouse",
"fieldtype": "Link",
"hidden": 0,
@@ -1140,6 +1184,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "target_warehouse",
"fieldtype": "Link",
"hidden": 1,
@@ -1166,6 +1211,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "serial_no",
"fieldtype": "Small Text",
"hidden": 0,
@@ -1192,6 +1238,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "batch_no",
"fieldtype": "Link",
"hidden": 0,
@@ -1217,6 +1264,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "item_group",
"fieldtype": "Link",
@@ -1245,6 +1293,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "brand",
"fieldtype": "Data",
"hidden": 1,
@@ -1271,6 +1320,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "item_tax_rate",
"fieldtype": "Small Text",
"hidden": 1,
@@ -1297,6 +1347,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break5",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1320,6 +1371,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "actual_batch_qty",
"fieldtype": "Float",
"hidden": 0,
@@ -1347,6 +1399,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "actual_qty",
"fieldtype": "Float",
"hidden": 0,
@@ -1373,6 +1426,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "edit_references",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1398,6 +1452,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "sales_order",
"fieldtype": "Link",
"hidden": 0,
@@ -1425,6 +1480,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "so_detail",
"fieldtype": "Data",
"hidden": 1,
@@ -1451,6 +1507,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_50",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1475,6 +1532,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "delivery_note",
"fieldtype": "Link",
"hidden": 0,
@@ -1502,6 +1560,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "dn_detail",
"fieldtype": "Data",
"hidden": 1,
@@ -1528,6 +1587,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "delivered_qty",
"fieldtype": "Float",
"hidden": 0,
@@ -1554,6 +1614,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_fixed_asset",
"fieldtype": "Check",
"hidden": 1,
@@ -1579,6 +1640,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "asset",
"fieldtype": "Link",
"hidden": 0,
@@ -1605,6 +1667,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_54",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1629,6 +1692,7 @@
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "page_break",
"fieldtype": "Check",
"hidden": 0,
@@ -1660,7 +1724,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:28:07.483665",
"modified": "2016-11-01 13:01:58.844818",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -14,6 +14,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "time_sheet",
"fieldtype": "Link",
"hidden": 0,
@@ -40,6 +41,33 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "billing_hours",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Billing Hours",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "billing_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -60,6 +88,32 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "timesheet_detail",
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Timesheet Detail",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
@@ -72,7 +126,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:28:07.876168",
"modified": "2016-09-09 14:01:04.095775",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Timesheet",

View File

@@ -8,12 +8,14 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 1,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "charge_type",
"fieldtype": "Select",
"hidden": 0,
@@ -41,6 +43,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
"fieldname": "row_id",
"fieldtype": "Data",
@@ -68,13 +71,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "account_head",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Account Head",
"length": 0,
"no_copy": 0,
@@ -95,6 +99,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": ":Company",
"fieldname": "cost_center",
"fieldtype": "Link",
@@ -123,6 +128,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break_1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -147,13 +153,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description",
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
@@ -175,6 +182,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
"fieldname": "included_in_print_rate",
"fieldtype": "Check",
@@ -202,6 +210,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_8",
"fieldtype": "Section Break",
"hidden": 0,
@@ -226,6 +235,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "rate",
"fieldtype": "Float",
"hidden": 0,
@@ -252,6 +262,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_9",
"fieldtype": "Section Break",
"hidden": 0,
@@ -276,6 +287,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "tax_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -302,13 +314,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 2,
"fieldname": "total",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Total",
"length": 0,
"no_copy": 0,
@@ -328,6 +341,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "tax_amount_after_discount_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -354,6 +368,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_13",
"fieldtype": "Column Break",
"hidden": 0,
@@ -378,6 +393,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_tax_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -405,6 +421,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "base_total",
"fieldtype": "Currency",
"hidden": 0,
@@ -432,6 +449,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:parent.discount_amount",
"fieldname": "base_tax_amount_after_discount_amount",
"fieldtype": "Currency",
@@ -458,6 +476,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "item_wise_tax_detail",
"fieldtype": "Code",
"hidden": 1,
@@ -484,6 +503,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "parenttype",
"fieldtype": "Data",
"hidden": 1,
@@ -517,7 +537,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:28:08.283145",
"modified": "2016-08-26 03:08:03.235381",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges",

View File

@@ -3,21 +3,25 @@
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:title",
"beta": 0,
"creation": "2013-01-10 16:34:09",
"custom": 0,
"description": "Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.",
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Title",
@@ -27,7 +31,9 @@
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -38,10 +44,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "is_default",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Default",
@@ -49,7 +57,9 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -60,10 +70,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "disabled",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
@@ -72,7 +84,9 @@
"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,
@@ -83,17 +97,21 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -104,10 +122,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Company",
@@ -118,7 +138,9 @@
"options": "Company",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -129,17 +151,21 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_5",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -150,11 +176,13 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "* Will be calculated in the transaction.",
"fieldname": "taxes",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sales Taxes and Charges",
@@ -165,7 +193,9 @@
"options": "Sales Taxes and Charges",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -177,13 +207,14 @@
"hide_toolbar": 0,
"icon": "icon-money",
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-11-16 06:29:57.346680",
"modified": "2016-11-03 15:55:23.393483",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges Template",
@@ -199,6 +230,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -219,6 +251,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -239,6 +272,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -250,6 +284,9 @@
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0
"read_only_onload": 0,
"sort_order": "ASC",
"track_seen": 0
}

View File

@@ -4,12 +4,18 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from frappe.model.document import Document
from erpnext.controllers.accounts_controller import validate_taxes_and_charges, validate_inclusive_tax
class SalesTaxesandChargesTemplate(Document):
def validate(self):
valdiate_taxes_and_charges_template(self)
def set_missing_values(self):
for data in self.taxes:
if data.charge_type == 'On Net Total' and flt(data.rate) == 0.0:
data.rate = frappe.db.get_value('Account', data.account_head, 'tax_rate')
def valdiate_taxes_and_charges_template(doc):
# default should not be disabled

View File

@@ -3,21 +3,25 @@
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:label",
"beta": 0,
"creation": "2013-06-25 11:48:03",
"custom": 0,
"description": "Specify conditions to calculate shipping amount",
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "example: Next Day Shipping",
"fieldname": "label",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Shipping Rule Label",
@@ -25,7 +29,9 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -36,10 +42,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "disabled",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
@@ -48,7 +56,9 @@
"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,
@@ -59,11 +69,13 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Net Total",
"fieldname": "calculate_based_on",
"fieldtype": "Select",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Calculate Based On",
@@ -72,7 +84,9 @@
"options": "Net Total\nNet Weight",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -83,11 +97,13 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:!doc.disabled",
"fieldname": "rule_conditions_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Shipping Rule Conditions",
@@ -95,7 +111,9 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -106,10 +124,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "conditions",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Shipping Rule Conditions",
@@ -118,7 +138,9 @@
"options": "Shipping Rule Condition",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -129,11 +151,13 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:!doc.disabled",
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valid for Countries",
@@ -141,7 +165,9 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -152,10 +178,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "worldwide_shipping",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Worldwide Shipping",
@@ -164,7 +192,9 @@
"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,
@@ -175,11 +205,13 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:!doc.worldwide_shipping",
"fieldname": "countries",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valid for Countries",
@@ -189,7 +221,9 @@
"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,
@@ -200,18 +234,22 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:!doc.disabled",
"fieldname": "section_break_10",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -222,10 +260,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Company",
@@ -234,7 +274,9 @@
"options": "Company",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -245,17 +287,21 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_12",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -266,10 +312,12 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Shipping Account",
@@ -278,7 +326,9 @@
"options": "Account",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -289,10 +339,12 @@
"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_list_view": 0,
"label": "Cost Center",
@@ -301,7 +353,9 @@
"options": "Cost Center",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -313,13 +367,14 @@
"hide_toolbar": 0,
"icon": "icon-truck",
"idx": 1,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-11-16 06:29:57.633071",
"modified": "2016-11-03 15:56:10.088948",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Shipping Rule",
@@ -335,6 +390,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -355,6 +411,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -375,6 +432,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -395,6 +453,7 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -406,6 +465,9 @@
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0
"read_only_onload": 0,
"sort_order": "ASC",
"track_seen": 0
}

View File

@@ -9,11 +9,13 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Sales",
"fieldname": "tax_type",
"fieldtype": "Select",
@@ -31,6 +33,7 @@
"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,
@@ -41,6 +44,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "use_for_shopping_cart",
"fieldtype": "Check",
"hidden": 0,
@@ -56,6 +60,7 @@
"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,
@@ -66,6 +71,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -80,6 +86,7 @@
"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,
@@ -90,6 +97,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "sales_tax_template",
"fieldtype": "Link",
@@ -107,6 +115,7 @@
"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,
@@ -117,6 +126,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.tax_type==\"Purchase\"",
"fieldname": "purchase_tax_template",
"fieldtype": "Link",
@@ -134,6 +144,7 @@
"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,
@@ -144,6 +155,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "filters",
"fieldtype": "Section Break",
"hidden": 0,
@@ -159,6 +171,7 @@
"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,
@@ -169,6 +182,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "customer",
"fieldtype": "Link",
@@ -186,6 +200,7 @@
"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,
@@ -196,6 +211,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.tax_type==\"Purchase\"",
"fieldname": "supplier",
"fieldtype": "Link",
@@ -213,6 +229,7 @@
"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,
@@ -223,6 +240,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "billing_city",
"fieldtype": "Data",
"hidden": 0,
@@ -238,6 +256,7 @@
"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,
@@ -248,6 +267,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "billing_county",
"fieldtype": "Data",
"hidden": 0,
@@ -263,6 +283,7 @@
"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,
@@ -273,6 +294,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "billing_state",
"fieldtype": "Data",
"hidden": 0,
@@ -288,6 +310,7 @@
"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,
@@ -298,6 +321,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "billing_country",
"fieldtype": "Link",
"hidden": 0,
@@ -314,6 +338,7 @@
"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,
@@ -324,6 +349,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -338,6 +364,7 @@
"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,
@@ -348,6 +375,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "customer_group",
"fieldtype": "Link",
@@ -365,6 +393,7 @@
"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,
@@ -375,6 +404,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.tax_type==\"Purchase\"",
"fieldname": "supplier_type",
"fieldtype": "Link",
@@ -392,6 +422,7 @@
"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,
@@ -402,6 +433,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_city",
"fieldtype": "Data",
"hidden": 0,
@@ -417,6 +449,7 @@
"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,
@@ -427,6 +460,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_county",
"fieldtype": "Data",
"hidden": 0,
@@ -442,6 +476,7 @@
"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,
@@ -452,6 +487,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_state",
"fieldtype": "Data",
"hidden": 0,
@@ -467,6 +503,7 @@
"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,
@@ -477,6 +514,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_country",
"fieldtype": "Link",
"hidden": 0,
@@ -493,6 +531,7 @@
"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,
@@ -503,6 +542,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_4",
"fieldtype": "Section Break",
"hidden": 0,
@@ -518,6 +558,7 @@
"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,
@@ -528,6 +569,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "from_date",
"fieldtype": "Date",
"hidden": 0,
@@ -543,6 +585,7 @@
"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,
@@ -553,6 +596,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_7",
"fieldtype": "Column Break",
"hidden": 0,
@@ -567,6 +611,7 @@
"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,
@@ -577,6 +622,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "to_date",
"fieldtype": "Date",
"hidden": 0,
@@ -592,6 +638,7 @@
"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,
@@ -602,6 +649,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
@@ -616,6 +664,7 @@
"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,
@@ -626,6 +675,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"fieldname": "priority",
"fieldtype": "Int",
@@ -642,6 +692,7 @@
"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,
@@ -652,6 +703,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_20",
"fieldtype": "Column Break",
"hidden": 0,
@@ -666,6 +718,7 @@
"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,
@@ -676,6 +729,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -692,6 +746,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -702,13 +757,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-05-30 15:53:16.630072",
"modified": "2016-11-03 15:56:28.704122",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Rule",
@@ -725,6 +781,7 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View File

@@ -15,33 +15,19 @@ frappe.pages['pos'].refresh = function(wrapper) {
window.onbeforeunload = function () {
return wrapper.pos.beforeunload()
}
wrapper.pos.on_refresh_page()
}
erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
init: function(wrapper){
this.load = true;
this.page = wrapper.page;
this.wrapper = $(wrapper).find('.page-content');
this.set_indicator();
this.onload();
this.make_menu_list();
this.set_interval_for_si_sync();
this.si_docs = this.get_doc_from_localstorage();
},
on_refresh_page: function() {
var me = this;
if(this.load){
this.load = false;
}else if(this.connection_status){
this.onload();
}else{
this.create_new();
}
},
beforeunload: function(e){
if(this.connection_status == false && frappe.get_route()[0] == "pos"){
e = e || window.event;
@@ -86,8 +72,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.get_data_from_server(function(){
me.create_new();
});
this.check_internet_connection();
},
make_menu_list: function(){
@@ -111,6 +95,10 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
})
});
this.page.add_menu_item(__("Sync Offline Invoices"), function(){
me.sync_sales_invoice()
});
this.page.add_menu_item(__("POS Profile"), function() {
frappe.set_route('List', 'POS Profile');
});
@@ -128,10 +116,11 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.list_body = this.list_dialog.body;
if(this.si_docs.length > 0){
$(this.list_body).append('<div class="row list-row list-row-head pos-invoice-list">\
<div class="col-xs-2">Sr</div>\
<div class="col-xs-4">Customer</div>\
<div class="col-xs-1">Sr</div>\
<div class="col-xs-3">Customer</div>\
<div class="col-xs-2 text-left">Status</div>\
<div class="col-xs-4 text-right">Grand Total</div>\
<div class="col-xs-3 text-right">Paid Amount</div>\
<div class="col-xs-3 text-right">Grand Total</div>\
</div>')
$.each(this.si_docs, function(index, data){
@@ -140,6 +129,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
sr: index + 1,
name: key,
customer: data[key].customer,
paid_amount: format_currency(data[key].paid_amount, me.frm.doc.currency),
grand_total: format_currency(data[key].grand_total, me.frm.doc.currency),
data: me.get_doctype_status(data[key])
})).appendTo($(me.list_body));
@@ -163,12 +153,12 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
},
get_doctype_status: function(doc){
if(doc.outstanding_amount == 0){
return {status: "Paid", indicator: "green"}
}else if(doc.docstatus == 0){
if(doc.docstatus == 0) {
return {status: "Draft", indicator: "red"}
}else if(doc.paid_amount >= 0){
return {status: "Unpaid", indicator: "orange"}
}else if(doc.outstanding_amount == 0) {
return {status: "Paid", indicator: "green"}
}else {
return {status: "Submitted", indicator: "blue"}
}
},
@@ -211,13 +201,10 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
freeze: true,
freeze_message: __("Master data syncing, it might take some time"),
callback: function(r){
window.items = r.message.items;
window.customers = r.message.customers;
window.pricing_rules = r.message.pricing_rules;
window.meta = r.message.meta;
window.print_template = r.message.print_template;
me.default_customer = r.message.default_customer || null;
me.init_master_data(r)
localStorage.setItem('doc', JSON.stringify(r.message.doc));
me.set_interval_for_si_sync();
me.check_internet_connection();
if(callback){
callback();
}
@@ -225,6 +212,22 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
})
},
init_master_data: function(r){
var me = this;
this.meta = r.message.meta;
this.item_data = r.message.items;
this.customers = r.message.customers;
this.serial_no_data = r.message.serial_no_data;
this.batch_no_data = r.message.batch_no_data;
this.tax_data = r.message.tax_data;
this.price_list_data = r.message.price_list_data;
this.bin_data = r.message.bin_data;
this.pricing_rules = r.message.pricing_rules;
this.print_template = r.message.print_template;
this.pos_profile_data = r.message.pos_profile;
this.default_customer = r.message.default_customer || null;
},
save_previous_entry : function(){
if(this.frm.doc.items.length > 0){
this.create_invoice()
@@ -240,20 +243,22 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
},
load_data: function(load_doc){
this.items = window.items;
this.customers = window.customers;
this.pricing_rules = window.pricing_rules;
var me = this;
this.items = this.item_data;
this.actual_qty_dict = {};
if(load_doc) {
this.frm.doc = JSON.parse(localStorage.getItem('doc'));
}
$.each(window.meta, function(i, data){
$.each(this.meta, function(i, data){
frappe.meta.sync(data)
})
this.print_template = frappe.render_template("print_template",
{content: window.print_template, title:"POS"})
{content: this.print_template, title:"POS",
base_url: frappe.urllib.get_base_url(), print_css: frappe.boot.print_css})
},
setup: function(){
@@ -313,6 +318,15 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
});
this.party_field.make_input();
this.set_focus()
},
set_focus: function(){
if(this.default_customer){
this.search.$input.focus();
}else{
this.party_field.$input.focus();
}
},
make_customer: function() {
@@ -355,11 +369,14 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
get_customers: function(key){
var me = this;
key = key.toLowerCase().trim()
var re = new RegExp('%', 'g');
var reg = new RegExp(key.replace(re, '\\w*\\s*[a-zA-Z0-9]*'))
if(key){
return $.grep(this.customers, function(data) {
if(data.name.toLowerCase().match(key)
|| data.customer_name.toLowerCase().match(key)
|| (data.customer_group && data.customer_group.toLowerCase().match(key))){
if(reg.test(data.name.toLowerCase())
|| reg.test(data.customer_name.toLowerCase())
|| (data.customer_group && reg.test(data.customer_group.toLowerCase()))){
return data
}
})
@@ -381,12 +398,12 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
var $wrap = me.wrapper.find(".item-list");
me.wrapper.find(".item-list").empty();
if (this.items) {
if (this.items.length > 0) {
$.each(this.items, function(index, obj) {
if(index < 16){
if(index < 30){
$(frappe.render_template("pos_item", {
item_code: obj.name,
item_price: format_currency(obj.price_list_rate, obj.currency),
item_price: format_currency(me.price_list_data[obj.name], me.frm.doc.currency),
item_name: obj.name===obj.item_name ? "" : obj.item_name,
item_image: obj.image ? "url('" + obj.image + "')" : null,
color: frappe.get_palette(obj.item_name),
@@ -394,6 +411,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
})).tooltip().appendTo($wrap);
}
});
} else {
$("<h4>Searching record not found.</h4>").appendTo($wrap)
}
if(this.items.length == 1
@@ -420,37 +439,40 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.item_batch_no = {};
if(item_code){
return $.grep(window.items, function(item){
return $.grep(this.item_data, function(item){
if(item.item_code == item_code ){
return true
}
})
}
key = this.search.$input.val().toLowerCase();
key = this.search.$input.val().toLowerCase().replace(/[&\/\\#,+()\[\]$~.'":*?<>{}]/g,'\\$&');
var re = new RegExp('%', 'g');
var reg = new RegExp(key.replace(re, '[\\w*\\s*[a-zA-Z0-9]*]*'))
search_status = true
if(key){
return $.grep(window.items, function(item){
return $.grep(this.item_data, function(item){
if(search_status){
if(in_list(item.batch_nos, me.search.$input.val())){
if(in_list(me.batch_no_data[item.item_code], me.search.$input.val())){
search_status = false;
return me.item_batch_no[item.item_code] = me.search.$input.val()
} else if(in_list(Object.keys(item.serial_nos), me.search.$input.val())) {
} else if( me.serial_no_data[item.item_code]
&& in_list(Object.keys(me.serial_no_data[item.item_code]), me.search.$input.val())) {
search_status = false;
me.item_serial_no[item.item_code] = [me.search.$input.val(), item.serial_nos[me.search.$input.val()]]
me.item_serial_no[item.item_code] = [me.search.$input.val(), me.serial_no_data[item.item_code][me.search.$input.val()]]
return true
} else if(item.barcode == me.search.$input.val()) {
search_status = false;
return item.barcode == me.search.$input.val();
} else if((item.item_code.toLowerCase().match(key)) ||
(item.item_name.toLowerCase().match(key)) || (item.item_group.toLowerCase().match(key))) {
} else if(reg.test(item.item_code.toLowerCase()) || reg.test(item.description.toLowerCase()) ||
reg.test(item.item_name.toLowerCase()) || reg.test(item.item_group.toLowerCase()) ){
return true
}
}
})
}else{
return window.items;
return this.item_data;
}
},
@@ -603,18 +625,18 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.child.description = this.items[0].description;
this.child.qty = 1;
this.child.item_group = this.items[0].item_group;
this.child.cost_center = this.items[0].cost_center;
this.child.income_account = this.items[0].income_account;
this.child.cost_center = this.pos_profile_data['cost_center'] || this.items[0].cost_center;
this.child.income_account = this.pos_profile_data['income_account'] || this.items[0].income_account;
this.child.warehouse = (this.item_serial_no[this.child.item_code]
? this.item_serial_no[this.child.item_code][1] : this.items[0].default_warehouse);
this.child.price_list_rate = flt(this.items[0].price_list_rate, 9) / flt(this.frm.doc.conversion_rate, 9);
this.child.rate = flt(this.items[0].price_list_rate, 9) / flt(this.frm.doc.conversion_rate, 9);
this.child.actual_qty = this.items[0].actual_qty;
? this.item_serial_no[this.child.item_code][1] : (this.pos_profile_data['warehouse'] || this.items[0].default_warehouse) );
this.child.price_list_rate = flt(this.price_list_data[this.child.item_code], 9) / flt(this.frm.doc.conversion_rate, 9);
this.child.rate = flt(this.price_list_data[this.child.item_code], 9) / flt(this.frm.doc.conversion_rate, 9);
this.child.actual_qty = me.get_actual_qty(this.items[0]);
this.child.amount = flt(this.child.qty) * flt(this.child.rate);
this.child.batch_no = this.item_batch_no[this.child.item_code];
this.child.serial_no = (this.item_serial_no[this.child.item_code]
? this.item_serial_no[this.child.item_code][0] : '');
this.child.item_tax_rate = this.items[0].taxes;
this.child.item_tax_rate = JSON.stringify(this.tax_data[this.child.item_code]);
},
update_paid_amount_status: function(update_paid_amount){
@@ -660,7 +682,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
item_code: d.item_code,
item_name: (d.item_name===d.item_code || !d.item_name) ? "" : ("<br>" + d.item_name),
qty: d.qty,
actual_qty: d.actual_qty,
actual_qty: me.actual_qty_dict[d.item_code] || 0,
projected_qty: d.projected_qty,
rate: format_number(d.rate, me.frm.doc.currency),
amount: format_currency(d.amount, me.frm.doc.currency)
@@ -727,6 +749,26 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
}, "octicon octicon-plus").addClass("btn-primary");
},
print_dialog: function(){
var me = this;
msgprint = frappe.msgprint(format('<a class="btn btn-primary print_doc" \
style="margin-right: 5px;">{0}</a>\
<a class="btn btn-default new_doc">{1}</a>', [
__('Print'), __('New')
]));
$('.print_doc').click(function(){
html = frappe.render(me.print_template, me.frm.doc)
me.print_document(html)
})
$('.new_doc').click(function(){
msgprint.hide()
me.create_new();
})
},
print_document: function(html){
var w = window.open();
w.document.write(html);
@@ -739,10 +781,10 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
submit_invoice: function(){
var me = this;
frappe.confirm(__("Do you really want to submit the invoice?"), function () {
me.change_status();
frappe.msgprint(__("Sales invoice submitted sucessfully."))
})
this.change_status();
if(this.frm.doc.docstatus == 1){
this.print_dialog()
}
},
change_status: function(){
@@ -960,6 +1002,10 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
item.margin_rate_or_amount = pricing_rule[0].margin_rate_or_amount;
item.discount_percentage = pricing_rule[0].discount_percentage || 0.0;
me.apply_pricing_rule_on_item(item)
} else if(item.discount_percentage > 0 || item.margin_rate_or_amount > 0) {
item.margin_rate_or_amount = 0.0;
item.discount_percentage = 0.0;
me.apply_pricing_rule_on_item(item)
}
})
},
@@ -1032,8 +1078,20 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
},
validate_warehouse: function(){
if(!this.items[0].default_warehouse){
frappe.throw(__("Deafault warehouse is required for selected item"))
if(this.items[0].is_stock_item && !this.items[0].default_warehouse && !this.pos_profile_data['warehouse']){
frappe.throw(__("Default warehouse is required for selected item"))
}
},
get_actual_qty: function(item) {
this.actual_qty = 0.0;
var warehouse = this.pos_profile_data['warehouse'] || item.default_warehouse;
if(warehouse && this.bin_data[item.item_code]) {
this.actual_qty = this.bin_data[item.item_code][warehouse] || 0;
this.actual_qty_dict[item.item_code] = this.actual_qty
}
return this.actual_qty
}
})

View File

@@ -4,7 +4,7 @@
<h2 class="text-center">{%= __(report.report_name) %}</h2>
<h4 class="text-center">{%= filters.customer || filters.supplier %} </h4>
<h5 class="text-center">
{%= filters.ageing_based_on %}
{%= __(filters.ageing_based_on) %}
{%= __("Until") %}
{%= dateutil.str_to_user(filters.report_date) %}
</h5>
@@ -12,7 +12,7 @@
<table class="table table-bordered">
<thead>
<tr>
{% if(__(report.report_name) == "Accounts Receivable" || __(report.report_name) == "Accounts Payable") { %}
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
<th style="width: 15%">{%= __("Date") %}</th>
<th style="width: 15%">{%= __("Ref") %}</th>
<th style="width: 40%">{%= __("Party") %}</th>
@@ -30,7 +30,7 @@
<tbody>
{% for(var i=0, l=data.length; i<l; i++) { %}
<tr>
{% if(__(report.report_name) == "Accounts Receivable" || __(report.report_name) == "Accounts Payable") { %}
{% 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")] %}
@@ -38,21 +38,21 @@
<td>{%= data[i][__("Customer Name")] || data[i][__("Customer")] || data[i][__("Supplier Name")] || data[i][__("Supplier")] %}
<br>{%= __("Remarks") %}: {%= data[i][__("Remarks")] %}</td>
<td style="text-align: right">
{%= format_currency(data[i][__("Invoiced Amount")], data[i]["currency"]) %}</td>
{%= 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>
{%= format_currency(data[i]["Paid Amount"], data[i]["currency"]) %}</td>
<td style="text-align: right">
{%= format_currency(data[i][__("Outstanding Amount")], data[i]["currency"]) %}</td>
{%= format_currency(data[i]["Outstanding Amount"], data[i]["currency"]) %}</td>
{% } else { %}
<td></td>
<td></td>
<td><b>{%= __("Total") %}</b></td>
<td style="text-align: right">
{%= format_currency(data[i][__("Invoiced Amount")]) %}</td>
{%= format_currency(data[i]["Invoiced Amount"]) %}</td>
<td style="text-align: right">
{%= format_currency(data[i][__("Paid Amount")]) %}</td>
{%= format_currency(data[i]["Paid Amount"]) %}</td>
<td style="text-align: right">
{%= format_currency(data[i][__("Outstanding Amount")]) %}</td>
{%= format_currency(data[i]["Outstanding Amount"]) %}</td>
{% } %}
{% } else { %}
{% if(data[i][__("Customer")] || data[i][__("Supplier")]|| "&nbsp;") { %}
@@ -71,4 +71,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

@@ -56,7 +56,6 @@ class ReceivablePayableReport(object):
"{range1}-{range2}".format(range1=cint(self.filters["range1"])+ 1, range2=self.filters["range2"]),
"{range2}-{range3}".format(range2=cint(self.filters["range2"])+ 1, range3=self.filters["range3"]),
"{range3}-{above}".format(range3=cint(self.filters["range3"])+ 1, above=_("Above"))):
frappe.errprint(label)
columns.append({
"label": label,
"fieldtype": "Currency",
@@ -89,6 +88,9 @@ class ReceivablePayableReport(object):
future_vouchers = self.get_entries_after(self.filters.report_date, args.get("party_type"))
if not self.filters.get("company"):
self.filters["company"] = frappe.db.get_single_value('Global Defaults', 'default_company')
company_currency = frappe.db.get_value("Company", self.filters.get("company"), "default_currency")
data = []

View File

@@ -4,27 +4,44 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from frappe.utils import flt, cint
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data)
def execute(filters=None):
period_list = get_period_list(filters.fiscal_year, filters.periodicity)
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, filters.periodicity)
asset = get_data(filters.company, "Asset", "Debit", period_list, only_current_fiscal_year=False)
liability = get_data(filters.company, "Liability", "Credit", period_list, only_current_fiscal_year=False)
equity = get_data(filters.company, "Equity", "Credit", period_list, only_current_fiscal_year=False)
provisional_profit_loss = get_provisional_profit_loss(asset, liability, equity,
provisional_profit_loss, total_credit = get_provisional_profit_loss(asset, liability, equity,
period_list, filters.company)
message = check_opening_balance(asset, liability, equity)
message, opening_balance = check_opening_balance(asset, liability, equity)
data = []
data.extend(asset or [])
data.extend(liability or [])
data.extend(equity or [])
if opening_balance and round(opening_balance,2) !=0:
unclosed ={
"account_name": "'" + _("Unclosed Fiscal Years Profit / Loss (Credit)") + "'",
"account": None,
"warn_if_negative": True,
"currency": frappe.db.get_value("Company", filters.company, "default_currency")
}
for period in period_list:
unclosed[period.key] = opening_balance
if provisional_profit_loss:
provisional_profit_loss[period.key] = provisional_profit_loss[period.key] - opening_balance
unclosed["total"]=opening_balance
data.append(unclosed)
if provisional_profit_loss:
data.append(provisional_profit_loss)
if total_credit:
data.append(total_credit)
columns = get_columns(filters.periodicity, period_list, company=filters.company)
@@ -33,15 +50,17 @@ def execute(filters=None):
return columns, data, message, chart
def get_provisional_profit_loss(asset, liability, equity, period_list, company):
provisional_profit_loss = {}
total_row = {}
if asset and (liability or equity):
total=0
provisional_profit_loss = {
"account_name": "'" + _("Provisional Profit / Loss (Credit)") + "'",
total = total_row_total=0
currency = frappe.db.get_value("Company", company, "default_currency")
total_row = {
"account_name": "'" + _("Total (Credit)") + "'",
"account": None,
"warn_if_negative": True,
"currency": frappe.db.get_value("Company", company, "default_currency")
"currency": currency
}
has_value = False
for period in period_list:
@@ -52,28 +71,41 @@ def get_provisional_profit_loss(asset, liability, equity, period_list, company):
effective_liability += flt(equity[-2].get(period.key))
provisional_profit_loss[period.key] = flt(asset[-2].get(period.key)) - effective_liability
total_row[period.key] = effective_liability + provisional_profit_loss[period.key]
if provisional_profit_loss[period.key]:
has_value = True
total += flt(provisional_profit_loss[period.key])
provisional_profit_loss["total"] = total
total_row_total += flt(total_row[period.key])
total_row["total"] = total_row_total
if has_value:
return provisional_profit_loss
provisional_profit_loss.update({
"account_name": "'" + _("Provisional Profit / Loss (Credit)") + "'",
"account": None,
"warn_if_negative": True,
"currency": currency
})
return provisional_profit_loss, total_row
def check_opening_balance(asset, liability, equity):
# Check if previous year balance sheet closed
opening_balance = 0
float_precision = cint(frappe.db.get_default("float_precision")) or 2
if asset:
opening_balance = flt(asset[0].get("opening_balance", 0))
opening_balance = flt(asset[0].get("opening_balance", 0), float_precision)
if liability:
opening_balance -= flt(liability[0].get("opening_balance", 0))
opening_balance -= flt(liability[0].get("opening_balance", 0), float_precision)
if equity:
opening_balance -= flt(asset[0].get("opening_balance", 0))
opening_balance -= flt(equity[0].get("opening_balance", 0), float_precision)
if opening_balance:
return _("Previous Financial Year is not closed")
return _("Previous Financial Year is not closed"),opening_balance
return None,None
def get_chart_data(columns, asset, liability, equity):
x_intervals = ['x'] + [d.get("label") for d in columns[2:]]
@@ -101,4 +133,4 @@ def get_chart_data(columns, asset, liability, equity):
'x': 'x',
'columns': columns
}
}
}

View File

@@ -16,7 +16,7 @@ def execute(filters=None):
def get_columns():
return [
_("Payment Document") + ":Link/DocType:130",
_("Payment Document") + "::130",
_("Payment Entry") + ":Dynamic Link/"+_("Payment Document")+":110",
_("Posting Date") + ":Date:100",
_("Cheque/Reference No") + "::120",

View File

@@ -8,7 +8,7 @@
<thead>
<tr>
<th style="width: 15%">{%= __("Posting Date") %}</th>
<th style="width: 15%">{%= __("Journal Entry") %}</th>
<th style="width: 15%">{%= __("Payment Entry") %}</th>
<th style="width: 40%">{%= __("Reference") %}</th>
<th style="width: 15%; text-align: right;">{%= __("Debit") %}</th>
<th style="width: 15%; text-align: right;">{%= __("Credit") %}</th>
@@ -19,10 +19,10 @@
{% if (data[i]["posting_date"]) { %}
<tr>
<td>{%= dateutil.str_to_user(data[i]["posting_date"]) %}</td>
<td>{%= data[i]["journal_entry"] %}</td>
<td>{%= data[i]["payment_entry"] %}</td>
<td>{%= __("Against") %}: {%= data[i]["against_account"] %}
{% if (data[i]["reference"]) { %}
<br>{%= __("Reference") %}: {%= data[i]["reference"] %}
{% if (data[i]["reference_no"]) { %}
<br>{%= __("Reference") %}: {%= data[i]["reference_no"] %}
{% if (data[i]["ref_date"]) { %}
<br>{%= __("Reference Date") %}: {%= dateutil.str_to_user(data[i]["ref_date"]) %}
{% } %}
@@ -38,7 +38,7 @@
<tr>
<td></td>
<td></td>
<td>{%= data[i]["journal_entry"] %}</td>
<td>{%= data[i]["payment_entry"] %}</td>
<td style="text-align: right">{%= format_currency(data[i]["debit"]) %}</td>
<td style="text-align: right">{%= format_currency(data[i]["credit"]) %}</td>
</tr>

View File

@@ -129,7 +129,7 @@ def get_entries(filters):
reference_no, reference_date as ref_date,
if(paid_to=%(account)s, received_amount, 0) as debit,
if(paid_from=%(account)s, paid_amount, 0) as credit,
posting_date, party as against_account, clearance_date,
posting_date, ifnull(party,if(paid_from=%(account)s,paid_to,paid_from)) as against_account, clearance_date,
if(paid_to=%(account)s, paid_to_account_currency, paid_from_account_currency) as account_currency
from `tabPayment Entry`
where

View File

@@ -64,7 +64,7 @@ def get_cost_center_target_details(filters):
return frappe.db.sql("""
select b.cost_center, b.monthly_distribution, ba.account, ba.budget_amount
from `tabBudget` b, `tabBudget Account` ba
where b.name=ba.parent and b.fiscal_year=%s and b.company=%s
where b.name=ba.parent and b.docstatus = 1 and b.fiscal_year=%s and b.company=%s
""", (filters.fiscal_year, filters.company), as_dict=True)
#Get target distribution details of accounts of cost center
@@ -84,8 +84,9 @@ def get_actual_details(cost_center, fiscal_year):
ac_details = frappe.db.sql("""select gl.account, gl.debit, gl.credit,
MONTHNAME(gl.posting_date) as month_name, b.cost_center
from `tabGL Entry` gl, `tabBudget Account` ba, `tabBudget` b
where
where
b.name = ba.parent
and b.docstatus = 1
and ba.account=gl.account
and gl.fiscal_year=%s
and b.cost_center=%s

View File

@@ -0,0 +1 @@
{% include "accounts/report/financial_statements.html" %}

View File

@@ -2,7 +2,8 @@
// For license information, please see license.txt
frappe.require("assets/erpnext/js/financial_statements.js", function() {
frappe.query_reports["Cash Flow"] = erpnext.financial_statements;
frappe.query_reports["Cash Flow"] = $.extend({},
erpnext.financial_statements);
frappe.query_reports["Cash Flow"]["filters"].push({
"fieldname": "accumulated_values",

View File

@@ -6,10 +6,11 @@ import frappe
from frappe import _
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data)
from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import get_net_profit_loss
from erpnext.accounts.utils import get_fiscal_year
def execute(filters=None):
period_list = get_period_list(filters.fiscal_year, filters.periodicity)
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, filters.periodicity)
operation_accounts = {
"section_name": "Operations",
@@ -49,9 +50,9 @@ def execute(filters=None):
# compute net profit / loss
income = get_data(filters.company, "Income", "Credit", period_list,
accumulated_values=filters.accumulated_values, ignore_closing_entries=True)
accumulated_values=filters.accumulated_values, ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
expense = get_data(filters.company, "Expense", "Debit", period_list,
accumulated_values=filters.accumulated_values, ignore_closing_entries=True)
accumulated_values=filters.accumulated_values, ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
net_profit_loss = get_net_profit_loss(income, expense, period_list, filters.company)
@@ -98,33 +99,39 @@ def execute(filters=None):
return columns, data
def get_account_type_based_data(company, account_type, period_list, accumulated_values):
data = {}
total = 0
for period in period_list:
start_date = get_start_date(period, accumulated_values)
gl_sum = frappe.db.sql_list("""
select sum(credit) - sum(debit)
from `tabGL Entry`
where company=%s and posting_date >= %s and posting_date <= %s
and voucher_type != 'Period Closing Voucher'
and account in ( SELECT name FROM tabAccount WHERE account_type = %s)
""", (company, period["year_start_date"] if accumulated_values else period['from_date'],
""", (company, start_date if accumulated_values else period['from_date'],
period['to_date'], account_type))
if gl_sum and gl_sum[0]:
amount = gl_sum[0]
if account_type == "Depreciation":
amount *= -1
else:
amount = 0
total += amount
data.setdefault(period["key"], amount)
data["total"] = total
return data
def get_start_date(period, accumulated_values):
start_date = period["year_start_date"]
if accumulated_values:
start_date = get_fiscal_year(period.to_date)[1]
return start_date
def add_total_row_account(out, data, label, period_list, currency):
total_row = {

View File

@@ -7,12 +7,12 @@
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2016-05-17 08:40:18.711626",
"modified": "2016-08-18 14:29:50.680329",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Delivered Items To Be Billed",
"owner": "Administrator",
"query": "select\n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n\t`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n\t`tabDelivery Note`.`posting_date` as \"Date:Date\",\n\t`tabDelivery Note`.`project` as \"Project\",\n\t`tabDelivery Note Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabDelivery Note Item`.`base_amount` - `tabDelivery Note Item`.`billed_amt`*ifnull(`tabDelivery Note`.conversion_rate, 1)) as \"Pending Amount:Currency:110\",\n\t`tabDelivery Note Item`.`item_name` as \"Item Name::150\",\n\t`tabDelivery Note Item`.`description` as \"Description::200\",\n\t`tabDelivery Note`.`company` as \"Company:Link/Company:\"\nfrom `tabDelivery Note`, `tabDelivery Note Item`\nwhere \n `tabDelivery Note`.name = `tabDelivery Note Item`.parent \n and `tabDelivery Note`.docstatus = 1 \n and `tabDelivery Note`.`status` not in (\"Stopped\", \"Closed\") \n and `tabDelivery Note Item`.amount > 0\n and `tabDelivery Note Item`.billed_amt < `tabDelivery Note Item`.amount\norder by `tabDelivery Note`.`name` desc",
"query": "select\n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n\t`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n\t`tabDelivery Note`.`customer_name` as \"Customer Name::150\",\n\t`tabDelivery Note`.`posting_date` as \"Date:Date\",\n\t`tabDelivery Note`.`project` as \"Project\",\n\t`tabDelivery Note Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabDelivery Note Item`.`base_amount` - `tabDelivery Note Item`.`billed_amt`*ifnull(`tabDelivery Note`.conversion_rate, 1)) as \"Pending Amount:Currency:110\",\n\t`tabDelivery Note Item`.`item_name` as \"Item Name::150\",\n\t`tabDelivery Note Item`.`description` as \"Description::200\",\n\t`tabDelivery Note`.`company` as \"Company:Link/Company:\"\nfrom `tabDelivery Note`, `tabDelivery Note Item`\nwhere \n `tabDelivery Note`.name = `tabDelivery Note Item`.parent \n and `tabDelivery Note`.docstatus = 1 \n and `tabDelivery Note`.`status` not in (\"Stopped\", \"Closed\") \n and `tabDelivery Note Item`.amount > 0\n and `tabDelivery Note Item`.billed_amt < `tabDelivery Note Item`.amount\norder by `tabDelivery Note`.`name` desc",
"ref_doctype": "Sales Invoice",
"report_name": "Delivered Items To Be Billed",
"report_type": "Query Report"

View File

@@ -3,61 +3,60 @@
from __future__ import unicode_literals
import frappe
import math
from frappe import _
from frappe.utils import (flt, getdate, get_first_day, get_last_day,
add_months, add_days, formatdate)
from frappe.utils import (flt, getdate, get_first_day, get_last_day, date_diff,
add_months, add_days, formatdate, cint)
def get_period_list(fiscal_year, periodicity):
def get_period_list(from_fiscal_year, to_fiscal_year, periodicity):
"""Get a list of dict {"from_date": from_date, "to_date": to_date, "key": key, "label": label}
Periodicity can be (Yearly, Quarterly, Monthly)"""
fy_start_end_date = frappe.db.get_value("Fiscal Year", fiscal_year, ["year_start_date", "year_end_date"])
if not fy_start_end_date:
frappe.throw(_("Fiscal Year {0} not found.").format(fiscal_year))
fiscal_year = get_fiscal_year_data(from_fiscal_year, to_fiscal_year)
validate_fiscal_year(fiscal_year, from_fiscal_year, to_fiscal_year)
# start with first day, so as to avoid year to_dates like 2-April if ever they occur]
year_start_date = get_first_day(getdate(fy_start_end_date[0]))
year_end_date = getdate(fy_start_end_date[1])
if periodicity == "Yearly":
period_list = [frappe._dict({"from_date": year_start_date, "to_date": year_end_date,
"key": fiscal_year, "label": fiscal_year})]
else:
months_to_add = {
"Half-Yearly": 6,
"Quarterly": 3,
"Monthly": 1
}[periodicity]
year_start_date = getdate(fiscal_year.year_start_date)
year_end_date = getdate(fiscal_year.year_end_date)
period_list = []
months_to_add = {
"Yearly": 12,
"Half-Yearly": 6,
"Quarterly": 3,
"Monthly": 1
}[periodicity]
start_date = year_start_date
for i in xrange(12 / months_to_add):
period = frappe._dict({
"from_date": start_date
})
to_date = add_months(start_date, months_to_add)
start_date = to_date
if to_date == get_first_day(to_date):
# if to_date is the first day, get the last day of previous month
to_date = add_days(to_date, -1)
else:
# to_date should be the last day of the new to_date's month
to_date = get_last_day(to_date)
period_list = []
start_date = year_start_date
months = get_months(year_start_date, year_end_date)
for i in xrange(months / months_to_add):
period = frappe._dict({
"from_date": start_date
})
to_date = add_months(start_date, months_to_add)
start_date = to_date
if to_date == get_first_day(to_date):
# if to_date is the first day, get the last day of previous month
to_date = add_days(to_date, -1)
if to_date <= year_end_date:
# the normal case
period.to_date = to_date
else:
# if a fiscal year ends before a 12 month period
period.to_date = year_end_date
period.to_date_fiscal_year = get_date_fiscal_year(period.to_date)
period_list.append(period)
if period.to_date == year_end_date:
break
if to_date <= year_end_date:
# the normal case
period.to_date = to_date
else:
# if a fiscal year ends before a 12 month period
period.to_date = year_end_date
period_list.append(period)
if period.to_date == year_end_date:
break
# common processing
for opts in period_list:
key = opts["to_date"].strftime("%b_%Y").lower()
@@ -75,6 +74,22 @@ def get_period_list(fiscal_year, periodicity):
return period_list
def get_fiscal_year_data(from_fiscal_year, to_fiscal_year):
fiscal_year = frappe.db.sql("""select min(year_start_date) as year_start_date,
max(year_end_date) as year_end_date from `tabFiscal Year` where
name between %(from_fiscal_year)s and %(to_fiscal_year)s""",
{'from_fiscal_year': from_fiscal_year, 'to_fiscal_year': to_fiscal_year}, as_dict=1)
return fiscal_year[0] if fiscal_year else {}
def validate_fiscal_year(fiscal_year, from_fiscal_year, to_fiscal_year):
if not fiscal_year.get('year_start_date') and not fiscal_year.get('year_end_date'):
frappe.throw(_("End Year cannot be before Start Year"))
def get_months(start_date, end_date):
diff = (12 * end_date.year + end_date.month) - (12 * start_date.year + start_date.month)
return diff + 1
def get_label(periodicity, from_date, to_date):
if periodicity=="Yearly":
if formatdate(from_date, "YYYY") == formatdate(to_date, "YYYY"):
@@ -86,8 +101,9 @@ def get_label(periodicity, from_date, to_date):
return label
def get_data(company, root_type, balance_must_be, period_list,
accumulated_values=1, only_current_fiscal_year=True, ignore_closing_entries=False):
def get_data(company, root_type, balance_must_be, period_list, filters=None,
accumulated_values=1, only_current_fiscal_year=True, ignore_closing_entries=False,
ignore_accumulated_values_for_fy=False):
accounts = get_accounts(company, root_type)
if not accounts:
return None
@@ -103,10 +119,10 @@ def get_data(company, root_type, balance_must_be, period_list,
set_gl_entries_by_account(company,
period_list[0]["year_start_date"] if only_current_fiscal_year else None,
period_list[-1]["to_date"],
root.lft, root.rgt,
root.lft, root.rgt, filters,
gl_entries_by_account, ignore_closing_entries=ignore_closing_entries)
calculate_values(accounts_by_name, gl_entries_by_account, period_list, accumulated_values)
calculate_values(accounts_by_name, gl_entries_by_account, period_list, accumulated_values, ignore_accumulated_values_for_fy)
accumulate_values_into_parents(accounts, accounts_by_name, period_list, accumulated_values)
out = prepare_data(accounts, balance_must_be, period_list, company_currency)
out = filter_out_zero_value_rows(out, parent_children_map)
@@ -116,18 +132,25 @@ def get_data(company, root_type, balance_must_be, period_list,
return out
def calculate_values(accounts_by_name, gl_entries_by_account, period_list, accumulated_values):
def calculate_values(accounts_by_name, gl_entries_by_account, period_list, accumulated_values, ignore_accumulated_values_for_fy):
for entries in gl_entries_by_account.values():
for entry in entries:
d = accounts_by_name.get(entry.account)
for period in period_list:
# check if posting date is within the period
if entry.posting_date <= period.to_date:
if accumulated_values or entry.posting_date >= period.from_date:
if (accumulated_values or entry.posting_date >= period.from_date) and \
(entry.fiscal_year == period.to_date_fiscal_year or not ignore_accumulated_values_for_fy):
d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
if entry.posting_date < period_list[0].year_start_date:
d["opening_balance"] = d.get("opening_balance", 0.0) + flt(entry.debit) - flt(entry.credit)
def get_date_fiscal_year(date):
from erpnext.accounts.utils import get_fiscal_year
return get_fiscal_year(date)[0]
def accumulate_values_into_parents(accounts, accounts_by_name, period_list, accumulated_values):
"""accumulate children's values in parent accounts"""
@@ -261,24 +284,19 @@ def sort_root_accounts(roots):
roots.sort(compare_roots)
def set_gl_entries_by_account(company, from_date, to_date, root_lft, root_rgt, gl_entries_by_account,
def set_gl_entries_by_account(company, from_date, to_date, root_lft, root_rgt, filters, gl_entries_by_account,
ignore_closing_entries=False):
"""Returns a dict like { "account": [gl entries], ... }"""
additional_conditions = []
if ignore_closing_entries:
additional_conditions.append("and ifnull(voucher_type, '')!='Period Closing Voucher'")
additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters)
if from_date:
additional_conditions.append("and posting_date >= %(from_date)s")
gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening from `tabGL Entry`
gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year from `tabGL Entry`
where company=%(company)s
{additional_conditions}
and posting_date <= %(to_date)s
and account in (select name from `tabAccount`
where lft >= %(lft)s and rgt <= %(rgt)s)
order by account, posting_date""".format(additional_conditions="\n".join(additional_conditions)),
order by account, posting_date""".format(additional_conditions=additional_conditions),
{
"company": company,
"from_date": from_date,
@@ -293,6 +311,27 @@ def set_gl_entries_by_account(company, from_date, to_date, root_lft, root_rgt, g
return gl_entries_by_account
def get_additional_conditions(from_date, ignore_closing_entries, filters):
additional_conditions = []
if ignore_closing_entries:
additional_conditions.append("ifnull(voucher_type, '')!='Period Closing Voucher'")
if from_date:
additional_conditions.append("posting_date >= %(from_date)s")
if filters:
if filters.get("project"):
additional_conditions.append("project = '%s'"%(frappe.db.escape(filters.get("project"))))
if filters.get("cost_center"):
additional_conditions.append(get_cost_center_cond(filters.get("cost_center")))
return " and {}".format(" and ".join(additional_conditions)) if additional_conditions else ""
def get_cost_center_cond(cost_center):
lft, rgt = frappe.db.get_value("Cost Center", cost_center, ["lft", "rgt"])
return (""" cost_center in (select name from `tabCost Center` where lft >=%s and rgt <=%s)"""%(lft, rgt))
def get_columns(periodicity, period_list, accumulated_values=1, company=None):
columns = [{
"fieldname": "account",

View File

@@ -33,7 +33,7 @@ frappe.query_reports["General Ledger"] = {
"fieldtype": "Link",
"options": "Account",
"get_query": function() {
var company = frappe.query_report.filters_by_name.company.get_value();
var company = frappe.query_report_filters_by_name.company.get_value();
return {
"doctype": "Account",
"filters": {
@@ -62,8 +62,8 @@ frappe.query_reports["General Ledger"] = {
"label": __("Party"),
"fieldtype": "Dynamic Link",
"get_options": function() {
var party_type = frappe.query_report.filters_by_name.party_type.get_value();
var party = frappe.query_report.filters_by_name.party.get_value();
var party_type = frappe.query_report_filters_by_name.party_type.get_value();
var party = frappe.query_report_filters_by_name.party.get_value();
if(party && !party_type) {
frappe.throw(__("Please select Party Type first"));
}

View File

@@ -91,6 +91,7 @@ def get_columns(filters):
_("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"
]
@@ -118,6 +119,7 @@ def get_gl_entries(filters):
posting_date, account, party_type, party,
sum(debit) as debit, sum(credit) as credit,
voucher_type, voucher_no, cost_center, project,
against_voucher_type, against_voucher,
remarks, against, is_opening {select_fields}
from `tabGL Entry`
where company=%(company)s {conditions}
@@ -290,7 +292,7 @@ def get_result_as_list(data, filters):
row += [d.get("debit_in_account_currency"), d.get("credit_in_account_currency")]
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("remarks")
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")
]
result.append(row)

View File

@@ -6,6 +6,7 @@ import frappe
from frappe import _, scrub
from frappe.utils import flt
def execute(filters=None):
if not filters: filters = frappe._dict()
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
@@ -16,7 +17,7 @@ def execute(filters=None):
source = gross_profit_data.grouped_data if filters.get("group_by") != "Invoice" else gross_profit_data.data
group_wise_columns = frappe._dict({
"invoice": ["parent", "customer", "posting_date","item_code", "item_name","item_group", "brand", "description", \
"invoice": ["parent", "customer", "customer_group", "posting_date","item_code", "item_name","item_group", "brand", "description", \
"warehouse", "qty", "base_rate", "buying_rate", "base_amount",
"buying_amount", "gross_profit", "gross_profit_percent", "project"],
"item_code": ["item_code", "item_name", "brand", "description", "qty", "base_rate",
@@ -188,8 +189,8 @@ class GrossProfitGenerator(object):
# stock_ledger_entries should already be filtered by item_code and warehouse and
# sorted by posting_date desc, posting_time desc
if item_code in self.non_stock_items:
# average purchasing rate for non-stock items
item_rate = self.get_average_buying_rate(item_code)
#Issue 6089-Get last purchasing rate for non-stock item
item_rate = self.get_last_purchase_rate(item_code)
return flt(row.qty) * item_rate
else:
@@ -225,6 +226,22 @@ class GrossProfitGenerator(object):
return self.average_buying_rate[item_code]
def get_last_purchase_rate(self, item_code):
if self.filters.to_date:
last_purchase_rate = frappe.db.sql("""
select (a.base_rate / a.conversion_factor)
from `tabPurchase Invoice Item` a
where a.item_code = %s and a.docstatus=1
and modified <= %s
order by a.modified desc limit 1""", (item_code,self.filters.to_date))
else:
last_purchase_rate = frappe.db.sql("""
select (a.base_rate / a.conversion_factor)
from `tabPurchase Invoice Item` a
where a.item_code = %s and a.docstatus=1
order by a.modified desc limit 1""", item_code)
return flt(last_purchase_rate[0][0]) if last_purchase_rate else 0
def load_invoice_items(self):
conditions = ""
if self.filters.company:

View File

@@ -31,7 +31,7 @@ def execute(filters=None):
purchase_receipt = d.purchase_receipt
elif d.po_detail:
purchase_receipt = ", ".join(frappe.db.sql_list("""select distinct parent
from `tabPurchase Receipt Item` where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail))
from `tabPurchase Receipt Item` where docstatus=1 and purchase_order_item=%s""", d.po_detail))
expense_account = d.expense_account or aii_account_map.get(d.company)
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.supplier,

View File

@@ -32,6 +32,8 @@ def execute(filters=None):
elif d.so_detail:
delivery_note = ", ".join(frappe.db.sql_list("""select distinct parent
from `tabDelivery Note Item` where docstatus=1 and so_detail=%s""", d.so_detail))
if not delivery_note and d.update_stock:
delivery_note = d.parent
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.customer, d.customer_name,
d.customer_group, d.debit_to, ", ".join(mode_of_payments.get(d.parent, [])),
@@ -91,7 +93,7 @@ def get_items(filters):
si_item.item_code, si_item.item_name, si_item.item_group, si_item.sales_order,
si_item.delivery_note, si_item.income_account, si_item.cost_center, si_item.qty,
si_item.base_net_rate, si_item.base_net_amount, si.customer_name,
si.customer_group, si_item.so_detail
si.customer_group, si_item.so_detail, si.update_stock
from `tabSales Invoice` si, `tabSales Invoice Item` si_item
where si.name = si_item.parent and si.docstatus = 1 %s
order by si.posting_date desc, si_item.item_code desc""" % conditions, filters, as_dict=1)

View File

@@ -7,12 +7,12 @@
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"modified": "2016-05-17 08:26:50.810208",
"modified": "2016-08-18 14:29:50.680329",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Ordered Items To Be Billed",
"owner": "Administrator",
"query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.base_amount as \"Amount:Currency:110\",\n (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (`tabSales Order Item`.base_amount - (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1))) as \"Pending Amount:Currency:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order`.`company` as \"Company:Link/Company:\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Closed\"\n and `tabSales Order Item`.amount > 0\n and `tabSales Order Item`.billed_amt < `tabSales Order Item`.amount\norder by `tabSales Order`.transaction_date asc",
"query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`customer_name` as \"Customer Name:150\",\n`tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.base_amount as \"Amount:Currency:110\",\n (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (`tabSales Order Item`.base_amount - (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1))) as \"Pending Amount:Currency:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order`.`company` as \"Company:Link/Company:\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Closed\"\n and `tabSales Order Item`.amount > 0\n and `tabSales Order Item`.billed_amt < `tabSales Order Item`.amount\norder by `tabSales Order`.transaction_date asc",
"ref_doctype": "Sales Invoice",
"report_name": "Ordered Items To Be Billed",
"report_type": "Query Report"

View File

@@ -46,8 +46,8 @@ frappe.query_reports["Payment Period Based On Invoice Date"] = {
"label": __("Party"),
"fieldtype": "Dynamic Link",
"get_options": function() {
var party_type = frappe.query_report.filters_by_name.party_type.get_value();
var party = frappe.query_report.filters_by_name.party.get_value();
var party_type = frappe.query_report_filters_by_name.party_type.get_value();
var party = frappe.query_report_filters_by_name.party.get_value();
if(party && !party_type) {
frappe.throw(__("Please select Party Type first"));
}

View File

@@ -5,9 +5,23 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
frappe.query_reports["Profit and Loss Statement"] = $.extend({},
erpnext.financial_statements);
frappe.query_reports["Profit and Loss Statement"]["filters"].push({
"fieldname": "accumulated_values",
"label": __("Accumulated Values"),
"fieldtype": "Check"
});
frappe.query_reports["Profit and Loss Statement"]["filters"].push(
{
"fieldname":"cost_center",
"label": __("Cost Center"),
"fieldtype": "Link",
"options": "Cost Center"
},
{
"fieldname":"project",
"label": __("Project"),
"fieldtype": "Link",
"options": "Project"
},
{
"fieldname": "accumulated_values",
"label": __("Accumulated Values"),
"fieldtype": "Check"
}
);
});

View File

@@ -8,12 +8,12 @@ from frappe.utils import flt
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data)
def execute(filters=None):
period_list = get_period_list(filters.fiscal_year, filters.periodicity)
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, filters.periodicity)
income = get_data(filters.company, "Income", "Credit", period_list,
accumulated_values=filters.accumulated_values, ignore_closing_entries=True)
expense = get_data(filters.company, "Expense", "Debit", period_list,
accumulated_values=filters.accumulated_values, ignore_closing_entries=True)
income = get_data(filters.company, "Income", "Credit", period_list, filters = filters,
accumulated_values=filters.accumulated_values, ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
expense = get_data(filters.company, "Expense", "Debit", period_list, filters=filters,
accumulated_values=filters.accumulated_values, ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
net_profit_loss = get_net_profit_loss(income, expense, period_list, filters.company)
@@ -54,7 +54,7 @@ def get_net_profit_loss(income, expense, period_list, company):
return net_profit_loss
def get_chart_data(filters, columns, income, expense, net_profit_loss):
x_intervals = ['x'] + [d.get("label") for d in columns[2:-1]]
x_intervals = ['x'] + [d.get("label") for d in columns[2:]]
income_data, expense_data, net_profit = [], [], []

View File

@@ -0,0 +1 @@
{% include "accounts/report/financial_statements.html" %}

View File

@@ -0,0 +1,106 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.require("assets/erpnext/js/financial_statements.js", function() {
frappe.query_reports["Profitability Analysis"] = {
"filters": [
{
"fieldname": "company",
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_user_default("Company"),
"reqd": 1
},
{
"fieldname": "based_on",
"label": __("Based On"),
"fieldtype": "Select",
"options": "Cost Center\nProject",
"default": "Cost Center",
"reqd": 1
},
{
"fieldname": "fiscal_year",
"label": __("Fiscal Year"),
"fieldtype": "Link",
"options": "Fiscal Year",
"default": frappe.defaults.get_user_default("fiscal_year"),
"reqd": 1,
"on_change": function(query_report) {
var fiscal_year = query_report.get_values().fiscal_year;
if (!fiscal_year) {
return;
}
frappe.model.with_doc("Fiscal Year", fiscal_year, function(r) {
var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
frappe.query_report_filters_by_name.from_date.set_input(fy.year_start_date);
frappe.query_report_filters_by_name.to_date.set_input(fy.year_end_date);
query_report.trigger_refresh();
});
}
},
{
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
"default": frappe.defaults.get_user_default("year_start_date"),
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
"default": frappe.defaults.get_user_default("year_end_date"),
},
{
"fieldname": "show_zero_values",
"label": __("Show zero values"),
"fieldtype": "Check"
}
],
"formatter": function(row, cell, value, columnDef, dataContext, default_formatter) {
if (columnDef.df.fieldname=="account") {
value = dataContext.account_name;
columnDef.df.link_onclick =
"frappe.query_reports['Profitability Analysis'].open_profit_and_loss_statement(" + JSON.stringify(dataContext) + ")";
columnDef.df.is_tree = true;
}
value = default_formatter(row, cell, value, columnDef, dataContext);
if (!dataContext.parent_account && dataContext.based_on != 'project') {
var $value = $(value).css("font-weight", "bold");
if (dataContext.warn_if_negative && dataContext[columnDef.df.fieldname] < 0) {
$value.addClass("text-danger");
}
value = $value.wrap("<p></p>").parent().html();
}
return value;
},
"open_profit_and_loss_statement": function(data) {
if (!data.account) return;
frappe.route_options = {
"company": frappe.query_report_filters_by_name.company.get_value(),
"from_fiscal_year": data.fiscal_year,
"to_fiscal_year": data.fiscal_year
};
if(data.based_on == 'cost_center'){
frappe.route_options["cost_center"] = data.account
} else {
frappe.route_options["project"] = data.account
}
frappe.set_route("query-report", "Profit and Loss Statement");
},
"tree": true,
"name_field": "account",
"parent_field": "parent_account",
"initial_depth": 3
}
});

View File

@@ -0,0 +1,18 @@
{
"add_total_row": 0,
"apply_user_permissions": 1,
"creation": "2016-08-24 05:47:09.931202",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
"modified": "2016-08-24 05:47:09.931202",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Profitability Analysis",
"owner": "Administrator",
"ref_doctype": "GL Entry",
"report_name": "Profitability Analysis",
"report_type": "Script Report"
}

View File

@@ -0,0 +1,188 @@
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, getdate, formatdate, cstr
from erpnext.accounts.report.financial_statements import filter_accounts, filter_out_zero_value_rows
from erpnext.accounts.report.trial_balance.trial_balance import validate_filters
value_fields = ("income", "expense", "gross_profit_loss")
def execute(filters=None):
based_on = filters.based_on.replace(' ', '_').lower()
validate_filters(filters)
accounts = get_accounts_data(based_on, filters.company)
data = get_data(accounts, filters, based_on)
columns = get_columns(filters)
return columns, data
def get_accounts_data(based_on, company):
if based_on == 'cost_center':
return frappe.db.sql("""select name, parent_cost_center as parent_account, cost_center_name as account_name, lft, rgt
from `tabCost Center` where company=%s order by lft""", company, as_dict=True)
else:
return frappe.get_all('Project', fields = ["name"], filters = {'company': company})
def get_data(accounts, filters, based_on):
if not accounts:
return None
accounts, accounts_by_name, parent_children_map = filter_accounts(accounts)
gl_entries_by_account = {}
set_gl_entries_by_account(filters.company, filters.from_date,
filters.to_date, based_on, gl_entries_by_account, ignore_closing_entries=not flt(filters.with_period_closing_entry))
total_row = calculate_values(accounts, gl_entries_by_account, filters)
accumulate_values_into_parents(accounts, accounts_by_name)
data = prepare_data(accounts, filters, total_row, parent_children_map, based_on)
data = filter_out_zero_value_rows(data, parent_children_map,
show_zero_values=filters.get("show_zero_values"))
return data
def calculate_values(accounts, gl_entries_by_account, filters):
init = {
"income": 0.0,
"expense": 0.0,
"gross_profit_loss": 0.0
}
total_row = {
"cost_center": None,
"account_name": "'" + _("Total") + "'",
"warn_if_negative": True,
"income": 0.0,
"expense": 0.0,
"gross_profit_loss": 0.0
}
for d in accounts:
d.update(init.copy())
# add opening
for entry in gl_entries_by_account.get(d.name, []):
if cstr(entry.is_opening) != "Yes":
if entry.type == 'Income':
d["income"] += flt(entry.credit) - flt(entry.debit)
if entry.type == 'Expense':
d["expense"] += flt(entry.debit) - flt(entry.credit)
d["gross_profit_loss"] = d.get("income") - d.get("expense")
total_row["income"] += d["income"]
total_row["expense"] += d["expense"]
total_row["gross_profit_loss"] = total_row.get("income") - total_row.get("expense")
return total_row
def accumulate_values_into_parents(accounts, accounts_by_name):
for d in reversed(accounts):
if d.parent_account:
for key in value_fields:
accounts_by_name[d.parent_account][key] += d[key]
def prepare_data(accounts, filters, total_row, parent_children_map, based_on):
data = []
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
for d in accounts:
has_value = False
row = {
"account_name": d.account_name or d.name,
"account": d.name,
"parent_account": d.parent_account,
"indent": d.indent,
"fiscal_year": filters.fiscal_year,
"currency": company_currency,
"based_on": based_on
}
for key in value_fields:
row[key] = flt(d.get(key, 0.0), 3)
if abs(row[key]) >= 0.005:
# ignore zero values
has_value = True
row["has_value"] = has_value
data.append(row)
data.extend([{},total_row])
return data
def get_columns(filters):
return [
{
"fieldname": "account",
"label": _(filters.based_on),
"fieldtype": "Link",
"options": filters.based_on,
"width": 300
},
{
"fieldname": "income",
"label": _("Income"),
"fieldtype": "Currency",
"options": "currency",
"width": 120
},
{
"fieldname": "expense",
"label": _("Expense"),
"fieldtype": "Currency",
"options": "currency",
"width": 120
},
{
"fieldname": "gross_profit_loss",
"label": _("Gross Profit / Loss"),
"fieldtype": "Currency",
"options": "currency",
"width": 120
},
{
"fieldname": "currency",
"label": _("Currency"),
"fieldtype": "Link",
"options": "Currency",
"hidden": 1
}
]
def set_gl_entries_by_account(company, from_date, to_date, based_on, gl_entries_by_account,
ignore_closing_entries=False):
"""Returns a dict like { "account": [gl entries], ... }"""
additional_conditions = []
if ignore_closing_entries:
additional_conditions.append("and ifnull(voucher_type, '')!='Period Closing Voucher'")
if from_date:
additional_conditions.append("and posting_date >= %(from_date)s")
gl_entries = frappe.db.sql("""select posting_date, {based_on} as based_on, debit, credit,
is_opening, (select root_type from `tabAccount` where name = account) as type
from `tabGL Entry` where company=%(company)s
{additional_conditions}
and posting_date <= %(to_date)s
and {based_on} is not null
order by {based_on}, posting_date""".format(additional_conditions="\n".join(additional_conditions), based_on= based_on),
{
"company": company,
"from_date": from_date,
"to_date": to_date
},
as_dict=True)
for entry in gl_entries:
gl_entries_by_account.setdefault(entry.based_on, []).append(entry)
return gl_entries_by_account

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