feat(tahesab): net sales by factor, group, and commission
Report weight after returns for the selected period, with parent customer groups and separate silver and investment commission. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
ALTER TABLE "CustomerGroup" ADD COLUMN IF NOT EXISTS "parentId" TEXT;
|
||||
CREATE INDEX IF NOT EXISTS "CustomerGroup_parentId_idx" ON "CustomerGroup"("parentId");
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "CustomerGroup"
|
||||
ADD CONSTRAINT "CustomerGroup_parentId_fkey"
|
||||
FOREIGN KEY ("parentId") REFERENCES "CustomerGroup"("id")
|
||||
ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN NULL;
|
||||
END $$;
|
||||
|
||||
ALTER TABLE "AccountingAsnadLine" ADD COLUMN IF NOT EXISTS "darsad" DOUBLE PRECISION;
|
||||
ALTER TABLE "AccountingAsnadLine" ADD COLUMN IF NOT EXISTS "darsadTalayee" DOUBLE PRECISION;
|
||||
ALTER TABLE "AccountingAsnadLine" ADD COLUMN IF NOT EXISTS "maliatDarsad" DOUBLE PRECISION;
|
||||
@@ -527,6 +527,10 @@ model CustomerGroup {
|
||||
/// گروه متناظر در تهحساب (GID) روی همان اتصال
|
||||
tahesabConnectionId String?
|
||||
tahesabGid String?
|
||||
/// گروه اصلی؛ فقط یک سطح (اصلی / فرعی)
|
||||
parentId String?
|
||||
parent CustomerGroup? @relation("CustomerGroupTree", fields: [parentId], references: [id], onDelete: SetNull)
|
||||
children CustomerGroup[] @relation("CustomerGroupTree")
|
||||
people PersonGroupLink[]
|
||||
companies CompanyGroupLink[]
|
||||
createdAt DateTime @default(now())
|
||||
@@ -535,6 +539,7 @@ model CustomerGroup {
|
||||
@@unique([organizationId, name])
|
||||
@@index([organizationId, position])
|
||||
@@index([tahesabConnectionId, tahesabGid])
|
||||
@@index([parentId])
|
||||
}
|
||||
|
||||
model PersonGroupLink {
|
||||
@@ -1879,6 +1884,10 @@ model AccountingAsnadLine {
|
||||
mali Float?
|
||||
count Float?
|
||||
ayar Float?
|
||||
/// درصد اجرت سند تهحساب؛ بعد از همگامسازی پر میشود
|
||||
darsad Float?
|
||||
darsadTalayee Float?
|
||||
maliatDarsad Float?
|
||||
mazaneh Float?
|
||||
fi Float?
|
||||
sharh1 String?
|
||||
|
||||
Reference in New Issue
Block a user