""" update_furnitex_info.py Updates ERPNext with real Furnitex business details from furnitex.co.in Run via: bench --site frontend execute frappe.update_furnitex_info.run """ import frappe COMPANY = "Furnitex" ADDRESS = "6/A/108 Mukundapur" CITY = "Kolkata" STATE = "West Bengal" PINCODE = "700099" COUNTRY = "India" PHONE = "+91 62905 91422" EMAIL = "info.furnitex@gmail.com" WEBSITE = "https://furnitex.co.in" INSTAGRAM = "https://www.instagram.com/frunitex" LEGAL_NAME = "Furnitex Atelier Pvt. Ltd." TAGLINE = "Redefine What Surrounds You" FULL_ADDR = f"{ADDRESS}, {CITY} - {PINCODE}, {STATE}, {COUNTRY}" REP_NAME = "Subhankar Dhar" OFFICE_HOURS = "Monday – Saturday, 10:00 AM – 7:00 PM (India Time)" def run(): frappe.set_user("Administrator") update_company() update_address() update_letter_head() update_terms_conditions() frappe.db.commit() frappe.clear_cache() print("\n✓ Furnitex business info updated successfully.\n") # ── 1. Company record ───────────────────────────────────────────────────────── def update_company(): co = frappe.get_doc("Company", COMPANY) co.phone_no = PHONE co.email = EMAIL co.website = WEBSITE co.company_name = COMPANY # keep short name as primary co.flags.ignore_permissions = True co.save() print(f" ✓ Company record updated: phone={PHONE}, email={EMAIL}") # ── 2. Address record ───────────────────────────────────────────────────────── def update_address(): # Check if a Furnitex address already exists existing = frappe.db.get_value( "Address", {"address_title": COMPANY, "address_type": "Billing"}, "name" ) addr_doc = { "doctype": "Address", "address_title": COMPANY, "address_type": "Billing", "address_line1": ADDRESS, "city": CITY, "state": STATE, "pincode": PINCODE, "country": COUNTRY, "phone": PHONE, "email_id": EMAIL, "is_primary_address": 1, "links": [{"link_doctype": "Company", "link_name": COMPANY}], } if existing: doc = frappe.get_doc("Address", existing) doc.update(addr_doc) doc.flags.ignore_permissions = True doc.save() print(f" ✓ Address updated: {FULL_ADDR}") else: doc = frappe.get_doc(addr_doc) doc.flags.ignore_permissions = True doc.insert() print(f" ✓ Address created: {FULL_ADDR}") # ── 3. Letter Head ──────────────────────────────────────────────────────────── LETTER_HEAD_HTML = f"""
FURNITEX
{TAGLINE}
{LEGAL_NAME}
{ADDRESS}
{CITY} - {PINCODE}, {STATE}
Phone: {PHONE}
Email: {EMAIL}
Web: furnitex.co.in
""" def update_letter_head(): lh_name = "Furnitex" if frappe.db.exists("Letter Head", lh_name): doc = frappe.get_doc("Letter Head", lh_name) doc.content = LETTER_HEAD_HTML doc.is_default = 1 doc.flags.ignore_permissions = True doc.save() print(" ✓ Letter Head updated with real contact details") else: doc = frappe.get_doc( { "doctype": "Letter Head", "letter_head_name": lh_name, "content": LETTER_HEAD_HTML, "is_default": 1, } ) doc.flags.ignore_permissions = True doc.insert() print(" ✓ Letter Head created") # ── 4. Terms & Conditions ───────────────────────────────────────────────────── QUOTATION_TC = f"""
FURNITEX — Quotation Terms & Conditions

1. Validity: This quotation is valid for 15 days from the date of issue.
2. Payment Terms: 30% advance on order confirmation, 30% at 50% completion, 30% at completion, 10% at handover.
3. Delivery: Timelines are estimated and subject to site readiness and material availability. Furnitex is not liable for delays caused by site conditions.
4. Design Changes: Any changes post order confirmation may attract additional charges and revised timelines.
5. Material: All materials as specified. Substitutions may be made with equivalent or superior alternatives with prior intimation.
6. Site Access: Client to ensure uninterrupted site access during agreed working hours: {OFFICE_HOURS}.
7. Warranty: 1-year manufacturing warranty on all Furnitex-fabricated items. Hardware and third-party products carry manufacturer warranty.
8. Dispute Resolution: All disputes subject to Kolkata jurisdiction.

Furnitex Atelier Pvt. Ltd. · {ADDRESS}, {CITY} - {PINCODE} · {PHONE} · {EMAIL}
""" INVOICE_TC = f"""
FURNITEX — Invoice Terms & Conditions

1. Payment Due: Payment is due within 7 days of invoice date unless otherwise agreed in writing.
2. Late Payment: Overdue amounts attract interest at 18% per annum.
3. GST: GST as applicable under Indian law is charged additionally where mentioned.
4. Delivery & Installation: Goods remain property of Furnitex until full payment is received.
5. Returns: Custom-manufactured furniture is non-returnable. Defects to be reported within 48 hours of delivery.
6. Warranty: 1-year manufacturing defect warranty. Normal wear, misuse, or site-caused damage not covered.
7. Disputes: Subject to Kolkata jurisdiction.

Furnitex Atelier Pvt. Ltd. · {ADDRESS}, {CITY} - {PINCODE} · {PHONE} · {EMAIL}
""" PO_TC = f"""
FURNITEX — Purchase Order Terms & Conditions

1. Acceptance: Supply of goods/services against this PO constitutes acceptance of these terms.
2. Quality: All materials must conform to the specifications mentioned. Substandard materials will be rejected at supplier's cost.
3. Delivery: Deliver to the address specified on the PO by the agreed date. Delays must be communicated 48 hours in advance.
4. Invoice: Raise GST-compliant invoice (or cash memo for URD) with PO reference. Payment processed within 7 days of invoice receipt and material acceptance.
5. Warranty: Supplier warrants materials against defects for minimum 6 months from delivery.
6. Jurisdiction: Kolkata courts have exclusive jurisdiction.

Furnitex Atelier Pvt. Ltd. · {ADDRESS}, {CITY} - {PINCODE} · {PHONE} · {EMAIL}
""" TC_MAP = { "Furnitex - Quotation T&C": QUOTATION_TC, "Furnitex - Invoice T&C": INVOICE_TC, "Furnitex - Purchase Order T&C": PO_TC, } def update_terms_conditions(): for title, content in TC_MAP.items(): if frappe.db.exists("Terms and Conditions", title): doc = frappe.get_doc("Terms and Conditions", title) doc.terms = content doc.flags.ignore_permissions = True doc.save() print(f" ✓ Updated T&C: {title}") else: doc = frappe.get_doc( { "doctype": "Terms and Conditions", "title": title, "terms": content, "selling": 1, "buying": 1, "hr": 0, } ) doc.flags.ignore_permissions = True doc.insert() print(f" ✓ Created T&C: {title}")