removed duplicate function from sales invoice
This commit is contained in:
parent
214d62a09a
commit
9a90c89b3f
@ -636,49 +636,6 @@ class DocType(TransactionBase):
|
||||
|
||||
self.make_gl_entries(is_cancel=1)
|
||||
|
||||
# Get Warehouse
|
||||
def get_warehouse(self):
|
||||
w = webnotes.conn.sql("select warehouse from `tabPOS Setting` where ifnull(user,'') = '%s' and company = '%s'" % (session['user'], self.doc.company))
|
||||
w = w and w[0][0] or ''
|
||||
if not w:
|
||||
ps = webnotes.conn.sql("select name, warehouse from `tabPOS Setting` where ifnull(user,'') = '' and company = '%s'" % self.doc.company)
|
||||
if not ps:
|
||||
msgprint("To make POS entry, please create POS Setting from Setup --> Accounts --> POS Setting and refresh the system.")
|
||||
raise Exception
|
||||
elif not ps[0][1]:
|
||||
msgprint("Please enter warehouse in POS Setting")
|
||||
else:
|
||||
w = ps[0][1]
|
||||
return w
|
||||
|
||||
# on update
|
||||
def on_update(self):
|
||||
# Set default warehouse from pos setting
|
||||
#----------------------------------------
|
||||
if cint(self.doc.is_pos) == 1:
|
||||
self.set_actual_qty()
|
||||
w = self.get_warehouse()
|
||||
if w:
|
||||
for d in getlist(self.doclist, 'entries'):
|
||||
if not d.warehouse:
|
||||
d.warehouse = cstr(w)
|
||||
|
||||
if flt(self.doc.paid_amount) == 0:
|
||||
if self.doc.cash_bank_account:
|
||||
webnotes.conn.set(self.doc, 'paid_amount',
|
||||
(flt(self.doc.grand_total) - flt(self.doc.write_off_amount)))
|
||||
else:
|
||||
# show message that the amount is not paid
|
||||
webnotes.conn.set(self.doc,'paid_amount',0)
|
||||
webnotes.msgprint("Note: Payment Entry not created since 'Cash/Bank Account' was not specified.")
|
||||
|
||||
else:
|
||||
webnotes.conn.set(self.doc,'paid_amount',0)
|
||||
|
||||
webnotes.conn.set(self.doc,'outstanding_amount',flt(self.doc.grand_total) - flt(self.doc.total_advance) - flt(self.doc.paid_amount) - flt(self.doc.write_off_amount))
|
||||
|
||||
#-------------------------------------------------------------------------------------
|
||||
|
||||
def set_default_recurring_values(self):
|
||||
from webnotes.utils import cstr
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
@ -1,3 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
def execute():
|
||||
web_cache_perms()
|
||||
|
@ -1,3 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.model.doc import addchild
|
||||
|
@ -1,3 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
from webnotes.model.doc import Document
|
||||
perms = []
|
||||
|
@ -1,3 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
|
@ -1,3 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.model.doc import addchild
|
||||
|
@ -14,6 +14,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
data_map = {
|
||||
"Account": {
|
||||
"columns": ["name", "parent_account", "lft", "rgt", "debit_or_credit", "is_pl_account",
|
||||
|
@ -14,6 +14,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def get_unread_messages():
|
||||
|
@ -0,0 +1 @@
|
||||
from __future__ import unicode_literals
|
Loading…
x
Reference in New Issue
Block a user