Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

style: reformat the quote line pricing history carousel cards to use a table

Rob Carringtona296fd0026dc
diff --git a/apps/erp/app/modules/sales/ui/Quotes/QuoteLinePricingHistory.tsx b/apps/erp/app/modules/sales/ui/Quotes/QuoteLinePricingHistory.tsx
index 6732cb1c45..99fd454ad7 100644
--- a/apps/erp/app/modules/sales/ui/Quotes/QuoteLinePricingHistory.tsx
+++ b/apps/erp/app/modules/sales/ui/Quotes/QuoteLinePricingHistory.tsx
@@ -1,6 +1,8 @@
+import { Link } from "@remix-run/react";
import { useState } from "react";
import { LuChevronDown } from "react-icons/lu";
import { CustomerAvatar, Empty } from "~/components";
+import { path } from "~/utils/path";
import { Button } from "../../../../../../../packages/react/src/Button";
import {
Card,
@@ -83,45 +85,49 @@ const QuoteLinePricingHistory = ({
>
<Card className="w-full">
<CardContent className="p-4">
- <div className="space-y-2">
- <div className="flex justify-between">
- <span className="text-sm font-medium">
- <CustomerAvatar
- customerId={line.customerId}
- />
- </span>
- </div>
-
- <div className="flex justify-between">
+ <HStack className="flex justify-between mb-2">
+ <Link
+ to={path.to.salesOrderLine(
+ line.salesOrderId!,
+ line.id!
+ )}
+ className="text-sm font-medium hover:underline"
+ >
+ {line.salesOrderReadableId}
+ </Link>
+ <div>
<span className="text-sm text-muted-foreground">
- Order Date
- </span>
- <span className="text-sm font-medium">
{new Date(
line.orderDate!
).toLocaleDateString()}
</span>
</div>
-
+ </HStack>
+ <div className="space-y-2">
<div className="flex justify-between">
- <span className="text-sm text-muted-foreground">
- Quantity
- </span>
<span className="text-sm font-medium">
- {line.saleQuantity}
+ <CustomerAvatar
+ customerId={line.customerId}
+ />
</span>
</div>
- <div className="flex justify-between">
- <span className="text-sm text-muted-foreground">
+ <div className="grid grid-cols-2">
+ <div className="text-sm font-medium border p-2">
+ Quantity
+ </div>
+ <div className="text-sm font-medium border p-2">
Unit Price
- </span>
- <span className="text-sm font-medium">
+ </div>
+ <div className="text-sm text-muted-foreground border p-2">
+ {line.saleQuantity}
+ </div>
+ <div className="text-sm text-muted-foreground border p-2">
{new Intl.NumberFormat("en-US", {
style: "currency",
currency: baseCurrency,
}).format(line.unitPrice ?? 0)}
- </span>
+ </div>
</div>
</div>
</CardContent>
diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.ts
index 90d74b0564..00b270ca71 100644
--- a/packages/database/src/swagger-docs-schema.ts
+++ b/packages/database/src/swagger-docs-schema.ts
@@ -27501,6 +27501,9 @@ export default {
{
$ref: "#/parameters/rowFilter.salesOrderLines.customerId",
},
+ {
+ $ref: "#/parameters/rowFilter.salesOrderLines.salesOrderReadableId",
+ },
{
$ref: "#/parameters/select",
},
@@ -40284,347 +40287,506 @@ export default {
tags: ["purchaseOrderTransaction"],
},
},
- "/salesRfqFavorite": {
- get: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.salesRfqFavorite.rfqId",
- },
- {
- $ref: "#/parameters/rowFilter.salesRfqFavorite.userId",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/order",
- },
- {
- $ref: "#/parameters/range",
- },
- {
- $ref: "#/parameters/rangeUnit",
- },
- {
- $ref: "#/parameters/offset",
- },
- {
- $ref: "#/parameters/limit",
- },
- {
- $ref: "#/parameters/preferCount",
- },
- ],
- responses: {
- "200": {
- description: "OK",
- schema: {
- items: {
- $ref: "#/definitions/salesRfqFavorite",
- },
- type: "array",
- },
- },
- "206": {
- description: "Partial Content",
- },
- },
- tags: ["salesRfqFavorite"],
- },
- post: {
- parameters: [
- {
- $ref: "#/parameters/body.salesRfqFavorite",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/preferPost",
- },
- ],
- responses: {
- "201": {
- description: "Created",
- },
- },
- tags: ["salesRfqFavorite"],
- },
- delete: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.salesRfqFavorite.rfqId",
- },
- {
- $ref: "#/parameters/rowFilter.salesRfqFavorite.userId",
- },
- {
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["salesRfqFavorite"],
- },
- patch: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.salesRfqFavorite.rfqId",
- },
- {
- $ref: "#/parameters/rowFilter.salesRfqFavorite.userId",
- },
- {
- $ref: "#/parameters/body.salesRfqFavorite",
- },
- {
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["salesRfqFavorite"],
- },
- },
- "/holiday": {
+ "/quoteLinePrices": {
get: {
parameters: [
{
- $ref: "#/parameters/rowFilter.holiday.id",
- },
- {
- $ref: "#/parameters/rowFilter.holiday.name",
- },
- {
- $ref: "#/parameters/rowFilter.holiday.date",
- },
- {
- $ref: "#/parameters/rowFilter.holiday.year",
- },
- {
- $ref: "#/parameters/rowFilter.holiday.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.holiday.createdBy",
- },
- {
- $ref: "#/parameters/rowFilter.holiday.createdAt",
- },
- {
- $ref: "#/parameters/rowFilter.holiday.updatedBy",
- },
- {
- $ref: "#/parameters/rowFilter.holiday.updatedAt",
- },
- {
- $ref: "#/parameters/rowFilter.holiday.customFields",
- },
- {
- $ref: "#/parameters/rowFilter.holiday.tags",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/order",
- },
- {
- $ref: "#/parameters/range",
- },
- {
- $ref: "#/parameters/rangeUnit",
- },
- {
- $ref: "#/parameters/offset",
- },
- {
- $ref: "#/parameters/limit",
- },
- {
- $ref: "#/parameters/preferCount",
- },
- ],
- responses: {
- "200": {
- description: "OK",
- schema: {
- items: {
- $ref: "#/definitions/holiday",
- },
- type: "array",
- },
- },
- "206": {
- description: "Partial Content",
- },
- },
- tags: ["holiday"],
- },
- post: {
- parameters: [
- {
- $ref: "#/parameters/body.holiday",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/preferPost",
- },
- ],
- responses: {
- "201": {
- description: "Created",
- },
- },
- tags: ["holiday"],
- },
- delete: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.holiday.id",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.id",
},
{
- $ref: "#/parameters/rowFilter.holiday.name",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.quoteId",
},
{
- $ref: "#/parameters/rowFilter.holiday.date",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.quoteRevisionId",
},
{
- $ref: "#/parameters/rowFilter.holiday.year",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.status",
},
{
- $ref: "#/parameters/rowFilter.holiday.companyId",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.estimatorId",
},
{
- $ref: "#/parameters/rowFilter.holiday.createdBy",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.itemId",
},
{
- $ref: "#/parameters/rowFilter.holiday.createdAt",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.itemReadableId",
},
{
- $ref: "#/parameters/rowFilter.holiday.updatedBy",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.itemType",
},
{
- $ref: "#/parameters/rowFilter.holiday.updatedAt",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.description",
},
{
- $ref: "#/parameters/rowFilter.holiday.customFields",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.customerPartId",
},
{
- $ref: "#/parameters/rowFilter.holiday.tags",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.customerPartRevision",
},
{
- $ref: "#/parameters/preferReturn",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.methodType",
},
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["holiday"],
- },
- patch: {
- parameters: [
{
- $ref: "#/parameters/rowFilter.holiday.id",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.unitOfMeasureCode",
},
{
- $ref: "#/parameters/rowFilter.holiday.name",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.internalNotes",
},
{
- $ref: "#/parameters/rowFilter.holiday.date",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.companyId",
},
{
- $ref: "#/parameters/rowFilter.holiday.year",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.createdBy",
},
{
- $ref: "#/parameters/rowFilter.holiday.companyId",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.updatedAt",
},
{
- $ref: "#/parameters/rowFilter.holiday.createdBy",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.updatedBy",
},
{
- $ref: "#/parameters/rowFilter.holiday.createdAt",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.customFields",
},
{
- $ref: "#/parameters/rowFilter.holiday.updatedBy",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.modelUploadId",
},
{
- $ref: "#/parameters/rowFilter.holiday.updatedAt",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.quantity",
},
{
- $ref: "#/parameters/rowFilter.holiday.customFields",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.additionalCharges",
},
{
- $ref: "#/parameters/rowFilter.holiday.tags",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.locationId",
},
{
- $ref: "#/parameters/body.holiday",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.noQuoteReason",
},
{
- $ref: "#/parameters/preferReturn",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.taxPercent",
},
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["holiday"],
- },
- },
- "/productionEvent": {
- get: {
- parameters: [
{
- $ref: "#/parameters/rowFilter.productionEvent.id",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.tags",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.jobOperationId",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.unitPricePrecision",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.type",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.externalNotes",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.startTime",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.configuration",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.endTime",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.thumbnailPath",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.duration",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.modelId",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.employeeId",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.autodeskUrn",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.workCenterId",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.modelPath",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.companyId",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.modelName",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.createdAt",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.modelSize",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.createdBy",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.unitCost",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.updatedAt",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.qty",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.updatedBy",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.unitPrice",
},
{
- $ref: "#/parameters/rowFilter.productionEvent.notes",
+ $ref: "#/parameters/rowFilter.quoteLinePrices.quoteReadableId",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/quoteLinePrices",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["quoteLinePrices"],
+ },
+ },
+ "/salesRfqFavorite": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.salesRfqFavorite.rfqId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.salesRfqFavorite.userId",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/salesRfqFavorite",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["salesRfqFavorite"],
+ },
+ post: {
+ parameters: [
+ {
+ $ref: "#/parameters/body.salesRfqFavorite",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/preferPost",
+ },
+ ],
+ responses: {
+ "201": {
+ description: "Created",
+ },
+ },
+ tags: ["salesRfqFavorite"],
+ },
+ delete: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.salesRfqFavorite.rfqId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.salesRfqFavorite.userId",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["salesRfqFavorite"],
+ },
+ patch: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.salesRfqFavorite.rfqId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.salesRfqFavorite.userId",
+ },
+ {
+ $ref: "#/parameters/body.salesRfqFavorite",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["salesRfqFavorite"],
+ },
+ },
+ "/holiday": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.holiday.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.name",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.date",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.year",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.customFields",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.tags",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/holiday",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["holiday"],
+ },
+ post: {
+ parameters: [
+ {
+ $ref: "#/parameters/body.holiday",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/preferPost",
+ },
+ ],
+ responses: {
+ "201": {
+ description: "Created",
+ },
+ },
+ tags: ["holiday"],
+ },
+ delete: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.holiday.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.name",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.date",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.year",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.customFields",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.tags",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["holiday"],
+ },
+ patch: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.holiday.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.name",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.date",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.year",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.customFields",
+ },
+ {
+ $ref: "#/parameters/rowFilter.holiday.tags",
+ },
+ {
+ $ref: "#/parameters/body.holiday",
+ },
+ {
+ $ref: "#/parameters/preferReturn",
+ },
+ ],
+ responses: {
+ "204": {
+ description: "No Content",
+ },
+ },
+ tags: ["holiday"],
+ },
+ },
+ "/productionEvent": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.jobOperationId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.type",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.startTime",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.endTime",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.duration",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.employeeId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.workCenterId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.productionEvent.notes",
},
{
$ref: "#/parameters/select",
@@ -50305,7 +50467,7 @@ export default {
properties: {
id: {
description:
- "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
+ "Note:\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
format: "text",
type: "string",
},
@@ -50354,7 +50516,7 @@ export default {
},
supplierLocationId: {
description:
- "Note:\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
+ "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
format: "text",
type: "string",
},
@@ -60131,6 +60293,10 @@ export default {
format: "text",
type: "string",
},
+ salesOrderReadableId: {
+ format: "text",
+ type: "string",
+ },
},
type: "object",
},
@@ -66599,6 +66765,187 @@ export default {
},
type: "object",
},
+ quoteLinePrices: {
+ properties: {
+ id: {
+ description: "Note:\nThis is a Primary Key.<pk/>",
+ format: "text",
+ type: "string",
+ },
+ quoteId: {
+ description:
+ "Note:\nThis is a Foreign Key to `quote.id`.<fk table='quote' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ quoteRevisionId: {
+ format: "integer",
+ type: "integer",
+ },
+ status: {
+ enum: ["Not Started", "In Progress", "Complete", "No Quote"],
+ format: 'public."quoteLineStatus"',
+ type: "string",
+ },
+ estimatorId: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ itemId: {
+ description:
+ "Note:\nThis is a Foreign Key to `item.id`.<fk table='item' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ itemReadableId: {
+ format: "text",
+ type: "string",
+ },
+ itemType: {
+ format: "text",
+ type: "string",
+ },
+ description: {
+ format: "text",
+ type: "string",
+ },
+ customerPartId: {
+ format: "text",
+ type: "string",
+ },
+ customerPartRevision: {
+ format: "text",
+ type: "string",
+ },
+ methodType: {
+ enum: ["Buy", "Make", "Pick"],
+ format: 'public."methodType"',
+ type: "string",
+ },
+ unitOfMeasureCode: {
+ format: "text",
+ type: "string",
+ },
+ internalNotes: {
+ format: "json",
+ },
+ companyId: {
+ description:
+ "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ updatedAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ updatedBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ customFields: {
+ format: "jsonb",
+ },
+ modelUploadId: {
+ description:
+ "Note:\nThis is a Foreign Key to `modelUpload.id`.<fk table='modelUpload' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ quantity: {
+ format: "numeric[]",
+ items: {
+ type: "number",
+ },
+ type: "array",
+ },
+ additionalCharges: {
+ format: "jsonb",
+ },
+ locationId: {
+ description:
+ "Note:\nThis is a Foreign Key to `location.id`.<fk table='location' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ noQuoteReason: {
+ format: "text",
+ type: "string",
+ },
+ taxPercent: {
+ format: "numeric",
+ type: "number",
+ },
+ tags: {
+ format: "text[]",
+ items: {
+ type: "string",
+ },
+ type: "array",
+ },
+ unitPricePrecision: {
+ format: "integer",
+ type: "integer",
+ },
+ externalNotes: {
+ format: "jsonb",
+ },
+ configuration: {
+ format: "jsonb",
+ },
+ thumbnailPath: {
+ format: "text",
+ type: "string",
+ },
+ modelId: {
+ format: "text",
+ type: "string",
+ },
+ autodeskUrn: {
+ format: "text",
+ type: "string",
+ },
+ modelPath: {
+ format: "text",
+ type: "string",
+ },
+ modelName: {
+ format: "text",
+ type: "string",
+ },
+ modelSize: {
+ format: "bigint",
+ type: "integer",
+ },
+ unitCost: {
+ format: "numeric",
+ type: "number",
+ },
+ qty: {
+ format: "numeric",
+ type: "number",
+ },
+ unitPrice: {
+ format: "numeric",
+ type: "number",
+ },
+ quoteReadableId: {
+ format: "text",
+ type: "string",
+ },
+ },
+ type: "object",
+ },
salesRfqFavorite: {
required: ["rfqId", "userId"],
properties: {
@@ -84152,6 +84499,13 @@ export default {
in: "query",
type: "string",
},
+ "rowFilter.salesOrderLines.salesOrderReadableId": {
+ name: "salesOrderReadableId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
"body.customerAccount": {
name: "customerAccount",
description: "customerAccount",
@@ -92594,6 +92948,288 @@ export default {
in: "query",
type: "string",
},
+ "body.quoteLinePrices": {
+ name: "quoteLinePrices",
+ description: "quoteLinePrices",
+ required: false,
+ in: "body",
+ schema: {
+ $ref: "#/definitions/quoteLinePrices",
+ },
+ },
+ "rowFilter.quoteLinePrices.id": {
+ name: "id",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.quoteId": {
+ name: "quoteId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.quoteRevisionId": {
+ name: "quoteRevisionId",
+ required: false,
+ format: "integer",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.status": {
+ name: "status",
+ required: false,
+ format: 'public."quoteLineStatus"',
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.estimatorId": {
+ name: "estimatorId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.itemId": {
+ name: "itemId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.itemReadableId": {
+ name: "itemReadableId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.itemType": {
+ name: "itemType",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.description": {
+ name: "description",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.customerPartId": {
+ name: "customerPartId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.customerPartRevision": {
+ name: "customerPartRevision",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.methodType": {
+ name: "methodType",
+ required: false,
+ format: 'public."methodType"',
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.unitOfMeasureCode": {
+ name: "unitOfMeasureCode",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.internalNotes": {
+ name: "internalNotes",
+ required: false,
+ format: "json",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.companyId": {
+ name: "companyId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.createdBy": {
+ name: "createdBy",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.updatedAt": {
+ name: "updatedAt",
+ required: false,
+ format: "timestamp with time zone",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.updatedBy": {
+ name: "updatedBy",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.customFields": {
+ name: "customFields",
+ required: false,
+ format: "jsonb",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.modelUploadId": {
+ name: "modelUploadId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.quantity": {
+ name: "quantity",
+ required: false,
+ format: "numeric[]",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.additionalCharges": {
+ name: "additionalCharges",
+ required: false,
+ format: "jsonb",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.locationId": {
+ name: "locationId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.noQuoteReason": {
+ name: "noQuoteReason",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.taxPercent": {
+ name: "taxPercent",
+ required: false,
+ format: "numeric",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.tags": {
+ name: "tags",
+ required: false,
+ format: "text[]",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.unitPricePrecision": {
+ name: "unitPricePrecision",
+ required: false,
+ format: "integer",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.externalNotes": {
+ name: "externalNotes",
+ required: false,
+ format: "jsonb",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.configuration": {
+ name: "configuration",
+ required: false,
+ format: "jsonb",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.thumbnailPath": {
+ name: "thumbnailPath",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.modelId": {
+ name: "modelId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.autodeskUrn": {
+ name: "autodeskUrn",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.modelPath": {
+ name: "modelPath",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.modelName": {
+ name: "modelName",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.modelSize": {
+ name: "modelSize",
+ required: false,
+ format: "bigint",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.unitCost": {
+ name: "unitCost",
+ required: false,
+ format: "numeric",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.qty": {
+ name: "qty",
+ required: false,
+ format: "numeric",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.unitPrice": {
+ name: "unitPrice",
+ required: false,
+ format: "numeric",
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.quoteLinePrices.quoteReadableId": {
+ name: "quoteReadableId",
+ required: false,
+ format: "text",
+ in: "query",
+ type: "string",
+ },
"body.salesRfqFavorite": {
name: "salesRfqFavorite",
description: "salesRfqFavorite",
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index 024e111204..065a7ae71e 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -17790,6 +17790,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteLinePrice_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteLinePrice_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -17993,6 +18000,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteMakeMethod_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteMakeMethod_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -18212,6 +18226,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteMaterial_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteMaterial_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -18528,6 +18549,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteOperation_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteOperation_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -30471,14 +30499,14 @@ export type Database = {
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["id"]
+ columns: ["supplierLocationId"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["supplierLocationId"]
+ columns: ["id"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
@@ -32152,6 +32180,261 @@ export type Database = {
},
]
}
+ quoteLinePrices: {
+ Row: {
+ additionalCharges: Json | null
+ autodeskUrn: string | null
+ companyId: string | null
+ configuration: Json | null
+ createdBy: string | null
+ customerPartId: string | null
+ customerPartRevision: string | null
+ customFields: Json | null
+ description: string | null
+ estimatorId: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ itemId: string | null
+ itemReadableId: string | null
+ itemType: string | null
+ locationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"] | null
+ modelId: string | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ modelUploadId: string | null
+ noQuoteReason: string | null
+ qty: number | null
+ quantity: number[] | null
+ quoteId: string | null
+ quoteReadableId: string | null
+ quoteRevisionId: number | null
+ status: Database["public"]["Enums"]["quoteLineStatus"] | null
+ tags: string[] | null
+ taxPercent: number | null
+ thumbnailPath: string | null
+ unitCost: number | null
+ unitOfMeasureCode: string | null
+ unitPrice: number | null
+ unitPricePrecision: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
quoteLines: {
Row: {
additionalCharges: Json | null
@@ -32530,6 +32813,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteMaterial_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteMaterial_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -32781,6 +33071,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteOperation_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteOperation_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -33242,6 +33539,7 @@ export type Database = {
salesOrderLineType:
| Database["public"]["Enums"]["salesOrderLineType"]
| null
+ salesOrderReadableId: string | null
sentComplete: boolean | null
setupPrice: number | null
shelfId: string | null
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index 024e111204..065a7ae71e 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -17790,6 +17790,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteLinePrice_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteLinePrice_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -17993,6 +18000,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteMakeMethod_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteMakeMethod_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -18212,6 +18226,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteMaterial_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteMaterial_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -18528,6 +18549,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteOperation_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteOperation_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -30471,14 +30499,14 @@ export type Database = {
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["id"]
+ columns: ["supplierLocationId"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["supplierLocationId"]
+ columns: ["id"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
@@ -32152,6 +32180,261 @@ export type Database = {
},
]
}
+ quoteLinePrices: {
+ Row: {
+ additionalCharges: Json | null
+ autodeskUrn: string | null
+ companyId: string | null
+ configuration: Json | null
+ createdBy: string | null
+ customerPartId: string | null
+ customerPartRevision: string | null
+ customFields: Json | null
+ description: string | null
+ estimatorId: string | null
+ externalNotes: Json | null
+ id: string | null
+ internalNotes: Json | null
+ itemId: string | null
+ itemReadableId: string | null
+ itemType: string | null
+ locationId: string | null
+ methodType: Database["public"]["Enums"]["methodType"] | null
+ modelId: string | null
+ modelName: string | null
+ modelPath: string | null
+ modelSize: number | null
+ modelUploadId: string | null
+ noQuoteReason: string | null
+ qty: number | null
+ quantity: number[] | null
+ quoteId: string | null
+ quoteReadableId: string | null
+ quoteRevisionId: number | null
+ status: Database["public"]["Enums"]["quoteLineStatus"] | null
+ tags: string[] | null
+ taxPercent: number | null
+ thumbnailPath: string | null
+ unitCost: number | null
+ unitOfMeasureCode: string | null
+ unitPrice: number | null
+ unitPricePrecision: number | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_estimatorId_fkey"
+ columns: ["estimatorId"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "quoteLine_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "modelUpload"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "jobs"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "salesRfqLines"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_modelUploadId_fkey"
+ columns: ["modelUploadId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["modelId"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quote"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quoteCustomerDetails"
+ referencedColumns: ["quoteId"]
+ },
+ {
+ foreignKeyName: "quoteLine_quoteId_fkey"
+ columns: ["quoteId"]
+ isOneToOne: false
+ referencedRelation: "quotes"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_unitOfMeasureCode_fkey"
+ columns: ["unitOfMeasureCode", "companyId"]
+ isOneToOne: false
+ referencedRelation: "unitOfMeasure"
+ referencedColumns: ["code", "companyId"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "quoteLine_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
quoteLines: {
Row: {
additionalCharges: Json | null
@@ -32530,6 +32813,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteMaterial_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteMaterial_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -32781,6 +33071,13 @@ export type Database = {
referencedRelation: "quoteLine"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteOperation_quoteLineId_fkey"
+ columns: ["quoteLineId"]
+ isOneToOne: false
+ referencedRelation: "quoteLinePrices"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteOperation_quoteLineId_fkey"
columns: ["quoteLineId"]
@@ -33242,6 +33539,7 @@ export type Database = {
salesOrderLineType:
| Database["public"]["Enums"]["salesOrderLineType"]
| null
+ salesOrderReadableId: string | null
sentComplete: boolean | null
setupPrice: number | null
shelfId: string | null
diff --git a/packages/database/supabase/migrations/20250317181045_sales-order-lines-order-date.sql b/packages/database/supabase/migrations/20250317181045_sales-order-lines-order-date.sql
index f98904c42d..08f6a94b3c 100644
--- a/packages/database/supabase/migrations/20250317181045_sales-order-lines-order-date.sql
+++ b/packages/database/supabase/migrations/20250317181045_sales-order-lines-order-date.sql
@@ -16,7 +16,8 @@ CREATE OR REPLACE VIEW "salesOrderLines" WITH(SECURITY_INVOKER=true) AS (
cp."customerPartId",
cp."customerPartRevision",
so."orderDate",
- so."customerId"
+ so."customerId",
+ so."salesOrderId" as "salesOrderReadableId"
FROM "salesOrderLine" sl
INNER JOIN "salesOrder" so ON so.id = sl."salesOrderId"
LEFT JOIN "modelUpload" mu ON sl."modelUploadId" = mu."id"
@@ -24,4 +25,30 @@ CREATE OR REPLACE VIEW "salesOrderLines" WITH(SECURITY_INVOKER=true) AS (
LEFT JOIN "itemCost" ic ON ic."itemId" = i.id
LEFT JOIN "modelUpload" imu ON imu.id = i."modelUploadId"
LEFT JOIN "customerPartToItem" cp ON cp."customerId" = so."customerId" AND cp."itemId" = i.id
+);
+
+CREATE OR REPLACE VIEW "quoteLinePrices" WITH(SECURITY_INVOKER=true) AS (
+ SELECT
+ ql.*,
+ CASE
+ WHEN i."thumbnailPath" IS NULL AND mu."thumbnailPath" IS NOT NULL THEN mu."thumbnailPath"
+ WHEN i."thumbnailPath" IS NULL AND imu."thumbnailPath" IS NOT NULL THEN imu."thumbnailPath"
+ ELSE i."thumbnailPath"
+ END as "thumbnailPath",
+ COALESCE(mu.id, imu.id) as "modelId",
+ COALESCE(mu."autodeskUrn", imu."autodeskUrn") as "autodeskUrn",
+ COALESCE(mu."modelPath", imu."modelPath") as "modelPath",
+ COALESCE(mu."name", imu."name") as "modelName",
+ COALESCE(mu."size", imu."size") as "modelSize",
+ ic."unitCost" as "unitCost",
+ qlp."quantity" as "qty",
+ qlp."unitPrice",
+ q."quoteId" as "quoteReadableId"
+ FROM "quoteLine" ql
+ INNER JOIN "quote" q ON q.id = ql."quoteId"
+ LEFT JOIN "modelUpload" mu ON ql."modelUploadId" = mu."id"
+ INNER JOIN "item" i ON i.id = ql."itemId"
+ LEFT JOIN "itemCost" ic ON ic."itemId" = i.id
+ LEFT JOIN "modelUpload" imu ON imu.id = i."modelUploadId"
+ LEFT JOIN "quoteLinePrice" qlp ON qlp."quoteLineId" = ql.id
);
\ No newline at end of file