purchase tax mapping while pulling
This commit is contained in:
parent
1c48c59898
commit
f092b8c21e
@ -169,13 +169,12 @@ cur_frm.cscript['Recalculate'] = function(doc, dt, dn) {
|
|||||||
// -----------------
|
// -----------------
|
||||||
cur_frm.cscript['Get Items'] = function(doc, dt, dn) {
|
cur_frm.cscript['Get Items'] = function(doc, dt, dn) {
|
||||||
var callback = function(r,rt) {
|
var callback = function(r,rt) {
|
||||||
unhide_field(['supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email']);
|
unhide_field(['supplier_address', 'contact_person', 'supplier_name', 'address_display', 'contact_display', 'contact_mobile','contact_email']);
|
||||||
refresh_many(['credit_to','supplier','supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email','entries','purchase_receipt_main','purchase_order_main']);
|
refresh_many(['credit_to','supplier','supplier_address','contact_person','supplier_name', 'address_display', 'contact_display','contact_mobile', 'contact_email','entries', 'purchase_receipt_main', 'purchase_order_main', 'purchase_tax_details']);
|
||||||
}
|
}
|
||||||
get_server_fields('pull_details','','',doc, dt, dn,1,callback);
|
$c_obj(make_doclist(dt,dn),'pull_details','',callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ========== PV Details Table ============
|
// ========== PV Details Table ============
|
||||||
|
|
||||||
// Item Code
|
// Item Code
|
||||||
|
@ -72,25 +72,19 @@ class DocType(TransactionBase):
|
|||||||
ret['cost_center'] = cost_center and cost_center[0][0] or ''
|
ret['cost_center'] = cost_center and cost_center[0][0] or ''
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
# Get Items based on PO or PR
|
# Get Items based on PO or PR
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
def pull_details(self):
|
def pull_details(self):
|
||||||
if self.doc.purchase_receipt_main:
|
if self.doc.purchase_receipt_main:
|
||||||
self.validate_duplicate_docname('purchase_receipt')
|
self.validate_duplicate_docname('purchase_receipt')
|
||||||
self.doclist = get_obj('DocType Mapper', 'Purchase Receipt-Payable Voucher').dt_map('Purchase Receipt', 'Payable Voucher', self.doc.purchase_receipt_main, self.doc, self.doclist, "[['Purchase Receipt', 'Payable Voucher'],['Purchase Receipt Detail', 'PV Detail']]")
|
self.doclist = get_obj('DocType Mapper', 'Purchase Receipt-Payable Voucher').dt_map('Purchase Receipt', 'Payable Voucher', self.doc.purchase_receipt_main, self.doc, self.doclist, "[['Purchase Receipt', 'Payable Voucher'], ['Purchase Receipt Detail', 'PV Detail'], ['Purchase Tax Detail','Purchase Tax Detail']]")
|
||||||
|
|
||||||
elif self.doc.purchase_order_main:
|
elif self.doc.purchase_order_main:
|
||||||
self.validate_duplicate_docname('purchase_order')
|
self.validate_duplicate_docname('purchase_order')
|
||||||
self.doclist = get_obj('DocType Mapper', 'Purchase Order-Payable Voucher').dt_map('Purchase Order', 'Payable Voucher', self.doc.purchase_order_main, self.doc, self.doclist, "[['Purchase Order', 'Payable Voucher'],['PO Detail', 'PV Detail']]")
|
self.doclist = get_obj('DocType Mapper', 'Purchase Order-Payable Voucher').dt_map('Purchase Order', 'Payable Voucher', self.doc.purchase_order_main, self.doc, self.doclist, "[['Purchase Order', 'Payable Voucher'],['PO Detail', 'PV Detail'], ['Purchase Tax Detail','Purchase Tax Detail']]")
|
||||||
|
|
||||||
ret = self.get_credit_to()
|
ret = self.get_credit_to()
|
||||||
#self.doc.supplier_name = ret['supplier_name']
|
|
||||||
#self.doc.supplier_address = ret['supplier_address']
|
|
||||||
|
|
||||||
#self.doc.cst_no =ret['cst_no']
|
|
||||||
#self.doc.bst_no = ret['bst_no']
|
|
||||||
#self.doc.vat_tin_no = ret['vat_tin_no']
|
|
||||||
|
|
||||||
if ret.has_key('credit_to'):
|
if ret.has_key('credit_to'):
|
||||||
self.doc.credit_to = ret['credit_to']
|
self.doc.credit_to = ret['credit_to']
|
||||||
|
@ -78,17 +78,19 @@ cur_frm.fields_dict.contact_person.on_new = function(dn) {
|
|||||||
locals['Contact'][dn].supplier_name = locals[cur_frm.doctype][cur_frm.docname].supplier_name;
|
locals['Contact'][dn].supplier_name = locals[cur_frm.doctype][cur_frm.docname].supplier_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get Purchase Order Button
|
// Get Purchase Order Button
|
||||||
// -----------------
|
// -----------------
|
||||||
cur_frm.cscript['Pull Purchase Order Details'] = function(doc, dt, dn) {
|
cur_frm.cscript['Pull Purchase Order Details'] = function(doc, dt, dn) {
|
||||||
var callback = function(r,rt) {
|
var callback = function(r,rt) {
|
||||||
unhide_field(['supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email']);
|
unhide_field(['supplier_address','contact_person','supplier_name','address_display', 'contact_display', 'contact_mobile','contact_email']);
|
||||||
refresh_many(['supplier','supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email','purchase_receipt_details']);
|
refresh_many(['supplier','supplier_address','contact_person', 'supplier_name', 'address_display', 'contact_display','contact_mobile', 'contact_email', 'purchase_receipt_details', 'purchase_tax_details']);
|
||||||
}
|
}
|
||||||
get_server_fields('get_po_details','','',doc, dt, dn,1,callback);
|
$c_obj(make_doclist(dt,dn),'get_po_details','',callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//================ create new contact ============================================================================
|
//================ create new contact ============================================================================
|
||||||
cur_frm.cscript.new_contact = function(){
|
cur_frm.cscript.new_contact = function(){
|
||||||
tn = createLocal('Contact');
|
tn = createLocal('Contact');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user