This commit is contained in:
pawan
2018-03-21 09:19:36 +05:30
parent ce08aabc84
commit 53a4d2c430
3 changed files with 26 additions and 3 deletions

View File

@@ -1445,6 +1445,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.set_taxes();
this.calculate_outstanding_amount(update_paid_amount);
this.set_totals();
this.update_total_qty();
},
get_company_currency: function () {
@@ -1515,6 +1516,18 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.wrapper.find('input.discount-amount').val(this.frm.doc.discount_amount);
},
update_total_qty: function() {
var me = this;
var qty_total = 0;
$.each(this.frm.doc["items"] || [], function (i, d) {
if (d.item_code) {
qty_total += d.qty;
}
});
this.frm.doc.qty_total = qty_total;
this.wrapper.find('.qty-total').text(this.frm.doc.qty_total);
},
set_primary_action: function () {
var me = this;
this.page.set_primary_action(__("New Cart"), function () {
@@ -1637,7 +1650,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
var me = this;
var invoice_data = {};
this.si_docs = this.get_doc_from_localstorage();
if (this.frm.doc.offline_pos_name) {
this.update_invoice()
//to retrieve and set the default payment
@@ -1651,6 +1664,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.frm.doc.offline_pos_name = $.now();
this.frm.doc.posting_date = frappe.datetime.get_today();
this.frm.doc.posting_time = frappe.datetime.now_time();
this.frm.doc.pos_total_qty = this.frm.doc.qty_total;
this.frm.doc.pos_profile = this.pos_profile_data['name'];
invoice_data[this.frm.doc.offline_pos_name] = this.frm.doc;
this.si_docs.push(invoice_data);