chore: Add more invoices
diff --git a/erpnext/accounts/dashboard_chart/profit_and_loss/profit_and_loss.json b/erpnext/accounts/dashboard_chart/profit_and_loss/profit_and_loss.json
index 3fa995b..0a0bf3a 100644
--- a/erpnext/accounts/dashboard_chart/profit_and_loss/profit_and_loss.json
+++ b/erpnext/accounts/dashboard_chart/profit_and_loss/profit_and_loss.json
@@ -9,7 +9,7 @@
"idx": 0,
"is_public": 1,
"is_standard": 1,
- "modified": "2020-07-22 12:33:48.888943",
+ "modified": "2023-06-17 12:33:48.888943",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Profit and Loss",
diff --git a/erpnext/setup/demo.py b/erpnext/setup/demo.py
index 41faff2..6947f45 100644
--- a/erpnext/setup/demo.py
+++ b/erpnext/setup/demo.py
@@ -3,8 +3,10 @@
import json
import os
+from random import randint
import frappe
+from frappe.utils import add_days
import erpnext
@@ -18,7 +20,7 @@
@frappe.whitelist()
def clear_demo_data():
- company = erpnext.get_default_company()
+ company = frappe.db.get_single_value("Global Defaults", "demo_company")
create_transaction_deletion_record(company)
clear_masters()
delete_company(company)
@@ -39,10 +41,10 @@
new_company.chart_of_accounts = company_doc.chart_of_accounts
new_company.insert()
- frappe.db.set_single_value("Global Defaults", "original_default_company", company)
-
# Set Demo Company as default to
- frappe.db.set_single_value("Global Defaults", "default_company", new_company.name)
+ frappe.db.set_single_value("Global Defaults", "demo_company", new_company.name)
+ frappe.db.set_default("company", new_company.name)
+
return new_company.name
@@ -59,15 +61,24 @@
def make_transactions(company):
+ fiscal_year = frappe.db.get_single_value("Global Defaults", "current_fiscal_year")
+ start_date = frappe.db.get_value("Fiscal Year", fiscal_year, "year_start_date")
+
for doctype in frappe.get_hooks("demo_transaction_doctypes"):
data = read_data_file_using_hooks(doctype)
if data:
for item in json.loads(data):
- create_transaction(item, company)
+ create_transaction(item, company, start_date)
-def create_transaction(doctype, company):
- doctype.update({"company": company})
+def create_transaction(doctype, company, start_date):
+ doctype.update(
+ {
+ "company": company,
+ "set_posting_time": 1,
+ "posting_date": get_random_date(start_date),
+ }
+ )
income_account, expense_account = frappe.db.get_value(
"Company", company, ["default_income_account", "default_expense_account"]
@@ -87,6 +98,10 @@
doc.submit()
+def get_random_date(start_date):
+ return add_days(start_date, randint(1, 365))
+
+
def create_transaction_deletion_record(company):
transaction_deletion_record = frappe.new_doc("Transaction Deletion Record")
transaction_deletion_record.company = company
@@ -110,8 +125,6 @@
def delete_company(company):
- original_company = frappe.db.get_single_value("Global Defaults", "original_default_company")
- frappe.db.set_single_value("Global Defaults", "default_company", original_company)
frappe.delete_doc("Company", company, ignore_permissions=True)
diff --git a/erpnext/setup/demo_data/customer.json b/erpnext/setup/demo_data/customer.json
index ed95292..b27c444 100644
--- a/erpnext/setup/demo_data/customer.json
+++ b/erpnext/setup/demo_data/customer.json
@@ -15,6 +15,6 @@
"doctype": "Customer",
"customer_group": "Demo Customer Group",
"territory": "All Territories",
- "customer_name": "KJPR Pvt Ltd"
+ "customer_name": "KJPR Pvt. Ltd."
}
]
\ No newline at end of file
diff --git a/erpnext/setup/demo_data/payment_entry.json b/erpnext/setup/demo_data/payment_entry.json
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/setup/demo_data/payment_entry.json
diff --git a/erpnext/setup/demo_data/purchase_invoice.json b/erpnext/setup/demo_data/purchase_invoice.json
index cfcd00c..725f571 100644
--- a/erpnext/setup/demo_data/purchase_invoice.json
+++ b/erpnext/setup/demo_data/purchase_invoice.json
@@ -6,9 +6,144 @@
"items": [
{
"doctype": "Purchase Invoice Item",
+ "item_code": "SKU001",
+ "parentfield": "items",
+ "qty": 100.0,
+ "rate": 400.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "supplier": "MA Inc.",
+ "doctype": "Purchase Invoice",
+ "items": [
+ {
+ "doctype": "Purchase Invoice Item",
+ "item_code": "SKU002",
+ "parentfield": "items",
+ "qty": 100.0,
+ "rate": 400.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "supplier": "KC Corp.",
+ "doctype": "Purchase Invoice",
+ "items": [
+ {
+ "doctype": "Purchase Invoice Item",
+ "item_code": "SKU003",
+ "parentfield": "items",
+ "qty": 100.0,
+ "rate": 400.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "supplier": "DQ Industries",
+ "doctype": "Purchase Invoice",
+ "items": [
+ {
+ "doctype": "Purchase Invoice Item",
"item_code": "SKU004",
"parentfield": "items",
- "qty": 20.0,
+ "qty": 100.0,
+ "rate": 400.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "supplier": "MA Inc.",
+ "doctype": "Purchase Invoice",
+ "items": [
+ {
+ "doctype": "Purchase Invoice Item",
+ "item_code": "SKU005",
+ "parentfield": "items",
+ "qty": 100.0,
+ "rate": 400.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "supplier": "KC Corp.",
+ "doctype": "Purchase Invoice",
+ "items": [
+ {
+ "doctype": "Purchase Invoice Item",
+ "item_code": "SKU006",
+ "parentfield": "items",
+ "qty": 100.0,
+ "rate": 400.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "supplier": "DQ Industries",
+ "doctype": "Purchase Invoice",
+ "items": [
+ {
+ "doctype": "Purchase Invoice Item",
+ "item_code": "SKU007",
+ "parentfield": "items",
+ "qty": 100.0,
+ "rate": 400.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "supplier": "MA Inc.",
+ "doctype": "Purchase Invoice",
+ "items": [
+ {
+ "doctype": "Purchase Invoice Item",
+ "item_code": "SKU008",
+ "parentfield": "items",
+ "qty": 100.0,
+ "rate": 400.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "supplier": "KC Corp.",
+ "doctype": "Purchase Invoice",
+ "items": [
+ {
+ "doctype": "Purchase Invoice Item",
+ "item_code": "SKU009",
+ "parentfield": "items",
+ "qty": 100.0,
+ "rate": 400.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "supplier": "DQ Industries",
+ "doctype": "Purchase Invoice",
+ "items": [
+ {
+ "doctype": "Purchase Invoice Item",
+ "item_code": "SKU010",
+ "parentfield": "items",
+ "qty": 100.0,
"rate": 400.0,
"conversion_factor": 1
}
diff --git a/erpnext/setup/demo_data/sales_invoice.json b/erpnext/setup/demo_data/sales_invoice.json
index 64f04f0..6aaffc2 100644
--- a/erpnext/setup/demo_data/sales_invoice.json
+++ b/erpnext/setup/demo_data/sales_invoice.json
@@ -13,5 +13,105 @@
"conversion_factor": 1
}
]
+ },
+ {
+ "conversion_rate": 1.0,
+ "customer": "XYZ Corporation",
+ "doctype": "Sales Invoice",
+ "items": [
+ {
+ "doctype": "Sales Invoice Item",
+ "item_code": "SKU001",
+ "parentfield": "items",
+ "qty": 25.0,
+ "rate": 600.0,
+ "conversion_factor": 1
+ },
+ {
+ "doctype": "Sales Invoice Item",
+ "item_code": "SKU002",
+ "parentfield": "items",
+ "qty": 15.0,
+ "rate": 300.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "customer": "XYZ Corporation",
+ "doctype": "Sales Invoice",
+ "items": [
+ {
+ "doctype": "Sales Invoice Item",
+ "item_code": "SKU003",
+ "parentfield": "items",
+ "qty": 100,
+ "rate": 300.0,
+ "conversion_factor": 1
+ },
+ {
+ "doctype": "Sales Invoice Item",
+ "item_code": "SKU006",
+ "parentfield": "items",
+ "qty": 100,
+ "rate": 300.0,
+ "conversion_factor": 1
+ },
+ {
+ "doctype": "Sales Invoice Item",
+ "item_code": "SKU007",
+ "parentfield": "items",
+ "qty": 100,
+ "rate": 300.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "customer": "KJPR Pvt. Ltd.",
+ "doctype": "Sales Invoice",
+ "items": [
+ {
+ "doctype": "Sales Invoice Item",
+ "item_code": "SKU005",
+ "parentfield": "items",
+ "qty": 200.0,
+ "rate": 100.0,
+ "conversion_factor": 1
+ }
+ ]
+ },
+ {
+ "conversion_rate": 1.0,
+ "customer": "ABC Enterprises",
+ "doctype": "Sales Invoice",
+ "items": [
+ {
+ "doctype": "Sales Invoice Item",
+ "item_code": "SKU008",
+ "parentfield": "items",
+ "qty": 20.0,
+ "rate": 500.0,
+ "conversion_factor": 1
+ },
+ {
+ "doctype": "Sales Invoice Item",
+ "item_code": "SKU009",
+ "parentfield": "items",
+ "qty": 40.0,
+ "rate": 300.0,
+ "conversion_factor": 1
+ },
+ {
+ "doctype": "Sales Invoice Item",
+ "item_code": "SKU010",
+ "parentfield": "items",
+ "qty": 50.0,
+ "rate": 900.0,
+ "conversion_factor": 1
+ }
+ ]
}
]
\ No newline at end of file
diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.json b/erpnext/setup/doctype/global_defaults/global_defaults.json
index 6d912ce..a2a135b 100644
--- a/erpnext/setup/doctype/global_defaults/global_defaults.json
+++ b/erpnext/setup/doctype/global_defaults/global_defaults.json
@@ -14,7 +14,7 @@
"hide_currency_symbol",
"disable_rounded_total",
"disable_in_words",
- "original_default_company"
+ "demo_company"
],
"fields": [
{
@@ -82,10 +82,10 @@
"label": "Disable In Words"
},
{
- "fieldname": "original_default_company",
+ "fieldname": "demo_company",
"fieldtype": "Link",
"hidden": 1,
- "label": "Original Default Company",
+ "label": "Demo Company",
"options": "Company",
"read_only": 1
}
@@ -95,7 +95,7 @@
"in_create": 1,
"issingle": 1,
"links": [],
- "modified": "2023-06-17 13:07:40.074663",
+ "modified": "2023-06-17 19:49:14.094209",
"modified_by": "Administrator",
"module": "Setup",
"name": "Global Defaults",
diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py
index 8e61fe2..6c81cfc 100644
--- a/erpnext/setup/setup_wizard/operations/install_fixtures.py
+++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py
@@ -492,7 +492,7 @@
def create_bank_account(args):
if not args.get("bank_account"):
- return
+ args["bank_account"] = _("Bank Account")
company_name = args.get("company_name")
bank_account_group = frappe.db.get_value(