Merge branch 'v11-pre-release' into version-11

This commit is contained in:
Sahil Khan
2019-12-18 13:59:59 +05:30
19 changed files with 1776 additions and 1572 deletions

View File

@@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides from erpnext.hooks import regional_overrides
from frappe.utils import getdate from frappe.utils import getdate
__version__ = '11.1.68' __version__ = '11.1.71'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''
@@ -144,4 +144,4 @@ def is_member():
last_membership = get_last_membership() last_membership = get_last_membership()
if last_membership and getdate(last_membership.to_date) > getdate(): if last_membership and getdate(last_membership.to_date) > getdate():
return True return True
return False return False

View File

@@ -1,465 +1,466 @@
{ {
"country_code": "ae", "country_code": "ae",
"name": "U.A.E - Chart of Accounts", "name": "U.A.E - Chart of Accounts",
"tree": { "tree": {
"Assets": { "Assets": {
"Current Assets": { "Current Assets": {
"Accounts Receivable": { "Accounts Receivable": {
"Corporate Credit Cards": { "Corporate Credit Cards": {
"account_type": "Receivable" "account_type": "Receivable"
}, },
"Other Receivable": { "Other Receivable": {
"Accrued Rebates Due from Suppliers": { "Accrued Rebates Due from Suppliers": {
"account_type": "Receivable" "account_type": "Receivable"
}, },
"Accured Income from Suppliers": { "Accrued Income from Suppliers": {
"account_type": "Receivable" "account_type": "Receivable"
}, },
"Other Debtors": { "Other Debtors": {
"account_type": "Receivable" "account_type": "Receivable"
}, },
"account_type": "Receivable" "account_type": "Receivable"
}, },
"Post Dated Cheques Received": { "Post Dated Cheques Received": {
"account_type": "Receivable" "account_type": "Receivable"
}, },
"Staff Receivable": { "Staff Receivable": {
"account_type": "Receivable" "account_type": "Receivable"
}, },
"Trade Receivable": { "Trade Receivable": {
"account_type": "Receivable" "account_type": "Receivable"
}, },
"Trade in Opening Fees": { "Trade in Opening Fees": {
"account_type": "Receivable" "account_type": "Receivable"
}, },
"account_type": "Receivable" "account_type": "Receivable"
}, },
"Cash in Hand & Banks": { "Cash in Hand & Banks": {
"Banks": { "Banks": {
"Bank Margin On LC & LG": {}, "Bank Margin On LC & LG": {},
"Banks Blocked Deposits": {}, "Banks Blocked Deposits": {},
"Banks Call Deposit Accounts": {}, "Banks Call Deposit Accounts": {},
"Banks Current Accounts": { "Banks Current Accounts": {
"account_type": "Bank" "account_type": "Bank"
}, },
"account_type": "Bank" "account_type": "Bank"
}, },
"Cash in Hand": { "Cash in Hand": {
"Cash in Safe": { "Cash in Safe": {
"Main Safe": { "Main Safe": {
"account_type": "Cash" "account_type": "Cash"
}, },
"Main Safe - Foreign Currency": { "Main Safe - Foreign Currency": {
"account_type": "Cash" "account_type": "Cash"
} }
}, },
"Petty Cash": { "Petty Cash": {
"Petty Cash - Admininistration": { "Petty Cash - Admininistration": {
"account_type": "Cash" "account_type": "Cash"
}, },
"Petty Cash - Others": { "Petty Cash - Others": {
"account_type": "Cash" "account_type": "Cash"
} }
}, },
"account_type": "Cash" "account_type": "Cash"
}, },
"Cash in Transit": { "Cash in Transit": {
"Credit Cards": { "Credit Cards": {
"Gateway Credit Cards": { "Gateway Credit Cards": {
"account_type": "Bank" "account_type": "Bank"
}, },
"Manual Visa & Master Cards": { "Manual Visa & Master Cards": {
"account_type": "Bank" "account_type": "Bank"
}, },
"PayPal Account": { "PayPal Account": {
"account_type": "Bank" "account_type": "Bank"
}, },
"Visa & Master Credit Cards": { "Visa & Master Credit Cards": {
"account_type": "Bank" "account_type": "Bank"
} }
} }
} }
}, },
"Inventory": { "Inventory": {
"Consigned Stock": { "Consigned Stock": {
"Handling Difference in Inventory": { "Handling Difference in Inventory": {},
"account_type": "Stock Adjustment" "Items Delivered to Customs on temporary Base": {}
}, },
"Items Delivered to Customs on temprary Base": {}
},
"Stock in Hand": { "Stock in Hand": {
"account_type": "Stock" "account_type": "Stock"
} }
}, },
"Perliminary and Preoperating Expenses": { "Preliminary and Preoperating Expenses": {
"Preoperating Expenses": {} "Preoperating Expenses": {}
}, },
"Prepayments & Deposits": { "Prepayments & Deposits": {
"Deposits": { "Deposits": {
"Deposit - Office Rent": {}, "Deposit - Office Rent": {},
"Deposit Others": {}, "Deposit Others": {},
"Deposit to Immigration (Visa)": {}, "Deposit to Immigration (Visa)": {},
"Deposits - Customs": {} "Deposits - Customs": {}
}, },
"Prepaid Taxes": { "Prepaid Taxes": {
"Sales Taxes Receivables": {}, "Sales Taxes Receivables": {},
"Withholding Tax Receivables": {} "Withholding Tax Receivables": {}
}, },
"Prepayments": { "Prepayments": {
"Other Prepayments": {}, "Other Prepayments": {},
"PrePaid Advertisement Expenses": {}, "PrePaid Advertisement Expenses": {},
"Prepaid Bank Guarantee": {}, "Prepaid Bank Guarantee": {},
"Prepaid Consultancy Fees": {}, "Prepaid Consultancy Fees": {},
"Prepaid Employees Housing": {}, "Prepaid Employees Housing": {},
"Prepaid Finance charge for Loans": {}, "Prepaid Finance charge for Loans": {},
"Prepaid Legal Fees": {}, "Prepaid Legal Fees": {},
"Prepaid License Fees": {}, "Prepaid License Fees": {},
"Prepaid Life Insurance": {}, "Prepaid Life Insurance": {},
"Prepaid Maintenance": {}, "Prepaid Maintenance": {},
"Prepaid Medical Insurance": {}, "Prepaid Medical Insurance": {},
"Prepaid Office Rent": {}, "Prepaid Office Rent": {},
"Prepaid Other Insurance": {}, "Prepaid Other Insurance": {},
"Prepaid Schooling Fees": {}, "Prepaid Schooling Fees": {},
"Prepaid Site Hosting Fees": {}, "Prepaid Site Hosting Fees": {},
"Prepaid Sponsorship Fees": {} "Prepaid Sponsorship Fees": {}
} }
} }
}, },
"Long Term Assets": { "Long Term Assets": {
"Fixed Assets": { "Fixed Assets": {
"Accumulated Depreciation": { "Accumulated Depreciation": {
"Acc. Depreciation of Motor Vehicles": { "Acc. Depreciation of Motor Vehicles": {
"account_type": "Accumulated Depreciation" "account_type": "Accumulated Depreciation"
}, },
"Acc. Deprn.Computer Hardware & Software": { "Acc. Deprn.Computer Hardware & Software": {
"account_type": "Accumulated Depreciation" "account_type": "Accumulated Depreciation"
}, },
"Acc.Deprn.of Furniture & Office Equipment": { "Acc.Deprn.of Furniture & Office Equipment": {
"account_type": "Accumulated Depreciation" "account_type": "Accumulated Depreciation"
}, },
"Amortisation on Leasehold Improvement": { "Amortisation on Leasehold Improvement": {
"account_type": "Accumulated Depreciation" "account_type": "Accumulated Depreciation"
}, },
"account_type": "Accumulated Depreciation" "account_type": "Accumulated Depreciation"
}, },
"Fixed Assets (Cost Price)": { "Fixed Assets (Cost Price)": {
"Computer Hardware & Software": { "Computer Hardware & Software": {
"account_type": "Fixed Asset" "account_type": "Fixed Asset"
}, },
"Furniture and Equipment": { "Furniture and Equipment": {
"account_type": "Fixed Asset" "account_type": "Fixed Asset"
}, },
"Leasehold Improvement": {}, "Leasehold Improvement": {},
"Motor Vehicules": { "Motor Vehicles": {
"account_type": "Fixed Asset" "account_type": "Fixed Asset"
}, },
"Work In Progrees": {}, "Work In Progress": {},
"account_type": "Fixed Asset" "account_type": "Fixed Asset"
} }
}, },
"Intangible Assets": { "Intangible Assets": {
"Computer Card Renewal": {}, "Computer Card Renewal": {},
"Dispoal of Outlets": {}, "Disposal of Outlets": {},
"Registration of Trademarks": {} "Registration of Trademarks": {}
}, },
"Intercompany Accounts": {}, "Intercompany Accounts": {},
"Investments": { "Investments": {
"Investments in Subsidiaries": {} "Investments in Subsidiaries": {}
} }
}, },
"root_type": "Asset" "root_type": "Asset"
}, },
"Closing And Temporary Accounts": { "Closing And Temporary Accounts": {
"Closing Accounts": { "Closing Accounts": {
"Closing Account": {} "Closing Account": {}
}, },
"root_type": "Liability" "root_type": "Liability"
}, },
"Expenses": { "Expenses": {
"Commercial Expenses": { "Commercial Expenses": {
"Consultancy Fees": {}, "Consultancy Fees": {},
"Provision for Doubtful Debts": {} "Provision for Doubtful Debts": {}
}, },
"Cost of Sale": { "Cost of Sale": {
"Cost Of Goods Sold": { "Cost Of Goods Sold": {
"Cost Of Goods Sold I/C Sales": {}, "Cost Of Goods Sold I/C Sales": {},
"Cost of Goods Sold in Trading": { "Cost of Goods Sold in Trading": {
"account_type": "Cost of Goods Sold" "account_type": "Cost of Goods Sold"
}, },
"account_type": "Cost of Goods Sold" "account_type": "Cost of Goods Sold"
}, },
"Expenses Included In Valuation": { "Expenses Included In Valuation": {
"account_type": "Expenses Included In Valuation" "account_type": "Expenses Included In Valuation"
},
"Stock Adjustment": {
"account_type": "Stock Adjustment"
} }
}, },
"Depreciation": { "Depreciation": {
"Depreciation & Amortization": { "Depreciation & Amortization": {
"Amortization on Leasehold Improvement": {}, "Amortization on Leasehold Improvement": {},
"Depreciation Of Computer Hard & Soft": { "Depreciation Of Computer Hard & Soft": {
"account_type": "Depreciation" "account_type": "Depreciation"
}, },
"Depreciation Of Furniture & Office Equipment\n\t\t\t": { "Depreciation Of Furniture & Office Equipment\n\t\t\t": {
"account_type": "Depreciation" "account_type": "Depreciation"
}, },
"Depreciation Of Motor Vehicles": { "Depreciation Of Motor Vehicles": {
"account_type": "Depreciation" "account_type": "Depreciation"
} }
} }
}, },
"Direct Expenses": { "Direct Expenses": {
"Financial Charges": { "Financial Charges": {
"Air Miles Card Charges": {}, "Air Miles Card Charges": {},
"Amex Credit Cards Charges": {}, "Amex Credit Cards Charges": {},
"Bank Finance & Loan Charges": {}, "Bank Finance & Loan Charges": {},
"Credit Card Charges": {}, "Credit Card Charges": {},
"Credit Card Swipe Charges": {}, "Credit Card Swipe Charges": {},
"PayPal Charges": {} "PayPal Charges": {}
} }
}, },
"MISC Charges": { "MISC Charges": {
"Other Charges": { "Other Charges": {
"Captial Loss": { "Capital Loss": {
"Disposal of Business Branch": {}, "Disposal of Business Branch": {},
"Loss On Fixed Assets Disposal": {}, "Loss On Fixed Assets Disposal": {},
"Loss on Difference on Exchange": {} "Loss on Difference on Exchange": {}
}, },
"Other Non Operating Exp": { "Other Non Operating Exp": {
"Other Non Operating Expenses": {} "Other Non Operating Expenses": {}
}, },
"Previous Year Adjustments": { "Previous Year Adjustments": {
"Previous Year Adjustments Account": {} "Previous Year Adjustments Account": {}
}, },
"Royalty Fees": { "Royalty Fees": {
"Royalty to Parent Co.": {} "Royalty to Parent Co.": {}
}, },
"Tax / Zakat Expenses": { "Tax / Zakat Expenses": {
"Income Tax": { "Income Tax": {
"account_type": "Tax" "account_type": "Tax"
}, },
"Zakat": {}, "Zakat": {},
"account_type": "Tax" "account_type": "Tax"
} }
} }
}, },
"Share Resources": { "Share Resources": {
"Share Resource Expenses Account": {} "Share Resource Expenses Account": {}
}, },
"Store Operating Expenses": { "Store Operating Expenses": {
"Selling, General & Admin Expenses": { "Selling, General & Admin Expenses": {
"Advertising Expenses": { "Advertising Expenses": {
"Other - Advertising Expenses": {} "Other - Advertising Expenses": {}
}, },
"Bank & Finance Charges": { "Bank & Finance Charges": {
"Other Bank Charges": {} "Other Bank Charges": {}
}, },
"Communications": { "Communications": {
"Courrier": {}, "Courier": {},
"Others - Communication": {}, "Others - Communication": {},
"Telephone": {}, "Telephone": {},
"Web Site Hosting Fees": {} "Web Site Hosting Fees": {}
}, },
"Office & Various Expenses": { "Office & Various Expenses": {
"Cleaning": {}, "Cleaning": {},
"Convoyance Expenses": {}, "Conveyance Expenses": {},
"Gifts & Donations": {}, "Gifts & Donations": {},
"Insurance": {}, "Insurance": {},
"Kitchen and Buffet Expenses": {}, "Kitchen and Buffet Expenses": {},
"Maintenance": {}, "Maintenance": {},
"Others - Office Various Expenses": {}, "Others - Office Various Expenses": {},
"Security & Guard": {}, "Security & Guard": {},
"Stationary From Suppliers": {}, "Stationary From Suppliers": {},
"Stationary Out Of Stock": {}, "Stationary Out Of Stock": {},
"Subscriptions": {}, "Subscriptions": {},
"Training": {}, "Training": {},
"Vehicle Expenses": {} "Vehicle Expenses": {}
}, },
"Personnel Cost": { "Personnel Cost": {
"Basic Salary": {}, "Basic Salary": {},
"End Of Service Indemnity": {}, "End Of Service Indemnity": {},
"Housing Allowance": {}, "Housing Allowance": {},
"Leave Salary": {}, "Leave Salary": {},
"Leave Ticket": {}, "Leave Ticket": {},
"Life Insurance": {}, "Life Insurance": {},
"Medical Insurance": {}, "Medical Insurance": {},
"Personnel Cost Others": {}, "Personnel Cost Others": {},
"Sales Commission": {}, "Sales Commission": {},
"Staff School Allowances": {}, "Staff School Allowances": {},
"Transportation Allowance": {}, "Transportation Allowance": {},
"Uniform": {}, "Uniform": {},
"Visa Expenses": {} "Visa Expenses": {}
}, },
"Professional & Legal Fees": { "Professional & Legal Fees": {
"Audit Fees": {}, "Audit Fees": {},
"Legal fees": {}, "Legal fees": {},
"Others - Professional Fees": {}, "Others - Professional Fees": {},
"Sponsorship Fees": {}, "Sponsorship Fees": {},
"Trade License Fees": {} "Trade License Fees": {}
}, },
"Provision & Write Off": { "Provision & Write Off": {
"Amortisation of Preoperating Expenses": {}, "Amortisation of Preoperating Expenses": {},
"Cash Shortage": {}, "Cash Shortage": {},
"Others - Provision & Write off": {}, "Others - Provision & Write off": {},
"Write Off Inventory": {}, "Write Off Inventory": {},
"Write Off Receivables & Payables": {} "Write Off Receivables & Payables": {}
}, },
"Rent Expenses": { "Rent Expenses": {
"Office Rent": {}, "Office Rent": {},
"Warehouse Rent": {} "Warehouse Rent": {}
}, },
"Travel Expenses": { "Travel Expenses": {
"Air tickets": {}, "Air tickets": {},
"Hotel": {}, "Hotel": {},
"Meals": {}, "Meals": {},
"Others": {}, "Others": {},
"Per Diem": {} "Per Diem": {}
}, },
"Utilities": { "Utilities": {
"Other Utility Cahrges": {}, "Other Utility Cahrges": {},
"Water & Electricity": {} "Water & Electricity": {}
} }
} }
}, },
"root_type": "Expense" "root_type": "Expense"
}, },
"Liabilities": { "Liabilities": {
"Current Liabilities": { "Current Liabilities": {
"Accounts Payable": { "Accounts Payable": {
"Payables": { "Payables": {
"Advance Paybale to Suppliers": { "Advance Paybale to Suppliers": {
"account_type": "Payable" "account_type": "Payable"
}, },
"Consigned Payable": { "Consigned Payable": {
"account_type": "Payable" "account_type": "Payable"
}, },
"Other Payable": { "Other Payable": {
"account_type": "Payable" "account_type": "Payable"
}, },
"Post Dated Cheques Paid": { "Post Dated Cheques Paid": {
"account_type": "Payable" "account_type": "Payable"
}, },
"Staff Payable": {}, "Staff Payable": {},
"Suppliers Price Protection": { "Suppliers Price Protection": {
"account_type": "Payable" "account_type": "Payable"
}, },
"Trade Payable": { "Trade Payable": {
"account_type": "Payable" "account_type": "Payable"
}, },
"account_type": "Payable" "account_type": "Payable"
} }
}, },
"Accruals & Provisions": { "Accruals & Provisions": {
"Accruals": { "Accruals": {
"Accrued Personnel Cost": { "Accrued Personnel Cost": {
"Accrued - Commissions": {}, "Accrued - Commissions": {},
"Accrued - Leave Salary": {}, "Accrued - Leave Salary": {},
"Accrued - Leave Tickets": {}, "Accrued - Leave Tickets": {},
"Accrued - Salaries": {}, "Accrued - Salaries": {},
"Accrued Other Personnel Cost": {}, "Accrued Other Personnel Cost": {},
"Accrued Salaries Increment": {}, "Accrued Salaries Increment": {},
"Accrued-Staff Bonus": {} "Accrued-Staff Bonus": {}
} }
}, },
"Accrued Expenses": { "Accrued Expenses": {
"Accrued Other Expenses": { "Accrued Other Expenses": {
"Accrued - Audit Fees": {}, "Accrued - Audit Fees": {},
"Accrued - Office Rent": {}, "Accrued - Office Rent": {},
"Accrued - Sponsorship": {}, "Accrued - Sponsorship": {},
"Accrued - Telephone": {}, "Accrued - Telephone": {},
"Accrued - Utilities": {}, "Accrued - Utilities": {},
"Accrued Others": {} "Accrued Others": {}
} }
}, },
"Other Current Liabilities": { "Other Current Liabilities": {
"Accrued Dubai Customs": {}, "Accrued Dubai Customs": {},
"Deferred income": {}, "Deferred income": {},
"Shipping & Handling": {} "Shipping & Handling": {}
}, },
"Provisions": { "Provisions": {
"Tax Payables": { "Tax Payables": {
"Income Tax Payable": {}, "Income Tax Payable": {},
"Sales Tax Payable": {}, "Sales Tax Payable": {},
"Withholding Tax Payable": {} "Withholding Tax Payable": {}
} }
}, },
"Short Term Loan": {} "Short Term Loan": {}
}, },
"Duties and Taxes": { "Duties and Taxes": {
"account_type": "Tax", "account_type": "Tax",
"is_group": 1 "is_group": 1
}, },
"Reservations & Credit Notes": { "Reservations & Credit Notes": {
"Credit Notes": { "Credit Notes": {
"Credit Notes to Customers": {}, "Credit Notes to Customers": {},
"Reservations": {} "Reservations": {}
} }
}, },
"Stock Liabilities": { "Stock Liabilities": {
"Stock Received But Not Billed": { "Stock Received But Not Billed": {
"account_type": "Stock Received But Not Billed" "account_type": "Stock Received But Not Billed"
} }
}, },
"Unearned Income": {} "Unearned Income": {}
}, },
"Long Term Liabilities": { "Long Term Liabilities": {
"Long Term Loans & Provisions": {} "Long Term Loans & Provisions": {}
}, },
"root_type": "Liability" "root_type": "Liability"
}, },
"Revenue": { "Revenue": {
"Direct Revenue": { "Direct Revenue": {
"Other Direct Revenue": { "Other Direct Revenue": {
"Other Revenue - Operating": { "Other Revenue - Operating": {
"Advertising Income": {}, "Advertising Income": {},
"Branding Income": {}, "Branding Income": {},
"Early Setmt Margin from Suppliers": {}, "Early Setmt Margin from Suppliers": {},
"Marketing Rebate from Suppliers": {}, "Marketing Rebate from Suppliers": {},
"Rebate from Suppliers": {}, "Rebate from Suppliers": {},
"Service Income": {}, "Service Income": {},
"Space Rental Income": {} "Space Rental Income": {}
} }
} }
}, },
"Indirect Revenue": { "Indirect Revenue": {
"Other Indirect Revenue": { "Other Indirect Revenue": {
"Capital Gain": {}, "Capital Gain": {},
"Excess In Till": {}, "Excess In Till": {},
"Gain On Difference Of Exchange": {}, "Gain On Difference Of Exchange": {},
"Management Consultancy Fees": {}, "Management Consultancy Fees": {},
"Other Income": {} "Other Income": {}
}, },
"Other Revenue - Non Operating": { "Other Revenue - Non Operating": {
"Interest Revenue": {}, "Interest Revenue": {},
"Interest from FD": {}, "Interest from FD": {},
"Products Listing Fees from Suppliers": {}, "Products Listing Fees from Suppliers": {},
"Trade Opening Fees from suppliers": {} "Trade Opening Fees from suppliers": {}
} }
}, },
"Sales": { "Sales": {
"Sales from Other Regions": { "Sales from Other Regions": {
"Sales from Other Region": {} "Sales from Other Region": {}
}, },
"Sales of same region": { "Sales of same region": {
"Management Consultancy Fees 1": {}, "Management Consultancy Fees 1": {},
"Sales Account": {}, "Sales Account": {},
"Sales of I/C": {} "Sales of I/C": {}
} }
}, },
"root_type": "Income" "root_type": "Income"
}, },
"Share Holder Equity": { "Share Holder Equity": {
"Capital": { "Capital": {
"Contributed Capital": {}, "Contributed Capital": {},
"Share Capital": {}, "Share Capital": {},
"Shareholders Current A/c": {}, "Shareholders Current A/c": {},
"Sub Ordinated Loan": {}, "Sub Ordinated Loan": {},
"Treasury Stocks": {} "Treasury Stocks": {}
}, },
"Retained Earnings": { "Retained Earnings": {
"Current Year Results": {}, "Current Year Results": {},
"Dividends Paid": {}, "Dividends Paid": {},
"Previous Years Results": {} "Previous Years Results": {}
}, },
"account_type": "Equity", "account_type": "Equity",
"root_type": "Equity" "root_type": "Equity"
} }
} }

View File

@@ -92,10 +92,10 @@ frappe.ui.form.on("Journal Entry", {
multi_currency: function(frm) { multi_currency: function(frm) {
erpnext.journal_entry.toggle_fields_based_on_currency(frm); erpnext.journal_entry.toggle_fields_based_on_currency(frm);
}, },
posting_date: function(frm) { posting_date: function(frm) {
if(!frm.doc.multi_currency || !frm.doc.posting_date) return; if(!frm.doc.multi_currency || !frm.doc.posting_date) return;
$.each(frm.doc.accounts || [], function(i, row) { $.each(frm.doc.accounts || [], function(i, row) {
erpnext.journal_entry.set_exchange_rate(frm, row.doctype, row.name); erpnext.journal_entry.set_exchange_rate(frm, row.doctype, row.name);
}) })
@@ -234,7 +234,7 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
out.filters.push([jvd.reference_type, "per_billed", "<", 100]); out.filters.push([jvd.reference_type, "per_billed", "<", 100]);
} }
if(jvd.party_type && jvd.party) { if(jvd.party_type && jvd.party) {
var party_field = ""; var party_field = "";
if(jvd.reference_type.indexOf("Sales")===0) { if(jvd.reference_type.indexOf("Sales")===0) {
@@ -382,7 +382,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
}); });
refresh_field("accounts"); refresh_field("accounts");
} }
if((!(doc.accounts || []).length) || ((doc.accounts || []).length==1 && !doc.accounts[0].account)) { if((!(doc.accounts || []).length) || ((doc.accounts || []).length==1 && !doc.accounts[0].account)) {
if(in_list(["Bank Entry", "Cash Entry"], doc.voucher_type)) { if(in_list(["Bank Entry", "Cash Entry"], doc.voucher_type)) {
return frappe.call({ return frappe.call({
@@ -390,7 +390,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_default_bank_cash_account", method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_default_bank_cash_account",
args: { args: {
"account_type": (doc.voucher_type=="Bank Entry" ? "account_type": (doc.voucher_type=="Bank Entry" ?
"Bank" : (doc.voucher_type=="Cash" ? "Cash" : null)), "Bank" : (doc.voucher_type=="Cash Entry" ? "Cash" : null)),
"company": doc.company "company": doc.company
}, },
callback: function(r) { callback: function(r) {
@@ -442,7 +442,7 @@ frappe.ui.form.on("Journal Entry Account", {
account: function(frm, dt, dn) { account: function(frm, dt, dn) {
erpnext.journal_entry.set_account_balance(frm, dt, dn); erpnext.journal_entry.set_account_balance(frm, dt, dn);
}, },
debit_in_account_currency: function(frm, cdt, cdn) { debit_in_account_currency: function(frm, cdt, cdn) {
erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn); erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn);
}, },

View File

@@ -250,7 +250,7 @@ class PurchaseInvoice(BuyingController):
def set_against_expense_account(self): def set_against_expense_account(self):
against_accounts = [] against_accounts = []
for item in self.get("items"): for item in self.get("items"):
if item.expense_account not in against_accounts: if item.expense_account and (item.expense_account not in against_accounts):
against_accounts.append(item.expense_account) against_accounts.append(item.expense_account)
self.against_expense_account = ",".join(against_accounts) self.against_expense_account = ",".join(against_accounts)
@@ -750,7 +750,11 @@ class PurchaseInvoice(BuyingController):
) )
def make_gle_for_rounding_adjustment(self, gl_entries): def make_gle_for_rounding_adjustment(self, gl_entries):
if self.rounding_adjustment: # if rounding adjustment in small and conversion rate is also small then
# base_rounding_adjustment may become zero due to small precision
# eg: rounding_adjustment = 0.01 and exchange rate = 0.05 and precision of base_rounding_adjustment is 2
# then base_rounding_adjustment becomes zero and error is thrown in GL Entry
if self.rounding_adjustment and self.base_rounding_adjustment:
round_off_account, round_off_cost_center = \ round_off_account, round_off_cost_center = \
get_round_off_account_and_cost_center(self.company) get_round_off_account_and_cost_center(self.company)

View File

@@ -944,7 +944,7 @@ class SalesInvoice(SellingController):
) )
def make_gle_for_rounding_adjustment(self, gl_entries): def make_gle_for_rounding_adjustment(self, gl_entries):
if flt(self.rounding_adjustment, self.precision("rounding_adjustment")): if flt(self.rounding_adjustment, self.precision("rounding_adjustment")) and self.base_rounding_adjustment:
round_off_account, round_off_cost_center = \ round_off_account, round_off_cost_center = \
get_round_off_account_and_cost_center(self.company) get_round_off_account_and_cost_center(self.company)
@@ -1039,13 +1039,18 @@ class SalesInvoice(SellingController):
continue continue
for serial_no in item.serial_no.split("\n"): for serial_no in item.serial_no.split("\n"):
sales_invoice, item_code = frappe.db.get_value("Serial No", serial_no, serial_no_details = frappe.db.get_value("Serial No", serial_no,
["sales_invoice", "item_code"]) ["sales_invoice", "item_code"], as_dict=1)
if sales_invoice and item_code == item.item_code and self.name != sales_invoice:
sales_invoice_company = frappe.db.get_value("Sales Invoice", sales_invoice, "company") if not serial_no_details:
continue
if serial_no_details.sales_invoice and serial_no_details.item_code == item.item_code \
and self.name != serial_no_details.sales_invoice:
sales_invoice_company = frappe.db.get_value("Sales Invoice", serial_no_details.sales_invoice, "company")
if sales_invoice_company == self.company: if sales_invoice_company == self.company:
frappe.throw(_("Serial Number: {0} is already referenced in Sales Invoice: {1}" frappe.throw(_("Serial Number: {0} is already referenced in Sales Invoice: {1}"
.format(serial_no, sales_invoice))) .format(serial_no, serial_no_details.sales_invoice)))
def update_project(self): def update_project(self):
if self.project: if self.project:

View File

@@ -59,6 +59,7 @@ class ReceivablePayableReport(object):
def get_data(self): def get_data(self):
self.get_gl_entries() self.get_gl_entries()
self.get_sales_invoices_or_customers_based_on_sales_person()
self.voucher_balance = OrderedDict() self.voucher_balance = OrderedDict()
self.init_voucher_balance() # invoiced, paid, credit_note, outstanding self.init_voucher_balance() # invoiced, paid, credit_note, outstanding
@@ -102,12 +103,18 @@ class ReceivablePayableReport(object):
def get_invoices(self, gle): def get_invoices(self, gle):
if gle.voucher_type in ('Sales Invoice', 'Purchase Invoice'): if gle.voucher_type in ('Sales Invoice', 'Purchase Invoice'):
self.invoices.add(gle.voucher_no) if self.filters.get("sales_person"):
if gle.voucher_no in self.sales_person_records.get("Sales Invoice", []) \
or gle.party in self.sales_person_records.get("Customer", []):
self.invoices.add(gle.voucher_no)
else:
self.invoices.add(gle.voucher_no)
def update_voucher_balance(self, gle): def update_voucher_balance(self, gle):
# get the row where this balance needs to be updated # get the row where this balance needs to be updated
# if its a payment, it will return the linked invoice or will be considered as advance # if its a payment, it will return the linked invoice or will be considered as advance
row = self.get_voucher_balance(gle) row = self.get_voucher_balance(gle)
if not row: return
# gle_balance will be the total "debit - credit" for receivable type reports and # gle_balance will be the total "debit - credit" for receivable type reports and
# and vice-versa for payable type reports # and vice-versa for payable type reports
gle_balance = self.get_gle_balance(gle) gle_balance = self.get_gle_balance(gle)
@@ -128,8 +135,13 @@ class ReceivablePayableReport(object):
row.paid -= gle_balance row.paid -= gle_balance
def get_voucher_balance(self, gle): def get_voucher_balance(self, gle):
voucher_balance = None if self.filters.get("sales_person"):
against_voucher = gle.against_voucher or gle.voucher_no
if not (gle.party in self.sales_person_records.get("Customer", []) or \
against_voucher in self.sales_person_records.get("Sales Invoice", [])):
return
voucher_balance = None
if gle.against_voucher: if gle.against_voucher:
# find invoice # find invoice
against_voucher = gle.against_voucher against_voucher = gle.against_voucher
@@ -511,6 +523,22 @@ class ReceivablePayableReport(object):
order by posting_date, party""" order by posting_date, party"""
.format(select_fields, conditions), values, as_dict=True) .format(select_fields, conditions), values, as_dict=True)
def get_sales_invoices_or_customers_based_on_sales_person(self):
if self.filters.get("sales_person"):
lft, rgt = frappe.db.get_value("Sales Person",
self.filters.get("sales_person"), ["lft", "rgt"])
records = frappe.db.sql("""
select distinct parent, parenttype
from `tabSales Team` steam
where parenttype in ('Customer', 'Sales Invoice')
and exists(select name from `tabSales Person` where lft >= %s and rgt <= %s and name = steam.sales_person)
""", (lft, rgt), as_dict=1)
self.sales_person_records = frappe._dict()
for d in records:
self.sales_person_records.setdefault(d.parenttype, set()).add(d.parent)
def prepare_conditions(self): def prepare_conditions(self):
conditions = [""] conditions = [""]
values = [self.party_type, self.filters.report_date] values = [self.party_type, self.filters.report_date]
@@ -561,16 +589,6 @@ class ReceivablePayableReport(object):
conditions.append("party in (select name from tabCustomer where default_sales_partner=%s)") conditions.append("party in (select name from tabCustomer where default_sales_partner=%s)")
values.append(self.filters.get("sales_partner")) values.append(self.filters.get("sales_partner"))
if self.filters.get("sales_person"):
lft, rgt = frappe.db.get_value("Sales Person",
self.filters.get("sales_person"), ["lft", "rgt"])
conditions.append("""exists(select name from `tabSales Team` steam where
steam.sales_person in (select name from `tabSales Person` where lft >= {0} and rgt <= {1})
and ((steam.parent = voucher_no and steam.parenttype = voucher_type)
or (steam.parent = against_voucher and steam.parenttype = against_voucher_type)
or (steam.parent = party and steam.parenttype = 'Customer')))""".format(lft, rgt))
def add_supplier_filters(self, conditions, values): def add_supplier_filters(self, conditions, values):
if self.filters.get("supplier_group"): if self.filters.get("supplier_group"):
conditions.append("""party in (select name from tabSupplier conditions.append("""party in (select name from tabSupplier

View File

@@ -36,7 +36,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
self.filters.report_date) or {} self.filters.report_date) or {}
for party, party_dict in iteritems(self.party_total): for party, party_dict in iteritems(self.party_total):
if party_dict.outstanding <= 0: if party_dict.outstanding == 0:
continue continue
row = frappe._dict() row = frappe._dict()
@@ -135,4 +135,4 @@ class AccountsReceivableSummary(ReceivablePayableReport):
"{range2}-{range3}".format(range2=cint(self.filters["range2"])+ 1, range3=self.filters["range3"]), "{range2}-{range3}".format(range2=cint(self.filters["range2"])+ 1, range3=self.filters["range3"]),
"{range3}-{range4}".format(range3=cint(self.filters["range3"])+ 1, range4=self.filters["range4"]), "{range3}-{range4}".format(range3=cint(self.filters["range3"])+ 1, range4=self.filters["range4"]),
"{range4}-{above}".format(range4=cint(self.filters["range4"])+ 1, above=_("Above"))]): "{range4}-{above}".format(range4=cint(self.filters["range4"])+ 1, above=_("Above"))]):
self.add_column(label=label, fieldname='range' + str(i+1)) self.add_column(label=label, fieldname='range' + str(i+1))

View File

@@ -18,14 +18,17 @@ def execute(filters=None):
return columns, data return columns, data
def get_data(filters, show_party_name): def get_data(filters, show_party_name):
party_name_field = "{0}_name".format(frappe.scrub(filters.get('party_type'))) if filters.get('party_type') in ('Customer', 'Supplier', 'Employee', 'Member'):
party_name_field = "{0}_name".format(frappe.scrub(filters.get('party_type')))
if filters.get('party_type') == 'Student': if filters.get('party_type') == 'Student':
party_name_field = 'first_name' party_name_field = 'first_name'
elif filters.get('party_type') == 'Shareholder': elif filters.get('party_type') == 'Shareholder':
party_name_field = 'title' party_name_field = 'title'
else:
party_name_field = 'name'
party_filters = {"name": filters.get("party")} if filters.get("party") else {} party_filters = {"name": filters.get("party")} if filters.get("party") else {}
parties = frappe.get_all(filters.get("party_type"), fields = ["name", party_name_field], parties = frappe.get_all(filters.get("party_type"), fields = ["name", party_name_field],
filters = party_filters, order_by="name") filters = party_filters, order_by="name")
company_currency = frappe.get_cached_value('Company', filters.company, "default_currency") company_currency = frappe.get_cached_value('Company', filters.company, "default_currency")
opening_balances = get_opening_balances(filters) opening_balances = get_opening_balances(filters)
@@ -70,7 +73,7 @@ def get_data(filters, show_party_name):
# totals # totals
for col in total_row: for col in total_row:
total_row[col] += row.get(col) total_row[col] += row.get(col)
row.update({ row.update({
"currency": company_currency "currency": company_currency
}) })
@@ -78,7 +81,7 @@ def get_data(filters, show_party_name):
has_value = False has_value = False
if (opening_debit or opening_credit or debit or credit or closing_debit or closing_credit): if (opening_debit or opening_credit or debit or credit or closing_debit or closing_credit):
has_value =True has_value =True
if cint(filters.show_zero_values) or has_value: if cint(filters.show_zero_values) or has_value:
data.append(row) data.append(row)
@@ -94,9 +97,9 @@ def get_data(filters, show_party_name):
def get_opening_balances(filters): def get_opening_balances(filters):
gle = frappe.db.sql(""" gle = frappe.db.sql("""
select party, sum(debit) as opening_debit, sum(credit) as opening_credit select party, sum(debit) as opening_debit, sum(credit) as opening_credit
from `tabGL Entry` from `tabGL Entry`
where company=%(company)s where company=%(company)s
and ifnull(party_type, '') = %(party_type)s and ifnull(party, '') != '' and ifnull(party_type, '') = %(party_type)s and ifnull(party, '') != ''
and (posting_date < %(from_date)s or ifnull(is_opening, 'No') = 'Yes') and (posting_date < %(from_date)s or ifnull(is_opening, 'No') = 'Yes')
group by party""", { group by party""", {
@@ -114,11 +117,11 @@ def get_opening_balances(filters):
def get_balances_within_period(filters): def get_balances_within_period(filters):
gle = frappe.db.sql(""" gle = frappe.db.sql("""
select party, sum(debit) as debit, sum(credit) as credit select party, sum(debit) as debit, sum(credit) as credit
from `tabGL Entry` from `tabGL Entry`
where company=%(company)s where company=%(company)s
and ifnull(party_type, '') = %(party_type)s and ifnull(party, '') != '' and ifnull(party_type, '') = %(party_type)s and ifnull(party, '') != ''
and posting_date >= %(from_date)s and posting_date <= %(to_date)s and posting_date >= %(from_date)s and posting_date <= %(to_date)s
and ifnull(is_opening, 'No') = 'No' and ifnull(is_opening, 'No') = 'No'
group by party""", { group by party""", {
"company": filters.company, "company": filters.company,

View File

@@ -375,9 +375,10 @@ class AccountsController(TransactionBase):
return gl_dict return gl_dict
def validate_qty_is_not_zero(self): def validate_qty_is_not_zero(self):
for item in self.items: if self.doctype != "Purchase Receipt":
if not item.qty: for item in self.items:
frappe.throw(_("Item quantity can not be zero")) if not item.qty:
frappe.throw(_("Item quantity can not be zero"))
def validate_account_currency(self, account, account_currency=None): def validate_account_currency(self, account, account_currency=None):
valid_currency = [self.company_currency] valid_currency = [self.company_currency]

View File

@@ -371,6 +371,11 @@ frappe.ui.form.on("Work Order", {
} }
}); });
} }
},
additional_operating_cost: function(frm) {
erpnext.work_order.calculate_cost(frm.doc);
erpnext.work_order.calculate_total_cost(frm);
} }
}); });
@@ -507,8 +512,7 @@ erpnext.work_order = {
}, },
calculate_total_cost: function(frm) { calculate_total_cost: function(frm) {
var variable_cost = frm.doc.actual_operating_cost ? let variable_cost = flt(frm.doc.actual_operating_cost) || flt(frm.doc.planned_operating_cost);
flt(frm.doc.actual_operating_cost) : flt(frm.doc.planned_operating_cost)
frm.set_value("total_operating_cost", (flt(frm.doc.additional_operating_cost) + variable_cost)) frm.set_value("total_operating_cost", (flt(frm.doc.additional_operating_cost) + variable_cost))
}, },

