Compare commits

...

116 Commits

Author SHA1 Message Date
Rushabh Mehta
7909a30008 Merge branch 'develop' 2016-08-10 19:47:24 +05:30
Rushabh Mehta
cf80f850bd bumped to version 7.0.26 2016-08-10 20:17:23 +06:00
Rushabh Mehta
36f2d4f81e [fix] patch for schools; 2016-08-10 19:46:12 +05:30
Rushabh Mehta
a7d92bc8f6 Merge pull request #6050 from rohitwaghchaure/pos_serial_no_search_issue
[Fix] Serial no search issue, if serial no is similar with item code.
2016-08-10 18:52:17 +05:30
Rushabh Mehta
332729e99e Merge branch 'develop' 2016-08-10 18:19:14 +05:30
Rushabh Mehta
18480bdc23 bumped to version 7.0.25 2016-08-10 18:49:14 +06:00
Rushabh Mehta
4b08f9ad1f [fix] patch 2016-08-10 18:18:14 +05:30
Rohit Waghchaure
ea5a32d304 [Fix] Searial no search issue, if serial no is similar with item code 2016-08-10 17:18:52 +05:30
Rushabh Mehta
c9501eb460 Merge branch 'develop' 2016-08-10 14:34:39 +05:30
Rushabh Mehta
d908b99b00 bumped to version 7.0.24 2016-08-10 15:04:39 +06:00
Rushabh Mehta
6646960e31 Merge pull request #6045 from bcornwellmott/quotereportcurrency
Quoted item currency
2016-08-10 14:26:25 +05:30
Rushabh Mehta
185c247286 Merge pull request #6024 from rohitwaghchaure/get_account_of_payment_mode_issue
[Fix] Get account of the mode of payment on sales invoice and pos profile
2016-08-10 14:25:42 +05:30
Rushabh Mehta
a56121a342 Merge pull request #6034 from netchampfaris/ui-fixes
[ui] fix thumbnail for long images in image view frappe/erpnext#1939
2016-08-10 14:24:58 +05:30
Rushabh Mehta
cc054a5bbc [minor] fix reload for school migrate patch 2016-08-10 14:24:16 +05:30
Rushabh Mehta
aa12d30d5a Merge pull request #6048 from PawanMeh/fixes_5723
[fix] #5723
2016-08-10 14:12:56 +05:30
pawan mehta
399a4bf201 [fix] #5723 2016-08-10 13:20:16 +05:30
Rohit Waghchaure
70be24d6f0 [Fix] Get account of the mode of payment on sales invoice and pos profile 2016-08-10 13:16:39 +05:30
Rushabh Mehta
6ddbb8820a Merge pull request #6047 from revant/develop
[fix] Issue #6046 group_name replaced with name
2016-08-10 12:57:53 +05:30
Rushabh Mehta
6252e935a0 Merge pull request #5844 from bcornwellmott/quoteditemplot-1
Added C3.JS Plot to compare quotes in Print view
2016-08-10 12:50:36 +05:30
Revant Nandgaonkar
5bbc68df8b [fix] Issue #6046 group_name replaced with name 2016-08-10 11:06:31 +05:30
Nabin Hait
88fff46ab4 Merge pull request #6038 from nabinhait/portal_settings_schools
Portal settings for schools
2016-08-09 17:20:56 +05:30
Nabin Hait
f44b5152d2 Portal settings for schools 2016-08-09 17:08:13 +05:30
Rushabh Mehta
ec2d09c557 [minor] setting up website optional in setup wizard 2016-08-09 16:44:37 +05:30
Nabin Hait
722b22a834 Merge branch 'develop' 2016-08-09 15:30:32 +05:30
Nabin Hait
08e2105b09 bumped to version 7.0.23 2016-08-09 16:00:31 +06:00
Nabin Hait
11d565b07c Update migrate_schools_to_erpnext.py 2016-08-09 15:23:01 +05:30
Nabin Hait
a2c9d13f68 Merge branch 'develop' 2016-08-09 15:00:16 +05:30
Nabin Hait
508542d4d9 bumped to version 7.0.22 2016-08-09 15:30:16 +06:00
Nabin Hait
50ff8471e0 Merge pull request #6023 from neilLasrado/docs
Merged docs for schools to erpnext docs
2016-08-09 14:23:48 +05:30
Nabin Hait
78b8cdc3c1 Merge pull request #6033 from nabinhait/patch_fix_10
[patch] Reload Purchase Invoice in patch. Fixed #6032
2016-08-09 14:22:40 +05:30
Nabin Hait
2275cd15e6 [patch] Reload Purchase Invoice in patch 2016-08-09 14:21:29 +05:30
Faris Ansari
d217387400 [ui] fix thumbnail for long images in image view 2016-08-09 14:15:59 +05:30
Nabin Hait
b9376641af Merge pull request #6031 from nabinhait/patch_fix_9
[fix]Patch order changed. Fixed #6026
2016-08-09 11:28:48 +05:30
Nabin Hait
ee018b5ae1 [fix]Patch order changed. Fixed #6026 2016-08-09 11:27:28 +05:30
Neil Trini Lasrado
acf85dffc5 Merged docs for schools to erpnext docs 2016-08-08 18:59:15 +05:30
Nabin Hait
660f3ed0d6 Merge branch 'develop' 2016-08-08 15:50:00 +05:30
Nabin Hait
d5c83122f2 bumped to version 7.0.21 2016-08-08 16:20:00 +06:00
Nabin Hait
2777f23ace Merge pull request #6019 from nabinhait/pcv_test_case
Fixed test cases for period closing voucher
2016-08-08 15:45:19 +05:30
Nabin Hait
ae65172dca Added 'Ledger' button to show accounting entries against PCV 2016-08-08 15:44:45 +05:30
Nabin Hait
d261d40c7e Fixed test cases for period closing voucher 2016-08-08 15:44:45 +05:30
Nabin Hait
4b231c2692 Merge pull request #6018 from rohitwaghchaure/add_calendar_to_timesheets
Added a Calendar view for timesheet logs
2016-08-08 14:46:18 +05:30
Nabin Hait
7e27e32e92 Merge pull request #6017 from nabinhait/repost_future_stock_transactions
Repost gle for future transactions if update stock checked in back dated purchase invoice
2016-08-08 14:45:17 +05:30
Ben Cornwell-Mott
ed1b8cfe3f Added a Calendar view for timesheet logs 2016-08-08 14:17:06 +05:30
Nabin Hait
99d4ff4a29 Repost gle for future transactions if update stock checked in back dated purchase invoice 2016-08-08 14:12:58 +05:30
Nabin Hait
595dbd6dea Merge pull request #5963 from neilLasrado/assessment
Assessment Groups
2016-08-08 12:50:10 +05:30
Nabin Hait
f979b18ddb Merge pull request #6003 from neilLasrado/bug-fix
[bug fix] Fixed bug in fee caclulation, renamed functions
2016-08-08 12:44:27 +05:30
Nabin Hait
3ef6e7847e Merge pull request #6010 from rohitwaghchaure/minor_fix_pos
[Fix] pos ambiguous issue
2016-08-08 12:40:28 +05:30
Nabin Hait
2dba3b5e25 Merge pull request #6012 from bohlian/develop
[Enhancement + Fix] Disable buttons when Production Order is Stopped, Fixed Stopping and Re-Opening of Production Order
2016-08-08 12:40:00 +05:30
Nabin Hait
2cb8c6a867 Merge pull request #6015 from nabinhait/ar_ap_cols
[fix] Label for ageing cols in AR/AP report
2016-08-08 12:37:19 +05:30
Nabin Hait
be3aee973c Merge pull request #6011 from saurabh6790/get_acount_balance_fix
[minor][fix] return if account details not found
2016-08-08 12:36:40 +05:30
Nabin Hait
c30c342bdf [fix] Label for ageing cols in AR/AP report 2016-08-08 11:47:13 +05:30
Neil Trini Lasrado
f02a0d4d24 [bug fix] Fixed bug in fee caclulation, renamed functions 2016-08-08 11:09:29 +05:30
Ben Cornwell-Mott
44f85fed26 Converted to a common currency (company) 2016-08-07 10:29:51 -07:00
Rohit Waghchaure
cd6c00d505 [Fix] pos ambiguous issue 2016-08-07 14:29:21 +05:30
Javier Wong
e6cd228288 [Enhancement + Fix] Disable buttons when Production Order is Stopped, Fixed Stopping and Re-Opening of Production Order
Disabled the following buttons:
- Make Timesheet
- Start
- Finish `

- A better fix than 316f78f859
- Sets the Status to In Process or Not Started instead of Unstopped
- Displays this same status on the client prompt (msgprint)
2016-08-07 16:01:49 +08:00
Saurabh
ec14c81ebd [minor][fix] return if account details not found 2016-08-07 08:52:45 +05:30
Nabin Hait
8793b823af Merge branch 'develop' 2016-08-06 14:15:34 +05:30
Nabin Hait
537301a210 bumped to version 7.0.20 2016-08-06 14:45:34 +06:00
Nabin Hait
f1d8fc3d51 Merge pull request #6008 from KanchanChauhan/leave-application-validation
Leave Application Validation for processed salary
2016-08-06 14:13:46 +05:30
Nabin Hait
20b4666e89 Merge pull request #5958 from rohitwaghchaure/minor_fixes_and_cleanups
fixes and cleanups.
2016-08-06 14:11:24 +05:30
Rushabh Mehta
84969bdb2d Merge pull request #6007 from KanchanChauhan/task-json-fixed
[Minor] Removed hard coded success URL from task webform
2016-08-06 13:42:50 +05:30
Kanchan Chauhan
705384d8fe Leave Application Validation for processed salary 2016-08-06 13:42:18 +05:30
Rushabh Mehta
2123e02eda Merge pull request #6005 from revant/patch-2
[fix] success_url Issue #6004
2016-08-06 13:40:02 +05:30
Rohit Waghchaure
b77a1057ce fixes and cleanups. 2016-08-06 12:45:02 +05:30
Kanchan Chauhan
93b1f2ad72 [Minor] Removed hard coded success URL 2016-08-06 12:09:08 +05:30
Revant Nandgaonkar
9a433ffca1 [fix] success_url Issue #6004 2016-08-05 21:44:34 +05:30
Nabin Hait
c1162796c5 Merge branch 'develop' 2016-08-05 16:45:14 +05:30
Nabin Hait
82446bf83e bumped to version 7.0.19 2016-08-05 17:15:14 +06:00
Nabin Hait
c72f8976aa Merge pull request #5989 from umairsy/2aug
updated docs
2016-08-05 15:50:34 +05:30
Nabin Hait
c49a3425ef Merge pull request #6002 from nabinhait/pe_fix_101
Payment Entry fix: Unallocated amount in payment entry considering deductions
2016-08-05 15:44:44 +05:30
Neil Trini Lasrado
50b2278eda Renamed fields in Examination Doctype, Renamed examination doctype to Assessment, Added Assessment Group, added patch 2016-08-05 15:09:49 +05:30
Nabin Hait
e1d85f2467 Payment Entry fix: Unallocated amount in payment entry considering deductions 2016-08-05 14:51:36 +05:30
Umair Sayyed
3962cded76 updated docs 2016-08-04 19:01:02 +05:30
Umair Sayyed
66360f694e updated docs 2016-08-04 19:01:02 +05:30
Umair Sayyed
5dba950afa docs update 2016-08-04 19:01:02 +05:30
Umair Sayyed
6a3f51bee2 updated docs 2016-08-04 19:01:02 +05:30
Rushabh Mehta
efe1ab742f [minor] fixes for demo 2016-08-04 17:29:46 +05:30
Rushabh Mehta
4d32d5301a Merge pull request #5996 from KanchanChauhan/users-selection-for-project
'Project Users' role not required to add user to the project
2016-08-04 14:25:52 +05:30
Kanchan Chauhan
58bc00f954 Project Users role not required to add user to the project 2016-08-04 14:21:20 +05:30
Nabin Hait
155074479b Merge pull request #5986 from nabinhait/pe_fix_101
Set received amount based on paid amount if currency is same
2016-08-03 17:54:01 +05:30
Nabin Hait
fa1775b6a6 Merge pull request #5988 from nabinhait/item_route
default material request type field restored in item
2016-08-03 17:53:11 +05:30
Nabin Hait
764e6ef210 default material request type field restored in item 2016-08-03 17:32:26 +05:30
Rushabh Mehta
f2d89987f5 [minor] ignore email validation if comes from email; 2016-08-03 16:42:29 +05:30
Rushabh Mehta
06c92a782a [fix] small text for route 2016-08-03 16:27:11 +05:30
Nabin Hait
f43e49f378 Set received amount based on paid amount if currency is same 2016-08-03 14:17:05 +05:30
Rushabh Mehta
ea5ad84c5e [minor] fix image for demo 2016-08-02 21:26:04 +05:30
Nabin Hait
46f328cbda Merge branch 'develop' 2016-08-02 18:07:53 +05:30
Nabin Hait
1b9a01b6c3 bumped to version 7.0.18 2016-08-02 18:37:52 +06:00
Nabin Hait
e8ab7b8898 Merge pull request #5976 from nabinhait/patch_fix_109
[patch] Set default material request type in Item based on default bom
2016-08-02 18:05:03 +05:30
Nabin Hait
ae921ce2c8 [patch] Set default material request type in Item based on default bom 2016-08-02 18:02:31 +05:30
Nabin Hait
b77ad7c31d Merge branch 'develop' 2016-08-02 17:16:46 +05:30
Nabin Hait
cc13a9f2f6 bumped to version 7.0.17 2016-08-02 17:46:46 +06:00
Nabin Hait
97c74f9f8f Merge pull request #5925 from rohitwaghchaure/bcornwellmott-1
PPT looks at default MR type in Item to set MR type.
2016-08-02 17:15:02 +05:30
Nabin Hait
e1e6468b33 Merge pull request #5974 from nabinhait/pos_change_amount
Change amount calcualtion in POS if there is write off amount and gl entries in this scenario
2016-08-02 17:14:50 +05:30
Nabin Hait
6620e2a494 Test case fixed for pos gl entry 2016-08-02 17:14:28 +05:30
Rohit Waghchaure
08aadb853c PPT looks at default MR type in Item to set MR type. 2016-08-02 16:59:03 +05:30
Nabin Hait
3bb1a421f0 Change amount calcualtion in POS if there is write off amount and gl entries in this scenario 2016-08-02 16:41:15 +05:30
Nabin Hait
afc0bbc8ff Merge pull request #5964 from frappe/neilLasrado-patch-1-1
Fixes for patch - make_guardian.py
2016-08-02 11:30:45 +05:30
Nabin Hait
8869430a81 Merge pull request #5967 from rohitwaghchaure/minor_fix
minor fix in payment entry
2016-08-02 11:29:48 +05:30
Rohit Waghchaure
7f031d1bfd minor fix in payment entry 2016-08-02 11:07:40 +05:30
Rushabh Mehta
5b1ebc5c54 Merge pull request #5933 from shreyasp/erpnext/update-travis
[Minor] Updated the travis.yml to use latest bench installer for erpnext
2016-08-02 10:44:39 +05:30
Neil Trini Lasrado
5bb2f56b47 Update make_guardian.py 2016-08-02 00:01:00 +05:30
Nabin Hait
1e3e6865ce Merge branch 'develop' 2016-08-01 18:07:21 +05:30
Nabin Hait
94542e104c bumped to version 7.0.16 2016-08-01 18:37:20 +06:00
Nabin Hait
90bf69aa52 Merge pull request #5957 from nabinhait/guardian_patch_fix
[patch] reload guardian interest
2016-08-01 18:05:33 +05:30
Nabin Hait
3b8109780f [patch] reload guardian interest 2016-08-01 17:59:46 +05:30
Nabin Hait
f863055b91 Merge pull request #5955 from umairsy/28jul
added documentation for the new features
2016-08-01 17:53:26 +05:30
Nabin Hait
3aac12d56b Merge branch 'develop' 2016-08-01 17:48:28 +05:30
Nabin Hait
ed75667f64 bumped to version 7.0.15 2016-08-01 18:18:27 +06:00
Nabin Hait
16a0fef759 Merge pull request #5956 from nabinhait/guardian_patch_fix
[patch] fixed reload doc and permission issue in guardian patch
2016-08-01 17:47:48 +05:30
Nabin Hait
08aec855c4 [patch] fixed reload doc and permission issue in guardian patch 2016-08-01 17:46:56 +05:30
Umair Sayyed
e96b3ce725 added documentation for the new features 2016-08-01 17:42:30 +05:30
shreyas
60e9f84c8a [Minor] Updated the travis.yml to use new installer for erpnext 2016-08-01 17:40:20 +05:30
Ben Cornwell-Mott
590d2d524b Updated html file to use c3.js instead of Google Charts 2016-07-25 18:03:01 -07:00
Ben Cornwell-Mott
fe11e71084 Removed hover tooltip 2016-07-22 10:02:41 -07:00
Ben Cornwell-Mott
2c76aec119 Added Google Chart to compare quotes in Print view 2016-07-22 09:56:29 -07:00
247 changed files with 1506 additions and 575 deletions

View File

@@ -1,4 +1,5 @@
language: python
dist: trusty
python:
- "2.7"
@@ -11,10 +12,14 @@ before_install:
- "sh -e /etc/init.d/xvfb start"
install:
- sudo apt-get purge -y mysql-common
- wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
- sudo bash setup_frappe.sh --skip-setup-bench --mysql-root-password travis --bench-branch develop
- sudo pip install --upgrade pip
- sudo apt-get purge -y mysql-common mysql-server mysql-client
# - wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
# - sudo bash setup_frappe.sh --skip-setup-bench --mysql-root-password travis --bench-branch develop
- wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
- sudo python install.py --develop --user travis --without-bench-setup
- sudo pip install -e ~/bench
# - sudo pip install --upgrade pip
- rm $TRAVIS_BUILD_DIR/.git/shallow
- bash $TRAVIS_BUILD_DIR/travis/bench_init.sh
- cp -r $TRAVIS_BUILD_DIR/test_sites/test_site ~/frappe-bench/sites/
@@ -30,7 +35,7 @@ script:
- bench --verbose run-tests --driver Firefox
before_script:
- mysql -e 'create database test_frappe'
- mysql -u root -ptravis -e 'create database test_frappe'
- echo "USE mysql;\nCREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe';\nFLUSH PRIVILEGES;\n" | mysql -u root -ptravis
- echo "USE mysql;\nGRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost';\n" | mysql -u root -ptravis

View File

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

View File

@@ -47,7 +47,7 @@ cur_frm.cscript.account_type = function(doc, cdt, cdn) {
cur_frm.cscript.add_toolbar_buttons = function(doc) {
cur_frm.add_custom_button(__('Chart of Accounts'),
function() { frappe.set_route("Tree", "Account"); }, __("View"))
function() { frappe.set_route("Tree", "Account"); });
if (doc.is_group == 1) {
cur_frm.add_custom_button(__('Group to Non-Group'),
@@ -61,7 +61,7 @@ cur_frm.cscript.add_toolbar_buttons = function(doc) {
"company": doc.company
};
frappe.set_route("query-report", "General Ledger");
}, __("View"));
});
cur_frm.add_custom_button(__('Non-Group to Group'),
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet', 'btn-default')

View File

@@ -772,6 +772,9 @@ def get_account_balance_and_party_type(account, date, company, debit=None, credi
company_currency = get_company_currency(company)
account_details = frappe.db.get_value("Account", account, ["account_type", "account_currency"], as_dict=1)
if not account_details:
return
if account_details.account_type == "Receivable":
party_type = "Customer"
elif account_details.account_type == "Payable":

View File

@@ -1,5 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
{% include "erpnext/public/js/controllers/accounts.js" %}
frappe.ui.form.on('Payment Entry', {
onload: function(frm) {
@@ -95,13 +96,13 @@ frappe.ui.form.on('Payment Entry', {
frm.doc.paid_to_account_currency != company_currency &&
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency));
frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency);
frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency);
frm.toggle_display("base_received_amount", (frm.doc.paid_to_account_currency != company_currency &&
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency));
frm.toggle_display("received_amount",
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency)
frm.toggle_display("received_amount", (frm.doc.payment_type=="Internal Transfer" ||
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency))
frm.toggle_display(["base_total_allocated_amount"],
(frm.doc.paid_amount && frm.doc.received_amount && frm.doc.base_total_allocated_amount &&
@@ -257,22 +258,6 @@ frappe.ui.form.on('Payment Entry', {
}
},
mode_of_payment: function(frm) {
return frappe.call({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account",
args: {
"mode_of_payment": frm.doc.mode_of_payment,
"company": frm.doc.company
},
callback: function(r, rt) {
if(r.message) {
var payment_account_field = frm.doc.payment_type == "Receive" ? "paid_to" : "paid_from";
frm.set_value(payment_account_field, r.message['account']);
}
}
});
},
paid_from: function(frm) {
if(frm.set_party_account_based_on_party) return;
@@ -414,10 +399,7 @@ frappe.ui.form.on('Payment Entry', {
paid_amount: function(frm) {
frm.set_value("base_paid_amount", flt(frm.doc.paid_amount) * flt(frm.doc.source_exchange_rate));
frm.trigger("reset_received_amount");
frm.set_paid_amount_based_on_received_amount = false;
},
received_amount: function(frm) {
@@ -436,22 +418,19 @@ frappe.ui.form.on('Payment Entry', {
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount);
else
frm.events.set_difference_amount(frm);
frm.set_paid_amount_based_on_received_amount = false;
},
reset_received_amount: function(frm) {
if(!frm.set_paid_amount_based_on_received_amount &&
(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency)) {
// var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
// function(d) { return d.amount}));
//
// var received_amount = frm.doc.paid_amount +
// flt(total_deductions) / flt(frm.doc.source_exchange_rate);
//
frm.set_value("received_amount", frm.doc.paid_amount);
frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
frm.set_value("base_received_amount", frm.doc.base_paid_amount);
}
if(frm.doc.payment_type == "Receive")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount);
else
@@ -607,11 +586,18 @@ frappe.ui.form.on('Payment Entry', {
if(frm.doc.party) {
var party_amount = frm.doc.payment_type=="Receive" ?
frm.doc.paid_amount : frm.doc.received_amount;
var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
function(d) { return flt(d.amount) }));
if(frm.doc.total_allocated_amount < party_amount)
unallocated_amount = party_amount - frm.doc.total_allocated_amount;
if(frm.doc.total_allocated_amount < party_amount) {
if(frm.doc.payment_type == "Receive") {
unallocated_amount = party_amount - (frm.doc.total_allocated_amount - total_deductions);
} else {
unallocated_amount = party_amount - (frm.doc.total_allocated_amount + total_deductions);
}
}
}
frm.set_value("unallocated_amount", unallocated_amount);
var difference_amount = 0;

View File

@@ -247,8 +247,13 @@ class PaymentEntry(AccountsController):
if self.party:
party_amount = self.paid_amount if self.payment_type=="Receive" else self.received_amount
total_deductions = sum([flt(d.amount) for d in self.get("deductions")])
if self.total_allocated_amount < party_amount:
self.unallocated_amount = party_amount - self.total_allocated_amount
if self.payment_type == "Receive":
self.unallocated_amount = party_amount - (self.total_allocated_amount - total_deductions)
else:
self.unallocated_amount = party_amount - (self.total_allocated_amount + total_deductions)
def set_difference_amount(self):
base_unallocated_amount = flt(self.unallocated_amount) * (flt(self.source_exchange_rate)
@@ -569,10 +574,9 @@ def get_company_defaults(company):
@frappe.whitelist()
def get_reference_details(reference_doctype, reference_name, party_account_currency):
total_amount = outstanding_amount = exchange_rate = None
ref_doc = frappe.get_doc(reference_doctype, reference_name)
if reference_doctype != "Journal Entry":
ref_doc = frappe.get_doc(reference_doctype, reference_name)
if party_account_currency == ref_doc.company_currency:
total_amount = ref_doc.base_grand_total
exchange_rate = 1

View File

@@ -1,21 +1,37 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
//========================== On Load =================================================
cur_frm.cscript.onload = function(doc, cdt, cdn) {
if (!doc.transaction_date) doc.transaction_date = dateutil.obj_to_str(new Date());
}
// ***************** Get Account Head *****************
cur_frm.fields_dict['closing_account_head'].get_query = function(doc, cdt, cdn) {
return {
filters: [
['Account', 'company', '=', doc.company],
['Account', 'is_group', '=', '0'],
['Account', 'freeze_account', '=', 'No'],
['Account', 'root_type', 'in', 'Liability, Equity']
]
frappe.ui.form.on('Period Closing Voucher', {
onload: function(frm) {
if (!frm.doc.transaction_date) frm.doc.transaction_date = dateutil.obj_to_str(new Date());
},
setup: function(frm) {
frm.set_query("closing_account_head", function() {
return {
filters: [
['Account', 'company', '=', frm.doc.company],
['Account', 'is_group', '=', '0'],
['Account', 'freeze_account', '=', 'No'],
['Account', 'root_type', 'in', 'Liability, Equity']
]
}
});
},
refresh: function(frm) {
if(frm.doc.docstatus==1) {
frm.add_custom_button(__('Ledger'), function() {
frappe.route_options = {
"voucher_no": frm.doc.name,
"from_date": frm.doc.posting_date,
"to_date": frm.doc.posting_date,
"company": frm.doc.company,
group_by_voucher: 0
};
frappe.set_route("query-report", "General Ledger");
}, "icon-table");
}
}
}
})

View File

@@ -55,9 +55,8 @@ class TestPeriodClosingVoucher(unittest.TestCase):
if random_expense_account:
# Check posted value for teh above random_expense_account
gle_for_random_expense_account = frappe.db.sql("""
select debit - credit as amount,
debit_in_account_currency - credit_in_account_currency
as amount_in_account_currency
select sum(debit - credit) as amount,
sum(debit_in_account_currency - credit_in_account_currency) as amount_in_account_currency
from `tabGL Entry`
where voucher_type='Period Closing Voucher' and voucher_no=%s and account =%s""",
(pcv.name, random_expense_account[0].account), as_dict=True)

View File

@@ -1,6 +1,8 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
{% include "erpnext/public/js/controllers/accounts.js" %}
frappe.ui.form.on("POS Profile", "onload", function(frm) {
frm.set_query("selling_price_list", function() {
return { filters: { selling: 1 } };

View File

@@ -8,6 +8,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
@@ -832,7 +833,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-06-13 21:20:13.805101",
"modified": "2016-08-06 17:05:59.990031",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",
@@ -879,7 +880,7 @@
"write": 0
}
],
"quick_entry": 1,
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",

View File

@@ -9,6 +9,7 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 1,
@@ -117,6 +118,33 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "",
"fieldname": "bill_no",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Supplier Invoice No",
"length": 0,
"no_copy": 0,
"oldfieldname": "bill_no",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 1,
"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,
@@ -142,6 +170,32 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"default": "0",
"fieldname": "is_return",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Return",
"length": 0,
"no_copy": 0,
"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
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -198,19 +252,18 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "",
"fieldname": "bill_no",
"fieldtype": "Data",
"fieldname": "bill_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Supplier Invoice No",
"label": "Supplier Invoice Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "bill_no",
"oldfieldtype": "Data",
"oldfieldname": "bill_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
@@ -225,17 +278,17 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "bill_date",
"fieldname": "due_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Supplier Invoice Date",
"label": "Due Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "bill_date",
"oldfieldname": "due_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 1,
@@ -299,32 +352,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"default": "0",
"fieldname": "is_return",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Return",
"length": 0,
"no_copy": 0,
"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
},
{
"allow_on_submit": 0,
"bold": 0,
@@ -2497,32 +2524,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "due_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Due Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "due_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 1,
"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,
@@ -3031,7 +3032,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-06-30 13:40:39.440648",
"modified": "2016-08-10 02:45:28.746569",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -301,7 +301,7 @@ class PurchaseInvoice(BuyingController):
asset.flags.ignore_validate_update_after_submit = True
asset.save()
def make_gl_entries(self, repost_future_gle=False):
def make_gl_entries(self, repost_future_gle=True):
self.auto_accounting_for_stock = \
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))

View File

@@ -91,7 +91,7 @@ def update_multi_mode_option(doc, pos_profile):
def get_mode_of_payment(doc):
return frappe.db.sql(""" select mpa.default_account, mpa.parent, mp.type as type from `tabMode of Payment Account` mpa,
`tabMode of Payment` mp where mpa.parent = mp.name and company = %(company)s""", {'company': doc.company}, as_dict=1)
`tabMode of Payment` mp where mpa.parent = mp.name and mpa.company = %(company)s""", {'company': doc.company}, as_dict=1)
def update_tax_table(doc):
taxes = get_taxes_and_charges('Sales Taxes and Charges Template', doc.taxes_and_charges)
@@ -108,13 +108,14 @@ def get_items(doc, 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 item.default_warehouse or None
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)
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})
@@ -122,13 +123,19 @@ def get_items(doc, pos_profile):
return item_list
def get_serial_nos(item, pos_profile):
def get_item_warehouse_for_company(company, warehouse):
if frappe.db.get_value('Warehouse', warehouse, 'company') != company:
warehouse = None
return 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""".format(cond), {'item_code': item.item_code}, as_dict=1)
and item_code = %(item_code)s and company = %(company)s
""".format(cond), {'item_code': item.item_code, 'company': company}, as_dict=1)
serial_no_list = {}
for serial_no in serial_nos:
@@ -214,9 +221,9 @@ def submit_invoice(si_doc, name):
save_invoice(e, si_doc, name)
def save_invoice(e, si_doc, name):
si_doc.docstatus = 0
si_doc.name = ''
si_doc.save(ignore_permissions=True)
if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
si_doc.flags.ignore_mandatory = True
si_doc.insert()
make_scheduler_log(e, si_doc.name)
def make_scheduler_log(e, sales_invoice):

View File

@@ -10,6 +10,7 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
@@ -1135,7 +1136,7 @@
"no_copy": 0,
"permlevel": 0,
"precision": "2",
"print_hide": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
@@ -3676,7 +3677,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-07-07 13:40:27.977803",
"modified": "2016-08-03 11:50:49.680278",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -87,15 +87,6 @@ class SalesInvoice(SellingController):
def before_save(self):
set_account_for_mode_of_payment(self)
def update_change_amount(self):
self.base_paid_amount = 0.0
if self.paid_amount:
self.base_paid_amount = flt(self.paid_amount * self.conversion_rate, self.precision("base_paid_amount"))
self.change_amount = self.base_change_amount = 0.0
if self.paid_amount > self.grand_total:
self.change_amount = flt(self.paid_amount - self.grand_total, self.precision("change_amount"))
self.base_change_amount = flt(self.change_amount * self.conversion_rate, self.precision("base_change_amount"))
def on_submit(self):
if not self.recurring_id:
frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype,
@@ -110,6 +101,7 @@ class SalesInvoice(SellingController):
self.update_status_updater_args()
self.update_prevdoc_status()
self.update_billing_status_in_dn()
self.clear_unallocated_mode_of_payments()
# Updating stock ledger should always be called after updating prevdoc status,
# because updating reserved qty in bin depends upon updated delivered qty in SO
@@ -296,6 +288,12 @@ class SalesInvoice(SellingController):
frappe.throw(_("Debit To account must be a Receivable account"))
self.party_account_currency = account.account_currency
def clear_unallocated_mode_of_payments(self):
self.set("payments", self.get("payments", {"amount": ["not in", [0, None, ""]]}))
frappe.db.sql("""delete from `tabSales Invoice Payment` where parent = %s
and amount = 0""", self.name)
def validate_with_previous_doc(self):
super(SalesInvoice, self).validate_with_previous_doc({
@@ -504,6 +502,7 @@ class SalesInvoice(SellingController):
gl_entries = merge_similar_entries(gl_entries)
self.make_pos_gl_entries(gl_entries)
self.make_gle_for_change(gl_entries)
self.make_write_off_gl_entry(gl_entries)
@@ -578,27 +577,24 @@ class SalesInvoice(SellingController):
def make_pos_gl_entries(self, gl_entries):
if cint(self.is_pos) and self.paid_amount:
# POS, make payment entries
gl_entries.append(
self.get_gl_dict({
"account": self.debit_to,
"party_type": "Customer",
"party": self.customer,
"against": self.cash_bank_account,
"credit": flt(self.base_paid_amount - self.base_change_amount),
"credit_in_account_currency": flt(self.base_paid_amount - self.base_change_amount) \
if self.party_account_currency==self.company_currency else flt(self.paid_amount - self.change_amount),
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
}, self.party_account_currency)
)
cash_account = ''
for payment_mode in self.payments:
if payment_mode.type == 'Cash':
cash_account = payment_mode.account
if payment_mode.base_amount > 0:
# POS, make payment entries
gl_entries.append(
self.get_gl_dict({
"account": self.debit_to,
"party_type": "Customer",
"party": self.customer,
"against": payment_mode.account,
"credit": payment_mode.base_amount,
"credit_in_account_currency": payment_mode.base_amount \
if self.party_account_currency==self.company_currency \
else payment_mode.amount,
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
}, self.party_account_currency)
)
payment_mode_account_currency = get_account_currency(payment_mode.account)
gl_entries.append(
self.get_gl_dict({
@@ -609,20 +605,44 @@ class SalesInvoice(SellingController):
if payment_mode_account_currency==self.company_currency else payment_mode.amount
}, payment_mode_account_currency)
)
if self.change_amount:
cash_account = cash_account or self.payments[0].account
cash_account_currency = get_account_currency(cash_account)
def make_gle_for_change(self, gl_entries):
if cint(self.is_pos) and self.change_amount:
cash_account = self.get_cash_account()
if cash_account:
gl_entries.append(
self.get_gl_dict({
"account": self.debit_to,
"party_type": "Customer",
"party": self.customer,
"against": cash_account,
"debit": flt(self.base_change_amount),
"debit_in_account_currency": flt(self.base_change_amount) \
if self.party_account_currency==self.company_currency else flt(self.change_amount),
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype
}, self.party_account_currency)
)
gl_entries.append(
self.get_gl_dict({
"account": cash_account,
"against": self.customer,
"credit": self.base_change_amount,
"credit_in_account_currency": self.base_change_amount \
if payment_mode_account_currency==self.company_currency else self.change_amount
}, payment_mode_account_currency)
"credit": self.base_change_amount
})
)
def get_cash_account(self):
cash_account = [d.account for d in self.payments if d.type=="Cash"]
if cash_account:
cash_account = cash_account[0]
else:
cash_account = frappe.db.get_value("Account",
filters={"company": self.company, "account_type": "Cash", "is_group": 0})
return cash_account
def make_write_off_gl_entry(self, gl_entries):
# write off entries, applicable if only pos
if self.write_off_account and self.write_off_amount:

View File

@@ -503,7 +503,8 @@ class TestSalesInvoice(unittest.TestCase):
[pos["taxes"][1]["account_head"], 0.0, 50.0],
[stock_in_hand, 0.0, abs(sle.stock_value_difference)],
[pos["items"][0]["expense_account"], abs(sle.stock_value_difference), 0.0],
[si.debit_to, 0.0, si.paid_amount],
[si.debit_to, 0.0, 300.0],
[si.debit_to, 0.0, cash_amount],
["_Test Bank - _TC", 300.0, 0.0],
["Cash - _TC", cash_amount, 0.0]
])

View File

@@ -177,6 +177,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
doc = JSON.parse(localStorage.getItem('doc'))
if(this.frm.doc.payments.length == 0){
this.frm.doc.payments = doc.payments;
this.calculate_outstanding_amount();
}
if(this.frm.doc.customer){
@@ -420,19 +421,25 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
}
key = this.search.$input.val().toLowerCase();
search_status = true
if(key){
return $.grep(window.items, function(item){
if(in_list(item.batch_nos, me.search.$input.val())){
return me.item_batch_no[item.item_code] = me.search.$input.val()
} else if((item.item_code.toLowerCase().match(key)) ||
(item.item_name.toLowerCase().match(key)) || (item.item_group.toLowerCase().match(key))){
return true
}else if(item.barcode == me.search.$input.val()){
return item.barcode == me.search.$input.val();
} else if (in_list(Object.keys(item.serial_nos), me.search.$input.val())){
me.item_serial_no[item.item_code] = [me.search.$input.val(), item.serial_nos[me.search.$input.val()]]
return true
if(search_status){
if(in_list(item.batch_nos, 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())) {
search_status = false;
me.item_serial_no[item.item_code] = [me.search.$input.val(), item.serial_nos[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))) {
return true
}
}
})
}else{
@@ -869,6 +876,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
for(key in data){
if(data[key].docstatus == 1 && index < 50){
index++
data[key].docstatus = 0;
return data
}
}

View File

@@ -52,10 +52,10 @@ class ReceivablePayableReport(object):
if not "range3" in self.filters:
self.filters["range3"] = "90"
for label in ("0-{range1}".format(**self.filters),
"{range1}-{range2}".format(**self.filters),
"{range2}-{range3}".format(**self.filters),
"{range3}-{above}".format(range3=self.filters.range3, above=_("Above"))):
for label in ("0-{range1}".format(range1=self.filters["range1"]),
"{range1}-{range2}".format(range1=self.filters["range1"]+1, range2=self.filters["range2"]),
"{range2}-{range3}".format(range2=self.filters["range2"]+1, range3=self.filters["range3"]),
"{range3}-{above}".format(range3=self.filters["range3"] + 1, above=_("Above"))):
columns.append({
"label": label,
"fieldtype": "Currency",

View File

@@ -25,6 +25,9 @@ def execute(filters=None):
return columns, res
def validate_filters(filters, account_details):
if not filters.get('company'):
frappe.throw(_('{0} is mandatory').format(_('Company')))
if filters.get("account") and not account_details.get(filters.account):
frappe.throw(_("Account {0} does not exists").format(filters.account))
@@ -87,7 +90,7 @@ def get_columns(filters):
columns += [
_("Voucher Type") + "::120", _("Voucher No") + ":Dynamic Link/"+_("Voucher Type")+":160",
_("Against Account") + "::120", _("Party Type") + "::80", _("Party") + "::150",
_("Project") + ":Link/Project:100", _("Cost Center") + ":Link/Cost Center:100",
_("Project") + ":Link/Project:100", _("Cost Center") + ":Link/Cost Center:100",
_("Remarks") + "::400"
]
@@ -111,7 +114,7 @@ def get_gl_entries(filters):
if filters.get("group_by_voucher") else "group by name"
gl_entries = frappe.db.sql("""
select
select
posting_date, account, party_type, party,
sum(debit) as debit, sum(credit) as credit,
voucher_type, voucher_no, cost_center, project,

View File

@@ -30,7 +30,7 @@ frappe.ui.form.on("Request for Quotation",{
},
onload: function(frm) {
frm.add_fetch('standard_reply', 'response', 'response');
frm.add_fetch('standard_reply', 'response', 'message_for_supplier');
if(!frm.doc.message_for_supplier) {
frm.set_value("message_for_supplier", __("Please supply the specified items at the best possible rates"))

View File

@@ -9,6 +9,7 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
@@ -296,7 +297,7 @@
"options": "Standard Reply",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -638,7 +639,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-06-30 01:57:49.233065",
"modified": "2016-08-01 08:45:39.777405",
"modified_by": "Administrator",
"module": "Buying",
"name": "Request for Quotation",

View File

@@ -0,0 +1,132 @@
<head>
<link href="/assets/frappe/css/c3.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/assets/frappe/js/lib/d3.min.js"></script>
<script type="text/javascript" src="/assets/frappe/js/lib/c3.min.js"></script>
<script type="text/javascript">
onReady("#chart_div", function() {
var chartData = [];
{% var q = 0; %}
{% for(var j=0, m=data.length+1; j<m; j++) { %}
var tempData{%=j%} = [];
{% for(var i=1, l=report.columns.length; i<l; i++) { %}
{% if(__(report.columns[i].label) != __("Quotation")) { %}
{% if(j == 0) { %}
{% if(i == 1) { %}
tempData{%=j%}[{%=i%}-1] = \"x\";
{% } else { %}
tempData{%=j%}[{%=i%}-1] = Math.log(parseInt(\"{%= report.columns[i].label %}\".replace(\"Qty: \",\"\"))) / Math.LN10;
{% } %}
{% } else { %}
{% if(i == 1) { %}
tempData{%=j%}[{%=i%}-1] = \"{%= data[j-1][report.columns[i].field] %} \";
{% } else { %}
tempData{%=j%}[{%=i%}-1] = {% if(data[j-1][report.columns[i].field] == "") { if (i > 2) { %}
tempData{%=j%}[{%=i%}-2]
{% } else { %}
0
{% } } else { %}
{%= data[j-1][report.columns[i].field] %}
{% } %};
{% } %};
{% } %}
{% } else { %}
{% if(j == 0) { %}
{% if(i < l-1) { %}
tempData{%=j%}[{%=i%}-1] = Math.log(parseInt(\"{%= report.columns[i+1].label %}\".replace(\"Qty: \",\"\"))-1) / Math.LN10;
{% } else { %}
tempData{%=j%}[{%=i%}-1] = Math.log(2*parseInt(\"{%= report.columns[i-1].label %}\".replace(\"Qty: \",\"\"))) / Math.LN10;
{% } %}
{% } else { %}
tempData{%=j%}[{%=i%}-1] = tempData{%=j%}[{%=i%}-2];
{% } %}
{% } %}
{% } %}
chartData[{%=j%}] = tempData{%=j%};
{% } %}
console.log(chartData);
hold = {
bindto: "#chart_div" ,data: {
x: "x",
columns: chartData
},
axis: {
x: {
tick: {
format: function (x22) { return Math.pow(10,x22).toFixed(0); },
culling: {
max: {%=report.columns.length%} / 2
}
}
}
},
point: {
show: false
}
};
console.log(hold);
var chart = c3.generate(hold);
});
function onReady(selector, callback) {
var intervalID = window.setInterval(function() {
if (document.querySelector(selector) !== undefined) {
window.clearInterval(intervalID);
callback.call(this);
}
}, 500);}
</script>
</head>
<div style="margin-bottom: 7px;" class="text-center">
{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __(report.report_name) %}</h2>
<h4 class="text-center">{%= filters.item %} </h4>
<hr>
<table class="table table-bordered">
<thead>
<tr>
{% for(var i=0, l=report.columns.length; i<l; i++) { %}
<th style="width: 15%">{%= report.columns[i].label %}</th>
{% } %}
</tr>
</thead>
<tbody>
{% for(var i=0, l=data.length; i<l; i++) { %}
<tr>
{% for(var j=0,m=report.columns.length; j<m; j++) { %}
<td style="width: 15%">{%= data[i][report.columns[j].field] %}</td>
{% } %}
</tr>
{% } %}
</tbody>
</table>
<h4 class="text-center"> Analysis Chart </h4>
<div id="chart_div"></div>
<p class="text-right text-muted">Printed On {%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p>

View File

@@ -2,6 +2,8 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from erpnext.setup.utils import get_exchange_rate
import frappe
def execute(filters=None):
@@ -22,6 +24,7 @@ def get_quote_list(item, qty_list):
if item:
price_data = []
suppliers = []
company_currency = frappe.db.get_default("currency")
# Get the list of suppliers
for root in frappe.db.sql("""select parent, qty, rate from `tabSupplier Quotation Item` where item_code=%s and docstatus < 2""", item, as_dict=1):
for splr in frappe.db.sql("""SELECT supplier from `tabSupplier Quotation` where name =%s and docstatus < 2""", root.parent, as_dict=1):
@@ -35,6 +38,9 @@ def get_quote_list(item, qty_list):
#Add a row for each supplier
for root in set(suppliers):
supplier_currency = frappe.db.get_value("Supplier",root,"default_currency")
exg = get_exchange_rate(supplier_currency,company_currency)
row = frappe._dict({
"supplier_name": root
})
@@ -42,7 +48,7 @@ def get_quote_list(item, qty_list):
# Get the quantity for this row
for item_price in price_data:
if str(item_price.qty) == col.key and item_price.supplier == root:
row[col.key] = item_price.rate
row[col.key] = item_price.rate * exg
row[col.key + "QUOTE"] = item_price.parent
break
else:

View File

@@ -26,6 +26,12 @@ def get_data():
"name": "Payment Entry",
"description": _("Bank/Cash transactions against party or for internal transfer")
},
{
"type": "page",
"name": "pos",
"label": _("POS"),
"description": _("Point of Sale")
},
{
"type": "report",
"name": "Accounts Receivable",

View File

@@ -229,12 +229,12 @@ def get_data():
"type": "list"
},
{
"module_name": "Examination",
"module_name": "Assessment",
"color": "#8a70be",
"icon": "icon-file-text-alt",
"label": _("Examination"),
"link": "List/Examination",
"_doctype": "Examination",
"label": _("Assessment"),
"link": "List/Assessment",
"_doctype": "Assessment",
"type": "list"
},
{
@@ -261,7 +261,7 @@ def get_data():
"icon": "icon-map-marker",
"label": _("Room"),
"link": "List/Room",
"_doctype": "Examination",
"_doctype": "Room",
"type": "list"
},
{

View File

@@ -12,7 +12,7 @@ You can create Custom Form, Fields, Scripts and can also create your own Apps
to extend ERPNext functionality.
ERPNext is Open Source under the GNU General Public Licence v3 and has been
listed as one of the Best Open Source Softwares in the world by my online
listed as one of the Best Open Source Softwares in the world by many online
blogs."""
docs_version = "6.x.x"

View File

@@ -61,7 +61,11 @@ def get_data():
},
{
"type": "doctype",
"name": "Examination"
"name": "Assessment"
},
{
"type": "doctype",
"name": "Assessment Group"
},
{
"type": "doctype",

View File

@@ -38,6 +38,7 @@ class StockController(AccountsController):
gl_list = []
warehouse_with_no_account = []
for detail in voucher_details:
sle_list = sle_map.get(detail.name)
if sle_list:
@@ -266,10 +267,9 @@ def update_gl_entries_after(posting_date, posting_time, for_warehouses=None, for
voucher_obj = frappe.get_doc(voucher_type, voucher_no)
expected_gle = voucher_obj.get_gl_entries(warehouse_account)
if expected_gle:
if not existing_gle or not compare_existing_and_expected_gle(existing_gle,
expected_gle):
_delete_gl_entries(voucher_type, voucher_no)
voucher_obj.make_gl_entries(repost_future_gle=False)
if not existing_gle or not compare_existing_and_expected_gle(existing_gle, expected_gle):
_delete_gl_entries(voucher_type, voucher_no)
voucher_obj.make_gl_entries(repost_future_gle=False)
else:
_delete_gl_entries(voucher_type, voucher_no)

View File

@@ -440,33 +440,32 @@ class calculate_taxes_and_totals(object):
paid_amount = self.doc.paid_amount \
if self.doc.party_account_currency == self.doc.currency else self.doc.base_paid_amount
self.doc.outstanding_amount = 0
if total_amount_to_pay > paid_amount:
self.doc.outstanding_amount = flt(total_amount_to_pay - flt(paid_amount),
self.doc.precision("outstanding_amount"))
self.change_amount()
self.calculate_change_amount()
self.doc.outstanding_amount = flt(total_amount_to_pay - flt(paid_amount) +
flt(self.doc.change_amount), self.doc.precision("outstanding_amount"))
elif self.doc.doctype == "Purchase Invoice":
self.doc.outstanding_amount = flt(total_amount_to_pay, self.doc.precision("outstanding_amount"))
def calculate_paid_amount(self):
paid_amount = base_paid_amount = 0.0
for payment in self.doc.get('payments'):
payment.base_amount = flt(payment.amount * self.doc.conversion_rate)
paid_amount += payment.amount
base_paid_amount += payment.base_amount
if flt(payment.amount) > 0:
payment.base_amount = flt(payment.amount * self.doc.conversion_rate)
paid_amount += payment.amount
base_paid_amount += payment.base_amount
self.doc.paid_amount = flt(paid_amount, self.doc.precision("paid_amount"))
self.doc.base_paid_amount = flt(base_paid_amount, self.doc.precision("base_paid_amount"))
def change_amount(self):
change_amount = 0.0
def calculate_change_amount(self):
self.doc.change_amount = 0.0
if self.doc.paid_amount > self.doc.grand_total:
change_amount = flt(self.doc.paid_amount - self.doc.grand_total,
self.doc.precision("change_amount"))
self.doc.change_amount = flt(self.doc.paid_amount - self.doc.grand_total +
self.doc.write_off_amount, self.doc.precision("change_amount"))
self.doc.change_amount = change_amount;
self.doc.base_change_amount = flt(change_amount * self.doc.conversion_rate,
self.doc.base_change_amount = flt(self.doc.change_amount * self.doc.conversion_rate,
self.doc.precision("base_change_amount"))
def calculate_margin(self, item):

View File

@@ -38,7 +38,8 @@ class Lead(SellingController):
frappe.throw(_("Campaign Name is required"))
if self.email_id:
validate_email_add(self.email_id, True)
if not self.flags.ignore_email_validation:
validate_email_add(self.email_id, True)
if self.email_id == self.lead_owner:
# Lead Owner cannot be same as the Lead

View File

@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe, json
from frappe.utils import cstr, cint, get_fullname, validate_email_add
from frappe.utils import cstr, cint, get_fullname
from frappe import msgprint, _
from frappe.model.mapper import get_mapped_doc
from erpnext.setup.utils import get_exchange_rate
@@ -43,7 +43,7 @@ class Opportunity(TransactionBase):
def make_new_lead_if_required(self):
"""Set lead against new opportunity"""
if not (self.lead or self.customer) and self.contact_email and validate_email_add(self.contact_email):
if not (self.lead or self.customer) and self.contact_email:
lead_name = frappe.db.get_value("Lead", {"email_id": self.contact_email})
if not lead_name:
sender_name = get_fullname(self.contact_email)
@@ -64,6 +64,7 @@ class Opportunity(TransactionBase):
"lead_name": sender_name
})
lead.flags.ignore_email_validation = True
lead.insert(ignore_permissions=True)
lead_name = lead.name

View File

@@ -53,7 +53,7 @@ def simulate():
if not runs_for:
runs_for = frappe.utils.date_diff(frappe.utils.nowdate(), current_date)
# runs_for = 100
fixed_asset.work()
for i in xrange(runs_for):
@@ -72,9 +72,6 @@ def simulate():
stock.work()
accounts.work()
projects.run_projects(current_date)
# run_stock()
# run_accounts()
# run_projects()
# run_messages()
current_date = frappe.utils.add_days(current_date, 1)

View File

@@ -212,7 +212,7 @@ def setup_user():
user = frappe.new_doc("User")
user.update(u)
user.flags.no_welcome_mail
user.password = 'demo'
user.new_password = 'demo'
user.insert()
def import_json(doctype, submit=False, values=None):
@@ -377,6 +377,12 @@ def setup_budget():
def setup_user_roles():
user = frappe.get_doc('User', 'demo@erpnext.com')
user.add_roles('HR User', 'HR Manager', 'Accounts User', 'Accounts Manager',
'Stock User', 'Stock Manager', 'Sales User', 'Sales Manager', 'Purchase User',
'Purchase Manager', 'Projects User', 'Manufacturing User', 'Manufacturing Manager',
'Support Team')
if not frappe.db.get_global('demo_hr_user'):
user = frappe.get_doc('User', 'CharmaineGaudreau@example.com')
user.add_roles('HR User', 'HR Manager', 'Accounts User')
@@ -439,7 +445,7 @@ def setup_leave_allocation():
for leave_type in leave_types:
if not leave_type.max_days_allowed:
leave_type.max_days_allowed = 10
leave_allocation = frappe.get_doc({
"doctype": "Leave Allocation",
"employee": employee.name,
@@ -450,4 +456,4 @@ def setup_leave_allocation():
})
leave_allocation.insert()
leave_allocation.submit()
frappe.db.commit()
frappe.db.commit()

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

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