Commit graph

5 commits

Author SHA1 Message Date
SUBHANKAR DHAR
bdeb078f29 fix: skip custom project fields that already exist natively in v16
ERPNext v16 ships project fields natively on Purchase Invoice, Purchase
Order, Stock Entry, and Delivery Note. Adding duplicate custom fields
caused UniqueFieldnameError. Now only two custom fields are added:
  - Purchase Invoice.is_urd_purchase (new URD toggle)
  - Journal Entry.project (only doctype missing it)

Also update profitability report queries to use native 'project' field
instead of 'furnitex_project' on PI, SE, and JE.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 16:14:16 +05:30
SUBHANKAR DHAR
1f5bb6d942 fix: remove v16-incompatible supplier tax field set_value
ERPNext v16 dropped the per-supplier default_purchase_taxes_and_charges
_template column. URD tax bypass is now entirely handled by the server
script (Before Save on Purchase Invoice) via the is_urd_purchase flag.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 16:12:27 +05:30
SUBHANKAR DHAR
356fec8c38 fix: resolve all ERPNext v16 naming convention issues
- All ERPNext doctypes append company abbr to names (Warehouse, Tax
  Template, etc.) — switch existence checks to use filter-based lookup
  instead of hardcoded "{name} - Furnitex" strings
- Add safe_insert() helper to absorb DuplicateEntryError gracefully so
  re-runs never crash mid-way
- Service items: remove item_defaults entirely (non-stock items have no
  warehouse, avoids cross-company warehouse validation error)
- Raw material items: only add item_defaults when a valid Furnitex
  warehouse is resolved
- Supplier URD tax default: look up template by title+company filter
  rather than bare name string

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 16:11:37 +05:30
SUBHANKAR DHAR
ff152a3020 fix: use company abbr for warehouse names
ERPNext auto-appends the company abbreviation (e.g. "F") to warehouse
names, not the full company name. Fixed create_warehouses(), the
default_wh reference in raw material items, and the OnSite WIP server
script to all resolve the abbr at runtime via frappe.db.get_value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 16:08:36 +05:30
SUBHANKAR DHAR
5ebb3bc8fb feat: add Furnitex ERPNext automated setup script
Adds a complete ERPNext v16 configuration script for Furnitex, an
interior design and furniture manufacturing company based in Kolkata.

Automates creation of:
- Custom UOMs: SqFt, Rft, Sheet, Bag, Bundle
- Item groups for raw materials and execution services
- Supplier groups including Unregistered (URD) vendor category
- Warehouses: Main Store + dynamic OnSite WIP per project
- Tax templates: No-GST URD purchase, GST 18% purchase/sales
- 10 service items (SqFt + lumpsum billing modes)
- 19 raw material stock items (plywood, laminates, hardware, civil)
- 6 sample suppliers with auto-applied URD tax defaults
- Custom fields to tag Project on PI, PO, SE, DN, JE
- Server scripts for OnSite WIP auto-warehouse and URD tax auto-clear
- Custom Script Report: Furnitex Project Profitability

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 16:03:47 +05:30