View File

@@ -191,6 +191,9 @@ class Timesheet(Document):
}, as_dict=True) }, as_dict=True)
# check internal overlap # check internal overlap
for time_log in self.time_logs: for time_log in self.time_logs:
if not (time_log.from_time and time_log.to_time
and args.from_time and args.to_time): continue
if (fieldname != 'workstation' or args.get(fieldname) == time_log.get(fieldname)) and \ if (fieldname != 'workstation' or args.get(fieldname) == time_log.get(fieldname)) and \
args.idx != time_log.idx and ((args.from_time > time_log.from_time and args.from_time < time_log.to_time) or args.idx != time_log.idx and ((args.from_time > time_log.from_time and args.from_time < time_log.to_time) or
(args.to_time > time_log.from_time and args.to_time < time_log.to_time) or (args.to_time > time_log.from_time and args.to_time < time_log.to_time) or

View File

@@ -7,7 +7,7 @@ from frappe.utils import flt
def execute(filters=None): def execute(filters=None):
if not filters: filters = {} if not filters: filters = {}
columns = get_columns() columns = get_columns()
iwq_map = get_item_warehouse_quantity_map() iwq_map = get_item_warehouse_quantity_map()
item_map = get_item_details() item_map = get_item_details()
@@ -15,22 +15,23 @@ def execute(filters=None):
for sbom, warehouse in iwq_map.items(): for sbom, warehouse in iwq_map.items():
total = 0 total = 0
total_qty = 0 total_qty = 0
for wh, item_qty in warehouse.items(): for wh, item_qty in warehouse.items():
total += 1 total += 1
row = [sbom, item_map.get(sbom).item_name, item_map.get(sbom).description, if item_map.get(sbom):
item_map.get(sbom).stock_uom, wh] row = [sbom, item_map.get(sbom).item_name, item_map.get(sbom).description,
available_qty = item_qty item_map.get(sbom).stock_uom, wh]
total_qty += flt(available_qty) available_qty = item_qty
row += [available_qty] total_qty += flt(available_qty)
row += [available_qty]
if available_qty:
data.append(row) if available_qty:
if (total == len(warehouse)):
row = ["", "", "Total", "", "", total_qty]
data.append(row) data.append(row)
if (total == len(warehouse)):
row = ["", "", "Total", "", "", total_qty]
data.append(row)
return columns, data return columns, data
def get_columns(): def get_columns():
columns = ["Item Code:Link/Item:100", "Item Name::100", "Description::120", \ columns = ["Item Code:Link/Item:100", "Item Name::100", "Description::120", \
"UOM:Link/UOM:80", "Warehouse:Link/Warehouse:100", "Quantity::100"] "UOM:Link/UOM:80", "Warehouse:Link/Warehouse:100", "Quantity::100"]

View File

@@ -284,7 +284,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
child: item, child: item,
args: { args: {
"batch_no": item.batch_no, "batch_no": item.batch_no,
"stock_qty": item.stock_qty, "stock_qty": item.stock_qty || item.qty, //if stock_qty field is not available, fetch qty (in case of Packed Items table)
"warehouse": item.warehouse, "warehouse": item.warehouse,
"item_code": item.item_code, "item_code": item.item_code,
"has_serial_no": has_serial_no "has_serial_no": has_serial_no

View File

@@ -66,6 +66,7 @@ def place_order():
from erpnext.selling.doctype.quotation.quotation import _make_sales_order from erpnext.selling.doctype.quotation.quotation import _make_sales_order
sales_order = frappe.get_doc(_make_sales_order(quotation.name, ignore_permissions=True)) sales_order = frappe.get_doc(_make_sales_order(quotation.name, ignore_permissions=True))
sales_order.payment_schedule = []
if not cart_settings.allow_items_not_in_stock: if not cart_settings.allow_items_not_in_stock:
for item in sales_order.get("items"): for item in sales_order.get("items"):

View File

@@ -1,5 +1,7 @@
{ {
"allow_copy": 0, "allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0, "allow_import": 0,
"allow_rename": 0, "allow_rename": 0,
"beta": 0, "beta": 0,
@@ -11,10 +13,13 @@
"engine": "InnoDB", "engine": "InnoDB",
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "parent_item", "fieldname": "parent_item",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@@ -39,13 +44,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "item_code", "fieldname": "item_code",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@@ -70,13 +79,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "item_name", "fieldname": "item_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
@@ -100,13 +113,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_5", "fieldname": "column_break_5",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0, "hidden": 0,
@@ -128,13 +145,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Text Editor", "fieldtype": "Text Editor",
"hidden": 0, "hidden": 0,
@@ -159,14 +180,18 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0, "unique": 0,
"width": "300px" "width": "300px"
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "section_break_6", "fieldname": "section_break_6",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@@ -188,13 +213,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "warehouse", "fieldname": "warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@@ -219,13 +248,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "target_warehouse", "fieldname": "target_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@@ -249,13 +282,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_9", "fieldname": "column_break_9",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0, "hidden": 0,
@@ -277,13 +314,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "qty", "fieldname": "qty",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0, "hidden": 0,
@@ -307,13 +348,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "section_break_9", "fieldname": "section_break_9",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@@ -335,13 +380,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "serial_no", "fieldname": "serial_no",
"fieldtype": "Text", "fieldtype": "Text",
"hidden": 0, "hidden": 0,
@@ -363,13 +412,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_11", "fieldname": "column_break_11",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0, "hidden": 0,
@@ -391,13 +444,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "batch_no", "fieldname": "batch_no",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@@ -420,13 +477,51 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"depends_on": "batch_no",
"fetch_if_empty": 0,
"fieldname": "actual_batch_qty",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Actual Batch Quantity",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "section_break_13", "fieldname": "section_break_13",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@@ -448,13 +543,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 1, "allow_on_submit": 1,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "actual_qty", "fieldname": "actual_qty",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0, "hidden": 0,
@@ -478,13 +577,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 1, "allow_on_submit": 1,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "projected_qty", "fieldname": "projected_qty",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0, "hidden": 0,
@@ -508,13 +611,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_16", "fieldname": "column_break_16",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0, "hidden": 0,
@@ -536,13 +643,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "uom", "fieldname": "uom",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@@ -567,13 +678,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 1, "allow_on_submit": 1,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "page_break", "fieldname": "page_break",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "hidden": 0,
@@ -597,13 +712,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "prevdoc_doctype", "fieldname": "prevdoc_doctype",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
@@ -627,13 +746,17 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_if_empty": 0,
"fieldname": "parent_detail_docname", "fieldname": "parent_detail_docname",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1, "hidden": 1,
@@ -657,20 +780,21 @@
"reqd": 0, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"translatable": 0,
"unique": 0 "unique": 0
} }
], ],
"has_web_view": 0,
"hide_heading": 0, "hide_heading": 0,
"hide_toolbar": 0, "hide_toolbar": 0,
"idx": 1, "idx": 1,
"image_view": 0, "image_view": 0,
"in_create": 0, "in_create": 0,
"is_submittable": 0, "is_submittable": 0,
"issingle": 0, "issingle": 0,
"istable": 1, "istable": 1,
"max_attachments": 0, "max_attachments": 0,
"modified": "2017-02-20 13:27:37.569945", "modified": "2019-11-27 11:18:18.598759",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Packed Item", "name": "Packed Item",
@@ -681,5 +805,6 @@
"read_only_onload": 0, "read_only_onload": 0,
"show_name_in_global_search": 0, "show_name_in_global_search": 0,
"track_changes": 1, "track_changes": 1,
"track_seen": 0 "track_seen": 0,
"track_views": 0
} }

