Compare commits

...

13 Commits

Author SHA1 Message Date
Saurabh
7cf945c975 Merge branch 'hotfix' 2017-11-22 17:54:18 +05:30
Saurabh
4bc12b68e4 bumped to version 9.2.16 2017-11-22 18:24:18 +06:00
rohitwaghchaure
4dc5f0efaf [Fix] Item details not fetching if item has no default bom (#11688) 2017-11-22 15:21:47 +05:30
Nabin Hait
96abfd2ab9 [fix] In payment entry, run some events serially to avoid async issue 2017-11-22 15:13:16 +05:30
Makarand Bauskar
75443a94ee [minor] set the pos profile name while creating demo (#11664) 2017-11-21 16:12:40 +05:30
Nabin Hait
cc884578b5 Update sales_order.py 2017-11-21 12:24:03 +05:30
rohitwaghchaure
179e0c1d8d Added party name in accounts receivable/payable report (#11656) 2017-11-20 11:18:55 +05:30
rohitwaghchaure
34d6340be6 Merge pull request #11647 from rohitwaghchaure/pos_selling_price_issue
[fix] Price list not loaded from pos profile, auto set outstanding amount in the mode of payment
2017-11-18 21:33:32 +05:30
Rohit Waghchaure
77940493a8 [fix] Price list not loaded from pos profile, auto set outstanding amount in the mode of payment 2017-11-18 19:06:31 +05:30
Saurabh
a5b53e9480 Merge branch 'hotfix' 2017-11-17 14:55:23 +05:30
Saurabh
f773af6053 bumped to version 9.2.15 2017-11-17 15:25:23 +06:00
Saurabh
119a50e228 Merge pull request #11630 from saurabh6790/domain_settings_fix
[fix] set default language in local
2017-11-17 14:54:38 +05:30
Saurabh
11ec2c50e0 [fix] set default language in local 2017-11-17 14:51:08 +05:30
11 changed files with 98 additions and 61 deletions

View File

@@ -4,7 +4,7 @@ import inspect
import frappe
from erpnext.hooks import regional_overrides
__version__ = '9.2.14'
__version__ = '9.2.16'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -253,20 +253,24 @@ frappe.ui.form.on('Payment Entry', {
},
callback: function(r, rt) {
if(r.message) {
if(frm.doc.payment_type == "Receive") {
frm.set_value("paid_from", r.message.party_account);
frm.set_value("paid_from_account_currency", r.message.party_account_currency);
frm.set_value("paid_from_account_balance", r.message.account_balance);
} else if (frm.doc.payment_type == "Pay"){
frm.set_value("paid_to", r.message.party_account);
frm.set_value("paid_to_account_currency", r.message.party_account_currency);
frm.set_value("paid_to_account_balance", r.message.account_balance);
}
frm.set_value("party_balance", r.message.party_balance);
frm.events.get_outstanding_documents(frm);
frm.events.hide_unhide_fields(frm);
frm.events.set_dynamic_labels(frm);
frm.set_party_account_based_on_party = false;
frappe.run_serially([
() => {
if(frm.doc.payment_type == "Receive") {
frm.set_value("paid_from", r.message.party_account);
frm.set_value("paid_from_account_currency", r.message.party_account_currency);
frm.set_value("paid_from_account_balance", r.message.account_balance);
} else if (frm.doc.payment_type == "Pay"){
frm.set_value("paid_to", r.message.party_account);
frm.set_value("paid_to_account_currency", r.message.party_account_currency);
frm.set_value("paid_to_account_balance", r.message.account_balance);
}
},
() => frm.set_value("party_balance", r.message.party_balance),
() => frm.events.get_outstanding_documents(frm),
() => frm.events.hide_unhide_fields(frm),
() => frm.events.set_dynamic_labels(frm),
() => { frm.set_party_account_based_on_party = false; }
]);
}
}
});

View File

@@ -24,11 +24,11 @@ frappe.ui.form.on("POS Profile", "onload", function(frm) {
frappe.ui.form.on('POS Profile', {
setup: function(frm) {
frm.set_query("online_print_format", function() {
frm.set_query("print_format_for_online", function() {
return {
filters: [
['Print Format', 'doc_type', '=', 'Sales Invoice'],
['Print Format', 'print_format_type', '!=', 'Js'],
['Print Format', 'print_format_type', '=', 'Server'],
]
};
});

View File

@@ -247,7 +247,7 @@ class SalesInvoice(SellingController):
super(SalesInvoice, self).set_missing_values(for_validate)
if pos:
return {"print_format": pos.get("print_format") }
return {"print_format": pos.get("print_format_for_online") }
def update_time_sheet(self, sales_invoice):
for d in self.timesheets:

View File

@@ -36,8 +36,14 @@
<br>{%= data[i][__("Voucher No")] %}</td>
<td>
{% if(!(filters.customer || filters.supplier)) { %}
{%= data[i][__("Customer Name")] || data[i][__("Customer")] || data[i][__("Supplier Name")] || data[i][__("Supplier")] %}<br>{%= __("Remarks") %}:
{%= data[i][__("Customer")] || data[i][__("Supplier")] %}
{% if(data[i][__("Customer Name")] && data[i][__("Customer Name")] != data[i][__("Customer")]) { %}
<br> {%= data[i][__("Customer Name")] %}
{% } else if(data[i][__("Supplier Name")] != data[i][__("Supplier")]) { %}
<br> {%= data[i][__("Supplier Name")] %}
{% } %}
{% } %}
<br>{%= __("Remarks") %}:
{%= data[i][__("Remarks")] %}
</td>
<td style="text-align: right">
@@ -66,8 +72,13 @@
<td>
{% if(!(filters.customer || filters.supplier)) { %}
{%= data[i][__("Customer")] || data[i][__("Supplier")] %}
<br>{%= __("Remarks") %}:
{% if(data[i][__("Customer Name")] && data[i][__("Customer Name")] != data[i][__("Customer")]) { %}
<br> {%= data[i][__("Customer Name")] %}
{% } else if(data[i][__("Supplier Name")] != data[i][__("Supplier")]) { %}
<br> {%= data[i][__("Supplier Name")] %}
{% } %}
{% } %}
<br>{%= __("Remarks") %}:
{%= data[i][__("Remarks")] %}
</td>
{% } else { %}

View File

@@ -171,7 +171,7 @@ class BuyingController(StockController):
for item in self.get("items"):
if self.doctype in ["Purchase Receipt", "Purchase Invoice"]:
item.rm_supp_cost = 0.0
if item.item_code in self.sub_contracted_items:
if item.bom and item.item_code in self.sub_contracted_items:
self.update_raw_materials_supplied(item, raw_material_table)
if [item.item_code, item.name] not in parent_items:

View File

@@ -348,8 +348,10 @@ def setup_budget():
budget.action_if_annual_budget_exceeded = "Warn"
expense_ledger_count = frappe.db.count("Account", {"is_group": "0", "root_type": "Expense"})
add_random_children(budget, "accounts", rows=random.randint(10, expense_ledger_count), randomize = { "account": ("Account", {"is_group": "0", "root_type": "Expense"})
}, unique="account")
add_random_children(budget, "accounts", rows=random.randint(10, expense_ledger_count),
randomize = {
"account": ("Account", {"is_group": "0", "root_type": "Expense"})
}, unique="account")
for d in budget.accounts:
d.budget_amount = random.randint(5, 100) * 10000
@@ -361,6 +363,7 @@ def setup_pos_profile():
company_abbr = frappe.db.get_value("Company", erpnext.get_default_company(), "abbr")
pos = frappe.new_doc('POS Profile')
pos.user = frappe.db.get_global('demo_accounts_user')
pos.pos_profile_name = "Demo POS Profile"
pos.naming_series = 'SINV-'
pos.update_stock = 0
pos.write_off_account = 'Cost of Goods Sold - '+ company_abbr

View File

@@ -4,7 +4,9 @@ from frappe import _
def execute():
language = frappe.get_single("System Settings").language
if language.startswith('en'): return
if language and language.startswith('en'): return
frappe.local.lang = language
all_domains = frappe.get_hooks("domains")
@@ -16,11 +18,14 @@ def execute():
domain_settings = frappe.get_single("Domain Settings")
active_domains = [d.domain for d in domain_settings.active_domains]
for domain in active_domains:
domain = frappe.get_doc("Domain", domain)
domain.setup_domain()
try:
for domain in active_domains:
domain = frappe.get_doc("Domain", domain)
domain.setup_domain()
if int(frappe.db.get_single_value('System Settings', 'setup_complete')):
domain.setup_sidebar_items()
domain.setup_desktop_icons()
domain.set_default_portal_role()
if int(frappe.db.get_single_value('System Settings', 'setup_complete')):
domain.setup_sidebar_items()
domain.setup_desktop_icons()
domain.set_default_portal_role()
except frappe.LinkValidationError:
pass

View File

@@ -103,7 +103,7 @@ class SalesOrder(SellingController):
def validate_delivery_date(self):
if self.order_type == 'Sales':
if not self.delivery_date:
self.delivery_date = max([d.delivery_date for d in self.get("items")])
self.delivery_date = max([d.delivery_date for d in self.get("items") if d.delivery_date])
if self.delivery_date:
for d in self.get("items"):

View File

@@ -53,8 +53,6 @@ erpnext.pos.PointOfSale = class PointOfSale {
() => this.setup_pos_profile(),
() => this.make_new_invoice(),
() => {
frappe.timeout(1);
this.make_items();
this.bind_events();
frappe.dom.unfreeze();
},
@@ -323,16 +321,20 @@ erpnext.pos.PointOfSale = class PointOfSale {
make_new_invoice() {
return frappe.run_serially([
() => this.make_sales_invoice_frm(),
() => {
if (this.cart) {
this.cart.frm = this.frm;
this.cart.reset();
} else {
this.make_cart();
}
this.toggle_editing(true);
}
this.make_sales_invoice_frm()
.then(() => this.set_pos_profile_data())
.then(() => {
if (this.cart) {
this.cart.frm = this.frm;
this.cart.reset();
} else {
this.make_items();
this.make_cart();
}
this.toggle_editing(true);
})
},
]);
}
@@ -359,12 +361,29 @@ erpnext.pos.PointOfSale = class PointOfSale {
if(!frm.doc.company) {
frm.set_value('company', pos_profile.company);
}
frm.set_value('is_pos', 1);
frm.meta.default_print_format = 'POS Invoice';
frm.doc.is_pos = 1;
return frm;
}
}
set_pos_profile_data() {
return new Promise(resolve => {
return this.frm.call({
doc: this.frm.doc,
method: "set_missing_values",
}).then((r) => {
if(!r.exc) {
this.frm.script_manager.trigger("update_stock");
frappe.model.set_default_values(this.frm.doc);
this.frm.cscript.calculate_taxes_and_totals();
this.frm.meta.default_print_format = r.message.print_format || 'POS Invoice';
}
resolve();
})
})
}
prepare_menu() {
var me = this;
this.page.clear_menu();
@@ -392,9 +411,6 @@ erpnext.pos.PointOfSale = class PointOfSale {
if(this.frm.doc.docstatus !== 1) return;
this.page.set_secondary_action(__("Print"), () => {
if (this.pos_profile && this.pos_profile.print_format_for_online) {
this.frm.meta.default_print_format = this.pos_profile.print_format_for_online;
}
this.frm.print_preview.printit(true);
});
@@ -1264,6 +1280,16 @@ class Payment {
$(this.dialog.body).find('.input-with-feedback').focusin(function() {
me.numpad.reset_value();
me.fieldname = $(this).prop('dataset').fieldname;
if (me.frm.doc.outstanding_amount > 0 &&
!in_list(['write_off_amount', 'change_amount'], me.fieldname)) {
me.frm.doc.payments.forEach((data) => {
if (data.mode_of_payment == me.fieldname && !data.amount) {
me.dialog.set_value(me.fieldname,
me.frm.doc.outstanding_amount / me.frm.doc.conversion_rate);
return;
}
})
}
});
}
@@ -1403,4 +1429,4 @@ class Payment {
this.dialog.set_value("paid_amount", this.frm.doc.paid_amount);
this.dialog.set_value("outstanding_amount", this.frm.doc.outstanding_amount);
}
}
}

View File

@@ -96,16 +96,6 @@ def get_item_details(args):
return out
# print(frappe._dict({
# 'has_serial_no' : out.has_serial_no,
# 'has_batch_no' : out.has_batch_no
# }))
# return frappe._dict({
# 'has_serial_no' : out.has_serial_no,
# 'has_batch_no' : out.has_batch_no
# })
def process_args(args):
if isinstance(args, basestring):
args = json.loads(args)
@@ -532,8 +522,6 @@ def get_default_bom(item_code=None):
bom = frappe.db.get_value("BOM", {"docstatus": 1, "is_default": 1, "is_active": 1, "item": item_code})
if bom:
return bom
else:
frappe.throw(_("No default BOM exists for Item {0}").format(item_code))
def get_valuation_rate(item_code, warehouse=None):
item = frappe.get_doc("Item", item_code)