This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sql_date_cond = "" | |
| if filters.get("date_from") and filters.get("date_to"): | |
| date_from = frappe.db.escape(filters.get("date_from")) | |
| date_to = frappe.db.escape(filters.get("date_to")) | |
| sql_date_cond = f"""and posting_date between {date_from} and {date_to} """ | |
| elif filters.get("date_from"): | |
| date_from = frappe.db.escape(filters.get("date_from")) | |
| sql_date_cond = f"""and posting_date >= {date_from}""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd Desktop | |
| #create file for the git. | |
| mkdir <file name> | |
| cd <file name> | |
| # start git in the file | |
| git init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sql_item_code_cond_filter = "" | |
| if filters.get("item_code"): | |
| escaped_input = frappe.db.escape(filters.get("item_code")) | |
| sql_item_code_cond_filter = f"AND `tabStock Ledger Entry`.item_code = {escaped_input}" | |
| sql_sponge_shape="" | |
| if filters.get("sponge_shape"): | |
| escaped_input = frappe.db.escape(filters.get("sponge_shape")) | |
| sql_item_code_cond_filter = f"AND `tabStock Ledger Entry`.sponge_shape = {escaped_input}" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| branch="" | |
| if filters.get("branch"): | |
| escaped_input = frappe.db.escape(filters.get("branch")) | |
| branch = f" Where `tabSales Invoice`.branch = {escaped_input}" | |
| mode_of_payment="" | |
| if filters.get("mode_of_payment"): | |
| escaped_input = frappe.db.escape(filters.get("mode_of_payment")) | |
| mode_of_payment = f" AND `tabPayment Entry`.mode_of_payment = {escaped_input}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sql_date_cond = "" | |
| if filters.get("date_from") and filters.get("date_to"): | |
| date_from = frappe.db.escape(filters.get("date_from")) | |
| date_to = frappe.db.escape(filters.get("date_to")) | |
| sql_date_cond = f"""and posting_date between {date_from} and {date_to} """ | |
| elif filters.get("date_from"): | |
| date_from = frappe.db.escape(filters.get("date_from")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sql_account_filter = "" | |
| if filters.get("account"): | |
| escaped_input = frappe.db.escape(filters.get("account")) | |
| sql_account_filter = f"AND `tabGL Entry`.account = {escaped_input}" | |
| sql_date_cond = "" | |
| if filters.get("date_from") and filters.get("date_to"): | |
| date_from = frappe.db.escape(filters.get("date_from")) | |
| date_to = frappe.db.escape(filters.get("date_to")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| frappe.query_reports["Gl Entry Report"] = { | |
| "filters": [ | |
| { | |
| "fieldname":"account", | |
| "label": __("Account"), | |
| "fieldtype": "Link", | |
| "options": "Account", | |
| "reqd": 1, | |
| "width": "80", | |
| get_query: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select | |
| `tabSales Invoice`.branch, | |
| sum(case when `tabItem`.item_group = 'موكيت' then `tabSales Invoice Item`.qty else 0 end) AS موكيت, | |
| sum(case when `tabItem`.item_group = 'ممرات' then `tabSales Invoice Item`.qty else 0 end) as 'ممرات', | |
| sum(case when `tabItem`.item_group = 'كولا' then `tabSales Invoice Item`.qty else 0 end) as كولا, | |
| sum(case when `tabItem`.item_group = 'سجاد' then `tabSales Invoice Item`.qty else 0 end) as 'سجاد', | |
| sum(case when `tabItem`.item_group = 'دواسات' then `tabSales Invoice Item`.qty else 0 end) as دواسات | |
| from `tabSales Invoice Item` | |
| INNER JOIN `tabSales Invoice` | |
| on `tabSales Invoice`.name = `tabSales Invoice Item`.parent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| parent_warehouse="" | |
| if filters.get("parent_warehouse"): | |
| escaped_input = frappe.db.escape(filters.get("parent_warehouse")) | |
| parent_warehouse = f" WHERE `tabWarehouse`.parent_warehouse = {escaped_input}" | |
| item_code="" | |
| if filters.get("item_code"): | |
| escaped_input = frappe.db.escape(filters.get("item_code")) | |
| item_code = f" AND `tabBin`.item_code = {escaped_input}" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| party="" | |
| if filters.get("party"): | |
| escaped_input = frappe.db.escape(filters.get("party")) | |
| party = f" AND `tabGL Entry`.party = {escaped_input}" | |
| default_sales_partner="" | |
| if filters.get("default_sales_partner"): | |
| escaped_input = frappe.db.escape(filters.get("default_sales_partner")) | |
| default_sales_partner = f" AND `tabCustomer`.default_sales_partner = {escaped_input}" | |
| res = frappe.db.sql(f"""SELECT |
OlderNewer