mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
[fix] #13352
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user