removed duplicate function from sales invoice

This commit is contained in:
Nabin Hait 2012-09-18 13:37:27 +05:30
parent 214d62a09a
commit 9a90c89b3f
13 changed files with 12 additions and 43 deletions

View File

@ -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

View File

@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
import webnotes
def execute():
web_cache_perms()

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
def execute():
import webnotes
from webnotes.model.doc import addchild

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
def execute():
from webnotes.model.doc import Document
perms = []

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
def execute():
import webnotes
from webnotes.modules import reload_doc

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
def execute():
import webnotes
from webnotes.model.doc import addchild

View File

@ -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",

View File

@ -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():

View File

@ -0,0 +1 @@
from __future__ import unicode_literals