View File

@@ -65,7 +65,7 @@ def update_packing_list_item(doc, packing_item_code, qty, main_item_row, descrip
pi.actual_qty = flt(bin.get("actual_qty")) pi.actual_qty = flt(bin.get("actual_qty"))
pi.projected_qty = flt(bin.get("projected_qty")) pi.projected_qty = flt(bin.get("projected_qty"))
if old_packed_items_map: if old_packed_items_map and old_packed_items_map.get((packing_item_code, main_item_row.item_code)):
pi.batch_no = old_packed_items_map.get((packing_item_code, main_item_row.item_code))[0].batch_no pi.batch_no = old_packed_items_map.get((packing_item_code, main_item_row.item_code))[0].batch_no
pi.serial_no = old_packed_items_map.get((packing_item_code, main_item_row.item_code))[0].serial_no pi.serial_no = old_packed_items_map.get((packing_item_code, main_item_row.item_code))[0].serial_no
pi.warehouse = old_packed_items_map.get((packing_item_code, main_item_row.item_code))[0].warehouse pi.warehouse = old_packed_items_map.get((packing_item_code, main_item_row.item_code))[0].warehouse

View File

@@ -261,7 +261,7 @@ def validate_filters(filters):
if not (filters.get("item_code") or filters.get("warehouse")): if not (filters.get("item_code") or filters.get("warehouse")):
sle_count = flt(frappe.db.sql("""select count(name) from `tabStock Ledger Entry`""")[0][0]) sle_count = flt(frappe.db.sql("""select count(name) from `tabStock Ledger Entry`""")[0][0])
if sle_count > 500000: if sle_count > 500000:
frappe.throw(_("Please set filter based on Item or Warehouse")) frappe.throw(_("Please set filter based on Item or Warehouse due to a large amount of entries."))
def get_variants_attributes(): def get_variants_attributes():
'''Return all item variant attributes.''' '''Return all item variant attributes.'''