commit
151834d746
@ -1620,8 +1620,16 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
|||||||
var me = this;
|
var me = this;
|
||||||
var invoice_data = {};
|
var invoice_data = {};
|
||||||
this.si_docs = this.get_doc_from_localstorage();
|
this.si_docs = this.get_doc_from_localstorage();
|
||||||
|
|
||||||
if (this.frm.doc.offline_pos_name) {
|
if (this.frm.doc.offline_pos_name) {
|
||||||
this.update_invoice();
|
this.update_invoice()
|
||||||
|
//to retrieve and set the default payment
|
||||||
|
invoice_data[this.frm.doc.offline_pos_name] = this.frm.doc;
|
||||||
|
invoice_data[this.frm.doc.offline_pos_name].payments[0].amount = this.frm.doc.net_total
|
||||||
|
invoice_data[this.frm.doc.offline_pos_name].payments[0].base_amount = this.frm.doc.net_total
|
||||||
|
|
||||||
|
this.frm.doc.paid_amount = this.frm.doc.net_total
|
||||||
|
this.frm.doc.outstanding_amount = 0
|
||||||
} else {
|
} else {
|
||||||
this.frm.doc.offline_pos_name = $.now();
|
this.frm.doc.offline_pos_name = $.now();
|
||||||
this.frm.doc.posting_date = frappe.datetime.get_today();
|
this.frm.doc.posting_date = frappe.datetime.get_today();
|
||||||
|
|||||||
@ -51,8 +51,8 @@ def validate_filters(filters):
|
|||||||
filters.to_date = filters.year_end_date
|
filters.to_date = filters.year_end_date
|
||||||
|
|
||||||
def get_data(filters):
|
def get_data(filters):
|
||||||
accounts = frappe.db.sql("""select name, parent_account, account_name, root_type, report_type, lft, rgt
|
accounts = frappe.db.sql("""select name, parent_account, account_name, account_number, root_type, report_type, lft, rgt
|
||||||
from `tabAccount` where company=%s order by lft""", filters.company, as_dict=True)
|
from `tabAccount` where company=%s order by account_name, lft""", filters.company, as_dict=True)
|
||||||
company_currency = erpnext.get_company_currency(filters.company)
|
company_currency = erpnext.get_company_currency(filters.company)
|
||||||
|
|
||||||
if not accounts:
|
if not accounts:
|
||||||
@ -175,6 +175,9 @@ def accumulate_values_into_parents(accounts, accounts_by_name):
|
|||||||
|
|
||||||
def prepare_data(accounts, filters, total_row, parent_children_map, company_currency):
|
def prepare_data(accounts, filters, total_row, parent_children_map, company_currency):
|
||||||
data = []
|
data = []
|
||||||
|
tmpaccnt = sorted(accounts)
|
||||||
|
if not (accounts[0].account_number is None):
|
||||||
|
accounts = tmpaccnt
|
||||||
|
|
||||||
for d in accounts:
|
for d in accounts:
|
||||||
has_value = False
|
has_value = False
|
||||||
|
|||||||
@ -27,8 +27,14 @@ erpnext.payments = erpnext.stock.StockController.extend({
|
|||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
this.dialog.set_primary_action(__("Submit"), function() {
|
this.dialog.set_primary_action(__("Submit"), function() {
|
||||||
me.dialog.hide()
|
// Allow no ZERO payment
|
||||||
me.submit_invoice()
|
$.each(me.frm.doc.payments, function (index, data) {
|
||||||
|
if (data.amount != 0) {
|
||||||
|
me.dialog.hide();
|
||||||
|
me.submit_invoice();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user