rearranged fields in journal entry and journal entry type
This commit is contained in:
		
							parent
							
								
									8aa8457a2d
								
							
						
					
					
						commit
						8dbc4e648b
					
				| @ -123,9 +123,9 @@ frappe.ui.form.on("Journal Entry", { | ||||
| 
 | ||||
| 	voucher_type: function(frm){ | ||||
| 
 | ||||
| 		if(!frm.doc.company) return; | ||||
| 		 | ||||
| 		if((!(frm.doc.accounts || []).length) || ((frm.doc.accounts || []).length==1 && !frm.doc.accounts[0].account)) { | ||||
| 		if(!frm.doc.company) return null; | ||||
| 
 | ||||
| 		if((!(frm.doc.accounts || []).length) || ((frm.doc.accounts || []).length === 1 && !frm.doc.accounts[0].account)) { | ||||
| 			if(in_list(["Bank Entry", "Cash Entry"], frm.doc.voucher_type)) { | ||||
| 				return frappe.call({ | ||||
| 					type: "GET", | ||||
| @ -143,7 +143,7 @@ frappe.ui.form.on("Journal Entry", { | ||||
| 							} | ||||
| 						} | ||||
| 					} | ||||
| 				}) | ||||
| 				}); | ||||
| 			}  | ||||
| 			else if(frm.doc.voucher_type=="Opening Entry") { | ||||
| 				return frappe.call({ | ||||
| @ -157,9 +157,9 @@ frappe.ui.form.on("Journal Entry", { | ||||
| 						if(r.message) { | ||||
| 							update_jv_details(frm.doc, r.message); | ||||
| 						} | ||||
| 						cur_frm.set_value("is_opening", "Yes") | ||||
| 						cur_frm.set_value("is_opening", "Yes"); | ||||
| 					} | ||||
| 				}) | ||||
| 				}); | ||||
| 			} | ||||
| 		} | ||||
| 	}, | ||||
| @ -176,10 +176,7 @@ frappe.ui.form.on("Journal Entry", { | ||||
| 						"is_opening": doc.is_opening | ||||
| 					}) | ||||
| 					update_jv_details(frm.doc, doc.accounts); | ||||
| 				}) | ||||
| 				.catch((err)=>{ | ||||
| 					console.log(err); | ||||
| 				})	 | ||||
| 				}); | ||||
| 		} | ||||
| 	} | ||||
| }); | ||||
|  | ||||
| @ -11,11 +11,11 @@ | ||||
|   "title", | ||||
|   "voucher_type", | ||||
|   "naming_series", | ||||
|   "from_template", | ||||
|   "column_break1", | ||||
|   "posting_date", | ||||
|   "company", | ||||
|   "finance_book", | ||||
|   "column_break1", | ||||
|   "from_template", | ||||
|   "company", | ||||
|   "posting_date", | ||||
|   "2_add_edit_gl_entries", | ||||
|   "accounts", | ||||
|   "section_break99", | ||||
| @ -503,7 +503,7 @@ | ||||
|  "idx": 176, | ||||
|  "is_submittable": 1, | ||||
|  "links": [], | ||||
|  "modified": "2020-04-26 13:04:05.230155", | ||||
|  "modified": "2020-04-29 10:55:28.240916", | ||||
|  "modified_by": "Administrator", | ||||
|  "module": "Accounts", | ||||
|  "name": "Journal Entry", | ||||
|  | ||||
| @ -33,7 +33,7 @@ frappe.ui.form.on("Journal Entry Template", { | ||||
| 		} | ||||
| 	 | ||||
| 		if(!frm.doc.company) return; | ||||
| 	 | ||||
| 
 | ||||
| 		frm.trigger("clear_child"); | ||||
| 		switch(frm.doc.voucher_type){ | ||||
| 			case "Opening Entry": | ||||
| @ -49,7 +49,7 @@ frappe.ui.form.on("Journal Entry Template", { | ||||
| 							add_accounts(frm.doc, r.message); | ||||
| 						} | ||||
| 					} | ||||
| 				}) | ||||
| 				}); | ||||
| 				break; | ||||
| 			case "Bank Entry": | ||||
| 			case "Cash Entry": | ||||
|  | ||||
| @ -9,11 +9,10 @@ | ||||
|  "field_order": [ | ||||
|   "section_break_1", | ||||
|   "template_title", | ||||
|   "section_break_2", | ||||
|   "company", | ||||
|   "voucher_type", | ||||
|   "column_break_3", | ||||
|   "naming_series", | ||||
|   "column_break_3", | ||||
|   "company", | ||||
|   "is_opening", | ||||
|   "section_break_3", | ||||
|   "accounts" | ||||
| @ -52,10 +51,6 @@ | ||||
|    "label": "Is Opening", | ||||
|    "options": "No\nYes" | ||||
|   }, | ||||
|   { | ||||
|    "fieldname": "section_break_2", | ||||
|    "fieldtype": "Section Break" | ||||
|   }, | ||||
|   { | ||||
|    "fieldname": "accounts", | ||||
|    "fieldtype": "Table", | ||||
| @ -84,7 +79,7 @@ | ||||
|   } | ||||
|  ], | ||||
|  "links": [], | ||||
|  "modified": "2020-04-26 04:29:03.347852", | ||||
|  "modified": "2020-04-29 10:52:33.526433", | ||||
|  "modified_by": "Administrator", | ||||
|  "module": "Accounts", | ||||
|  "name": "Journal Entry Template", | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user