Skip to content

Commit

Permalink
[GYM Management]: Added gym erpnext app
Browse files Browse the repository at this point in the history
  • Loading branch information
nihantra committed Jul 1, 2022
1 parent 5798b89 commit 8344c59
Show file tree
Hide file tree
Showing 29 changed files with 3,656 additions and 0 deletions.
33 changes: 33 additions & 0 deletions gym_management/crud_events.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2022, Nihantra C. Patel and contributors
# For license information, please see license.txt


import frappe
import erpnext
import gym_management

def measurement_history(doc, event):

test_d = frappe.db.get_value("Customer",{'name':doc.customer},'name')
if test_d:
test_doc = frappe.get_doc("Customer",test_d)

# for remove duplicate row
[test_doc.measurement_history_table.remove(d) for d in test_doc.get('measurement_history_table') if d.measurement_history == doc.name]

row = test_doc.append('measurement_history_table', {})
row.measurement_history = doc.name
row.date = doc.date
row.customer = doc.customer
row.weight = doc.weight
row.height = doc.height
row.bmi = doc.bmi
row.bmr = doc.bmr
row.neck = doc.neck
row.biceps = doc.biceps
row.hips = doc.hips
row.calf = doc.calf
row.chest = doc.chest
row.waist = doc.waist
row.thighs = doc.thighs
test_doc.save()
146 changes: 146 additions & 0 deletions gym_management/fixtures/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
[
{
"context": null,
"contributed": 0,
"contribution_docname": null,
"contribution_status": "",
"docstatus": 0,
"doctype": "Translation",
"language": "en-US",
"modified": "2022-06-28 15:05:29.689287",
"name": "52187101c7",
"parent": null,
"parentfield": null,
"parenttype": null,
"source_text": "Item",
"translated_text": "Equipment"
},
{
"context": null,
"contributed": 0,
"contribution_docname": null,
"contribution_status": "",
"docstatus": 0,
"doctype": "Translation",
"language": "en-US",
"modified": "2022-06-28 15:06:14.922612",
"name": "955d5202e1",
"parent": null,
"parentfield": null,
"parenttype": null,
"source_text": "Skill",
"translated_text": "Trainer Skill"
},
{
"context": null,
"contributed": 0,
"contribution_docname": null,
"contribution_status": "",
"docstatus": 0,
"doctype": "Translation",
"language": "en-US",
"modified": "2022-06-28 15:06:32.824758",
"name": "1d523a2f18",
"parent": null,
"parentfield": null,
"parenttype": null,
"source_text": "Customer",
"translated_text": "Registered Member"
},
{
"context": null,
"contributed": 0,
"contribution_docname": null,
"contribution_status": "",
"docstatus": 0,
"doctype": "Translation",
"language": "en-US",
"modified": "2022-06-28 15:07:16.574586",
"name": "98ab247f14",
"parent": null,
"parentfield": null,
"parenttype": null,
"source_text": "Employee",
"translated_text": "Trainer"
},
{
"context": null,
"contributed": 0,
"contribution_docname": null,
"contribution_status": "",
"docstatus": 0,
"doctype": "Translation",
"language": "en-US",
"modified": "2022-06-28 15:20:36.700214",
"name": "37e42b8b4f",
"parent": null,
"parentfield": null,
"parenttype": null,
"source_text": "Item Group",
"translated_text": "Gym Exercise Type"
},
{
"context": null,
"contributed": 0,
"contribution_docname": null,
"contribution_status": "",
"docstatus": 0,
"doctype": "Translation",
"language": "en-US",
"modified": "2022-06-28 15:24:36.973694",
"name": "fa33737813",
"parent": null,
"parentfield": null,
"parenttype": null,
"source_text": "Item Code",
"translated_text": "Equipment Code"
},
{
"context": null,
"contributed": 0,
"contribution_docname": null,
"contribution_status": "",
"docstatus": 0,
"doctype": "Translation",
"language": "en-US",
"modified": "2022-06-28 15:24:48.582819",
"name": "d241394257",
"parent": null,
"parentfield": null,
"parenttype": null,
"source_text": "Item Name",
"translated_text": "Equipment Name"
},
{
"context": null,
"contributed": 0,
"contribution_docname": null,
"contribution_status": "",
"docstatus": 0,
"doctype": "Translation",
"language": "en-US",
"modified": "2022-06-29 10:21:05.838144",
"name": "857ebc82c0",
"parent": null,
"parentfield": null,
"parenttype": null,
"source_text": "Customer Group",
"translated_text": "Registered Member Type"
},
{
"context": null,
"contributed": 0,
"contribution_docname": null,
"contribution_status": "",
"docstatus": 0,
"doctype": "Translation",
"language": "en-US",
"modified": "2022-06-29 10:23:16.852614",
"name": "4978c4af0c",
"parent": null,
"parentfield": null,
"parenttype": null,
"source_text": "Customer Details",
"translated_text": "Registered Member Details"
}
]
Loading

0 comments on commit 8344c59

Please sign in to comment.