awsss
3 years ago
76 changed files with 2223 additions and 773 deletions
Binary file not shown.
Binary file not shown.
@ -1,9 +0,0 @@ |
|||
// Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
/* eslint-disable */ |
|||
|
|||
frappe.query_reports["_Test"] = { |
|||
"filters": [ |
|||
|
|||
] |
|||
}; |
@ -1,8 +0,0 @@ |
|||
# Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
|
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
return columns, data |
@ -0,0 +1,243 @@ |
|||
// Copyright (c) 2016, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
|
|||
const pictures = ['jpg','jpeg','png','tif','tiff','ico','bmp','gif','eps','raw']; |
|||
const videos = ['avi','mp4','mov','wmv','webm','mkv','3gp']; |
|||
const pdfs = ['pdf']; |
|||
const documents =['doc','docx','txt','odt','ppt','pptx']; |
|||
const spreadsheets=['ods','xls','xlsx','csv']; |
|||
const zip=['zip','zipx','rar'] |
|||
|
|||
frappe.query_reports["File Structure"] = { |
|||
"filters": [ |
|||
|
|||
], |
|||
|
|||
"formatter": function (value, row, column, data, default_formatter) { |
|||
if(data && column.fieldname=="filename" && data.folder==0){ |
|||
if(data.private==1){ |
|||
if(pictures.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="image" transform="translate(-1556 -3572)"> |
|||
<path id="Path_25" data-name="Path 25" d="M314.128,26.861h-9.14c-.4,0-.57-.089-.515-.515a3.327,3.327,0,0,0,0-.956c-.2-1.011.441-1.581,1.086-2.188,1.011-.956,1.986-1.95,2.96-2.943.294-.294.46-.332.754,0,.46.514.975.974,1.453,1.471.257.294.441.258.7,0,2.1-2.114,4.193-4.193,6.289-6.308.276-.276.4-.294.7,0,1.655,1.673,3.347,3.329,5.039,4.984a1.051,1.051,0,0,1,.35.846c-.019,1.692-.019,3.366,0,5.058,0,.422-.09.57-.552.57-3.052-.019-6.087-.019-9.122-.019" transform="translate(1256 3572)" fill="#bababa"/> |
|||
<path id="Path_26" data-name="Path 26" d="M307.136,12.994a2.465,2.465,0,0,1,2.578,2.347,2.669,2.669,0,0,1,0,.283,2.6,2.6,0,0,1-2.648,2.538,2.7,2.7,0,0,1-2.607-2.648,2.591,2.591,0,0,1,2.659-2.521h.021" transform="translate(1256 3572)" fill="#bababa"/> |
|||
<path id="Path_27" data-name="Path 27" d="M325.745,34.667h-23.25A1.5,1.5,0,0,1,301,33.172V2.495A1.5,1.5,0,0,1,302.495,1h19.56l5.185,5.186V33.172A1.5,1.5,0,0,1,325.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="2"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else if(pdfs.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="pdf" transform="translate(-1496 -3572)"> |
|||
<path id="Path_23" data-name="Path 23" d="M253.244,12.639a1.527,1.527,0,0,0,.069,2.057c.6-1.34-.046-2.057-.069-2.057m.393,5.431A44.428,44.428,0,0,1,251.9,22.9a32.847,32.847,0,0,1,4.206-1.294,23.672,23.672,0,0,1-2.473-3.536m4.853,4.206c.532.393.647.6.994.6a.82.82,0,0,0,.924-.555c-.069-.046-.185-.116-.763-.116a10.159,10.159,0,0,0-1.156.069m-8.851,2.843c-1.387.763-1.941,1.41-1.988,1.756,0,.069-.023.208.277.439.116-.023.67-.277,1.71-2.2m-1.71,3.282a1.012,1.012,0,0,1-.624-.208,1.54,1.54,0,0,1-.716-1.433c.116-1.04,1.433-2.126,3.883-3.236a42.9,42.9,0,0,0,2.45-6.887c-.647-1.387-1.271-3.189-.809-4.252a1.309,1.309,0,0,1,.74-.786,3.16,3.16,0,0,1,.647-.116c.347,0,.67.416.832.67a2.625,2.625,0,0,1,.254,1.618c-.046.532-.139,1.063-.231,1.6-.069.393-.162.763-.254,1.156a19.7,19.7,0,0,0,3.3,4.83,13.9,13.9,0,0,1,2.172-.231c1.017,0,1.641.231,1.872.716a1.284,1.284,0,0,1-.254,1.387,1.7,1.7,0,0,1-1.433.763,4.3,4.3,0,0,1-2.727-1.456,31.169,31.169,0,0,0-5.731,1.8,18.748,18.748,0,0,1-1.548,2.727c-.693.9-1.271,1.34-1.826,1.34" transform="translate(1256 3572)" fill="#bababa"/> |
|||
<path id="Path_24" data-name="Path 24" d="M265.745,34.667h-23.25A1.5,1.5,0,0,1,241,33.172V2.495A1.5,1.5,0,0,1,242.495,1h19.56l5.185,5.186V33.172A1.5,1.5,0,0,1,265.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="2"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else if(spreadsheets.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="spreadsheet" transform="translate(-1316 -3572)"> |
|||
<path id="Path_14" data-name="Path 14" d="M85.745,34.667H62.495A1.5,1.5,0,0,1,61,33.172V2.495A1.5,1.5,0,0,1,62.495,1h19.56L87.24,6.186V33.172A1.5,1.5,0,0,1,85.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="2"/> |
|||
<rect id="Rectangle_9" data-name="Rectangle 9" width="18.008" height="13.323" transform="translate(1321.116 3585.274)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="1.5"/> |
|||
<line id="Line_4" data-name="Line 4" x2="18.008" transform="translate(1321.116 3594.156)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="1.5"/> |
|||
<line id="Line_5" data-name="Line 5" x2="18.008" transform="translate(1321.116 3589.715)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="1.5"/> |
|||
<line id="Line_6" data-name="Line 6" y2="13.323" transform="translate(1333.121 3585.274)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="1.5"/> |
|||
<line id="Line_7" data-name="Line 7" y2="13.323" transform="translate(1327.119 3585.274)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="1.5"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else if(documents.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="text" transform="translate(-1256 -3572)"> |
|||
<path id="Path_8" data-name="Path 8" d="M12.616,14.225a15.577,15.577,0,0,0-1.588.009,2.534,2.534,0,0,0-2.159,2.293c-.054.259-.107.473-.473.321V13.609H19.843v3.256c-.036.036-.071.062-.107.1-.116-.116-.25-.223-.357-.348a.723.723,0,0,1-.08-.2c-.669-2.114-1.8-2.355-3.64-2.177-.009.134-.027.277-.027.419v9.5c0,.161.009.33.009.491.036.9.41,1.285,1.312,1.32a.643.643,0,0,1,.223.009,1.973,1.973,0,0,1,.259.152,1.522,1.522,0,0,1-.232.125c-.036.018-.089,0-.134,0q-2.945,0-5.888-.009a1.21,1.21,0,0,1-.375-.125,1.409,1.409,0,0,1,.384-.161c.981-.054,1.32-.366,1.41-1.347.018-.2.018-.419.018-.625v-9.76Z" transform="translate(1256 3572)" fill="#bababa"/> |
|||
<path id="Path_9" data-name="Path 9" d="M5.7,14.181H5.1V11.5h2.65v.562H5.7Z" transform="translate(1256 3572)" fill="#bababa"/> |
|||
<path id="Path_10" data-name="Path 10" d="M5.077,28.376V25.7h.58v2.07H7.736v.6c-.875.007-1.749.007-2.659.007" transform="translate(1256 3572)" fill="#bababa"/> |
|||
<path id="Path_11" data-name="Path 11" d="M23.153,14.189h-.541V12.084h-2.1v-.589h2.65c-.009.91-.009,1.793-.009,2.694" transform="translate(1256 3572)" fill="#bababa"/> |
|||
<path id="Path_12" data-name="Path 12" d="M22.582,25.7h.58v2.677h-2.65V27.8h2.07Z" transform="translate(1256 3572)" fill="#bababa"/> |
|||
<path id="Path_13" data-name="Path 13" d="M25.745,34.667H2.495A1.5,1.5,0,0,1,1,33.172V2.495A1.5,1.5,0,0,1,2.495,1h19.56L27.24,6.186V33.172A1.5,1.5,0,0,1,25.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="2"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else if(videos.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="video" transform="translate(-1436 -3572)"> |
|||
<path id="Path_20" data-name="Path 20" d="M205.745,34.667h-23.25A1.5,1.5,0,0,1,181,33.172V2.495A1.5,1.5,0,0,1,182.495,1h19.56l5.185,5.186V33.172A1.5,1.5,0,0,1,205.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="2"/> |
|||
<path id="Path_21" data-name="Path 21" d="M191.622,26.043h-4.84a2.211,2.211,0,0,1-2.471-1.916,2.184,2.184,0,0,1,0-.542V15.75a2.2,2.2,0,0,1,2.474-2.458q4.84-.022,9.679,0a2.153,2.153,0,0,1,2.443,1.817,2.188,2.188,0,0,1,0,.626V23.57a2.158,2.158,0,0,1-2.443,2.458c-1.614.027-3.227.015-4.84.015m-3-6.391c0,1.029-.015,2.043.015,3.073a1,1,0,0,0,.246.737c.154.092.522-.061.722-.2,1.49-1,2.965-2.013,4.44-3.027.707-.492.722-.691.015-1.152-1.506-1.029-3-2.043-4.517-3.042-.184-.123-.522-.261-.661-.184a.894.894,0,0,0-.246.661c-.027,1.045-.01,2.089-.01,3.137Z" transform="translate(1256 3572)" fill="#bababa"/> |
|||
<path id="Path_22" data-name="Path 22" d="M203.944,19.683c0,1.26.015,2.5-.015,3.764a1,1,0,0,1-.307.784.957.957,0,0,1-.814-.154c-1.029-.676-2.059-1.352-3.027-2.1a1.614,1.614,0,0,1-.507-1c-.077-.676.031-1.383-.031-2.074a1.7,1.7,0,0,1,.922-1.828c.922-.553,1.767-1.214,2.673-1.8a1.158,1.158,0,0,1,.83-.154c.169.061.261.461.277.722Z" transform="translate(1256 3572)" fill="#bababa"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else if(zip.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="28.24" height="35.667" viewBox="0 0 28.24 35.667">
|
|||
<g id="zip" transform="translate(-1616 -3572)"> |
|||
<path id="Path_28" data-name="Path 28" d="M385.745,34.667h-23.25A1.5,1.5,0,0,1,361,33.172V2.495A1.5,1.5,0,0,1,362.495,1h19.56l5.185,5.186V33.172A1.5,1.5,0,0,1,385.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="2"/> |
|||
<rect id="Rectangle_15" data-name="Rectangle 15" width="2.917" height="1.944" transform="translate(1628.175 3601.806)" fill="#bababa"/> |
|||
<rect id="Rectangle_16" data-name="Rectangle 16" width="2.917" height="1.944" transform="translate(1628.175 3597.806)" fill="#bababa"/> |
|||
<rect id="Rectangle_17" data-name="Rectangle 17" width="2.917" height="1.944" transform="translate(1628.175 3593.806)" fill="#bababa"/> |
|||
<rect id="Rectangle_18" data-name="Rectangle 18" width="2.917" height="1.944" transform="translate(1628.175 3589.806)" fill="#bababa"/> |
|||
<rect id="Rectangle_19" data-name="Rectangle 19" width="2.917" height="1.944" transform="translate(1628.175 3585.806)" fill="#bababa"/> |
|||
<rect id="Rectangle_20" data-name="Rectangle 20" width="2.917" height="1.944" transform="translate(1628.175 3581.806)" fill="#bababa"/> |
|||
<rect id="Rectangle_21" data-name="Rectangle 21" width="2.917" height="1.944" transform="translate(1628.175 3577.806)" fill="#bababa"/> |
|||
<rect id="Rectangle_22" data-name="Rectangle 22" width="2.917" height="1.944" transform="translate(1628.175 3573.806)" fill="#bababa"/> |
|||
<rect id="Rectangle_23" data-name="Rectangle 23" width="2.917" height="1.944" transform="translate(1631.092 3603.751)" fill="#bababa"/> |
|||
<rect id="Rectangle_24" data-name="Rectangle 24" width="2.917" height="1.944" transform="translate(1631.092 3599.751)" fill="#bababa"/> |
|||
<rect id="Rectangle_25" data-name="Rectangle 25" width="2.917" height="1.944" transform="translate(1631.092 3595.751)" fill="#bababa"/> |
|||
<rect id="Rectangle_26" data-name="Rectangle 26" width="2.917" height="1.944" transform="translate(1631.092 3591.751)" fill="#bababa"/> |
|||
<rect id="Rectangle_27" data-name="Rectangle 27" width="2.917" height="1.944" transform="translate(1631.092 3587.751)" fill="#bababa"/> |
|||
<rect id="Rectangle_28" data-name="Rectangle 28" width="2.917" height="1.944" transform="translate(1631.092 3583.751)" fill="#bababa"/> |
|||
<rect id="Rectangle_29" data-name="Rectangle 29" width="2.917" height="1.944" transform="translate(1631.092 3579.751)" fill="#bababa"/> |
|||
<rect id="Rectangle_30" data-name="Rectangle 30" width="2.917" height="1.944" transform="translate(1631.092 3575.751)" fill="#bababa"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else{ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="othersupport" transform="translate(-1796 -3572)"> |
|||
<path id="Path_37" data-name="Path 37" d="M565.745,34.667h-23.25A1.5,1.5,0,0,1,541,33.172V2.495A1.5,1.5,0,0,1,542.495,1h19.56l5.185,5.186V33.172A1.5,1.5,0,0,1,565.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#bababa" stroke-miterlimit="10" stroke-width="2"/> |
|||
<path id="Path_38" data-name="Path 38" d="M546.866,16.309h3.627V12.682h-3.627Zm5.44,10.88h3.627V23.562h-3.627Zm-5.44,0h3.627V23.562h-3.627Zm0-5.44h3.627V18.122h-3.627Zm5.44,0h3.627V18.122h-3.627Zm5.44-5.44h3.627V12.682h-3.627Zm-5.44,0h3.627V12.682h-3.627Zm5.44,5.44h3.627V18.122h-3.627Zm0,5.44h3.627V23.562h-3.627Z" transform="translate(1256 3572)" fill="#bababa"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
} |
|||
|
|||
} else if(data.private==0){ |
|||
if(pictures.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="image" transform="translate(-1556 -3572)"> |
|||
<path id="Path_25" data-name="Path 25" d="M314.128,26.861h-9.14c-.4,0-.57-.089-.515-.515a3.327,3.327,0,0,0,0-.956c-.2-1.011.441-1.581,1.086-2.188,1.011-.956,1.986-1.95,2.96-2.943.294-.294.46-.332.754,0,.46.514.975.974,1.453,1.471.257.294.441.258.7,0,2.1-2.114,4.193-4.193,6.289-6.308.276-.276.4-.294.7,0,1.655,1.673,3.347,3.329,5.039,4.984a1.051,1.051,0,0,1,.35.846c-.019,1.692-.019,3.366,0,5.058,0,.422-.09.57-.552.57-3.052-.019-6.087-.019-9.122-.019" transform="translate(1256 3572)" fill="#606060"/> |
|||
<path id="Path_26" data-name="Path 26" d="M307.136,12.994a2.465,2.465,0,0,1,2.578,2.347,2.669,2.669,0,0,1,0,.283,2.6,2.6,0,0,1-2.648,2.538,2.7,2.7,0,0,1-2.607-2.648,2.591,2.591,0,0,1,2.659-2.521h.021" transform="translate(1256 3572)" fill="#606060"/> |
|||
<path id="Path_27" data-name="Path 27" d="M325.745,34.667h-23.25A1.5,1.5,0,0,1,301,33.172V2.495A1.5,1.5,0,0,1,302.495,1h19.56l5.185,5.186V33.172A1.5,1.5,0,0,1,325.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="2"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else if(pdfs.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="pdf" transform="translate(-1496 -3572)"> |
|||
<path id="Path_23" data-name="Path 23" d="M253.244,12.639a1.527,1.527,0,0,0,.069,2.057c.6-1.34-.046-2.057-.069-2.057m.393,5.431A44.428,44.428,0,0,1,251.9,22.9a32.847,32.847,0,0,1,4.206-1.294,23.672,23.672,0,0,1-2.473-3.536m4.853,4.206c.532.393.647.6.994.6a.82.82,0,0,0,.924-.555c-.069-.046-.185-.116-.763-.116a10.159,10.159,0,0,0-1.156.069m-8.851,2.843c-1.387.763-1.941,1.41-1.988,1.756,0,.069-.023.208.277.439.116-.023.67-.277,1.71-2.2m-1.71,3.282a1.012,1.012,0,0,1-.624-.208,1.54,1.54,0,0,1-.716-1.433c.116-1.04,1.433-2.126,3.883-3.236a42.9,42.9,0,0,0,2.45-6.887c-.647-1.387-1.271-3.189-.809-4.252a1.309,1.309,0,0,1,.74-.786,3.16,3.16,0,0,1,.647-.116c.347,0,.67.416.832.67a2.625,2.625,0,0,1,.254,1.618c-.046.532-.139,1.063-.231,1.6-.069.393-.162.763-.254,1.156a19.7,19.7,0,0,0,3.3,4.83,13.9,13.9,0,0,1,2.172-.231c1.017,0,1.641.231,1.872.716a1.284,1.284,0,0,1-.254,1.387,1.7,1.7,0,0,1-1.433.763,4.3,4.3,0,0,1-2.727-1.456,31.169,31.169,0,0,0-5.731,1.8,18.748,18.748,0,0,1-1.548,2.727c-.693.9-1.271,1.34-1.826,1.34" transform="translate(1256 3572)" fill="#606060"/> |
|||
<path id="Path_24" data-name="Path 24" d="M265.745,34.667h-23.25A1.5,1.5,0,0,1,241,33.172V2.495A1.5,1.5,0,0,1,242.495,1h19.56l5.185,5.186V33.172A1.5,1.5,0,0,1,265.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="2"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else if(spreadsheets.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="spreadsheet" transform="translate(-1316 -3572)"> |
|||
<path id="Path_14" data-name="Path 14" d="M85.745,34.667H62.495A1.5,1.5,0,0,1,61,33.172V2.495A1.5,1.5,0,0,1,62.495,1h19.56L87.24,6.186V33.172A1.5,1.5,0,0,1,85.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="2"/> |
|||
<rect id="Rectangle_9" data-name="Rectangle 9" width="18.008" height="13.323" transform="translate(1321.116 3585.274)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="1.5"/> |
|||
<line id="Line_4" data-name="Line 4" x2="18.008" transform="translate(1321.116 3594.156)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="1.5"/> |
|||
<line id="Line_5" data-name="Line 5" x2="18.008" transform="translate(1321.116 3589.715)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="1.5"/> |
|||
<line id="Line_6" data-name="Line 6" y2="13.323" transform="translate(1333.121 3585.274)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="1.5"/> |
|||
<line id="Line_7" data-name="Line 7" y2="13.323" transform="translate(1327.119 3585.274)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="1.5"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else if(documents.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="text" transform="translate(-1256 -3572)"> |
|||
<path id="Path_8" data-name="Path 8" d="M12.616,14.225a15.577,15.577,0,0,0-1.588.009,2.534,2.534,0,0,0-2.159,2.293c-.054.259-.107.473-.473.321V13.609H19.843v3.256c-.036.036-.071.062-.107.1-.116-.116-.25-.223-.357-.348a.723.723,0,0,1-.08-.2c-.669-2.114-1.8-2.355-3.64-2.177-.009.134-.027.277-.027.419v9.5c0,.161.009.33.009.491.036.9.41,1.285,1.312,1.32a.643.643,0,0,1,.223.009,1.973,1.973,0,0,1,.259.152,1.522,1.522,0,0,1-.232.125c-.036.018-.089,0-.134,0q-2.945,0-5.888-.009a1.21,1.21,0,0,1-.375-.125,1.409,1.409,0,0,1,.384-.161c.981-.054,1.32-.366,1.41-1.347.018-.2.018-.419.018-.625v-9.76Z" transform="translate(1256 3572)" fill="#606060"/> |
|||
<path id="Path_9" data-name="Path 9" d="M5.7,14.181H5.1V11.5h2.65v.562H5.7Z" transform="translate(1256 3572)" fill="#606060"/> |
|||
<path id="Path_10" data-name="Path 10" d="M5.077,28.376V25.7h.58v2.07H7.736v.6c-.875.007-1.749.007-2.659.007" transform="translate(1256 3572)" fill="#606060"/> |
|||
<path id="Path_11" data-name="Path 11" d="M23.153,14.189h-.541V12.084h-2.1v-.589h2.65c-.009.91-.009,1.793-.009,2.694" transform="translate(1256 3572)" fill="#606060"/> |
|||
<path id="Path_12" data-name="Path 12" d="M22.582,25.7h.58v2.677h-2.65V27.8h2.07Z" transform="translate(1256 3572)" fill="#606060"/> |
|||
<path id="Path_13" data-name="Path 13" d="M25.745,34.667H2.495A1.5,1.5,0,0,1,1,33.172V2.495A1.5,1.5,0,0,1,2.495,1h19.56L27.24,6.186V33.172A1.5,1.5,0,0,1,25.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="2"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else if(videos.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="video" transform="translate(-1436 -3572)"> |
|||
<path id="Path_20" data-name="Path 20" d="M205.745,34.667h-23.25A1.5,1.5,0,0,1,181,33.172V2.495A1.5,1.5,0,0,1,182.495,1h19.56l5.185,5.186V33.172A1.5,1.5,0,0,1,205.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="2"/> |
|||
<path id="Path_21" data-name="Path 21" d="M191.622,26.043h-4.84a2.211,2.211,0,0,1-2.471-1.916,2.184,2.184,0,0,1,0-.542V15.75a2.2,2.2,0,0,1,2.474-2.458q4.84-.022,9.679,0a2.153,2.153,0,0,1,2.443,1.817,2.188,2.188,0,0,1,0,.626V23.57a2.158,2.158,0,0,1-2.443,2.458c-1.614.027-3.227.015-4.84.015m-3-6.391c0,1.029-.015,2.043.015,3.073a1,1,0,0,0,.246.737c.154.092.522-.061.722-.2,1.49-1,2.965-2.013,4.44-3.027.707-.492.722-.691.015-1.152-1.506-1.029-3-2.043-4.517-3.042-.184-.123-.522-.261-.661-.184a.894.894,0,0,0-.246.661c-.027,1.045-.01,2.089-.01,3.137Z" transform="translate(1256 3572)" fill="#606060"/> |
|||
<path id="Path_22" data-name="Path 22" d="M203.944,19.683c0,1.26.015,2.5-.015,3.764a1,1,0,0,1-.307.784.957.957,0,0,1-.814-.154c-1.029-.676-2.059-1.352-3.027-2.1a1.614,1.614,0,0,1-.507-1c-.077-.676.031-1.383-.031-2.074a1.7,1.7,0,0,1,.922-1.828c.922-.553,1.767-1.214,2.673-1.8a1.158,1.158,0,0,1,.83-.154c.169.061.261.461.277.722Z" transform="translate(1256 3572)" fill="#606060"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else if(zip.includes(data.fileformat)){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="28.24" height="35.667" viewBox="0 0 28.24 35.667">
|
|||
<g id="zip" transform="translate(-1616 -3572)"> |
|||
<path id="Path_28" data-name="Path 28" d="M385.745,34.667h-23.25A1.5,1.5,0,0,1,361,33.172V2.495A1.5,1.5,0,0,1,362.495,1h19.56l5.185,5.186V33.172A1.5,1.5,0,0,1,385.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="2"/> |
|||
<rect id="Rectangle_15" data-name="Rectangle 15" width="2.917" height="1.944" transform="translate(1628.175 3601.806)" fill="#606060"/> |
|||
<rect id="Rectangle_16" data-name="Rectangle 16" width="2.917" height="1.944" transform="translate(1628.175 3597.806)" fill="#606060"/> |
|||
<rect id="Rectangle_17" data-name="Rectangle 17" width="2.917" height="1.944" transform="translate(1628.175 3593.806)" fill="#606060"/> |
|||
<rect id="Rectangle_18" data-name="Rectangle 18" width="2.917" height="1.944" transform="translate(1628.175 3589.806)" fill="#606060"/> |
|||
<rect id="Rectangle_19" data-name="Rectangle 19" width="2.917" height="1.944" transform="translate(1628.175 3585.806)" fill="#606060"/> |
|||
<rect id="Rectangle_20" data-name="Rectangle 20" width="2.917" height="1.944" transform="translate(1628.175 3581.806)" fill="#606060"/> |
|||
<rect id="Rectangle_21" data-name="Rectangle 21" width="2.917" height="1.944" transform="translate(1628.175 3577.806)" fill="#606060"/> |
|||
<rect id="Rectangle_22" data-name="Rectangle 22" width="2.917" height="1.944" transform="translate(1628.175 3573.806)" fill="#606060"/> |
|||
<rect id="Rectangle_23" data-name="Rectangle 23" width="2.917" height="1.944" transform="translate(1631.092 3603.751)" fill="#606060"/> |
|||
<rect id="Rectangle_24" data-name="Rectangle 24" width="2.917" height="1.944" transform="translate(1631.092 3599.751)" fill="#606060"/> |
|||
<rect id="Rectangle_25" data-name="Rectangle 25" width="2.917" height="1.944" transform="translate(1631.092 3595.751)" fill="#606060"/> |
|||
<rect id="Rectangle_26" data-name="Rectangle 26" width="2.917" height="1.944" transform="translate(1631.092 3591.751)" fill="#606060"/> |
|||
<rect id="Rectangle_27" data-name="Rectangle 27" width="2.917" height="1.944" transform="translate(1631.092 3587.751)" fill="#606060"/> |
|||
<rect id="Rectangle_28" data-name="Rectangle 28" width="2.917" height="1.944" transform="translate(1631.092 3583.751)" fill="#606060"/> |
|||
<rect id="Rectangle_29" data-name="Rectangle 29" width="2.917" height="1.944" transform="translate(1631.092 3579.751)" fill="#606060"/> |
|||
<rect id="Rectangle_30" data-name="Rectangle 30" width="2.917" height="1.944" transform="translate(1631.092 3575.751)" fill="#606060"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
}else{ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 28.24 35.667">
|
|||
<g id="othersupport" transform="translate(-1796 -3572)"> |
|||
<path id="Path_37" data-name="Path 37" d="M565.745,34.667h-23.25A1.5,1.5,0,0,1,541,33.172V2.495A1.5,1.5,0,0,1,542.495,1h19.56l5.185,5.186V33.172A1.5,1.5,0,0,1,565.745,34.667Z" transform="translate(1256 3572)" fill="none" stroke="#606060" stroke-miterlimit="10" stroke-width="2"/> |
|||
<path id="Path_38" data-name="Path 38" d="M546.866,16.309h3.627V12.682h-3.627Zm5.44,10.88h3.627V23.562h-3.627Zm-5.44,0h3.627V23.562h-3.627Zm0-5.44h3.627V18.122h-3.627Zm5.44,0h3.627V18.122h-3.627Zm5.44-5.44h3.627V12.682h-3.627Zm-5.44,0h3.627V12.682h-3.627Zm5.44,5.44h3.627V18.122h-3.627Zm0,5.44h3.627V23.562h-3.627Z" transform="translate(1256 3572)" fill="#606060"/> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_file(" + JSON.stringify(data.filename) + ")" |
|||
} |
|||
} |
|||
} |
|||
else if(data && column.fieldname=="filename" && data.folder==1) { |
|||
if(data.private==1){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 40 40">
|
|||
<g id="Folder" transform="translate(-2581 -2062)"> |
|||
<rect id="Rectangle_1707" data-name="Rectangle 1707" width="40" height="40" transform="translate(2581 2062)" fill="none"/> |
|||
<path id="folder_icon" data-name="folder icon" d="M95.845,122.5H81.811a3.856,3.856,0,0,1-3.837-3.144,4.1,4.1,0,0,1-.074-.792V99.036A3.853,3.853,0,0,1,81.836,95.1h9.133a3.855,3.855,0,0,1,2.723,1.064c.594.569,1.213,1.114,1.807,1.683a2.238,2.238,0,0,0,1.683.668h12.7a3.853,3.853,0,0,1,3.886,3.292,5.215,5.215,0,0,1,.049.619v16.188a3.857,3.857,0,0,1-3.911,3.911C105.2,122.5,100.523,122.5,95.845,122.5Zm0-2h13.935a1.887,1.887,0,0,0,2.054-2.054c0-5.3-.025-10.594.025-15.891a1.988,1.988,0,0,0-2.079-2.079c-4.233.025-8.44.025-12.673.025a3.872,3.872,0,0,1-2.747-1.064L92.4,97.625a1.993,1.993,0,0,0-1.361-.52H81.885a2.266,2.266,0,0,0-.421.025,1.862,1.862,0,0,0-1.485,1.931v19.653a1.856,1.856,0,0,0,.817,1.46,1.984,1.984,0,0,0,1.238.322Z" transform="translate(2505.1 1973.9)" fill="#aaaaaa"/> |
|||
</g> |
|||
</svg> <b>${value}</b></p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_folder(" + JSON.stringify(data.filename) + ")" |
|||
}else if(data.private==0){ |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 40 40">
|
|||
<g id="Folder" transform="translate(-2581 -2062)"> |
|||
<rect id="Rectangle_1707" data-name="Rectangle 1707" width="40" height="40" transform="translate(2581 2062)" fill="none"/> |
|||
<path id="folder_icon" data-name="folder icon" d="M95.845,122.5H81.811a3.856,3.856,0,0,1-3.837-3.144,4.1,4.1,0,0,1-.074-.792V99.036A3.853,3.853,0,0,1,81.836,95.1h9.133a3.855,3.855,0,0,1,2.723,1.064c.594.569,1.213,1.114,1.807,1.683a2.238,2.238,0,0,0,1.683.668h12.7a3.853,3.853,0,0,1,3.886,3.292,5.215,5.215,0,0,1,.049.619v16.188a3.857,3.857,0,0,1-3.911,3.911C105.2,122.5,100.523,122.5,95.845,122.5Zm0-2h13.935a1.887,1.887,0,0,0,2.054-2.054c0-5.3-.025-10.594.025-15.891a1.988,1.988,0,0,0-2.079-2.079c-4.233.025-8.44.025-12.673.025a3.872,3.872,0,0,1-2.747-1.064L92.4,97.625a1.993,1.993,0,0,0-1.361-.52H81.885a2.266,2.266,0,0,0-.421.025,1.862,1.862,0,0,0-1.485,1.931v19.653a1.856,1.856,0,0,0,.817,1.46,1.984,1.984,0,0,0,1.238.322Z" transform="translate(2505.1 1973.9)" fill="#000000"/> |
|||
</g> |
|||
</svg> <b>${value}</b></p>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_folder(" + JSON.stringify(data.filename) + ")" |
|||
} |
|||
}else{ |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_folder(" + JSON.stringify(data.filename) + ")" |
|||
} |
|||
if(data && column.fieldname=="private" ){ |
|||
if(data.private==1){ |
|||
column.align='left'; |
|||
value = `<span class="filterable indicator-pill orange ellipsis"> Private </span>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_folder(" + JSON.stringify(data.filename) + ")" |
|||
}else if(data.private==0){ |
|||
column.align='left'; |
|||
value = `<span class="filterable indicator-pill green ellipsis"> Public </span>` |
|||
column.link_onclick = "frappe.query_reports['_File Structure'].set_route_to_folder(" + JSON.stringify(data.filename) + ")" |
|||
} |
|||
} |
|||
if(data && column.fieldname=="path" ){ |
|||
column.align='left'; |
|||
} |
|||
if(data && column.fieldname=="attached_to" ){ |
|||
column.align='left'; |
|||
} |
|||
if(data && column.fieldname=="modified" ){ |
|||
column.align='left'; |
|||
} |
|||
value = default_formatter(value, row, column, data); |
|||
return value; |
|||
}, |
|||
|
|||
"set_route_to_file": function (data) { |
|||
window.open("http://192.168.1.58:81/files/" + data); |
|||
}, |
|||
|
|||
"set_route_to_folder": function (data) { |
|||
|
|||
}, |
|||
"tree": true, |
|||
"name_field": "filename", |
|||
"parent_field": "", |
|||
"initial_depth": 4 |
|||
}; |
@ -0,0 +1,43 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"columns": [ |
|||
{ |
|||
"fieldname": "filename", |
|||
"fieldtype": "Dynamic Link", |
|||
"label": "Files and Folders", |
|||
"width": 300 |
|||
}, |
|||
{ |
|||
"fieldname": "attached_to", |
|||
"fieldtype": "Dynamic Link", |
|||
"label": "Attached To", |
|||
"width": 0 |
|||
} |
|||
], |
|||
"creation": "2021-11-03 16:08:49.650166", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"json": "{}", |
|||
"modified": "2022-05-17 16:07:01.929412", |
|||
"modified_by": "Administrator", |
|||
"module": "Add Ons", |
|||
"name": "File Structure", |
|||
"owner": "mahibaalana@hnsonline.com", |
|||
"prepared_report": 0, |
|||
"ref_doctype": "File", |
|||
"report_name": "File Structure", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
}, |
|||
{ |
|||
"role": "All" |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,179 @@ |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
import frappe |
|||
from frappe import _ |
|||
import datetime |
|||
from frappe.utils import now |
|||
|
|||
|
|||
|
|||
def execute(filters=None): |
|||
data = files_tree() |
|||
columns = get_columns() |
|||
# frappe.msgprint(str(now())) |
|||
return columns, data |
|||
|
|||
|
|||
#Import data, process and return tree |
|||
def files_tree(): |
|||
files_lst = frappe.db.sql("""SELECT tabFile.file_name as filename, tabFile.creation as creation, tabFile.modified as modified, tabFile.is_private as private, tabFile.folder as path, tabFile.is_folder as folder, tabFile.is_home_folder as home, |
|||
tabFile.attached_to_name as attached_to, tabFile.owner as created_by, tabFile.modified_by as modified_by FROM tabFile order by filename asc""", as_dict=1) |
|||
classified = classification(files_lst) |
|||
indented = indentation(classified) |
|||
tree = arrangement(indented) |
|||
return tree |
|||
|
|||
#Classification of Files, folders and root folder |
|||
def classification(files_list): |
|||
b = [] |
|||
for i in files_list: |
|||
if i['folder'] == 0 and i['home'] == 0: |
|||
Path_items = i['path'].split('/') |
|||
fileformat = i['filename'].split('.') |
|||
length = Path_items.__len__() |
|||
i['Depth'] = length |
|||
i['type'] = 'file' |
|||
i['Path_items']=Path_items |
|||
i['fileformat']=fileformat[-1] |
|||
|
|||
elif i['folder'] == 1 and i['home'] == 0: |
|||
Path_items = i['path'].split('/') |
|||
length = Path_items.__len__() |
|||
i['Depth'] = length |
|||
i['type'] = 'folder' |
|||
i['Path_items']=Path_items |
|||
i['fileformat']='folder' |
|||
|
|||
elif i['folder'] == 1 and i['home'] == 1: |
|||
length = 0 |
|||
i['Depth'] = length |
|||
i['type'] = 'root' |
|||
i['fileformat']='home' |
|||
b.append(i) |
|||
return b |
|||
|
|||
|
|||
#Adding Indents based on their depth |
|||
def indentation(b): |
|||
c = {} |
|||
for i in b: |
|||
if i['folder'] == 1 and i['home'] == 1: |
|||
i['indent'] = 0 |
|||
lst = [] |
|||
lst.append(i) |
|||
c['root'] = lst |
|||
|
|||
elif i['folder'] == 1 and i['home'] == 0: |
|||
lst = [] |
|||
temp1=[] |
|||
temp2=[] |
|||
for j in b: |
|||
pathinfo = 'Home' |
|||
indent = pathinfo.count('/') |
|||
if pathinfo == j['path']: |
|||
j['indent'] = indent+1 |
|||
if j['folder']==1: |
|||
temp1.append(j) |
|||
elif j['folder']==0: |
|||
temp2.append(j) |
|||
for k in temp1: |
|||
lst.append(k) |
|||
for l in temp2: |
|||
lst.append(l) |
|||
c[pathinfo] = lst |
|||
lst = [] |
|||
temp1=[] |
|||
temp2=[] |
|||
for j in b: |
|||
pathinfo = i['path']+'/'+i['filename'] |
|||
indent = pathinfo.count('/') |
|||
if pathinfo == j['path']: |
|||
j['indent'] = indent+1 |
|||
if j['folder']==1: |
|||
temp1.append(j) |
|||
elif j['folder']==0: |
|||
temp2.append(j) |
|||
for k in temp1: |
|||
lst.append(k) |
|||
for l in temp2: |
|||
lst.append(l) |
|||
c[pathinfo] = lst |
|||
return c |
|||
|
|||
#Arranging them to the required order for frappe |
|||
def arrangement(c): |
|||
out=[] |
|||
temp=c['root'] |
|||
out.append(temp[0]) |
|||
temp1= 'Home' |
|||
def repeating_method(temp2,c): |
|||
for x in c[temp2]: |
|||
out.append(x) |
|||
if x['folder']==1 and x['home']==0: |
|||
temp3=x['path']+'/'+x['filename'] |
|||
repeating_method(temp3,c) |
|||
repeating_method(temp1,c) |
|||
return out |
|||
|
|||
|
|||
#Columns to be displayed in tree view |
|||
def get_columns(): |
|||
return [ |
|||
{ |
|||
"fieldname": "filename", |
|||
"label": _("<b>Files and Folders</b>"), |
|||
"fieldtype": 'Dynamic Link', |
|||
"options": "", |
|||
"width": 550 |
|||
}, |
|||
{ |
|||
"fieldname": "private", |
|||
"label": _("<b>Permission</b>"), |
|||
"fieldtype": 'Data', |
|||
"options": "", |
|||
"width": 96 |
|||
}, |
|||
{ |
|||
"fieldname": "path", |
|||
"label": _("<b>Path</b>"), |
|||
"fieldtype": "Data", |
|||
"options": "", |
|||
"width": 175 |
|||
}, |
|||
{ |
|||
"fieldname": "attached_to", |
|||
"label": _("<b>Attached To</b>"), |
|||
"fieldtype": 'Dynamic Link', |
|||
"options": "", |
|||
"width": 175 |
|||
}, |
|||
{ |
|||
"fieldname": "creation", |
|||
"label": _("<b>Created On</b>"), |
|||
"fieldtype": "Data", |
|||
"options": "", |
|||
"width": 220 |
|||
}, |
|||
{ |
|||
"fieldname": "modified", |
|||
"label": _("<b>Modified On</b>"), |
|||
"fieldtype": "Data", |
|||
"options": "", |
|||
"width": 220 |
|||
}, |
|||
{ |
|||
"fieldname": "created_by", |
|||
"label": _("<b>Created By</b>"), |
|||
"fieldtype": 'Data', |
|||
"options": "", |
|||
"width": 175 |
|||
}, |
|||
{ |
|||
"fieldname": "modified_by", |
|||
"label": _("<b>Modified By</b>"), |
|||
"fieldtype": 'Data', |
|||
"options": "", |
|||
"width": 175 |
|||
} |
|||
] |
Binary file not shown.
Binary file not shown.
@ -1,29 +1,29 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"columns": [], |
|||
"creation": "2022-01-11 21:21:21.835448", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2022-01-11 21:21:21.835448", |
|||
"modified_by": "Administrator", |
|||
"module": "Add Ons", |
|||
"name": "Installation Report", |
|||
"owner": "Administrator", |
|||
"prepared_report": 0, |
|||
"ref_doctype": "App Log", |
|||
"report_name": "Installation Report", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
}, |
|||
{ |
|||
"role": "_Admin" |
|||
} |
|||
] |
|||
} |
|||
"add_total_row": 0, |
|||
"columns": [], |
|||
"creation": "2022-01-11 21:21:21.835448", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2022-03-24 15:19:15.315547", |
|||
"modified_by": "Administrator", |
|||
"module": "Add Ons", |
|||
"name": "Installation Report", |
|||
"owner": "Administrator", |
|||
"prepared_report": 0, |
|||
"ref_doctype": "App Log", |
|||
"report_name": "Installation Report", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
}, |
|||
{ |
|||
"role": "_Publisher" |
|||
} |
|||
] |
|||
} |
@ -1,8 +1,51 @@ |
|||
# Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils import cstr, cint, getdate |
|||
from frappe import msgprint, _ |
|||
|
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
columns = get_columns() |
|||
data = get_data(filters) |
|||
return columns, data |
|||
|
|||
def get_data(filters): |
|||
current_db_name = frappe.conf.get("db_name") |
|||
data = frappe.db.sql("""select dealer.zone,au.user_id,concat_ws(' ',au.first_name,au.last_name) as user_name,dealer.dealer_code,dealer.dealer_name,dealer.area,ad.os,ad.os_version, |
|||
al.device,ad.device_id,ad.app_current_version,al.type as type,ad.device_type,al.date_time_stamp,al.creation,al.date_time_stamp as date,al.date_time_stamp as time,time(al.date_time_stamp) as last_time |
|||
from {0}.`tabApp Log` al, {0}.`tabApp Device` ad, {0}.`tabApp Users` au, {0}.`tabApp Dealer` dealer |
|||
where |
|||
al.device = ad.name and al.user = au.name and au.dealer = dealer.name and (al.type = 'Installed' or al.type = 'Reinstalled') and |
|||
(date(al.modified) between '{1}' and '{2}')""".format(current_db_name,filters.get('from_date'), filters.get('to_date')), as_dict=1) |
|||
|
|||
if data: |
|||
return data |
|||
else: |
|||
frappe.msgprint('No Data for Selected Filters.') |
|||
|
|||
|
|||
def get_columns(): |
|||
columns = [ |
|||
{"label": _("<b>Zone</b>"), "fieldname": "zone", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>Area Office</b>"), "fieldname": "area", "fieldtype":"Data","width": 150}, |
|||
{"label": _("<b>Dealer Code</b>"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>Dealer Name</b>"), "fieldname": "dealer_name", "fieldtype":"Data","width": 150}, |
|||
{"label": _("<b>Installation</b>"), "fieldname": "device", "fieldtype": "Data","width": 100}, |
|||
{"label": _("<b>Device</b>"), "fieldname": "device_type", "fieldtype": "Data","width": 100}, |
|||
{"label": _("<b>Device ID</b>"), "fieldname": "device_id", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>Device OS</b>"), "fieldname": "os", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>OS Version</b>"), "fieldname": "os_version", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>User ID</b>"), "fieldname": "user_id", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>User Name</b>"), "fieldname": "user_name", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>Activity Type</b>"), "fieldname": "type", "fieldtype": "Data","width": 100}, |
|||
{"label": _("<b>App Installation Date</b>"), "fieldname": "date_time_stamp", "fieldtype": "DateTime","width": 200}, |
|||
{"label": _("<b>App Last Accessed Date</b>"), "fieldname": "date", "fieldtype": "DateTime","width": 200}, |
|||
{"label": _("<b>App Version No</b>"), "fieldname": "app_current_version", "fieldtype": "Data", "width": 150}, |
|||
] |
|||
return columns |
|||
|
|||
|
Binary file not shown.
Binary file not shown.
@ -1,8 +1,53 @@ |
|||
# Copyright (c) 2022, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils import cstr, cint, getdate |
|||
from frappe import msgprint, _ |
|||
from frappe.utils import cstr, flt, cint,TIME_FORMAT,DATE_FORMAT,DATETIME_FORMAT, now_datetime |
|||
from datetime import date, time, datetime, timedelta |
|||
from frappe.utils import now |
|||
import datetime |
|||
|
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
columns = get_columns() |
|||
data = get_data(filters) |
|||
return columns, data |
|||
|
|||
def get_data(filters): |
|||
current_db_name = frappe.conf.get("db_name") |
|||
from_date = filters.get('from_date') |
|||
to_date = filters.get('to_date') |
|||
data = frappe.db.sql("""select count(al.name) as count,dealer.zone,au.user_id,concat_ws(' ',au.first_name,au.last_name) as user_name, |
|||
dealer.dealer_code,dealer.dealer_name,dealer.area,ad.os,ad.os_version, |
|||
ad.device_type,ad.device_id,ad.app_current_version,al.type,al.latitude,al.longitude,al.date_time_stamp,al.creation, |
|||
date(al.date_time_stamp) as date,time(al.date_time_stamp) as time |
|||
from {0}.`tabApp Log` al,{0}.`tabApp Device` ad,{0}.`tabApp Users` au,{0}.`tabApp Dealer` dealer |
|||
where |
|||
al.device = ad.name and al.user = au.name and au.dealer = dealer.name and al.type = 'Logged in' and |
|||
(date(al.modified) between '{1}' and '{2}') group by al.user,ad.device_id,date(al.date_time_stamp)""".format(current_db_name,from_date,to_date), as_dict=1) |
|||
if data: |
|||
return data |
|||
else: |
|||
frappe.msgprint('No Data for Selected Filters.') |
|||
|
|||
def get_columns(): |
|||
columns = [ |
|||
{"label": _("<b>Date</b>"), "fieldname": "date", "fieldtype": "Date", "width": 100}, |
|||
{"label": _("<b>Time</b>"), "fieldname": "time", "fieldtype": "DateTime", "width": 130}, |
|||
{"label": _("<b>Zone</b>"), "fieldname": "zone", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>Area Office</b>"), "fieldname": "area", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>Dealer Code</b>"), "fieldname": "dealer_code", "fieldtype": "Data", "width": 150}, |
|||
{"label": _("<b>Dealer Name</b>"), "fieldname": "dealer_name", "fieldtype":"Data","width": 150}, |
|||
{"label": _("<b>Device</b>"), "fieldname": "device_type", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>Device ID</b>"), "fieldname": "device_id", "fieldtype": "Data", "width": 150}, |
|||
{"label": _("<b>User ID</b>"), "fieldname": "user_id", "fieldtype": "Data", "width": 150}, |
|||
{"label": _("<b>User Name</b>"), "fieldname": "user_name", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>Latitude</b>"), "fieldname": "latitude", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>Longitude</b>"), "fieldname": "longitude", "fieldtype": "Data", "width": 100}, |
|||
{"label": _("<b>Count</b>"), "fieldname": "count", "fieldtype": "Data", "width": 100}, |
|||
] |
|||
return columns |
|||
|
|||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +0,0 @@ |
|||
// Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
|
|||
frappe.ui.form.on('Release', { |
|||
}); |
@ -1,75 +0,0 @@ |
|||
{ |
|||
"actions": [], |
|||
"allow_rename": 1, |
|||
"autoname": "Ver.####", |
|||
"creation": "2021-11-01 12:28:45.623316", |
|||
"doctype": "DocType", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"field_order": [ |
|||
"planned_release_date", |
|||
"actual_release_date", |
|||
"column_break_3", |
|||
"release_description", |
|||
"section_break_5", |
|||
"docs" |
|||
], |
|||
"fields": [ |
|||
{ |
|||
"fieldname": "planned_release_date", |
|||
"fieldtype": "Date", |
|||
"in_list_view": 1, |
|||
"label": "Planned Release Date", |
|||
"reqd": 1 |
|||
}, |
|||
{ |
|||
"fieldname": "actual_release_date", |
|||
"fieldtype": "Date", |
|||
"label": "Actual Release Date", |
|||
"read_only": 1 |
|||
}, |
|||
{ |
|||
"fieldname": "column_break_3", |
|||
"fieldtype": "Column Break" |
|||
}, |
|||
{ |
|||
"fieldname": "release_description", |
|||
"fieldtype": "Small Text", |
|||
"label": "Release Description" |
|||
}, |
|||
{ |
|||
"fieldname": "section_break_5", |
|||
"fieldtype": "Section Break" |
|||
}, |
|||
{ |
|||
"fieldname": "docs", |
|||
"fieldtype": "Table", |
|||
"label": "Docs", |
|||
"options": "Release_Docs" |
|||
} |
|||
], |
|||
"index_web_pages_for_search": 1, |
|||
"links": [], |
|||
"modified": "2021-11-01 12:53:41.695352", |
|||
"modified_by": "Administrator", |
|||
"module": "Mahindra Smart Service", |
|||
"name": "Release", |
|||
"owner": "Administrator", |
|||
"permissions": [ |
|||
{ |
|||
"create": 1, |
|||
"delete": 1, |
|||
"email": 1, |
|||
"export": 1, |
|||
"print": 1, |
|||
"read": 1, |
|||
"report": 1, |
|||
"role": "System Manager", |
|||
"share": 1, |
|||
"write": 1 |
|||
} |
|||
], |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1 |
|||
} |
@ -1,16 +0,0 @@ |
|||
# Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
from frappe.model.document import Document |
|||
import frappe |
|||
import json |
|||
class Release(Document): |
|||
pass |
|||
|
|||
|
|||
|
|||
@frappe.whitelist() |
|||
def api_vehicle_map(): |
|||
doc = frappe.get_doc('Systems','Reverse Parking Assistance System') |
|||
return doc |
@ -1,8 +0,0 @@ |
|||
# Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and Contributors |
|||
# See license.txt |
|||
|
|||
# import frappe |
|||
import unittest |
|||
|
|||
class TestRelease(unittest.TestCase): |
|||
pass |
Binary file not shown.
Binary file not shown.
@ -1,39 +0,0 @@ |
|||
{ |
|||
"actions": [], |
|||
"creation": "2021-11-01 12:27:23.263495", |
|||
"doctype": "DocType", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"field_order": [ |
|||
"doc_type", |
|||
"doc_id" |
|||
], |
|||
"fields": [ |
|||
{ |
|||
"fieldname": "doc_type", |
|||
"fieldtype": "Link", |
|||
"in_list_view": 1, |
|||
"label": "Doc Type", |
|||
"options": "DocType" |
|||
}, |
|||
{ |
|||
"fieldname": "doc_id", |
|||
"fieldtype": "Dynamic Link", |
|||
"in_list_view": 1, |
|||
"label": "Doc ID", |
|||
"options": "doc_type" |
|||
} |
|||
], |
|||
"index_web_pages_for_search": 1, |
|||
"istable": 1, |
|||
"links": [], |
|||
"modified": "2021-11-01 12:29:04.655386", |
|||
"modified_by": "Administrator", |
|||
"module": "Mahindra Smart Service", |
|||
"name": "Release_Docs", |
|||
"owner": "Administrator", |
|||
"permissions": [], |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1 |
|||
} |
@ -1,8 +0,0 @@ |
|||
# Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
from frappe.model.document import Document |
|||
|
|||
class Release_Docs(Document): |
|||
pass |
@ -0,0 +1,17 @@ |
|||
// Copyright (c) 2016, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
/* eslint-disable */ |
|||
|
|||
frappe.query_reports["Drive Translation"] = { |
|||
"filters": [ |
|||
], |
|||
|
|||
"formatter": function (value, row, column, data, default_formatter) { |
|||
if(value==null){ |
|||
value=' ' |
|||
column.align='left'; |
|||
} |
|||
value = default_formatter(value, row, column, data); |
|||
return value; |
|||
} |
|||
}; |
@ -0,0 +1,26 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"columns": [], |
|||
"creation": "2021-11-29 12:15:09.820884", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2022-05-17 15:40:11.613032", |
|||
"modified_by": "Administrator", |
|||
"module": "Masters", |
|||
"name": "Drive Translation", |
|||
"owner": "Administrator", |
|||
"prepared_report": 0, |
|||
"ref_doctype": "Drive", |
|||
"report_name": "Drive Translation", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,66 @@ |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils import cstr, cint, getdate |
|||
from frappe import msgprint, _ |
|||
|
|||
current_db_name = frappe.conf.get("db_name") |
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
columns,lang = get_columns() |
|||
data = get_data() |
|||
return columns, data |
|||
|
|||
def get_data(): |
|||
|
|||
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True) |
|||
|
|||
queryAppendLang = "" |
|||
for d in custom_lang: |
|||
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0]) |
|||
queryAppendLang += q |
|||
|
|||
sel = "" |
|||
for d in custom_lang: |
|||
r = ",tabTranslation.%s as %s"%(d[0],d[0]) |
|||
sel+= r |
|||
|
|||
|
|||
actualQuery = """Select |
|||
`tabDrive`.modified as "Modified On", |
|||
`tabDrive`.active_status as "Status", |
|||
`tabDrive`.drive as 'Drive' |
|||
%s |
|||
From %s.`tabDrive` |
|||
LEFT JOIN %s.`tabTranslation` as tabTrans |
|||
ON %s.`tabDrive`.drive = tabTrans.source_text |
|||
LEFT JOIN (Select tabLang.languageCode as languageCode |
|||
,%s.tabTranslation.source_text as sourceText |
|||
, %s.tabTranslation.translated_text as translated_text |
|||
%s |
|||
From %s.tabTranslation |
|||
INNER JOIN (SELECT tanLang.language_name as language_name |
|||
, tanLang.language_code as languageCode |
|||
FROM %s.tabLanguage as tanLang) as tabLang |
|||
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation |
|||
ON %s.`tabDrive`.drive = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name) |
|||
|
|||
data = frappe.db.sql(actualQuery,as_list=True) |
|||
|
|||
return data |
|||
|
|||
def get_columns(): |
|||
columns = [] |
|||
columns += [ |
|||
_("<b>Modified On</b>") + ":Datetime/:200", _("<b>Status</b>") + ":Data/:100",_("<b>Drive</b>") + ":Data/:220", |
|||
] |
|||
lang = [] |
|||
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1) |
|||
for d in custom_lang: |
|||
lang.append("<b>"+cstr(d["lang_name"])+"</b>"+ "::220") |
|||
columns += lang |
|||
return columns,lang |
@ -0,0 +1,9 @@ |
|||
// Copyright (c) 2016, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
/* eslint-disable */ |
|||
|
|||
frappe.query_reports["Fuel Translation"] = { |
|||
"filters": [ |
|||
|
|||
] |
|||
}; |
@ -0,0 +1,69 @@ |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils import cstr, cint, getdate |
|||
from frappe import msgprint, _ |
|||
|
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
columns,lang = get_columns() |
|||
data = get_data() |
|||
return columns, data |
|||
|
|||
def get_data(): |
|||
|
|||
custom_lang = frappe.db.sql("""SELECT lang_code FROM `tabCustom Languages` where lang_code <> "en" order by lang_name""",as_list=True) |
|||
|
|||
queryAppendLang = "" |
|||
for d in custom_lang: |
|||
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN tabTranslation.translated_text ELSE null END) as %s" %(d[0],d[0]) |
|||
queryAppendLang += q |
|||
|
|||
sel = "" |
|||
for d in custom_lang: |
|||
r = ",tabTranslation.%s as %s"%(d[0],d[0]) |
|||
sel+= r |
|||
|
|||
|
|||
actualQuery = """Select |
|||
`tabFuel`.modified as "Modified On", |
|||
`tabFuel`.active_status as "Status", |
|||
`tabFuel`.fuel as 'Fuel' |
|||
%s |
|||
From `tabFuel` |
|||
LEFT JOIN `tabTranslation` as tabTrans |
|||
ON `tabFuel`.fuel = tabTrans.source_text |
|||
LEFT JOIN (Select tabLang.languageCode as languageCode |
|||
,tabTranslation.source_text as sourceText |
|||
, tabTranslation.translated_text as translated_text |
|||
%s |
|||
From tabTranslation |
|||
INNER JOIN (SELECT tanLang.language_name as language_name |
|||
, tanLang.language_code as languageCode |
|||
FROM tabLanguage as tanLang) as tabLang |
|||
ON tabTranslation.language = tabLang.languageCode) as tabTranslation |
|||
ON `tabFuel`.fuel = tabTranslation.sourceText;""" % (sel ,queryAppendLang) |
|||
|
|||
|
|||
data = frappe.db.sql(actualQuery,as_list=True) |
|||
|
|||
return data |
|||
|
|||
|
|||
def get_columns(): |
|||
current_db_name = frappe.conf.get("db_name") |
|||
|
|||
columns = [] |
|||
columns += [ |
|||
_("<b>Modified On</b>") + ":Datetime/:200", _("<b>Status</b>") + ":Data/:100",_("<b>Fuel</b>") + ":Data/:220", |
|||
] |
|||
lang = [] |
|||
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM {}.`tabCustom Languages` where lang_code <> "en" order by lang_name """.format(current_db_name),as_dict=1) |
|||
for d in custom_lang: |
|||
lang.append("<b>"+cstr(d["lang_name"])+"</b>"+ "::220") |
|||
columns += lang |
|||
return columns,lang |
@ -0,0 +1,18 @@ |
|||
// Copyright (c) 2016, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
/* eslint-disable */ |
|||
|
|||
frappe.query_reports["Sub Systems Translation"] = { |
|||
"filters": [ |
|||
|
|||
], |
|||
"formatter": function (value, row, column, data, default_formatter) { |
|||
console.log(value) |
|||
if(value==null){ |
|||
value=' ' |
|||
column.align='left'; |
|||
} |
|||
value = default_formatter(value, row, column, data); |
|||
return value; |
|||
} |
|||
}; |
@ -0,0 +1,27 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"columns": [], |
|||
"creation": "2021-11-03 17:06:30.300691", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2022-05-17 15:50:02.599201", |
|||
"modified_by": "Administrator", |
|||
"module": "Masters", |
|||
"name": "Sub Systems Translation", |
|||
"owner": "mahibaalana@hnsonline.com", |
|||
"prepared_report": 0, |
|||
"query": "Select `tabSub Systems`.modified as 'Modified On',`tabSub Systems`.active_status as 'Status', `tabSub Systems`.sub_system_name as 'Sub System' \n,\n`tabSub Systems`.sub_system_name as 'English', tabTranslation.gu as \u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0, tabTranslation.hi as \u0939\u093f\u0902\u0926\u0940, tabTranslation.kn as \u0c95\u0ca8\u0ccd\u0ca8\u0ca1, tabTranslation.ml as \u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02, tabTranslation.mr as \u092e\u0930\u093e\u0920\u0940, tabTranslation.ta as \u0ba4\u0bae\u0bbf\u0bb4\u0bcd, tabTranslation.te as \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41\n\nFrom _d6463952657fa86c.`tabSub Systems`\nLEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans \nON _d6463952657fa86c.`tabSub Systems`.sub_system_name = tabTrans.source_text\n\nLEFT JOIN (Select tabLang.languageCode as languageCode\n,_d6463952657fa86c.tabTranslation.source_text as sourceText\n, _d6463952657fa86c.tabTranslation.translated_text as translated_text\n, (CASE WHEN tabLang.languageCode = \"en\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en\n, (CASE WHEN tabLang.languageCode = \"gu\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu\n, (CASE WHEN tabLang.languageCode = \"hi\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi\n, (CASE WHEN tabLang.languageCode = \"kn\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn\n, (CASE WHEN tabLang.languageCode = \"ml\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml\n, (CASE WHEN tabLang.languageCode = \"mr\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr\n, (CASE WHEN tabLang.languageCode = \"ta\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta\n, (CASE WHEN tabLang.languageCode = \"te\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te\nFrom _d6463952657fa86c.tabTranslation\nINNER JOIN (SELECT tanLang.language_name as language_name\n, tanLang.language_code as languageCode \nFROM _d6463952657fa86c.tabLanguage as tanLang) as tabLang\nON _d6463952657fa86c.tabTranslation.language = tabLang.languageCode) as tabTranslation\nON _d6463952657fa86c.`tabSub Systems`.sub_system_name = tabTranslation.sourceText;", |
|||
"ref_doctype": "Systems", |
|||
"report_name": "Sub Systems Translation", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,70 @@ |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils import cstr, cint, getdate |
|||
from frappe import msgprint, _ |
|||
|
|||
current_db_name = frappe.conf.get("db_name") |
|||
|
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
columns,lang = get_columns() |
|||
data = get_data() |
|||
return columns, data |
|||
|
|||
def get_data(): |
|||
|
|||
custom_lang = frappe.db.sql("""SELECT lang_code FROM {}.`tabCustom Languages` where lang_code <> "en" order by lang_name""".format(current_db_name),as_list=True) |
|||
|
|||
queryAppendLang = "" |
|||
for d in custom_lang: |
|||
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0]) |
|||
queryAppendLang += q |
|||
|
|||
sel = "" |
|||
for d in custom_lang: |
|||
r = ",tabTranslation.%s as %s"%(d[0],d[0]) |
|||
sel+= r |
|||
|
|||
|
|||
actualQuery = """Select |
|||
{0}.`tabSub Systems`.modified as "Modified On", |
|||
{0}.`tabSub Systems`.active_status as "Status", |
|||
{0}.`tabSub Systems`.sub_system_name as 'Vehicle Segment' |
|||
{1} |
|||
From {0}.`tabSub Systems` |
|||
LEFT JOIN {0}.`tabTranslation` as tabTrans |
|||
ON {0}.`tabSub Systems`.sub_system_name = tabTrans.source_text |
|||
LEFT JOIN (Select tabLang.languageCode as languageCode |
|||
,{0}.tabTranslation.source_text as sourceText |
|||
, {0}.tabTranslation.translated_text as translated_text |
|||
{2} |
|||
From {0}.tabTranslation |
|||
INNER JOIN (SELECT tanLang.language_name as language_name |
|||
, tanLang.language_code as languageCode |
|||
FROM {0}.tabLanguage as tanLang) as tabLang |
|||
ON {0}.tabTranslation.language = tabLang.languageCode) as tabTranslation |
|||
ON {0}.`tabSub Systems`.sub_system_name = tabTranslation.sourceText;""" .format(current_db_name,sel ,queryAppendLang) |
|||
|
|||
|
|||
data = frappe.db.sql(actualQuery,as_list=True) |
|||
|
|||
return data |
|||
|
|||
|
|||
def get_columns(): |
|||
|
|||
columns = [] |
|||
columns += [ |
|||
_("<b>Modified On</b>") + ":Datetime/:200", _("<b>Status</b>") + ":Data/:100",_("<b>Sub Systems</b>") + ":Data/:300", |
|||
] |
|||
lang = [] |
|||
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM {0}.`tabCustom Languages` where lang_code <> "en" order by lang_name""".format(current_db_name),as_dict=1) |
|||
for d in custom_lang: |
|||
lang.append("<b>"+cstr(d["lang_name"])+"</b>"+ "::300") |
|||
columns += lang |
|||
return columns,lang |
@ -0,0 +1,17 @@ |
|||
// Copyright (c) 2016, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
/* eslint-disable */ |
|||
|
|||
frappe.query_reports["Systems Translation"] = { |
|||
"filters": [ |
|||
|
|||
], |
|||
"formatter": function (value, row, column, data, default_formatter) { |
|||
if(value==null){ |
|||
value=' ' |
|||
column.align='left'; |
|||
} |
|||
value = default_formatter(value, row, column, data); |
|||
return value; |
|||
} |
|||
}; |
@ -0,0 +1,27 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"columns": [], |
|||
"creation": "2021-11-03 16:56:50.175508", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2022-05-17 15:40:58.691805", |
|||
"modified_by": "Administrator", |
|||
"module": "Masters", |
|||
"name": "Systems Translation", |
|||
"owner": "mahibaalana@hnsonline.com", |
|||
"prepared_report": 0, |
|||
"query": "Select tabSystems.modified as 'Modified On', tabSystems.active_status as 'Status' ,tabSystems.system_name as 'System Name'\n,\ntabSystems.system_name as 'English', tabTranslation.gu as \u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0, tabTranslation.hi as \u0939\u093f\u0902\u0926\u0940, tabTranslation.kn as \u0c95\u0ca8\u0ccd\u0ca8\u0ca1, tabTranslation.ml as \u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02, tabTranslation.mr as \u092e\u0930\u093e\u0920\u0940, tabTranslation.ta as \u0ba4\u0bae\u0bbf\u0bb4\u0bcd, tabTranslation.te as \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41\n\nFrom _d6463952657fa86c.tabSystems\nLEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans \nON _d6463952657fa86c.tabSystems.system_name = tabTrans.source_text\n\nLEFT JOIN (Select tabLang.languageCode as languageCode\n,_d6463952657fa86c.tabTranslation.source_text as sourceText\n, _d6463952657fa86c.tabTranslation.translated_text as translated_text\n, (CASE WHEN tabLang.languageCode = \"en\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en\n, (CASE WHEN tabLang.languageCode = \"gu\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu\n, (CASE WHEN tabLang.languageCode = \"hi\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi\n, (CASE WHEN tabLang.languageCode = \"kn\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn\n, (CASE WHEN tabLang.languageCode = \"ml\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml\n, (CASE WHEN tabLang.languageCode = \"mr\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr\n, (CASE WHEN tabLang.languageCode = \"ta\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta\n, (CASE WHEN tabLang.languageCode = \"te\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te\nFrom _d6463952657fa86c.tabTranslation\nINNER JOIN (SELECT tanLang.language_name as language_name\n, tanLang.language_code as languageCode \nFROM _d6463952657fa86c.tabLanguage as tanLang) as tabLang\nON _d6463952657fa86c.tabTranslation.language = tabLang.languageCode) as tabTranslation\nON _d6463952657fa86c.tabSystems.system_name = tabTranslation.sourceText;", |
|||
"ref_doctype": "Systems", |
|||
"report_name": "Systems Translation", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,67 @@ |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils import cstr, cint, getdate |
|||
from frappe import msgprint, _ |
|||
|
|||
current_db_name = frappe.conf.get("db_name") |
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
columns,lang = get_columns() |
|||
data = get_data() |
|||
return columns, data |
|||
|
|||
def get_data(): |
|||
|
|||
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True) |
|||
|
|||
queryAppendLang = "" |
|||
for d in custom_lang: |
|||
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0]) |
|||
queryAppendLang += q |
|||
|
|||
sel = "" |
|||
for d in custom_lang: |
|||
r = ",tabTranslation.%s as %s"%(d[0],d[0]) |
|||
sel+= r |
|||
|
|||
|
|||
actualQuery = """Select |
|||
`tabSystems`.modified as "Modified On", |
|||
`tabSystems`.active_status as "Status", |
|||
`tabSystems`.system_name as 'Vehicle Segment' |
|||
%s |
|||
From %s.`tabSystems` |
|||
LEFT JOIN %s.`tabTranslation` as tabTrans |
|||
ON %s.`tabSystems`.system_name = tabTrans.source_text |
|||
LEFT JOIN (Select tabLang.languageCode as languageCode |
|||
,%s.tabTranslation.source_text as sourceText |
|||
, %s.tabTranslation.translated_text as translated_text |
|||
%s |
|||
From %s.tabTranslation |
|||
INNER JOIN (SELECT tanLang.language_name as language_name |
|||
, tanLang.language_code as languageCode |
|||
FROM %s.tabLanguage as tanLang) as tabLang |
|||
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation |
|||
ON %s.`tabSystems`.system_name = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name) |
|||
|
|||
data = frappe.db.sql(actualQuery,as_list=True) |
|||
|
|||
return data |
|||
|
|||
def get_columns(): |
|||
|
|||
columns = [] |
|||
columns += [ |
|||
_("<b>Modified On</b>") + ":Datetime/:200", _("<b>Status</b>") + ":Data/:100",_("<b>Systems</b>") + ":Data/:300", |
|||
] |
|||
lang = [] |
|||
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1) |
|||
for d in custom_lang: |
|||
lang.append("<b>"+cstr(d["lang_name"])+"</b>"+ "::300") |
|||
columns += lang |
|||
return columns,lang |
@ -0,0 +1,18 @@ |
|||
// Copyright (c) 2016, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
/* eslint-disable */ |
|||
|
|||
frappe.query_reports["Transmission Translation"] = { |
|||
"filters": [ |
|||
|
|||
], |
|||
"formatter": function (value, row, column, data, default_formatter) { |
|||
console.log(value) |
|||
if(value==null){ |
|||
value=' ' |
|||
column.align='left'; |
|||
} |
|||
value = default_formatter(value, row, column, data); |
|||
return value; |
|||
} |
|||
}; |
@ -0,0 +1,26 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"columns": [], |
|||
"creation": "2021-11-29 12:14:17.565403", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2022-05-17 15:55:54.646850", |
|||
"modified_by": "Administrator", |
|||
"module": "Masters", |
|||
"name": "Transmission Translation", |
|||
"owner": "Administrator", |
|||
"prepared_report": 0, |
|||
"ref_doctype": "Transmission", |
|||
"report_name": "Transmission Translation", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,65 @@ |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils import cstr, cint, getdate |
|||
from frappe import msgprint, _ |
|||
current_db_name = frappe.conf.get("db_name") |
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
columns,lang = get_columns() |
|||
data = get_data() |
|||
return columns, data |
|||
|
|||
def get_data(): |
|||
|
|||
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True) |
|||
queryAppendLang = "" |
|||
for d in custom_lang: |
|||
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0]) |
|||
queryAppendLang += q |
|||
|
|||
sel = "" |
|||
for d in custom_lang: |
|||
r = ",tabTranslation.%s as %s"%(d[0],d[0]) |
|||
sel+= r |
|||
|
|||
|
|||
actualQuery = """Select |
|||
`tabTransmission`.modified as "Modified On", |
|||
`tabTransmission`.active_status as "Status", |
|||
`tabTransmission`.transmission as 'Transmission' |
|||
%s |
|||
From %s.`tabTransmission` |
|||
LEFT JOIN %s.`tabTranslation` as tabTrans |
|||
ON %s.`tabTransmission`.transmission = tabTrans.source_text |
|||
LEFT JOIN (Select tabLang.languageCode as languageCode |
|||
,%s.tabTranslation.source_text as sourceText |
|||
, %s.tabTranslation.translated_text as translated_text |
|||
%s |
|||
From %s.tabTranslation |
|||
INNER JOIN (SELECT tanLang.language_name as language_name |
|||
, tanLang.language_code as languageCode |
|||
FROM %s.tabLanguage as tanLang) as tabLang |
|||
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation |
|||
ON %s.`tabTransmission`.transmission = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name) |
|||
|
|||
|
|||
data = frappe.db.sql(actualQuery,as_list=True) |
|||
return data |
|||
|
|||
def get_columns(): |
|||
|
|||
columns = [] |
|||
columns += [ |
|||
_("<b>Modified On</b>") + ":Datetime/:200", _("<b>Status</b>") + ":Data/:100",_("<b>Transmission</b>") + ":Data/:220", |
|||
] |
|||
lang = [] |
|||
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1) |
|||
for d in custom_lang: |
|||
lang.append("<b>"+cstr(d["lang_name"])+"</b>"+ "::220") |
|||
columns += lang |
|||
return columns,lang |
@ -0,0 +1,17 @@ |
|||
// Copyright (c) 2016, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
/* eslint-disable */ |
|||
|
|||
frappe.query_reports["Variant Translation"] = { |
|||
"filters": [ |
|||
|
|||
], |
|||
"formatter": function (value, row, column, data, default_formatter) { |
|||
if(value==null){ |
|||
value=' ' |
|||
column.align='left'; |
|||
} |
|||
value = default_formatter(value, row, column, data); |
|||
return value; |
|||
} |
|||
}; |
@ -0,0 +1,26 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"columns": [], |
|||
"creation": "2021-11-30 12:10:32.622816", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2022-05-17 16:03:23.326068", |
|||
"modified_by": "Administrator", |
|||
"module": "Masters", |
|||
"name": "Variant Translation", |
|||
"owner": "Administrator", |
|||
"prepared_report": 0, |
|||
"ref_doctype": "Variant", |
|||
"report_name": "Variant Translation", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,67 @@ |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils import cstr, cint, getdate |
|||
from frappe import msgprint, _ |
|||
|
|||
current_db_name = frappe.conf.get("db_name") |
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
columns,lang = get_columns() |
|||
data = get_data() |
|||
return columns, data |
|||
|
|||
def get_data(): |
|||
|
|||
custom_lang = frappe.db.sql("""SELECT lang_code FROM `tabCustom Languages` where lang_code <> "en" order by lang_name""",as_list=True) |
|||
queryAppendLang = "" |
|||
for d in custom_lang: |
|||
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN tabTranslation.translated_text ELSE null END) as %s" %(d[0],d[0]) |
|||
queryAppendLang += q |
|||
|
|||
sel = "" |
|||
for d in custom_lang: |
|||
r = ",tabTranslation.%s as %s"%(d[0],d[0]) |
|||
sel+= r |
|||
|
|||
actualQuery = """Select |
|||
`tabVariant`.modified as "Modified On", |
|||
`tabVariant`.active_status as "Status", |
|||
`tabVariant`.vehicle as "Vehicle", |
|||
`tabVariant`.variant as 'Variant' |
|||
|
|||
%s |
|||
From `tabVariant` |
|||
LEFT JOIN `tabTranslation` as tabTrans |
|||
ON `tabVariant`.variant = tabTrans.source_text |
|||
LEFT JOIN (Select tabLang.languageCode as languageCode |
|||
,tabTranslation.source_text as sourceText |
|||
, tabTranslation.translated_text as translated_text |
|||
%s |
|||
From tabTranslation |
|||
INNER JOIN (SELECT tanLang.language_name as language_name |
|||
, tanLang.language_code as languageCode |
|||
FROM tabLanguage as tanLang) as tabLang |
|||
ON tabTranslation.language = tabLang.languageCode) as tabTranslation |
|||
ON `tabVariant`.variant = tabTranslation.sourceText;""" % (sel ,queryAppendLang) |
|||
|
|||
data = frappe.db.sql(actualQuery,as_list=True) |
|||
return data |
|||
|
|||
|
|||
def get_columns(): |
|||
|
|||
columns = [] |
|||
columns += [ |
|||
_("<b>Modified On</b>") + ":Data/:240", _("<b>Status</b>") + ":Data/:100", _("<b>Vehicle</b>") + ":Data/:200",_("<b>Variant</b>") + ":Data/:220", |
|||
] |
|||
lang = [] |
|||
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1) |
|||
for d in custom_lang: |
|||
lang.append("<b>"+cstr(d["lang_name"])+"</b>"+ "::220") |
|||
columns += lang |
|||
return columns,lang |
@ -0,0 +1,18 @@ |
|||
// Copyright (c) 2016, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
/* eslint-disable */ |
|||
|
|||
frappe.query_reports["Vehicle Segment Translation"] = { |
|||
"filters": [ |
|||
|
|||
], |
|||
"formatter": function (value, row, column, data, default_formatter) { |
|||
if(value==null){ |
|||
value=' ' |
|||
column.align='left'; |
|||
} |
|||
value = default_formatter(value, row, column, data); |
|||
return value; |
|||
|
|||
} |
|||
}; |
@ -0,0 +1,47 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"columns": [ |
|||
{ |
|||
"fieldname": "Modified On", |
|||
"fieldtype": "Datetime", |
|||
"label": "Modified On", |
|||
"width": 0 |
|||
}, |
|||
{ |
|||
"fieldname": "Status", |
|||
"fieldtype": "Data", |
|||
"label": "Status", |
|||
"width": 0 |
|||
}, |
|||
{ |
|||
"fieldname": "Vehicle Segment", |
|||
"fieldtype": "Data", |
|||
"label": "Vehicle Segment", |
|||
"width": 0 |
|||
} |
|||
], |
|||
"creation": "2021-11-03 14:37:19.857975", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2022-05-17 15:40:27.039460", |
|||
"modified_by": "Administrator", |
|||
"module": "Masters", |
|||
"name": "Vehicle Segment Translation", |
|||
"owner": "mahibaalana@hnsonline.com", |
|||
"prepared_report": 0, |
|||
"query": "Select `tabVehicle Segment`.modified as 'Modified On',`tabVehicle Segment`.active_status as Status, `tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' , \r\n`tabVehicle Segment`.vehicle_segment as 'English', tabTranslation.gu as \u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0, tabTranslation.hi as \u0939\u093f\u0902\u0926\u0940, tabTranslation.kn as \u0c95\u0ca8\u0ccd\u0ca8\u0ca1, tabTranslation.ml as \u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02, tabTranslation.mr as \u092e\u0930\u093e\u0920\u0940, tabTranslation.ta as \u0ba4\u0bae\u0bbf\u0bb4\u0bcd, tabTranslation.te as \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41\r\nFrom _d6463952657fa86c.`tabVehicle Segment` \r\nLEFT JOIN _d6463952657fa86c.`tabTranslation` as tabTrans \r\nON _d6463952657fa86c.`tabVehicle Segment`.vehicle_segment = tabTrans.source_text\r\n\r\nLEFT JOIN (Select tabLang.languageCode as languageCode\r\n,_d6463952657fa86c.tabTranslation.source_text as sourceText\r\n, _d6463952657fa86c.tabTranslation.translated_text as translated_text\r\n, (CASE WHEN tabLang.languageCode = \"en\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as en\r\n, (CASE WHEN tabLang.languageCode = \"gu\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as gu\r\n, (CASE WHEN tabLang.languageCode = \"hi\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as hi\r\n, (CASE WHEN tabLang.languageCode = \"kn\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as kn\r\n, (CASE WHEN tabLang.languageCode = \"ml\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ml\r\n, (CASE WHEN tabLang.languageCode = \"mr\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as mr\r\n, (CASE WHEN tabLang.languageCode = \"ta\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as ta\r\n, (CASE WHEN tabLang.languageCode = \"te\" THEN _d6463952657fa86c.tabTranslation.translated_text ELSE null END) as te\r\nFrom _d6463952657fa86c.tabTranslation\r\nINNER JOIN (SELECT tanLang.language_name as language_name\r\n, tanLang.language_code as languageCode \r\nFROM _d6463952657fa86c.tabLanguage as tanLang) as tabLang\r\nON _d6463952657fa86c.tabTranslation.language = tabLang.languageCode) as tabTranslation\r\nON _d6463952657fa86c.`tabVehicle Segment`.vehicle_segment = tabTranslation.sourceText;", |
|||
"ref_doctype": "Vehicle Segment", |
|||
"report_name": "Vehicle Segment Translation", |
|||
"report_script": "\r\n columns = get_columns()\r\n data = [columns],[result]\r\n\r\n\r\n\r\ndef get_columns():\r\n\r\n\tcolumns = []\r\n\r\n\tcolumns += [\r\n\t\t_(\"Modified On\") + \":Datetime/Employee:120\", _(\"Status\") + \":Data/:120\", _(\"Vehicle Segment\")+ \":Data/:120\"\r\n\t]\r\n\t\r\n\tlang = frappe.db.get_list('Custom Languages')\r\n\t\r\n\tfor day in lang:\r\n\t\t\r\n\t\tcolumns.append(cstr(day)+\"::58\")\r\n\treturn columns\r\n\t\r\n\r\n", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,71 @@ |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils import cstr, cint, getdate |
|||
from frappe import msgprint, _ |
|||
current_db_name = frappe.conf.get("db_name") |
|||
|
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
columns,lang = get_columns() |
|||
data = get_data() |
|||
return columns, data |
|||
|
|||
def get_data(): |
|||
|
|||
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True) |
|||
|
|||
|
|||
queryAppendLang = "" |
|||
for d in custom_lang: |
|||
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0]) |
|||
queryAppendLang += q |
|||
|
|||
sel = "" |
|||
for d in custom_lang: |
|||
r = ",tabTranslation.%s as %s"%(d[0],d[0]) |
|||
sel+= r |
|||
|
|||
|
|||
actualQuery = """Select |
|||
`tabVehicle Segment`.modified as "Modified On", |
|||
`tabVehicle Segment`.active_status as "Status", |
|||
`tabVehicle Segment`.vehicle_segment as 'Vehicle Segment' |
|||
|
|||
|
|||
%s |
|||
From %s.`tabVehicle Segment` |
|||
LEFT JOIN %s.`tabTranslation` as tabTrans |
|||
ON %s.`tabVehicle Segment`.vehicle_segment = tabTrans.source_text |
|||
LEFT JOIN (Select tabLang.languageCode as languageCode |
|||
,%s.tabTranslation.source_text as sourceText |
|||
, %s.tabTranslation.translated_text as translated_text |
|||
%s |
|||
From %s.tabTranslation |
|||
INNER JOIN (SELECT tanLang.language_name as language_name |
|||
, tanLang.language_code as languageCode |
|||
FROM %s.tabLanguage as tanLang) as tabLang |
|||
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation |
|||
ON %s.`tabVehicle Segment`.vehicle_segment = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name) |
|||
|
|||
|
|||
data = frappe.db.sql(actualQuery,as_list=True) |
|||
return data |
|||
|
|||
|
|||
def get_columns(): |
|||
|
|||
columns = [] |
|||
columns += [ |
|||
_("<b>Modified On</b>") + ":Datetime/:200", _("<b>Status</b>") + ":Data/:100",_("<b>Vehicle Segment</b>") + ":Data/:220", |
|||
] |
|||
lang = [] |
|||
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1) |
|||
for d in custom_lang: |
|||
lang.append("<b>"+cstr(d["lang_name"])+"</b>"+ "::220") |
|||
columns += lang |
|||
return columns,lang |
@ -0,0 +1,17 @@ |
|||
// Copyright (c) 2016, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
/* eslint-disable */ |
|||
|
|||
frappe.query_reports["Vehicle Translation"] = { |
|||
"filters": [ |
|||
|
|||
], |
|||
"formatter": function (value, row, column, data, default_formatter) { |
|||
if(value==null){ |
|||
value=' ' |
|||
column.align='left'; |
|||
} |
|||
value = default_formatter(value, row, column, data); |
|||
return value; |
|||
} |
|||
}; |
@ -0,0 +1,26 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"columns": [], |
|||
"creation": "2021-11-24 16:56:50.600660", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2022-05-17 15:52:16.547515", |
|||
"modified_by": "Administrator", |
|||
"module": "Masters", |
|||
"name": "Vehicle Translation", |
|||
"owner": "Administrator", |
|||
"prepared_report": 0, |
|||
"ref_doctype": "Vehicle", |
|||
"report_name": "Vehicle Translation", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,65 @@ |
|||
# Copyright (c) 2013, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
|
|||
from __future__ import unicode_literals |
|||
import frappe |
|||
from frappe.utils import cstr, cint, getdate |
|||
from frappe import msgprint, _ |
|||
current_db_name = frappe.conf.get("db_name") |
|||
def execute(filters=None): |
|||
columns, data = [], [] |
|||
columns,lang = get_columns() |
|||
data = get_data() |
|||
return columns, data |
|||
|
|||
def get_data(): |
|||
|
|||
custom_lang = frappe.db.sql("""SELECT lang_code FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_list=True) |
|||
queryAppendLang = "" |
|||
for d in custom_lang: |
|||
q = ", (CASE WHEN tabLang.languageCode = '%s' THEN %s.tabTranslation.translated_text ELSE null END) as %s" %(d[0],current_db_name,d[0]) |
|||
queryAppendLang += q |
|||
|
|||
sel = "" |
|||
for d in custom_lang: |
|||
r = ",tabTranslation.%s as %s"%(d[0],d[0]) |
|||
sel+= r |
|||
|
|||
|
|||
actualQuery = """Select |
|||
`tabVehicle`.modified as "Modified On", |
|||
`tabVehicle`.active_status as "Status", |
|||
`tabVehicle`.vehicle as 'Vehicle' |
|||
%s |
|||
From %s.`tabVehicle` |
|||
LEFT JOIN %s.`tabTranslation` as tabTrans |
|||
ON %s.`tabVehicle`.vehicle = tabTrans.source_text |
|||
LEFT JOIN (Select tabLang.languageCode as languageCode |
|||
,%s.tabTranslation.source_text as sourceText |
|||
, %s.tabTranslation.translated_text as translated_text |
|||
%s |
|||
From %s.tabTranslation |
|||
INNER JOIN (SELECT tanLang.language_name as language_name |
|||
, tanLang.language_code as languageCode |
|||
FROM %s.tabLanguage as tanLang) as tabLang |
|||
ON %s.tabTranslation.language = tabLang.languageCode) as tabTranslation |
|||
ON %s.`tabVehicle`.vehicle = tabTranslation.sourceText;""" % (sel,current_db_name,current_db_name,current_db_name,current_db_name,current_db_name ,queryAppendLang,current_db_name,current_db_name,current_db_name,current_db_name) |
|||
|
|||
|
|||
data = frappe.db.sql(actualQuery,as_list=True) |
|||
return data |
|||
|
|||
def get_columns(): |
|||
|
|||
columns = [] |
|||
columns += [ |
|||
_("<b>Modified On</b>") + ":Datetime/:200", _("<b>Status</b>") + ":Data/:100",_("<b>Vehicle</b>") + ":Data/:220", |
|||
] |
|||
lang = [] |
|||
custom_lang = frappe.db.sql("""SELECT lang_code,lang_name,active_status FROM %s.`tabCustom Languages` where lang_code <> "en" order by lang_name"""%(current_db_name),as_dict=1) |
|||
for d in custom_lang: |
|||
lang.append("<b>"+cstr(d["lang_name"])+"</b>"+ "::220") |
|||
columns += lang |
|||
return columns,lang |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,8 +0,0 @@ |
|||
// Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and contributors
|
|||
// For license information, please see license.txt
|
|||
|
|||
frappe.ui.form.on('Pro', { |
|||
// refresh: function(frm) {
|
|||
|
|||
// }
|
|||
}); |
@ -1,217 +0,0 @@ |
|||
{ |
|||
"actions": [], |
|||
"allow_import": 1, |
|||
"autoname": "format:{variant_mapping}-{sub_systems}-{language}", |
|||
"creation": "2021-12-03 09:21:21.977317", |
|||
"doctype": "DocType", |
|||
"editable_grid": 1, |
|||
"engine": "InnoDB", |
|||
"field_order": [ |
|||
"variant_mapping", |
|||
"column_break_3", |
|||
"sub_systems", |
|||
"fuel", |
|||
"column_break_6", |
|||
"language", |
|||
"transmission", |
|||
"column_break_8", |
|||
"active_status", |
|||
"workflow_state", |
|||
"drive", |
|||
"column_break_10", |
|||
"vehicle", |
|||
"family_code", |
|||
"section_break_12", |
|||
"procedure", |
|||
"column_break_17", |
|||
"step", |
|||
"section_break_19", |
|||
"procedure_details", |
|||
"procedure_list_section", |
|||
"procedure_list" |
|||
], |
|||
"fields": [ |
|||
{ |
|||
"allow_in_quick_entry": 1, |
|||
"fieldname": "variant_mapping", |
|||
"fieldtype": "Link", |
|||
"in_list_view": 1, |
|||
"in_preview": 1, |
|||
"in_standard_filter": 1, |
|||
"label": "Variant Mapping", |
|||
"options": "Variant Mapping", |
|||
"reqd": 1, |
|||
"set_only_once": 1 |
|||
}, |
|||
{ |
|||
"fieldname": "column_break_3", |
|||
"fieldtype": "Column Break" |
|||
}, |
|||
{ |
|||
"fieldname": "sub_systems", |
|||
"fieldtype": "Link", |
|||
"label": "Sub Systems", |
|||
"options": "Sub Systems", |
|||
"reqd": 1, |
|||
"set_only_once": 1 |
|||
}, |
|||
{ |
|||
"fetch_from": "variant_mapping.fuel", |
|||
"fieldname": "fuel", |
|||
"fieldtype": "Link", |
|||
"label": "Fuel", |
|||
"options": "Fuel", |
|||
"read_only": 1 |
|||
}, |
|||
{ |
|||
"fieldname": "column_break_6", |
|||
"fieldtype": "Column Break" |
|||
}, |
|||
{ |
|||
"fieldname": "language", |
|||
"fieldtype": "Link", |
|||
"in_list_view": 1, |
|||
"label": "Language", |
|||
"options": "Custom Languages", |
|||
"reqd": 1, |
|||
"set_only_once": 1 |
|||
}, |
|||
{ |
|||
"fetch_from": "variant_mapping.transmission", |
|||
"fieldname": "transmission", |
|||
"fieldtype": "Link", |
|||
"label": "Transmission", |
|||
"options": "Transmission", |
|||
"read_only": 1 |
|||
}, |
|||
{ |
|||
"fieldname": "column_break_8", |
|||
"fieldtype": "Column Break" |
|||
}, |
|||
{ |
|||
"allow_in_quick_entry": 1, |
|||
"fieldname": "active_status", |
|||
"fieldtype": "Select", |
|||
"in_list_view": 1, |
|||
"in_preview": 1, |
|||
"in_standard_filter": 1, |
|||
"label": "Active Status", |
|||
"options": "Active\nInactive", |
|||
"reqd": 1 |
|||
}, |
|||
{ |
|||
"default": "Draft", |
|||
"fieldname": "workflow_state", |
|||
"fieldtype": "Select", |
|||
"hidden": 1, |
|||
"in_list_view": 1, |
|||
"in_standard_filter": 1, |
|||
"label": "Workflow State", |
|||
"options": "Draft\nReview Pending\nApproval Pending\nPublish Approval Pending\nPublish Ready\nPublished\nRevoked" |
|||
}, |
|||
{ |
|||
"fetch_from": "variant_mapping.drive", |
|||
"fieldname": "drive", |
|||
"fieldtype": "Link", |
|||
"label": "Drive", |
|||
"options": "Drive", |
|||
"read_only": 1 |
|||
}, |
|||
{ |
|||
"fieldname": "column_break_10", |
|||
"fieldtype": "Column Break" |
|||
}, |
|||
{ |
|||
"fetch_from": "variant_mapping.vehicle", |
|||
"fieldname": "vehicle", |
|||
"fieldtype": "Link", |
|||
"label": "Vehicle", |
|||
"options": "Vehicle", |
|||
"read_only": 1 |
|||
}, |
|||
{ |
|||
"fetch_from": "variant_mapping.family_code", |
|||
"fieldname": "family_code", |
|||
"fieldtype": "Data", |
|||
"label": "Family Code", |
|||
"read_only": 1 |
|||
}, |
|||
{ |
|||
"fieldname": "section_break_12", |
|||
"fieldtype": "Section Break" |
|||
}, |
|||
{ |
|||
"allow_bulk_edit": 1, |
|||
"fieldname": "procedure_details", |
|||
"fieldtype": "Table", |
|||
"label": "Procedure_Details", |
|||
"options": "Procedure_Details" |
|||
}, |
|||
{ |
|||
"fieldname": "procedure", |
|||
"fieldtype": "Select", |
|||
"label": "Procedure", |
|||
"options": "Overview\nInstall" |
|||
}, |
|||
{ |
|||
"fieldname": "column_break_17", |
|||
"fieldtype": "Column Break" |
|||
}, |
|||
{ |
|||
"fieldname": "section_break_19", |
|||
"fieldtype": "Section Break" |
|||
}, |
|||
{ |
|||
"fieldname": "step", |
|||
"fieldtype": "Select", |
|||
"label": "Step" |
|||
}, |
|||
{ |
|||
"fieldname": "procedure_list_section", |
|||
"fieldtype": "Section Break", |
|||
"label": "Procedure List" |
|||
}, |
|||
{ |
|||
"fieldname": "procedure_list", |
|||
"fieldtype": "Table", |
|||
"label": "Procedure List", |
|||
"options": "Procedure_Procedure List" |
|||
} |
|||
], |
|||
"index_web_pages_for_search": 1, |
|||
"links": [], |
|||
"modified": "2021-12-03 12:34:46.398047", |
|||
"modified_by": "Administrator", |
|||
"module": "Transactions", |
|||
"name": "Pro", |
|||
"owner": "Administrator", |
|||
"permissions": [ |
|||
{ |
|||
"create": 1, |
|||
"delete": 1, |
|||
"email": 1, |
|||
"export": 1, |
|||
"print": 1, |
|||
"read": 1, |
|||
"report": 1, |
|||
"role": "System Manager", |
|||
"share": 1, |
|||
"write": 1 |
|||
}, |
|||
{ |
|||
"create": 1, |
|||
"email": 1, |
|||
"export": 1, |
|||
"print": 1, |
|||
"read": 1, |
|||
"report": 1, |
|||
"role": "_Author", |
|||
"share": 1, |
|||
"write": 1 |
|||
} |
|||
], |
|||
"search_fields": "active_status,workflow_state,fuel,transmission,drive,family_code,language", |
|||
"sort_field": "modified", |
|||
"sort_order": "DESC", |
|||
"track_changes": 1 |
|||
} |
@ -1,8 +0,0 @@ |
|||
# Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and contributors |
|||
# For license information, please see license.txt |
|||
|
|||
# import frappe |
|||
from frappe.model.document import Document |
|||
|
|||
class Pro(Document): |
|||
pass |
@ -1,8 +0,0 @@ |
|||
# Copyright (c) 2021, Hard n Soft Technologies Pvt Ltd and Contributors |
|||
# See license.txt |
|||
|
|||
# import frappe |
|||
import unittest |
|||
|
|||
class TestPro(unittest.TestCase): |
|||
pass |
@ -0,0 +1,178 @@ |
|||
// Copyright (c) 2016, Frappe Technologies and contributors
|
|||
// For license information, please see license.txt
|
|||
/* eslint-disable */ |
|||
|
|||
frappe.query_reports["Procedure Report"] = { |
|||
"filters": [ |
|||
{ |
|||
"fieldname": "variant_mapping", |
|||
"label": __("Variant Mapping"), |
|||
"fieldtype": "Link", |
|||
"options": "Variant Mapping", |
|||
}, |
|||
], |
|||
|
|||
"formatter": function (value, row, column, data, default_formatter) { |
|||
if (data && column.fieldname == "procedure_name") { |
|||
switch (data.indent) { |
|||
case 3: |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 40 40">
|
|||
<g id="Procedure" transform="translate(-2581 -1954)"> |
|||
<rect id="Rectangle_1705" data-name="Rectangle 1705" width="40" height="40" transform="translate(2581 1954)" fill="none"/> |
|||
<g id="Group_3451" data-name="Group 3451" transform="translate(2225.943 558.381)"> |
|||
<path id="Path_2563" data-name="Path 2563" d="M386.281,1406.864c0-1.159-.454-1.613-1.616-1.616-.979,0-1.958,0-2.983,0,0-.224.009-.388,0-.55a.857.857,0,0,0-.951-.919c-.536-.009-1.074,0-1.678,0-.031-.685.1-1.436-.7-1.776h-6.579c-.679.385-.65,1.049-.624,1.776-.569,0-1.1,0-1.63,0-.952,0-1.186.226-1.205,1.161,0,.074-.009.147-.018.3h-1.37c-.593,0-1.188-.009-1.782,0a1.284,1.284,0,0,0-1.421,1.411q-.007,10.725-.01,21.449a1.4,1.4,0,0,0,1.036,1.453h14.5l.29-.274c.307-.289.616-.577.911-.877l.545-.553a3.172,3.172,0,0,1-1.173-.686l-.145.141v0a.507.507,0,0,1-.032-.176v-.144a3.192,3.192,0,0,1,2.259-5.358h-1.342c-1.412,0-2.058.655-2.061,2.086q0,2.006,0,4.013v.646h-13.6v-21.936h3.419c0,.315,0,.624,0,.933.01.752.318,1.055,1.108,1.057,2.322.007,4.643,0,6.965,0q2.034,0,4.068,0c.97,0,1.228-.258,1.23-1.217,0-.254,0-.51,0-.78h3.443v15.2h-3.065a3.183,3.183,0,0,1,2.934,2.138c.3-.311.605-.623.907-.934a1.306,1.306,0,0,0,.366-.806c0-.071,0-.14,0-.21C386.288,1416.83,386.282,1411.847,386.281,1406.864Zm-5.771.374H369.472V1404.9h1.742c.93,0,1.061-.133,1.065-1.064,0-.216,0-.433,0-.675H377.9c0,.322,0,.614,0,.907.007.6.2.809.791.827s1.184,0,1.818,0Z" transform="translate(0)" fill="#606060" stroke="#606060" stroke-width="0.25"/> |
|||
<path id="Path_2564" data-name="Path 2564" d="M408.471,1492.3q3.1,0,6.2,0a1.181,1.181,0,0,1,.6.07.787.787,0,0,1,.363.547c-.011.178-.248.379-.432.5-.124.078-.329.035-.5.035q-6.259,0-12.519,0c-.168,0-.377.042-.5-.039a.913.913,0,0,1-.413-.513.7.7,0,0,1,.329-.513,1.187,1.187,0,0,1,.6-.082Q405.341,1492.3,408.471,1492.3Z" transform="translate(-33.442 -80.228)" fill="#606060"/> |
|||
<path id="Path_2565" data-name="Path 2565" d="M408.413,1528.122c-2.143,0-4.287,0-6.43,0-.412,0-.811-.053-.817-.546s.38-.615.828-.614q6.374.008,12.747,0c.453,0,.83.118.816.623s-.415.539-.827.538C412.625,1528.118,410.519,1528.122,408.413,1528.122Z" transform="translate(-33.341 -111.024)" fill="#606060"/> |
|||
<path id="Path_2566" data-name="Path 2566" d="M406.889,1563.014c-1.633,0-3.267-.007-4.9,0-.422,0-.8-.081-.814-.556-.012-.517.385-.6.827-.594q4.872.012,9.743,0c.411,0,.8.052.808.553.013.541-.389.6-.821.594C410.118,1563.009,408.5,1563.014,406.889,1563.014Z" transform="translate(-33.324 -142.032)" fill="#606060"/> |
|||
<path id="Path_2567" data-name="Path 2567" d="M479.649,1554.137c-.42-.235-.837-.474-1.259-.7a.175.175,0,0,1-.114-.181c-.011-.361-.026-.723-.062-1.082a.223.223,0,0,1,.119-.246c.382-.267.754-.549,1.131-.823a.141.141,0,0,0,.056-.195c-.144-.326-.286-.654-.424-.982a.141.141,0,0,0-.183-.088c-.473.092-.946.178-1.419.276l-.011,0a.154.154,0,0,1-.175-.066c-.249-.275-.5-.546-.763-.808a.188.188,0,0,1-.064-.217c.123-.464.231-.932.349-1.4a.131.131,0,0,0-.076-.173l-.354-.177q-.3-.151-.6-.3a.14.14,0,0,0-.2.042c-.3.37-.607.734-.9,1.107a.2.2,0,0,1-.221.085c-.362-.051-.727-.09-1.092-.121a.175.175,0,0,1-.174-.122c-.206-.438-.422-.874-.643-1.305a.17.17,0,0,0-.139-.077c-.362.078-.723.169-1.084.253a.122.122,0,0,0-.1.144c.008.49.01.98.023,1.47a.15.15,0,0,1-.087.155c-.316.2-.632.405-.94.62a.187.187,0,0,1-.226.022c-.432-.2-.869-.387-1.3-.582a.146.146,0,0,0-.205.055q-.306.422-.623.836a.154.154,0,0,0,.013.225c.312.359.618.724.933,1.081a.168.168,0,0,1,.045.2q-.175.536-.321,1.08a.183.183,0,0,1-.154.15c-.459.126-.914.263-1.372.394a.148.148,0,0,0-.127.174c.023.346.043.694.061,1.04a.151.151,0,0,0,.143.161c.475.076.948.159,1.423.23a.171.171,0,0,1,.159.125c.141.347.29.693.447,1.033a.165.165,0,0,1-.013.2c-.173.25-.342.5-.512.757-.1.145-.195.292-.293.436a.155.155,0,0,0,.021.226c.15.156.3.313.449.47.09.094.18.189.268.284a.137.137,0,0,0,.2.029c.172-.106.345-.209.518-.313q.362-.218.724-.438a.152.152,0,0,1,.186-.011c.119.063.237.125.357.186q.334.17.674.33a.172.172,0,0,1,.112.168c.046.482.1.964.155,1.448a.131.131,0,0,0,.134.133c.345.04.691.078,1.036.121a.163.163,0,0,0,.2-.124c.153-.45.315-.9.465-1.349a.17.17,0,0,1,.152-.134c.358-.075.715-.156,1.068-.252a.209.209,0,0,1,.243.063c.337.335.686.66,1.029.989a.131.131,0,0,0,.188.016q.433-.29.871-.572a.163.163,0,0,0,.076-.226c-.171-.445-.335-.892-.51-1.333a.167.167,0,0,1,.027-.2c.231-.3.454-.6.672-.9a.165.165,0,0,1,.182-.089c.344.045.691.078,1.036.115,0,0,0-.008,0-.013.139,0,.277,0,.415,0a.135.135,0,0,0,.157-.108q.152-.521.31-1.039A.132.132,0,0,0,479.649,1554.137Zm-6.27,1.911a3.069,3.069,0,0,1-2.075-.809c-.059-.053-.115-.11-.17-.17a3.06,3.06,0,0,1,2.166-5.136c.026,0,.052,0,.079,0s.051,0,.077,0h0a3.058,3.058,0,0,1-.079,6.115Z" transform="translate(-91.456 -128.231)" fill="#000000"/> |
|||
</g> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
break; |
|||
case 2: |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 40 40">
|
|||
<g id="Sub_system" data-name="Sub system" transform="translate(-2581 -1900)"> |
|||
<rect id="Rectangle_1704" data-name="Rectangle 1704" width="40" height="40" transform="translate(2581 1900)" fill="none"/> |
|||
<g id="Group_3450" data-name="Group 3450" transform="translate(3980.455 977.971)"> |
|||
<path id="Path_2488" data-name="Path 2488" d="M-1366.515,938.924q-1.059-.01-2.119,0a.561.561,0,0,0-.626.633c-.007.633,0,1.266,0,1.9,0,.088,0,.177,0,.26-.56.083-.561.083-.561-.431,0-1.138-.034-2.276.014-3.412a1.8,1.8,0,0,0-1.793-1.785c-1.568.042-3.137.013-4.706.013-.088,0-.176-.008-.268-.011v-1.63a.316.316,0,0,1,.077-.031c.679,0,1.358,0,2.036-.007.492,0,.7-.217.7-.707,0-.66.005-1.321.015-1.981a.627.627,0,0,0-.689-.7c-.56,0-1.12,0-1.679,0q-3,0-6,0c-.464,0-.666.208-.667.675,0,.688,0,1.376,0,2.064,0,.449.207.648.662.652.514,0,1.027,0,1.541,0h.59V936.1h-.318c-.789,0-1.578,0-2.367,0a1.749,1.749,0,0,0-1.4.647c-.532.632-1.073,1.254-1.614,1.878-.246.284-.449.669-.762.813a2.961,2.961,0,0,1-1.11.052,1.087,1.087,0,0,1-.137,0,1.881,1.881,0,0,0-1.863,1.84c.04.418.006.843.006,1.265v.251h-1.122c0-.892-.01-1.762,0-2.632.008-.453-.206-.716-.656-.718q-1.045-.005-2.091,0c-.437,0-.646.206-.646.637q0,4.431,0,8.862a.572.572,0,0,0,.646.641q1.033,0,2.064,0c.472,0,.667-.193.669-.669,0-.8,0-1.6,0-2.394,0-.1.008-.194.013-.292h1.117c0,.531,0,1.043,0,1.554a1.832,1.832,0,0,0,1.8,1.8c.358,0,.717-.015,1.073.01a.623.623,0,0,1,.389.178c.772.872,1.529,1.758,2.292,2.638a1.585,1.585,0,0,0,1.239.562q3.564.009,7.128,0a1.7,1.7,0,0,0,1.257-.527q1.994-2.034,3.993-4.063a1.784,1.784,0,0,0,.551-1.332c0-.272,0-.544,0-.824h.564v.308c0,.615,0,1.229,0,1.844a.572.572,0,0,0,.643.647q1.059.006,2.119,0a.566.566,0,0,0,.623-.637q0-4.431,0-8.862A.574.574,0,0,0-1366.515,938.924Zm-23.059,6.2h-1.217c-.936,0-1.017.081-1.017,1.019v2.373c-.335,0-.628-.009-.92,0-.181.007-.212-.078-.211-.233.006-.513,0-1.027,0-1.54,0-1.943.008-3.887,0-5.83,0-.248.075-.321.313-.3.262.019.526,0,.818,0,0,.293,0,.556,0,.82,0,.642,0,1.283,0,1.925a.572.572,0,0,0,.642.646c.522.005,1.044,0,1.588,0Zm8.209-11.836h-.284v-1.1h6.732v1.1h-1.158c-.321,0-.642,0-.963,0-.464,0-.676.213-.677.67,0,.606,0,1.211,0,1.816v.321h-1.125c0-.171,0-.332,0-.493,0-.55.009-1.1.016-1.65a.606.606,0,0,0-.643-.661C-1380.1,933.284-1380.732,933.286-1381.365,933.285Zm14.33,14.633h-1.1v-.925c0-.422.005-.844,0-1.266a.563.563,0,0,0-.6-.605q-.812-.01-1.623,0a.557.557,0,0,0-.592.611c0,.468.014.936-.009,1.4a.723.723,0,0,1-.178.435q-2.012,2.073-4.05,4.122a.708.708,0,0,1-.454.184q-3.55.018-7.1,0a.668.668,0,0,1-.436-.217q-1.245-1.414-2.461-2.855a.743.743,0,0,0-.613-.3c-.5.006-1.009,0-1.513,0-.472-.006-.653-.183-.653-.651q0-3.275,0-6.549c0-.511.188-.688.706-.689.468,0,.936-.009,1.4.006a.784.784,0,0,0,.668-.3c.786-.921,1.585-1.831,2.366-2.755a.829.829,0,0,1,.7-.328c3.688.01,7.375.006,11.062.007.462,0,.563.1.563.566q0,2.188,0,4.376c0,.5.184.684.675.686s1.009,0,1.514,0a.564.564,0,0,0,.628-.629c0-.715,0-1.429,0-2.175h1.1Z" transform="translate(0)" fill="#606060"/> |
|||
<path id="Path_2489" data-name="Path 2489" d="M-1162.721,1084.808c-.943,0-1.82-.005-2.7.009-.084,0-.2.114-.243.2q-1.313,2.606-2.612,5.219c-.034.069-.059.142-.1.247h2.813l-1.641,4.932.054.024,4.431-6.1h-2.834Z" transform="translate(-213.288 -145.408)" fill="#000000"/> |
|||
</g> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
break; |
|||
case 1: |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 40 40">
|
|||
<g id="System" transform="translate(-2581 -1847)"> |
|||
<rect id="Rectangle_1703" data-name="Rectangle 1703" width="40" height="40" transform="translate(2581 1847)" fill="none"/> |
|||
<g id="Group_3452" data-name="Group 3452" transform="translate(2543.886 1836.5)"> |
|||
<g id="Group_3059" data-name="Group 3059" transform="translate(40 18)"> |
|||
<g id="Group_2846" data-name="Group 2846"> |
|||
<path id="Path_2504" data-name="Path 2504" d="M-75.495,783.858a2.7,2.7,0,0,0-2.613-2.766c-.051,0-.1,0-.14,0H-102.42a2.7,2.7,0,0,0-2.693,2.614V798.68a2.719,2.719,0,0,0,2.648,2.542c.507.01,1.015.007,1.523,0l7.811-.013v1.776h-4.045a1.665,1.665,0,0,0-1.314.641,2.653,2.653,0,0,0-.576,1.537.9.9,0,0,0,.181.7.9.9,0,0,0,.687.229h15.952a.714.714,0,0,0,.707-.723,2.722,2.722,0,0,0-.33-1.369,1.812,1.812,0,0,0-1.694-1.013c-.9.013-1.8.008-2.7,0l-1.217,0c0-.589,0-1.178-.01-1.766h7.225l.82-.006q.625-.006,1.248,0a2.6,2.6,0,0,0,1.914-.789,2.633,2.633,0,0,0,.8-1.977Q-75.5,791.152-75.495,783.858Zm-21.828,20.616a.3.3,0,0,1,.195-.049l13.5,0,.048,0a.44.44,0,0,1,.452.236H-97.478A.719.719,0,0,1-97.323,804.474Zm8.408-3.243v1.753H-91.7l0-1.763Zm7.94-1.428h-21.35a1.273,1.273,0,0,1-.925-.3,1.262,1.262,0,0,1-.439-.868,1.537,1.537,0,0,1,0-.215V783.872a1.275,1.275,0,0,1,1.188-1.352,1.5,1.5,0,0,1,.181,0h24.05a1.25,1.25,0,0,1,1.348,1.2,1.217,1.217,0,0,1,0,.176v14.6a1.256,1.256,0,0,1-1.111,1.293c-.25.024-.5.025-.754.025h-.174l-1.778,0C-80.819,799.8-80.9,799.8-80.975,799.8Z" transform="translate(105.113 -781.09)" fill="#606060"/> |
|||
<g id="car" transform="translate(8.425 4.295)"> |
|||
<g id="Group_550" data-name="Group 550"> |
|||
<g id="Group_549" data-name="Group 549"> |
|||
<path id="Path_452" data-name="Path 452" d="M-86.141,788.49l-1.6-3.759a.877.877,0,0,0-.808-.533H-95.4a.877.877,0,0,0-.808.533l-1.6,3.759a2.054,2.054,0,0,0-1.2,1.866V792.7a.881.881,0,0,0,.879.879h.289v1.463a.881.881,0,0,0,.879.879h1.174a.882.882,0,0,0,.885-.879h0V793.58h5.87v1.462a.881.881,0,0,0,.879.879h1.174a.882.882,0,0,0,.879-.879V793.58h.289a.883.883,0,0,0,.879-.879v-2.345A2.057,2.057,0,0,0-86.141,788.49Zm-9.532-3.526a.286.286,0,0,1,.272-.186h6.847a.288.288,0,0,1,.269.176l1.43,3.346H-97.108Zm.176,10.079a.29.29,0,0,1-.289.289h-1.177a.289.289,0,0,1-.289-.289h0V793.58H-95.5Zm8.5.289h-1.177a.289.289,0,0,1-.289-.289h0V793.58H-86.7v1.462h0a.291.291,0,0,1-.282.3H-87Zm1.174-2.345H-98.137a.289.289,0,0,1-.289-.289h0v-2.341a1.465,1.465,0,0,1,1.465-1.465h9.976a1.466,1.466,0,0,1,1.465,1.465V792.7h0a.29.29,0,0,1-.283.295h-.017Z" transform="translate(99.016 -784.197)" fill="#000000"/> |
|||
</g> |
|||
</g> |
|||
<g id="Group_552" data-name="Group 552" transform="translate(1.174 5.279)"> |
|||
<g id="Group_551" data-name="Group 551"> |
|||
<path id="Path_453" data-name="Path 453" d="M-96.739,787.848a1.464,1.464,0,0,0-1.465,1.465,1.465,1.465,0,0,0,1.465,1.465,1.465,1.465,0,0,0,1.465-1.465A1.466,1.466,0,0,0-96.739,787.848Zm0,2.345a.879.879,0,0,1-.879-.879.879.879,0,0,1,.879-.879.88.88,0,0,1,.879.879.882.882,0,0,1-.879.879Z" transform="translate(98.204 -787.848)" fill="#000000"/> |
|||
</g> |
|||
</g> |
|||
<g id="Group_554" data-name="Group 554" transform="translate(9.97 5.279)"> |
|||
<g id="Group_553" data-name="Group 553"> |
|||
<path id="Path_454" data-name="Path 454" d="M-90.655,787.848a1.464,1.464,0,0,0-1.465,1.465,1.465,1.465,0,0,0,1.465,1.465,1.465,1.465,0,0,0,1.465-1.465A1.466,1.466,0,0,0-90.655,787.848Zm0,2.345a.879.879,0,0,1-.879-.879.879.879,0,0,1,.879-.879.88.88,0,0,1,.879.879.882.882,0,0,1-.879.879Z" transform="translate(92.12 -787.848)" fill="#000000"/> |
|||
</g> |
|||
</g> |
|||
<g id="Group_556" data-name="Group 556" transform="translate(4.683 7.038)"> |
|||
<g id="Group_555" data-name="Group 555"> |
|||
<path id="Path_455" data-name="Path 455" d="M-91.37,789.065h-4.112a.294.294,0,0,0-.295.294.294.294,0,0,0,.295.295h4.1a.294.294,0,0,0,.294-.295.294.294,0,0,0-.294-.294Z" transform="translate(95.777 -789.065)" fill="#000000"/> |
|||
</g> |
|||
</g> |
|||
<g id="Group_558" data-name="Group 558" transform="translate(4.683 5.864)"> |
|||
<g id="Group_557" data-name="Group 557"> |
|||
<path id="Path_456" data-name="Path 456" d="M-91.37,788.253h-4.112a.294.294,0,0,0-.295.294.294.294,0,0,0,.295.295h4.1a.294.294,0,0,0,.294-.295.294.294,0,0,0-.294-.294Z" transform="translate(95.777 -788.253)" fill="#000000"/> |
|||
</g> |
|||
</g> |
|||
</g> |
|||
</g> |
|||
<g id="Group_3056" data-name="Group 3056" transform="translate(21.591 11.364)"> |
|||
<ellipse id="Ellipse_91" data-name="Ellipse 91" cx="7" cy="6.5" rx="7" ry="6.5" transform="translate(-0.477 0.136)" fill="#fff"/> |
|||
<path id="Path_2603" data-name="Path 2603" d="M-1045.072,205.021l-2.947-2.948a4.821,4.821,0,0,0,1.12-3.1,4.862,4.862,0,0,0-4.857-4.857h0a4.825,4.825,0,0,0-3.434,1.423,4.825,4.825,0,0,0-1.422,3.434,4.824,4.824,0,0,0,1.423,3.434,4.825,4.825,0,0,0,3.434,1.422,4.82,4.82,0,0,0,3.1-1.12l2.948,2.948a.447.447,0,0,0,.317.132.447.447,0,0,0,.317-.132A.449.449,0,0,0-1045.072,205.021Zm-6.684-2.091a3.933,3.933,0,0,1-2.8-1.159,3.933,3.933,0,0,1-1.16-2.8,3.933,3.933,0,0,1,1.16-2.8,3.933,3.933,0,0,1,2.8-1.16v0a3.964,3.964,0,0,1,3.959,3.959,3.933,3.933,0,0,1-1.16,2.8A3.933,3.933,0,0,1-1051.756,202.93Z" transform="translate(1058.064 -192.663)" fill="#000000"/> |
|||
</g> |
|||
</g> |
|||
</g> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
break; |
|||
case 0: |
|||
value = `<p><svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="18px" viewBox="0 0 24 24" width="18px" fill="#606060"><g><rect fill="none" height="24" width="24" y="0"/></g><g><g><path d="M18.92,6.01C18.72,5.42,18.16,5,17.5,5h-11C5.84,5,5.29,5.42,5.08,6.01L3,12v8c0,0.55,0.45,1,1,1h1c0.55,0,1-0.45,1-1v-1 h12v1c0,0.55,0.45,1,1,1h1c0.55,0,1-0.45,1-1v-8L18.92,6.01z M6.85,7h10.29l1.04,3H5.81L6.85,7z M19,17H5v-5h14V17z"/><circle cx="7.5" cy="14.5" r="1.5"/><circle cx="16.5" cy="14.5" r="1.5"/></g></g></svg><b> ${value}</b></p>` |
|||
break; |
|||
default: |
|||
value = `<p> <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 40 40">
|
|||
<g id="Steps" transform="translate(-2579 -2008)"> |
|||
<rect id="Rectangle_1706" data-name="Rectangle 1706" width="40" height="40" transform="translate(2579 2008)" fill="none"/> |
|||
<g id="Group_3453" data-name="Group 3453" transform="translate(-4.215 -1.96)"> |
|||
<circle id="Ellipse_97" data-name="Ellipse 97" cx="9" cy="9" r="9" transform="translate(2588.215 2020.96)" fill="#606060"/> |
|||
<path id="Path_2934" data-name="Path 2934" d="M6.732,17.942a.856.856,0,0,0,.68-.375,1.6,1.6,0,0,0,0-1.812L2.322,8.971l5.09-6.783a1.6,1.6,0,0,0,0-1.812.8.8,0,0,0-1.36,0L.282,8.065a1.6,1.6,0,0,0,0,1.812l5.77,7.689A.857.857,0,0,0,6.732,17.942Z" transform="translate(2617.437 2038.931) rotate(180)" fill="#000000"/> |
|||
</g> |
|||
</g> |
|||
</svg> ${value}</p>` |
|||
break; |
|||
} |
|||
} |
|||
if (data && column.fieldname == "length") { |
|||
column.align = 'center'; |
|||
switch (data.indent) { |
|||
case 2: |
|||
value = `<span class="filterable indicator-pill pink ellipsis"> ${value} Procedures</span>` |
|||
break; |
|||
case 3: |
|||
value = `<span class="filterable indicator-pill orange ellipsis"> ${value} Steps</span>` |
|||
break; |
|||
} |
|||
} |
|||
if (data && column.fieldname == "active_status") { |
|||
column.align = 'center'; |
|||
switch (value) { |
|||
case "Active": |
|||
value = `<span class="filterable indicator-pill green ellipsis"> ${value} </span>` |
|||
break; |
|||
|
|||
case "Inactive": |
|||
value = `<span class="filterable indicator-pill red ellipsis"> ${value} </span>` |
|||
break; |
|||
} |
|||
} |
|||
|
|||
|
|||
if(data && String(column.fieldname).slice(3)=='workflow_state'){ |
|||
if (value !== undefined){ |
|||
value = `<span>
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="18px" viewBox="0 0 24 24" width="18px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z"/></svg> |
|||
   ${value} </span>` |
|||
var langCode = String(column.fieldname).slice(0,2) |
|||
var proc = String(data.procedure).slice(0,-2) |
|||
column.link_onclick = "frappe.query_reports['_Procedure Report'].set_route(" + JSON.stringify(proc+langCode) + ")" |
|||
} |
|||
} |
|||
|
|||
if(data && String(column.fieldname).slice(2) == '_active_status'){ |
|||
switch(data.indent){ |
|||
case 2: |
|||
if(value !== undefined){ |
|||
newValue = "" |
|||
val = String(value).split(' / '); |
|||
switch (val[0]) { |
|||
case "Active": |
|||
newValue = `<span class="filterable indicator-pill green ellipsis"> ${val[0]} </span>` |
|||
break; |
|||
case "Inactive": |
|||
newValue = `<span class="filterable indicator-pill red ellipsis"> ${val[0]} </span>` |
|||
break; |
|||
} |
|||
value = newValue +" / "+ `<span class="filterable indicator-pill red ellipsis"> ${val[1]} </span>` |
|||
} |
|||
break; |
|||
case 3: |
|||
column.align= 'center' |
|||
if (value !==undefined){ |
|||
value = `<span class="filterable indicator-pill orange ellipsis"> ${value}</span>` |
|||
} |
|||
break; |
|||
} |
|||
} |
|||
|
|||
value = default_formatter(value, row, column, data); |
|||
return value; |
|||
}, |
|||
|
|||
"set_route": function (data) { |
|||
frappe.set_route("Form", "Procedure", data) |
|||
}, |
|||
|
|||
"tree": true, |
|||
"name_field": "procedure_name", |
|||
"parent_field": "", |
|||
"initial_depth": 2 |
|||
}; |
@ -0,0 +1,38 @@ |
|||
{ |
|||
"add_total_row": 0, |
|||
"columns": [], |
|||
"creation": "2021-11-10 12:27:31.252097", |
|||
"disable_prepared_report": 0, |
|||
"disabled": 0, |
|||
"docstatus": 0, |
|||
"doctype": "Report", |
|||
"filters": [ |
|||
{ |
|||
"fieldname": "Variant Mapping", |
|||
"fieldtype": "Link", |
|||
"label": "Variant Mapping", |
|||
"mandatory": 1, |
|||
"options": "Variant Mapping", |
|||
"wildcard_filter": 0 |
|||
} |
|||
], |
|||
"idx": 0, |
|||
"is_standard": "Yes", |
|||
"modified": "2022-05-17 16:05:06.151225", |
|||
"modified_by": "Administrator", |
|||
"module": "Transactions", |
|||
"name": "Procedure Report", |
|||
"owner": "Administrator", |
|||
"prepared_report": 0, |
|||
"ref_doctype": "Procedure", |
|||
"report_name": "Procedure Report", |
|||
"report_type": "Script Report", |
|||
"roles": [ |
|||
{ |
|||
"role": "System Manager" |
|||
}, |
|||
{ |
|||
"role": "_Author" |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,290 @@ |
|||
# # Copyright (c) 2013, Frappe Technologies and contributors |
|||
# # License: MIT. See LICENSE |
|||
from __future__ import unicode_literals |
|||
import functools |
|||
import frappe |
|||
from frappe import _ |
|||
|
|||
current_db_name = frappe.conf.get("db_name") |
|||
custom_lang = frappe.db.sql('''SELECT lang_code,lang_name FROM {}.`tabCustom Languages` where lang_code <> 'en'; '''.format( |
|||
current_db_name), as_dict=True) |
|||
|
|||
|
|||
def execute(filters=None): |
|||
validate_filters(filters) |
|||
data = get_data(filters) |
|||
columns = get_columns() |
|||
return columns, data |
|||
|
|||
|
|||
def validate_filters(filters): |
|||
return |
|||
|
|||
|
|||
def get_data(filters): |
|||
fil = None |
|||
if filters.variant_mapping != None: |
|||
fil = filters.variant_mapping + "%" |
|||
|
|||
data = frappe.db.sql( |
|||
""" |
|||
select `tabSystem Mapping_Sub System`.parent,`tabSystem Mapping_Sub System`.systems,`tabSystem Mapping_Sub System`.sub_systems,`tabSystem Mapping_Sub System`.`procedure` , |
|||
`tabProcedure_Details`.idx ,`tabProcedure_Details`.procedure_name ,`tabProcedure_Details`.step_name, |
|||
`tabProcedure`.active_status,`tabProcedure`.workflow_state |
|||
from (`tabSystem Mapping_Sub System` |
|||
inner join tabProcedure_Details |
|||
on `tabSystem Mapping_Sub System`.`procedure` = `tabProcedure_Details`.parent ) |
|||
inner join tabProcedure |
|||
on `tabSystem Mapping_Sub System`.`procedure` = tabProcedure.name |
|||
where `tabSystem Mapping_Sub System`.parent LIKE %s |
|||
and substring(`tabProcedure_Details`.parent,-2) = 'en' |
|||
GROUP by `tabSystem Mapping_Sub System`.`procedure` ,tabProcedure_Details.procedure_name ,tabProcedure_Details.step_name |
|||
order by `tabSystem Mapping_Sub System`.systems ,`tabSystem Mapping_Sub System`.sub_systems,`procedure`,idx; |
|||
""", fil, as_dict=True) |
|||
filterData = filters.variant_mapping |
|||
if(filterData != None and len(data) > 0): |
|||
data = modifyData(data, filterData) |
|||
return data |
|||
|
|||
|
|||
def modifyData(dataInput, filterParent): |
|||
list1 = [] |
|||
inputData = modifyChildData(dataInput, indent=4, header=0) |
|||
parentAppend = addParent(filterParent, indent=0, header=1) |
|||
list1.insert(0, parentAppend[0]) |
|||
|
|||
sMap, sSize = getParentMap(inputData, 'systems') |
|||
|
|||
for i in sMap: |
|||
sMap1, sSize1 = getParentMap(sMap[i], 'systems') |
|||
sMapAppend = appendToDic1(sMap1, filterParent, indent=1, header=0) |
|||
list1.append(sMapAppend[0]) |
|||
|
|||
ssMap, ssSize = getParentMap(sMap[i], 'sub_systems') |
|||
ssMapAppend = appendToDic2(ssMap, indent=2, header=1) |
|||
for j in ssMapAppend: |
|||
val = j['procedure_name'] |
|||
proc = j['procedure'] |
|||
procMap, procSize = getParentMap(ssMap[val], 'procedure_name') |
|||
procValuesDic = appendToDic3( |
|||
procMap, procSize, j, indent=3, header=0, procedure=proc) |
|||
|
|||
j['length'] = len(procValuesDic) |
|||
list1.append(j) |
|||
|
|||
for d in procValuesDic: |
|||
list1.append(d) |
|||
pval = d['procedure_name'] |
|||
|
|||
for s in procMap[pval]: |
|||
s['procedure_name'] = s['step_name'] |
|||
list1.append(s) |
|||
|
|||
appendData = addDuplicateData(list1) |
|||
appendData = removeDuplicateAndHeader(appendData) |
|||
return appendData |
|||
|
|||
|
|||
def appendToDic1(mapData, parent, indent, header): |
|||
mapDataAppend = [] |
|||
for d in mapData: |
|||
active = mapData[d][0]['active_status'] |
|||
keyDict = { |
|||
'systems': "", |
|||
'sub_systems': "", |
|||
'parent': d, |
|||
'procedure_name': d, |
|||
'active_status': active, |
|||
'indent': indent, |
|||
'header': header |
|||
} |
|||
mapDataAppend.append(keyDict) |
|||
return mapDataAppend |
|||
|
|||
|
|||
def appendToDic2(mapData, indent, header): |
|||
mapDataAppend = [] |
|||
for d in mapData: |
|||
da = mapData[d][0] |
|||
keyDict = { |
|||
'systems': da['systems'], |
|||
'sub_systems': da['sub_systems'], |
|||
'parent': da['parent'], |
|||
'procedure_name': d, |
|||
'active_status': da['active_status'], |
|||
'indent': indent, |
|||
'header': header, |
|||
'en_workflow_state': da['workflow_state'], |
|||
'procedure': da['procedure'], |
|||
} |
|||
|
|||
dic1 = {} |
|||
for c in custom_lang: |
|||
other_proc = da['procedure'] |
|||
other_proc = other_proc[:-2]+c['lang_code'] |
|||
others = frappe.db.sql('''select tabProcedure.active_status,count(distinct(`tabProcedure_Details`.procedure_name)) as syscount,tabProcedure.workflow_state |
|||
from (_d6463952657fa86c.`tabProcedure_Details` inner join _d6463952657fa86c.`tabProcedure` on `tabProcedure_Details`.`parent` = `tabProcedure`.`name`) |
|||
where `tabProcedure`.name = '{}'; '''.format(other_proc), as_dict=True) |
|||
|
|||
if len(others) > 0: |
|||
others = others[0] |
|||
if others['active_status'] is not None: |
|||
if others['syscount'] == 1: |
|||
dic1['{}_active_status'.format( |
|||
c['lang_code'])] = others['active_status'] + ' / ' + str(others['syscount']) + ' Procedure' |
|||
else: |
|||
dic1['{}_active_status'.format( |
|||
c['lang_code'])] = others['active_status'] + ' / ' + str(others['syscount']) + ' Procedures' |
|||
|
|||
dic1['{}_workflow_state'.format( |
|||
c['lang_code'])] = others['workflow_state'] |
|||
keyDict.update(dic1) |
|||
|
|||
mapDataAppend.append(keyDict) |
|||
return mapDataAppend |
|||
|
|||
|
|||
def appendToDic3(mapData, procSize, j, indent, header, procedure): |
|||
mapDataAppend = [] |
|||
i = 0 |
|||
dic1 = {} |
|||
list1 = [] |
|||
|
|||
for c in custom_lang: |
|||
list2 = [] |
|||
procedure = procedure[:-2]+c['lang_code'] |
|||
other_step_count = frappe.db.sql( |
|||
'''select count(distinct(step_name)) as count from _d6463952657fa86c.tabProcedure_Details where parent= '{}' group by(procedure_name) order by idx;'''.format(procedure), as_list=True) |
|||
for l in other_step_count: |
|||
list2.append(l[0]) |
|||
list1.append(list2) |
|||
|
|||
for u in mapData: |
|||
procDict = { |
|||
'systems': mapData[u][0]['systems'], |
|||
'sub_systems': mapData[u][0]['sub_systems'], |
|||
'parent': j["parent"], |
|||
'procedure_name': u, |
|||
'indent': indent, |
|||
'header': header, |
|||
'length': procSize[i], |
|||
} |
|||
|
|||
dic2 = {} |
|||
for cus in range(len(custom_lang)): |
|||
if len(list1[cus]) > 0: |
|||
if list1[cus][i] == 1: |
|||
dic1['{}_active_status'.format(custom_lang[cus]['lang_code'])] = str( |
|||
list1[cus][i]) + " Step" |
|||
else: |
|||
dic1['{}_active_status'.format(custom_lang[cus]['lang_code'])] = str( |
|||
list1[cus][i]) + " Steps" |
|||
|
|||
dic2.update(dic1) |
|||
procDict.update(dic1) |
|||
i += 1 |
|||
mapDataAppend.append(procDict) |
|||
return mapDataAppend |
|||
|
|||
|
|||
def modifyChildData(childData, indent, header): |
|||
for a in childData: |
|||
a.update({'indent': indent}) |
|||
a.update({'header': header}) |
|||
return childData |
|||
|
|||
|
|||
def addParent(variantParent, indent, header): |
|||
varParDict = [{ |
|||
'systems': "", |
|||
'sub_systems': "", |
|||
'parent': variantParent, |
|||
'procedure_name': variantParent, |
|||
'indent': indent, |
|||
'header': header |
|||
}] |
|||
return varParDict |
|||
|
|||
|
|||
def getParentMap(input_list, parameter): |
|||
sizeList = [] |
|||
parentChildMap = {} |
|||
for b in input_list: |
|||
parentChildMap.setdefault(b[parameter] or None, []).append(b) |
|||
for c in parentChildMap: |
|||
sizeList.append(len(parentChildMap[c])) |
|||
return parentChildMap, sizeList |
|||
|
|||
|
|||
def addDuplicateData(data1): |
|||
prevValue = "" |
|||
for i in data1: |
|||
if i['procedure_name'] == prevValue: |
|||
dup = {"duplicate": "yes"} |
|||
else: |
|||
dup = {"duplicate": "no"} |
|||
i.update(dup) |
|||
prevValue = i['procedure_name'] |
|||
return data1 |
|||
|
|||
|
|||
def removeDuplicateAndHeader(data1): |
|||
for k in data1: |
|||
if k['header'] == 0: |
|||
k['active_status'] = "" |
|||
k['workflow_state'] = "" |
|||
return data1 |
|||
|
|||
|
|||
def get_columns(): |
|||
columns = [ |
|||
{ |
|||
"fieldname": "procedure_name", |
|||
"label": _("Procedures"), |
|||
"fieldtype": "Data", |
|||
"width": 400 |
|||
}, |
|||
{ |
|||
"fieldname": "active_status", |
|||
"label": _("Status"), |
|||
"fieldtype": "Data", |
|||
"options": "", |
|||
"width": 100 |
|||
}, |
|||
{ |
|||
"fieldname": "length", |
|||
"label": "Elements Length", |
|||
"fieldtype": "Data", |
|||
"width": 150 |
|||
}, |
|||
{ |
|||
"fieldname": "en_workflow_state", |
|||
"label": _("English"), |
|||
"fieldtype": "Link", |
|||
"options": "Procedure", |
|||
"width": 150 |
|||
} |
|||
] |
|||
|
|||
if len(custom_lang) > 0: |
|||
lang = [] |
|||
for i in custom_lang: |
|||
lang_status = { |
|||
"fieldname": "{}_active_status".format(i['lang_code']), |
|||
"label": _("{}_Status".format(i['lang_name'])), |
|||
"fieldtype": "Data", |
|||
"options": "", |
|||
"width": 150 |
|||
} |
|||
lang_workflow = { |
|||
"fieldname": "{}_workflow_state".format(i['lang_code']), |
|||
"label": _("{}_workflow_state".format(i['lang_name'])), |
|||
"fieldtype": "Link", |
|||
"options": "Procedure", |
|||
"width": 150 |
|||
} |
|||
lang.append(lang_status) |
|||
lang.append(lang_workflow) |
|||
|
|||
columns += lang |
|||
return columns |
Loading…
Reference in new issue