Skip to content

Instantly share code, notes, and snippets.

View itsyosefali's full-sized avatar
🥱
Focusing

Yosef Ali itsyosefali

🥱
Focusing
View GitHub Profile
@itsyosefali
itsyosefali / install-guide.md
Created September 14, 2025 18:53 — forked from ascorbic-acid/install-guide.md
Install ERPNext v14 or v15 on Ubuntu 22.04 Production or Develop

Install ERPNext v14 or v15 on Ubuntu 22.04 Production or Develop

feel free to edit the parameters to suite your needs
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install software-properties-common \
nginx wget zip unzip git curl file certbot python3-pip \
python3-dev python3-venv redis-server mariadb-server \
@itsyosefali
itsyosefali / cpanel_create_email.py
Created April 11, 2024 23:26 — forked from NanoDano/cpanel_create_email.py
Create email account using cPanel API in Python
from requests import get # pip install requests
"""
Examples:
Docs:
- Create email (add_pop): https://documentation.cpanel.net/display/DD/UAPI+Functions+-+Email%3A%3Aadd_pop
- Delete email (delete_pop): https://documentation.cpanel.net/display/DD/UAPI+Functions+-+Email%3A%3Adelete_pop
- Change pass (passwd_pop): https://documentation.cpanel.net/display/DD/UAPI+Functions+-+Email%3A%3Apasswd_pop
@itsyosefali
itsyosefali / frappe-reference-guide.md
Created October 7, 2023 22:10 — forked from vijaywm/frappe-reference-guide.md
Frappe Reference Guide
@itsyosefali
itsyosefali / SpongeLedeger.py
Last active February 8, 2023 07:41
the stock ledeger of sponge shape only
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}"
@itsyosefali
itsyosefali / SpongeShape.py
Created January 19, 2023 09:31
the balance of sponge shape
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}"
parent_warehouse=""
if filters.get("parent_warehouse"):
escaped_input = frappe.db.escape(filters.get("parent_warehouse"))
parent_warehouse = f" AND `tabWarehouse`.parent_warehouse = {escaped_input}"
item_group=""
if filters.get("item_group"):
escaped_input = frappe.db.escape(filters.get("item_group"))
item_group = f" AND `tabItem`.item_group = {escaped_input}"
@itsyosefali
itsyosefali / Test-For-Coustomer.py
Last active January 10, 2023 12:59
الديون
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
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}"
@itsyosefali
itsyosefali / ItemGroup.sql
Last active January 8, 2023 12:06
تقرير تثبيت ال item group بناء على حركة المبيعات وفقا للcost center
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
frappe.query_reports["Gl Entry Report"] = {
"filters": [
{
"fieldname":"account",
"label": __("Account"),
"fieldtype": "Link",
"options": "Account",
"reqd": 1,
"width": "80",
get_query: function() {