form_16a party address pull fix
This commit is contained in:
parent
8491384946
commit
402ebab7df
@ -44,11 +44,19 @@ class DocType(TransactionBase):
|
||||
# Get party details
|
||||
#------------------
|
||||
def get_party_det(self):
|
||||
party_det=sql("Select pan_number, address from `tabAccount` where name = '%s'" % self.doc.party_name)
|
||||
party_det=sql("select master_type, master_name, pan_number from `tabAccount` where name='%s'" % self.doc.party_name)
|
||||
if party_det and party_det[0][0]=='Supplier':
|
||||
try:
|
||||
rec = sql("select name, address_line1, address_line2, city, country, pincode, state from `tabAddress` where supplier = '%s' and docstatus != 2 order by is_primary_address desc limit 1" %(party_det[0][1]), as_dict = 1)
|
||||
address_display = cstr((rec[0]['address_line1'] and rec[0]['address_line1'] or '')) + cstr((rec[0]['address_line2'] and '\n' + rec[0]['address_line2'] or '')) + cstr((rec[0]['city'] and '\n'+rec[0]['city'] or '')) + cstr((rec[0]['pincode'] and '\n' + rec[0]['pincode'] or '')) + cstr((rec[0]['state'] and '\n'+rec[0]['state'] or '')) + cstr((rec[0]['country'] and '\n'+rec[0]['country'] or ''))
|
||||
except:
|
||||
address_display = ''
|
||||
|
||||
ret = {
|
||||
'pan_number': cstr(party_det[0][0]) ,
|
||||
'party_address': cstr(party_det[0][1])
|
||||
'pan_number': cstr(party_det[0][2]) ,
|
||||
'party_address': cstr(address_display)
|
||||
}
|
||||
|
||||
return cstr(ret)
|
||||
|
||||
# Get TDS Return acknowledgement
|
||||
|
Loading…
x
Reference in New Issue
Block a user