@things-factory/sales 10.1.256 → 10.1.258
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/entity360/opportunity-360.d.ts +3 -4
- package/dist-client/entity360/opportunity-360.js +16 -38
- package/dist-client/entity360/opportunity-360.js.map +1 -1
- package/dist-client/pages/opportunity-editor.d.ts +25 -33
- package/dist-client/pages/opportunity-editor.js +108 -175
- package/dist-client/pages/opportunity-editor.js.map +1 -1
- package/dist-client/pages/opportunity-list.d.ts +2 -3
- package/dist-client/pages/opportunity-list.js +6 -12
- package/dist-client/pages/opportunity-list.js.map +1 -1
- package/dist-client/pages/quotation-editor.d.ts +45 -26
- package/dist-client/pages/quotation-editor.js +225 -248
- package/dist-client/pages/quotation-editor.js.map +1 -1
- package/dist-client/pages/quotation-list.d.ts +7 -3
- package/dist-client/pages/quotation-list.js +26 -27
- package/dist-client/pages/quotation-list.js.map +1 -1
- package/dist-client/pages/sales-product-list.d.ts +7 -2
- package/dist-client/pages/sales-product-list.js +36 -55
- package/dist-client/pages/sales-product-list.js.map +1 -1
- package/dist-client/sales-product-pick.d.ts +4 -2
- package/dist-client/sales-product-pick.js +36 -32
- package/dist-client/sales-product-pick.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/translations/es.json +8 -0
- package/translations/ja.json +8 -0
- package/translations/ms.json +8 -0
- package/translations/zh.json +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotation-editor.js","sourceRoot":"","sources":["../../client/pages/quotation-editor.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,sCAAsC,CAAA;AAC7C,OAAO,6BAA6B,CAAA;AACpC,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACxC,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AAE;;+CAAY;AACX;IAAR,KAAK,EAAE;;oDAAiB;AAEhB;IAAR,KAAK,EAAE;;sDAAwF;AAEvF;IAAR,KAAK,EAAE;;iDAAyC;AAExC;IAAR,KAAK,EAAE;;8CAAmC;AAElC;IAAR,KAAK,EAAE;;gDAAqC;AAEpC;IAAR,KAAK,EAAE;;sDAAsB;AAErB;IAAR,KAAK,EAAE;;wDAAwB;AAEL;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;8CAAA;AA7CjC,eAAe;IAD3B,aAAa,CAAC,kBAAkB,CAAC;GACrB,eAAe,CAof3B;;AAED,SAAS,KAAK;IACZ,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;AAC/K,CAAC","sourcesContent":["import '@operato/data-grist/ox-grist.js'\nimport '@operato/list-state/ox-page-state.js'\nimport '@operato/input/ox-select.js'\nimport '@operato/popup/ox-popup-list.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\n\nimport { DataGrist } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\nimport { navigate, PageView } from '@operato/shell'\nimport { ButtonStyles, CommonGristStyles, DocumentPageStyles, FormFieldStyles, ScrollbarStyles } from '@operato/styles'\nimport { hasPrivilege } from '@things-factory/auth-base/dist-client'\nimport {\n daysAfter,\n documentAmount,\n DocumentFormStyles,\n documentLinesConfig,\n linesOf,\n onLineChange,\n openDocumentPreview,\n reckonLines,\n renderDocumentHead,\n renderDocumentTotals,\n documentDefaults,\n headFromDefaults,\n nextInvoiceNumber,\n OUR_SIDE_FIELDS,\n oursFromLast,\n partyOfName,\n type DocumentDefaults,\n type DocumentFileFormat,\n type DocumentParty,\n type DocumentValue\n} from '@things-factory/invoice/dist-client'\n\nimport '@things-factory/invoice/dist-client/document/document-party.js'\n\nimport { quotationSection } from '../quotation-attach'\nimport '../sales-product-pick'\nimport { lineOfProduct, type PickedProduct } from '../sales-product-pick'\nimport { quotationStatusWord } from '../quotation-words'\n\nconst FIELDS = `\n id number version status validUntil outcomeReason opportunityId opportunity { id name } direction currency language supplierName supplierAddress supplierRegistrationNumber\n buyerName buyerAddress buyerRegistrationNumber issueDate purchaseOrder paymentTerms bankDetails notes sourceReference\n discountAmount lineSupplyAmount supplyAmount taxAmount totalAmount taxRounding currencyDigits\n items { position description quantity unit unitPrice discount taxKind taxRate supplyAmount }\n taxGroups { taxKind taxRate supplyAmount taxAmount }\n`\n\nconst HEAD = [\n 'number',\n 'direction',\n 'currency',\n 'language',\n 'supplierName',\n 'supplierAddress',\n 'supplierRegistrationNumber',\n 'buyerName',\n 'buyerAddress',\n 'buyerRegistrationNumber',\n 'issueDate',\n 'purchaseOrder',\n 'paymentTerms',\n 'bankDetails',\n 'notes',\n 'sourceReference',\n 'validUntil',\n 'opportunityId',\n 'discountAmount'\n]\n\nconst today = () => new Date().toLocaleDateString('en-CA')\n\n/** What an invoice made from a quotation takes of its head as it is. */\nconst INVOICE_HEAD = [\n 'direction',\n 'currency',\n 'language',\n 'supplierName',\n 'supplierAddress',\n 'supplierRegistrationNumber',\n 'buyerName',\n 'buyerAddress',\n 'buyerRegistrationNumber',\n 'paymentTerms',\n 'bankDetails',\n 'notes'\n]\n\n/** How long an offer holds unless the person writes another last day. */\nconst VALID_DAYS = 30\n\n/** Days an invoice made from a quotation is due unless the company says otherwise - the invoice editor's. */\nconst PAYMENT_DAYS = 30\n\n/** The next quotation number of a year after those given - 「Q2026-001」, 「Q2026-002」 … */\nexport function nextQuotationNumber(numbers: string[], year: number): string {\n const prefix = `Q${year}-`\n const last = Math.max(0, ...numbers.filter(one => one?.startsWith(prefix)).map(one => Number(one.slice(prefix.length)) || 0))\n return `${prefix}${String(last + 1).padStart(3, '0')}`\n}\n\n/**\n * 견적 편집 — the same head, lines and totals as an invoice, valid until a day.\n *\n * A draft is saved and sent; once sent its amounts are fixed, and the buyer's answer is recorded — accepted, or\n * declined with a reason. To change a sent quotation, revise it: the next version keeps the number.\n */\n@customElement('quotation-editor')\nexport class QuotationEditor extends localize(i18next)(PageView) {\n static styles = [\n FormFieldStyles,\n ButtonStyles,\n DocumentPageStyles,\n CommonGristStyles,\n ScrollbarStyles,\n DocumentFormStyles,\n css`\n ox-grist {\n height: calc(var(--form-element-height-medium) * 10);\n }\n /* 상품에서 추가 sits over the lines, as wide as a head field. */\n .pick {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-small);\n max-width: 480px;\n margin-bottom: var(--spacing-medium);\n font-size: var(--ui-t-micro);\n color: var(--ui-muted);\n }\n `\n ]\n\n @state() quotation: DocumentValue | null = null\n @state() form: DocumentValue = blank()\n @state() loading = false\n @state() error: unknown = null\n @state() busy = false\n @state() reason = ''\n @state() gristConfig: any\n /** The open opportunities a draft may answer, and the one it answers when that one is closed. */\n @state() opportunities: { id: string; name: string; counterparty?: DocumentParty | null }[] = []\n /** The company's words a new quotation starts with, the terms it offers and how long an offer holds (ADR-0170). */\n @state() defaults: DocumentDefaults | null = null\n /** The counterparty the buyer was taken from on this screen - shown in the picker. */\n @state() party: DocumentParty | null = null\n /** The totals of the lines as typed - reckoned as the quotation will keep them, shown before it is saved. */\n @state() amounts: Partial<DocumentValue> = {}\n /** Whether this person may write invoices - an accepted quotation then makes one. */\n @state() invoiceWriter = false\n /** Whether the application's section is this person's to read - asked once, before it is shown. */\n @state() sectionReadable = false\n\n @query('ox-grist') private grist?: DataGrist\n\n get editable() {\n return !this.quotation || this.quotation.status === 'DRAFT'\n }\n\n get context() {\n const status = this.quotation?.status\n const actions: any[] = []\n if (this.editable) {\n actions.push({ title: i18next.t('button.save'), icon: 'save', action: () => this.save() })\n actions.push({ title: i18next.t('button.quotation-send'), icon: 'send', emphasis: { raised: true }, action: () => this.send() })\n }\n if (status === 'SENT') {\n if (this.quotation!.validUntil < today()) actions.push({ title: i18next.t('button.quotation-expire'), action: () => this.change('expireQuotation') })\n else actions.push({ title: i18next.t('button.quotation-accept'), emphasis: { raised: true }, action: () => this.change('acceptQuotation') })\n }\n if (status === 'ACCEPTED' && this.invoiceWriter) actions.push({ title: i18next.t('button.quotation-make-invoice'), icon: 'receipt_long', emphasis: { raised: true }, action: () => this.makeInvoice() })\n if (['SENT', 'REJECTED', 'EXPIRED'].includes(status)) actions.push({ title: i18next.t('button.quotation-revise'), icon: 'edit_document', action: () => this.change('reviseQuotation') })\n if (this.quotation) actions.push({ title: i18next.t('button.preview'), icon: 'preview', action: () => this.preview() })\n return {\n title: this.quotation ? `${i18next.t('title.quotation')} ${this.quotation.number} · v${this.quotation.version}` : i18next.t('title.quotation-new'),\n ...(this.quotation ? { description: quotationStatusWord(status) } : {}),\n frame: 'document',\n /* Opened from the quotation list; the menu marks it. */\n menu: 'quotation-list',\n actions: this.error ? [] : actions\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (!this.active || !(changes.active || changes.params)) return\n const id = lifecycle?.params?.id\n if (!this.opportunities.length) await this.readOpportunities()\n if (!this.defaults) this.defaults = await documentDefaults()\n const section = quotationSection()\n if (section && !this.sectionReadable) (section.readable?.() ?? Promise.resolve(true)).then(may => (this.sectionReadable = !!may))\n hasPrivilege({ category: 'invoice', privilege: 'mutation', domainOwnerGranted: true }).then(writer => {\n this.invoiceWriter = !!writer\n this.updateContext()\n })\n if (!id) {\n this.quotation = null\n /* Written from an opportunity, the draft answers it. */\n this.form = { ...blank(), opportunityId: lifecycle?.params?.opportunity ?? '' }\n this.amounts = {}\n this.party = null\n this.configure()\n await this.prefill()\n this.updateContext()\n return\n }\n if (id !== this.quotation?.id) await this.load(id)\n }\n\n render() {\n const attached = this.quotation && this.sectionReadable ? quotationSection() : undefined\n const editable = this.editable && !this.busy\n return html`<ox-page-state .loading=${this.loading} .error=${this.error} @retry=${() => this.quotation && this.load(this.quotation.id)}>\n <div class=\"page\">\n <section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('text.quotation-section-head')}</h3></header>\n ${renderDocumentHead(\n this.form,\n editable,\n patch => this.edit(patch),\n html`<label\n >${i18next.t('field.quotation-valid-until')}\n <input type=\"date\" .value=${this.form.validUntil ?? ''} ?disabled=${!editable} @input=${(e: any) => (this.form = { ...this.form, validUntil: e.target.value })}\n /></label>\n ${this.renderOpportunity(editable)}`,\n 'field.quotation-number',\n {\n terms: this.defaults?.paymentTerms,\n /* In the group it fills - the buyer's of a sale, the supplier's of a purchase. */\n party: html`<label\n >${i18next.t('field.counterparty')}\n <document-party-select .party=${this.party} ?disabled=${!editable} @party=${(e: CustomEvent) => this.takeParty(e.detail)}></document-party-select>\n </label>`\n }\n )}\n </section>\n <section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('text.quotation-section-lines')}</h3></header>\n ${editable\n ? html`<label class=\"pick\"\n >${i18next.t('field.sales-product-pick')}\n <sales-product-pick .currency=${this.form.currency || 'KRW'} @product=${(e: CustomEvent) => this.addProduct(e.detail)}></sales-product-pick>\n </label>`\n : nothing}\n <ox-grist\n mode=\"GRID\"\n .config=${this.gristConfig}\n .fetchHandler=${() => ({ total: this.form.items.length, records: this.form.items })}\n @record-change=${(e: CustomEvent) => (this.amounts = onLineChange(this.grist, e, this.form.currency, false, this.form.discountAmount))}\n ></ox-grist>\n </section>\n <section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('text.quotation-section-totals')}</h3></header>\n ${renderDocumentTotals(\n { ...this.amounts, currency: this.form.currency },\n { value: this.form.discountAmount, editable, change: value => this.discount(value) }\n )}\n </section>\n ${this.quotation?.status === 'SENT' ? this.renderDecline() : nothing}\n ${this.quotation?.outcomeReason\n ? html`<section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('field.quotation-outcome-reason')}</h3></header>\n <p>${this.quotation.outcomeReason}</p>\n </section>`\n : nothing}\n ${attached && this.quotation\n ? html`<section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${attached.heading()}</h3></header>\n ${attached.render(this.quotation as any)}\n </section>`\n : nothing}\n </div>\n </ox-page-state>`\n }\n\n private renderDecline() {\n return html`<section class=\"page-section\">\n <header class=\"page-section-header\">\n <h3>${i18next.t('text.quotation-section-decline')}</h3>\n <div class=\"page-section-actions\">\n <button ?disabled=${this.busy || !this.reason.trim()} @click=${() => this.change('rejectQuotation', this.reason.trim())}>${i18next.t('button.quotation-reject')}</button>\n </div>\n </header>\n <div class=\"form\">\n <label class=\"wide\"\n >${i18next.t('field.quotation-outcome-reason')}\n <input .value=${this.reason} ?disabled=${this.busy} @input=${(e: any) => (this.reason = e.target.value)}\n /></label>\n </div>\n </section>`\n }\n\n /**\n * A line made from a product, after the lines there are - a copy the person then changes like any line (ADR-0171) -\n * and the totals reckoned with it.\n */\n private async addProduct(product: PickedProduct) {\n const grist = this.grist\n if (!grist || !product) return\n grist.addRecord(lineOfProduct(product))\n await grist.updateComplete\n this.amounts = reckonLines(grist, this.form.currency, false, this.form.discountAmount)\n grist.refresh()\n }\n\n /** The discount of the whole quotation as typed, and the totals after it. */\n private discount(value: string) {\n this.form = { ...this.form, discountAmount: value }\n this.amounts = reckonLines(this.grist, this.form.currency, false, value)\n }\n\n /** A change of the head; a new currency reckons the lines in its minor unit; the last day follows a moved issue day. */\n private edit(patch: DocumentValue) {\n const currency = this.form.currency\n const following = patch.issueDate && this.form.validUntil === daysAfter(this.form.issueDate, this.validDays)\n this.form = { ...this.form, ...patch, ...(following ? { validUntil: daysAfter(patch.issueDate, this.validDays) } : {}) }\n if (patch.currency && patch.currency !== currency) {\n this.configure()\n this.amounts = reckonLines(this.grist, this.form.currency, false, this.form.discountAmount)\n }\n }\n\n /** The opportunity it answers - found by typing; choosing one takes its counterparty as the buyer when none is written. */\n private renderOpportunity(editable: boolean) {\n const choices = this.opportunityChoices()\n const chosen = choices.find(one => one.id === this.form.opportunityId)\n const label = (one: { name: string; counterparty?: DocumentParty | null }) => `${one.name}${one.counterparty?.name ? ` · ${one.counterparty.name}` : ''}`\n return html`<label\n >${i18next.t('field.quotation-opportunity')}\n <ox-select\n .value=${this.form.opportunityId ?? ''}\n ?disabled=${!editable}\n aria-label=${i18next.t('field.quotation-opportunity')}\n @change=${(e: CustomEvent) => {\n const id = String(e.detail ?? '')\n if (id === (this.form.opportunityId ?? '')) return\n const opportunity = choices.find(one => one.id === id)\n this.form = { ...this.form, opportunityId: id }\n if (opportunity?.counterparty && !String(this.form.buyerName ?? '').trim()) this.takeParty(opportunity.counterparty)\n }}\n >\n <span slot=\"label\">${chosen ? label(chosen) : '—'}</span>\n <ox-popup-list align-left nowrap with-search>\n <div option value=\"\">—</div>\n ${choices.map(one => html`<div option value=${one.id}>${label(one)}</div>`)}\n </ox-popup-list>\n </ox-select>\n </label>`\n }\n\n /** A counterparty as the other side: the buyer of a sale, the supplier of a purchase. */\n private takeParty(party: DocumentParty | null) {\n this.party = party\n if (!party) return\n const side = this.form.direction === 'PURCHASE' ? 'supplier' : 'buyer'\n this.form = { ...this.form, [`${side}Name`]: party.name, [`${side}RegistrationNumber`]: party.businessNumber ?? this.form[`${side}RegistrationNumber`] ?? '' }\n }\n\n /**\n * What a new quotation starts with, so a person writes only what is new: the next number of the year, the last day an\n * offer holds, the company's own words (ADR-0170), and what they leave blank of our side as the last sales quotation\n * wrote it.\n */\n private async prefill() {\n try {\n const year = Number(this.form.issueDate.slice(0, 4))\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n numbered: quotations(filters: $filters, pagination: { page: 1, limit: 1000 }) { items { number } }\n last: quotations(pagination: $pagination, sortings: $sortings) { items { direction ${OUR_SIDE_FIELDS.join(' ')} } }\n }\n `,\n variables: { filters: [{ name: 'number', operator: 'like', value: `Q${year}-%` }], pagination: { page: 1, limit: 1 }, sortings: [{ name: 'createdAt', desc: true }] },\n fetchPolicy: 'no-cache'\n })\n const last = (response.data?.last?.items ?? []).find((one: any) => one.direction === 'SALES')\n this.form = { ...this.form, ...headFromDefaults(this.form, this.defaults) }\n this.form = {\n ...this.form,\n ...oursFromLast(this.form, last),\n number: this.form.number || nextQuotationNumber((response.data?.numbered?.items ?? []).map((one: any) => one.number), year),\n validUntil: this.form.validUntil || daysAfter(this.form.issueDate, this.validDays)\n }\n } catch {\n /* Nothing to start from - the person writes it, as before. */\n }\n const opportunity = this.opportunities.find(one => one.id === this.form.opportunityId)\n if (opportunity?.counterparty && !String(this.form.buyerName ?? '').trim()) this.takeParty(opportunity.counterparty)\n }\n\n /** Days an offer holds - the company's, or thirty. */\n private get validDays() {\n return this.defaults?.validDays || VALID_DAYS\n }\n\n private opportunityChoices() {\n const answered = this.quotation?.opportunity\n return answered && !this.opportunities.some(one => one.id === answered.id) ? [answered, ...this.opportunities] : this.opportunities\n }\n\n private async readOpportunities() {\n try {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n opportunities(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items { id name counterparty { id name businessNumber } }\n }\n }\n `,\n variables: {\n filters: [{ name: 'stage', operator: 'in', value: ['LEAD', 'PROPOSAL', 'QUOTED', 'NEGOTIATION'] }],\n pagination: { page: 1, limit: 500 },\n sortings: [{ name: 'name' }]\n },\n fetchPolicy: 'no-cache'\n })\n this.opportunities = response.data?.opportunities?.items ?? []\n } catch (error: any) {\n notify({ level: 'error', message: error?.graphQLErrors?.[0]?.message ?? error?.message ?? String(error) })\n }\n }\n\n private configure() {\n this.gristConfig = documentLinesConfig({ editable: this.editable, currency: this.form.currency || 'KRW' })\n }\n\n private async load(id: string) {\n this.loading = true\n this.error = null\n try {\n const response = await client.query({ query: gql(`query ($id: String!) { quotation(id: $id) { ${FIELDS} } }`), variables: { id }, fetchPolicy: 'no-cache' })\n if (response.errors?.length) throw response\n if (!response.data.quotation) throw new Error(i18next.t('text.quotation-not-found'))\n this.show(response.data.quotation)\n } catch (error) {\n this.error = error\n } finally {\n this.loading = false\n this.updateContext()\n }\n }\n\n private show(quotation: DocumentValue) {\n this.quotation = quotation\n this.form = { ...quotation, items: quotation.items.map((item: any) => ({ ...item })) }\n this.amounts = quotation\n this.reason = ''\n this.configure()\n this.grist?.fetch()\n }\n\n private async run<T>(work: () => Promise<T>): Promise<T | undefined> {\n if (this.busy) return undefined\n this.busy = true\n try {\n return await work()\n } catch (error: any) {\n notify({ level: 'error', message: error?.graphQLErrors?.[0]?.message ?? error?.errors?.[0]?.message ?? error?.message ?? String(error) })\n return undefined\n } finally {\n this.busy = false\n }\n }\n\n private input() {\n const input: DocumentValue = Object.fromEntries(HEAD.map(key => [key, this.form[key] === '' ? null : this.form[key] ?? null]))\n input.items = linesOf(this.grist).map(({ receivedTaxAmount, ...line }: any) => line)\n input.discountAmount = input.discountAmount === null ? 0 : Number(input.discountAmount)\n return input\n }\n\n private async save(): Promise<DocumentValue | undefined> {\n const id = this.quotation?.id\n const saved = await this.run(async () => {\n const response = await client.mutate({\n mutation: gql(\n id\n ? `mutation ($id: String!, $quotation: NewQuotation!) { quotation: updateQuotation(id: $id, quotation: $quotation) { ${FIELDS} } }`\n : `mutation ($quotation: NewQuotation!) { quotation: createQuotation(quotation: $quotation) { ${FIELDS} } }`\n ),\n variables: { ...(id ? { id } : {}), quotation: this.input() }\n })\n if (response.errors?.length) throw response\n return response.data.quotation as DocumentValue\n })\n if (!saved) return undefined\n this.show(saved)\n this.updateContext()\n if (!id) navigate(`quotation-editor?id=${saved.id}`)\n return saved\n }\n\n /** Asked first - to whom and how much, fixed after - then save what is on screen and send it. */\n private async send() {\n const purchase = this.form.direction === 'PURCHASE'\n const words = {\n party: (purchase ? this.form.supplierName : this.form.buyerName) || '—',\n total: documentAmount(this.amounts.totalAmount ?? 0, this.form.currency || 'KRW')\n }\n const confirmed = await OxPrompt.open({\n title: i18next.t('button.quotation-send'),\n text: purchase ? i18next.t('text.quotation-send-confirm-purchase', words) : i18next.t('text.quotation-send-confirm', words),\n confirmButton: { text: i18next.t('button.quotation-send') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n if (!confirmed) return\n const saved = await this.save()\n if (saved) await this.change('sendQuotation')\n }\n\n private async change(mutation: string, reason?: string) {\n const changed = await this.run(async () => {\n const response = await client.mutate({\n mutation: gql(\n reason === undefined\n ? `mutation ($id: String!) { quotation: ${mutation}(id: $id) { ${FIELDS} } }`\n : `mutation ($id: String!, $reason: String!) { quotation: ${mutation}(id: $id, reason: $reason) { ${FIELDS} } }`\n ),\n variables: { id: this.quotation!.id, ...(reason === undefined ? {} : { reason }) }\n })\n if (response.errors?.length) throw response\n return response.data.quotation as DocumentValue\n })\n if (!changed) return\n if (changed.id !== this.quotation?.id) navigate(`quotation-editor?id=${changed.id}`)\n this.show(changed)\n this.updateContext()\n }\n\n /**\n * An invoice draft of an accepted quotation (ADR-0170 decision 11): its parties, currency, language, terms, account,\n * notes, discount and lines as the quotation has them, issued today and due the company's days after, the quotation\n * named as its source - then opened to be checked and issued. The counterparty is the one of the other party's name,\n * as the invoice editor links it.\n */\n private async makeInvoice() {\n const quotation = this.quotation!\n const created = await this.run(async () => {\n const last = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n invoices(filters: $filters, pagination: $pagination, sortings: $sortings) { items { number } }\n }\n `,\n variables: { filters: [{ name: 'direction', operator: 'eq', value: 'SALES' }], pagination: { page: 1, limit: 1 }, sortings: [{ name: 'createdAt', desc: true }] },\n fetchPolicy: 'no-cache'\n })\n const issueDate = today()\n const party = await partyOfName(quotation.direction === 'PURCHASE' ? quotation.supplierName : quotation.buyerName)\n const response = await client.mutate({\n mutation: gql`\n mutation ($invoice: NewInvoice!) {\n createInvoice(invoice: $invoice) { id }\n }\n `,\n variables: {\n invoice: {\n number: nextInvoiceNumber(last.data?.invoices?.items?.[0]?.number, Number(issueDate.slice(0, 4))),\n counterpartyId: party?.id ?? null,\n ...Object.fromEntries(INVOICE_HEAD.map(key => [key, quotation[key] ?? null])),\n issueDate,\n dueDate: daysAfter(issueDate, this.defaults?.paymentDays ?? PAYMENT_DAYS),\n sourceReference: i18next.t('text.quotation-invoice-source', { number: quotation.number, version: quotation.version }),\n taxBasis: 'CALCULATED',\n discountAmount: Number(quotation.discountAmount ?? 0),\n items: quotation.items.map(({ description, quantity, unit, unitPrice, discount, taxKind, taxRate }: any) => ({\n description,\n quantity,\n unit: unit ?? null,\n unitPrice,\n discount,\n taxKind,\n taxRate\n }))\n }\n }\n })\n if (response.errors?.length) throw response\n return response.data.createInvoice as { id: string }\n })\n if (created) navigate(`invoice-editor?id=${created.id}`)\n }\n\n /**\n * The saved quotation as it goes out (ADR-0170 decision 10) - the server's page in the language chosen there, the\n * quotation's own first, to download as PDF or print. What is on screen and not saved is not in it.\n */\n private preview() {\n const { id, number, version, language } = this.quotation!\n openDocumentPreview(\n async (format: DocumentFileFormat, lng: string) => {\n const response = await client.query({\n query: gql`\n query ($id: String!, $format: DocumentFileFormat!, $language: String) {\n quotationDocumentFile(id: $id, format: $format, language: $language) { fileName mimeType content }\n }\n `,\n variables: { id, format, language: lng },\n fetchPolicy: 'no-cache'\n })\n if (!response.data?.quotationDocumentFile) throw response.errors?.[0] ?? new Error(i18next.t('text.quotation-not-found'))\n return response.data.quotationDocumentFile\n },\n language,\n `${i18next.t('title.preview')} · ${number} · v${version}`\n )\n }\n}\n\nfunction blank(): DocumentValue {\n return { number: '', direction: 'SALES', currency: 'KRW', language: 'ko', supplierName: '', buyerName: '', issueDate: today(), validUntil: '', discountAmount: 0, items: [] }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"quotation-editor.js","sourceRoot":"","sources":["../../client/pages/quotation-editor.ts"],"names":[],"m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;sDAAsB;AAErB;IAAR,KAAK,EAAE;;wDAAwB;AAEf;IAAhB,KAAK,EAAE;;+CAAuB;AAqHJ;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;8CAAA;AA1JjC,eAAe;IAD3B,aAAa,CAAC,kBAAkB,CAAC;GACrB,eAAe,CAghB3B;;AAED,mGAAmG;AACnG,SAAS,WAAW,CAAC,IAAmB,EAAE,KAAoB;IAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAA;IACjE,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,oBAAoB,CAAC,EAAE,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC,GAAG,IAAI,oBAAoB,CAAC,IAAI,EAAE,EAAE,CAAA;AAC/I,CAAC;AAED,SAAS,KAAK;IACZ,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;AAC/K,CAAC","sourcesContent":["import '@operato/data-grist/ox-grist.js'\nimport '@operato/list-state/ox-page-state.js'\nimport '@operato/input/ox-select.js'\nimport '@operato/popup/ox-popup-list.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport type { PropertyValues } from 'lit'\n\nimport { DataGrist } from '@operato/data-grist'\nimport { client, MutationController, QueryController } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\nimport { navigate, PageView, DraftController } from '@operato/shell'\nimport { ButtonStyles, CommonGristStyles, DocumentPageStyles, FormFieldStyles, ScrollbarStyles } from '@operato/styles'\nimport { hasPrivilege } from '@things-factory/auth-base/dist-client'\nimport {\n daysAfter,\n documentAmount,\n DocumentFormStyles,\n documentLinesConfig,\n linesOf,\n onLineChange,\n openDocumentPreview,\n reckonLines,\n renderDocumentHead,\n renderDocumentTotals,\n DOCUMENT_DEFAULTS,\n DOCUMENT_DEFAULTS_READER,\n headFromDefaults,\n nextInvoiceNumber,\n OUR_SIDE_FIELDS,\n oursFromLast,\n partyOfName,\n type DocumentDefaults,\n type DocumentFileFormat,\n type DocumentParty,\n type DocumentValue\n} from '@things-factory/invoice/dist-client'\n\nimport '@things-factory/invoice/dist-client/document/document-party.js'\n\nimport { quotationSection } from '../quotation-attach'\nimport '../sales-product-pick'\nimport { lineOfProduct, type PickedProduct } from '../sales-product-pick'\nimport { quotationStatusWord } from '../quotation-words'\n\nconst FIELDS = `\n id number version status validUntil outcomeReason opportunityId opportunity { id name } direction currency language supplierName supplierAddress supplierRegistrationNumber\n buyerName buyerAddress buyerRegistrationNumber issueDate purchaseOrder paymentTerms bankDetails notes sourceReference\n discountAmount lineSupplyAmount supplyAmount taxAmount totalAmount taxRounding currencyDigits\n items { position description quantity unit unitPrice discount taxKind taxRate supplyAmount }\n taxGroups { taxKind taxRate supplyAmount taxAmount }\n`\n\nconst HEAD = [\n 'number',\n 'direction',\n 'currency',\n 'language',\n 'supplierName',\n 'supplierAddress',\n 'supplierRegistrationNumber',\n 'buyerName',\n 'buyerAddress',\n 'buyerRegistrationNumber',\n 'issueDate',\n 'purchaseOrder',\n 'paymentTerms',\n 'bankDetails',\n 'notes',\n 'sourceReference',\n 'validUntil',\n 'opportunityId',\n 'discountAmount'\n]\n\nconst today = () => new Date().toLocaleDateString('en-CA')\n\n/** What an invoice made from a quotation takes of its head as it is. */\nconst INVOICE_HEAD = [\n 'direction',\n 'currency',\n 'language',\n 'supplierName',\n 'supplierAddress',\n 'supplierRegistrationNumber',\n 'buyerName',\n 'buyerAddress',\n 'buyerRegistrationNumber',\n 'paymentTerms',\n 'bankDetails',\n 'notes'\n]\n\n/** A step of a quotation's life - each answers with the quotation it leaves (a revision is a new one). */\nconst step = (name: string, reason = false) =>\n gql(\n reason\n ? `mutation ($id: String!, $reason: String!) { quotation: ${name}(id: $id, reason: $reason) { id } }`\n : `mutation ($id: String!) { quotation: ${name}(id: $id) { id } }`\n )\n\n/** How long an offer holds unless the person writes another last day. */\nconst VALID_DAYS = 30\n\n/** Days an invoice made from a quotation is due unless the company says otherwise - the invoice editor's. */\nconst PAYMENT_DAYS = 30\n\n/** The next quotation number of a year after those given - 「Q2026-001」, 「Q2026-002」 … */\nexport function nextQuotationNumber(numbers: string[], year: number): string {\n const prefix = `Q${year}-`\n const last = Math.max(0, ...numbers.filter(one => one?.startsWith(prefix)).map(one => Number(one.slice(prefix.length)) || 0))\n return `${prefix}${String(last + 1).padStart(3, '0')}`\n}\n\n/**\n * 견적 편집 — the same head, lines and totals as an invoice, valid until a day.\n *\n * A draft is saved and sent; once sent its amounts are fixed, and the buyer's answer is recorded — accepted, or\n * declined with a reason. To change a sent quotation, revise it: the next version keeps the number.\n */\n@customElement('quotation-editor')\nexport class QuotationEditor extends localize(i18next)(PageView) {\n static styles = [\n FormFieldStyles,\n ButtonStyles,\n DocumentPageStyles,\n CommonGristStyles,\n ScrollbarStyles,\n DocumentFormStyles,\n css`\n ox-grist {\n height: calc(var(--form-element-height-medium) * 10);\n }\n /* 상품에서 추가 sits over the lines, as wide as a head field. */\n .pick {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-small);\n max-width: 480px;\n margin-bottom: var(--spacing-medium);\n font-size: var(--ui-t-micro);\n color: var(--ui-muted);\n }\n `\n ]\n\n /** What the address opens: a quotation by id, or a new one - written from an opportunity, it answers that one. */\n @state() private address?: { id?: string; opportunity?: string }\n @state() gristConfig: any\n /** Whether this person may read the company's words - unknown, and nothing read, until asked. */\n @state() private defaultsReadable = false\n /** The totals of the lines as typed - reckoned as the quotation will keep them, shown before it is saved. */\n @state() private typedAmounts: Partial<DocumentValue> | null = null\n /** Whether this person may write invoices - an accepted quotation then makes one. */\n @state() invoiceWriter = false\n /** Whether the application's section is this person's to read - asked once, before it is shown. */\n @state() sectionReadable = false\n /** An invoice being made of this quotation - its look-ups and its save. */\n @state() private making = false\n\n /* The company's words, the open opportunities a draft may answer, the quotation the address names, and what a new one starts from (ADR-0190). */\n private companyDefaults = new QueryController(this, DOCUMENT_DEFAULTS, { variables: () => (this.defaultsReadable ? {} : undefined) })\n private openOpportunities = new QueryController(\n this,\n gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n opportunities(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items { id name counterparty { id name businessNumber } }\n }\n }\n `,\n {\n variables: () => ({\n filters: [{ name: 'stage', operator: 'in', value: ['LEAD', 'PROPOSAL', 'QUOTED', 'NEGOTIATION'] }],\n pagination: { page: 1, limit: 500 },\n sortings: [{ name: 'name' }]\n })\n }\n )\n private record = new QueryController(this, gql(`query ($id: String!) { quotation(id: $id) { ${FIELDS} } }`), {\n variables: () => (this.quotationId ? { id: this.quotationId } : undefined)\n })\n private starts = new QueryController(\n this,\n gql`\n query ($filters: [Filter!], $sortings: [Sorting!]) {\n numbered: quotations(filters: $filters, pagination: { page: 1, limit: 1000 }) { items { number } }\n last: quotations(pagination: { page: 1, limit: 1 }, sortings: $sortings) { items { direction ${OUR_SIDE_FIELDS.join(' ')} } }\n }\n `,\n {\n variables: () =>\n this.address && !this.address.id ? { filters: [{ name: 'number', operator: 'like', value: `Q${today().slice(0, 4)}-%` }], sortings: [{ name: 'createdAt', desc: true }] } : undefined\n }\n )\n\n /* What is typed over the quotation read, or over what a new one starts with; the lines are the grid's. */\n private draft = new DraftController<DocumentValue>(this, { read: () => this.formRead, key: () => this.address })\n /* The reason the buyer declined with. */\n private decline = new DraftController<{ reason: string }>(this, { read: () => ({ reason: '' }), key: () => this.address })\n\n /* Every change of the quotation reads it again once it is done. */\n private saves = {\n create: new MutationController(this, gql`mutation ($quotation: NewQuotation!) { quotation: createQuotation(quotation: $quotation) { id } }`),\n update: this.saving(gql`mutation ($id: String!, $quotation: NewQuotation!) { quotation: updateQuotation(id: $id, quotation: $quotation) { id } }`),\n sendQuotation: this.saving(step('sendQuotation')),\n expireQuotation: this.saving(step('expireQuotation')),\n acceptQuotation: this.saving(step('acceptQuotation')),\n reviseQuotation: this.saving(step('reviseQuotation')),\n rejectQuotation: this.saving(step('rejectQuotation', true)),\n invoice: new MutationController(\n this,\n gql`\n mutation ($invoice: NewInvoice!) {\n created: createInvoice(invoice: $invoice) { id }\n }\n `\n )\n }\n\n private saving(mutation: any) {\n return new MutationController(this, mutation, { refetch: () => [this.record] })\n }\n\n private get quotationId() {\n return this.address?.id ?? ''\n }\n\n /** The company's words a new quotation starts with, the terms it offers and how long an offer holds (ADR-0170) - none until read. */\n get defaults(): DocumentDefaults | null {\n return this.companyDefaults.data?.documentDefaults ?? null\n }\n\n get quotation(): DocumentValue | null {\n return (this.quotationId && this.record.data?.quotation) || null\n }\n\n private get opportunities(): { id: string; name: string; counterparty?: DocumentParty | null }[] {\n return this.openOpportunities.data?.opportunities?.items ?? []\n }\n\n /** What the form shows unedited: the quotation read, or what a new one starts with. */\n private get formRead(): DocumentValue | undefined {\n if (!this.address) return undefined\n return this.address.id ? (this.quotation ?? undefined) : this.start\n }\n\n /** The form as it shows: each field's edit, else what was read. */\n get form(): DocumentValue {\n return { ...blank(), ...this.formRead, ...this.draft.edits }\n }\n\n /** The totals of the lines as typed, else as the quotation keeps them. */\n get amounts(): Partial<DocumentValue> {\n return this.typedAmounts ?? this.quotation ?? {}\n }\n\n get reason() {\n return this.decline.value('reason') ?? ''\n }\n\n /** A failed read, or a quotation the address names that is not there. */\n get error(): unknown {\n if (this.record.error) return this.record.error\n return this.quotationId && this.record.data && !this.record.data.quotation ? new Error(i18next.t('text.quotation-not-found')) : null\n }\n\n get loading() {\n return this.record.loading\n }\n\n get busy() {\n return this.making || Object.values(this.saves).some(save => save.pending)\n }\n\n @query('ox-grist') private grist?: DataGrist\n\n get editable() {\n return !this.quotation || this.quotation.status === 'DRAFT'\n }\n\n get context() {\n const status = this.quotation?.status\n const actions: any[] = []\n if (this.editable) {\n actions.push({ title: i18next.t('button.save'), icon: 'save', action: () => this.save() })\n actions.push({ title: i18next.t('button.quotation-send'), icon: 'send', emphasis: { raised: true }, action: () => this.send() })\n }\n if (status === 'SENT') {\n if (this.quotation!.validUntil < today()) actions.push({ title: i18next.t('button.quotation-expire'), action: () => this.change('expireQuotation') })\n else actions.push({ title: i18next.t('button.quotation-accept'), emphasis: { raised: true }, action: () => this.change('acceptQuotation') })\n }\n if (status === 'ACCEPTED' && this.invoiceWriter) actions.push({ title: i18next.t('button.quotation-make-invoice'), icon: 'receipt_long', emphasis: { raised: true }, action: () => this.makeInvoice() })\n if (['SENT', 'REJECTED', 'EXPIRED'].includes(status)) actions.push({ title: i18next.t('button.quotation-revise'), icon: 'edit_document', action: () => this.change('reviseQuotation') })\n if (this.quotation) actions.push({ title: i18next.t('button.preview'), icon: 'preview', action: () => this.preview() })\n return {\n title: this.quotation ? `${i18next.t('title.quotation')} ${this.quotation.number} · v${this.quotation.version}` : i18next.t('title.quotation-new'),\n ...(this.quotation ? { description: quotationStatusWord(status) } : {}),\n frame: 'document',\n /* Opened from the quotation list; the menu marks it. */\n menu: 'quotation-list',\n actions: this.error ? [] : actions\n }\n }\n\n pageUpdated(changes: any, lifecycle: any) {\n if (!this.active || !(changes.active || changes.params)) return\n const { id, opportunity } = lifecycle?.params ?? {}\n if (!this.defaultsReadable) hasPrivilege(DOCUMENT_DEFAULTS_READER).then(may => (this.defaultsReadable = !!may))\n const section = quotationSection()\n if (section && !this.sectionReadable) (section.readable?.() ?? Promise.resolve(true)).then(may => (this.sectionReadable = !!may))\n hasPrivilege({ category: 'invoice', privilege: 'mutation', domainOwnerGranted: true }).then(writer => {\n this.invoiceWriter = !!writer\n this.updateContext()\n })\n /* Written from an opportunity, the draft answers it. */\n this.address = id ? { id } : { opportunity: opportunity ?? '' }\n }\n\n /* The lines and their totals are the grid's: a new answer, or another quotation, puts the lines read in it again. */\n private lined?: unknown\n private relined = false\n\n willUpdate(changes: PropertyValues) {\n super.willUpdate(changes)\n const source = this.quotationId ? this.quotation : JSON.stringify(this.address ?? null)\n if (source === this.lined) return\n this.lined = source\n this.typedAmounts = null\n this.configure()\n this.relined = true\n }\n\n updated(changes: PropertyValues) {\n super.updated(changes)\n if (!this.relined) return\n this.relined = false\n this.grist?.fetch()\n }\n\n render() {\n const attached = this.quotation && this.sectionReadable ? quotationSection() : undefined\n const editable = this.editable && !this.busy\n return html`<ox-page-state .loading=${this.loading} .error=${this.error} @retry=${() => this.record.refetch()}>\n <div class=\"page\">\n <section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('text.quotation-section-head')}</h3></header>\n ${renderDocumentHead(\n this.form,\n editable,\n patch => this.edit(patch),\n html`<label\n >${i18next.t('field.quotation-valid-until')}\n <input type=\"date\" .value=${this.form.validUntil ?? ''} ?disabled=${!editable} @input=${(e: any) => this.put({ validUntil: e.target.value })}\n /></label>\n ${this.renderOpportunity(editable)}`,\n 'field.quotation-number',\n {\n terms: this.defaults?.paymentTerms,\n /* In the group it fills - the buyer's of a sale, the supplier's of a purchase. */\n party: html`<label\n >${i18next.t('field.counterparty')}\n <document-party-select .party=${this.form.party ?? null} ?disabled=${!editable} @party=${(e: CustomEvent) => this.takeParty(e.detail)}></document-party-select>\n </label>`\n }\n )}\n </section>\n <section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('text.quotation-section-lines')}</h3></header>\n ${editable\n ? html`<label class=\"pick\"\n >${i18next.t('field.sales-product-pick')}\n <sales-product-pick .currency=${this.form.currency || 'KRW'} @product=${(e: CustomEvent) => this.addProduct(e.detail)}></sales-product-pick>\n </label>`\n : nothing}\n <ox-grist\n mode=\"GRID\"\n .config=${this.gristConfig}\n .fetchHandler=${() => ({ total: (this.form.items ?? []).length, records: (this.form.items ?? []).map((item: any) => ({ ...item })) })}\n @record-change=${(e: CustomEvent) => (this.typedAmounts = onLineChange(this.grist, e, this.form.currency, false, this.form.discountAmount))}\n ></ox-grist>\n </section>\n <section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('text.quotation-section-totals')}</h3></header>\n ${renderDocumentTotals(\n { ...this.amounts, currency: this.form.currency },\n { value: this.form.discountAmount, editable, change: value => this.discount(value) }\n )}\n </section>\n ${this.quotation?.status === 'SENT' ? this.renderDecline() : nothing}\n ${this.quotation?.outcomeReason\n ? html`<section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('field.quotation-outcome-reason')}</h3></header>\n <p>${this.quotation.outcomeReason}</p>\n </section>`\n : nothing}\n ${attached && this.quotation\n ? html`<section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${attached.heading()}</h3></header>\n ${attached.render(this.quotation as any)}\n </section>`\n : nothing}\n </div>\n </ox-page-state>`\n }\n\n private renderDecline() {\n return html`<section class=\"page-section\">\n <header class=\"page-section-header\">\n <h3>${i18next.t('text.quotation-section-decline')}</h3>\n <div class=\"page-section-actions\">\n <button ?disabled=${this.busy || !this.reason.trim()} @click=${() => this.decline.submit(sent => this.change('rejectQuotation', (sent.reason ?? '').trim()))}>${i18next.t('button.quotation-reject')}</button>\n </div>\n </header>\n <div class=\"form\">\n <label class=\"wide\"\n >${i18next.t('field.quotation-outcome-reason')}\n <input .value=${this.reason} ?disabled=${this.busy} @input=${(e: any) => this.decline.set('reason', e.target.value)}\n /></label>\n </div>\n </section>`\n }\n\n /**\n * A line made from a product, after the lines there are - a copy the person then changes like any line (ADR-0171) -\n * and the totals reckoned with it.\n */\n private async addProduct(product: PickedProduct) {\n const grist = this.grist\n if (!grist || !product) return\n grist.addRecord(lineOfProduct(product))\n await grist.updateComplete\n this.typedAmounts = reckonLines(grist, this.form.currency, false, this.form.discountAmount)\n grist.refresh()\n }\n\n /** The discount of the whole quotation as typed, and the totals after it. */\n private discount(value: string) {\n this.put({ discountAmount: value })\n this.typedAmounts = reckonLines(this.grist, this.form.currency, false, value)\n }\n\n /** Edits of several fields at once. */\n private put(patch: DocumentValue) {\n for (const [name, value] of Object.entries(patch)) this.draft.set(name, value)\n }\n\n /** A change of the head; a new currency reckons the lines in its minor unit; the last day follows a moved issue day. */\n private edit(patch: DocumentValue) {\n const currency = this.form.currency\n const following = patch.issueDate && this.form.validUntil === daysAfter(this.form.issueDate, this.validDays)\n this.put({ ...patch, ...(following ? { validUntil: daysAfter(patch.issueDate, this.validDays) } : {}) })\n if (patch.currency && patch.currency !== currency) {\n this.configure()\n this.typedAmounts = reckonLines(this.grist, this.form.currency, false, this.form.discountAmount)\n }\n }\n\n /** The opportunity it answers - found by typing; choosing one takes its counterparty as the buyer when none is written. */\n private renderOpportunity(editable: boolean) {\n const choices = this.opportunityChoices()\n const chosen = choices.find(one => one.id === this.form.opportunityId)\n const label = (one: { name: string; counterparty?: DocumentParty | null }) => `${one.name}${one.counterparty?.name ? ` · ${one.counterparty.name}` : ''}`\n return html`<label\n >${i18next.t('field.quotation-opportunity')}\n <ox-select\n .value=${this.form.opportunityId ?? ''}\n ?disabled=${!editable}\n aria-label=${i18next.t('field.quotation-opportunity')}\n @change=${(e: CustomEvent) => {\n const id = String(e.detail ?? '')\n if (id === (this.form.opportunityId ?? '')) return\n const opportunity = choices.find(one => one.id === id)\n this.put({ opportunityId: id })\n if (opportunity?.counterparty && !String(this.form.buyerName ?? '').trim()) this.takeParty(opportunity.counterparty)\n }}\n >\n <span slot=\"label\">${chosen ? label(chosen) : '—'}</span>\n <ox-popup-list align-left nowrap with-search>\n <div option value=\"\">—</div>\n ${choices.map(one => html`<div option value=${one.id}>${label(one)}</div>`)}\n </ox-popup-list>\n </ox-select>\n </label>`\n }\n\n /** A counterparty as the other side: the buyer of a sale, the supplier of a purchase. */\n private takeParty(party: DocumentParty | null) {\n this.put(party ? partyFields(this.form, party) : { party: null })\n }\n\n /**\n * What a new quotation starts with, so a person writes only what is new: the next number of the year, the last day an\n * offer holds, the company's own words (ADR-0170), what they leave blank of our side as the last sales quotation\n * wrote it, and the counterparty of the opportunity it answers.\n */\n private get start(): DocumentValue {\n const form: DocumentValue = { ...blank(), opportunityId: this.address?.opportunity ?? '' }\n const started = this.starts.data\n const last = (started?.last?.items ?? []).find((one: any) => one.direction === 'SALES')\n const head = { ...form, ...headFromDefaults(form, this.defaults) }\n const filled = {\n ...head,\n ...oursFromLast(head, last),\n number: started ? nextQuotationNumber((started.numbered?.items ?? []).map((one: any) => one.number), Number(form.issueDate.slice(0, 4))) : '',\n validUntil: daysAfter(form.issueDate, this.validDays)\n }\n const opportunity = this.opportunities.find(one => one.id === form.opportunityId)\n return opportunity?.counterparty ? { ...filled, ...partyFields(filled, opportunity.counterparty) } : filled\n }\n\n /** Days an offer holds - the company's, or thirty. */\n private get validDays() {\n return this.defaults?.validDays || VALID_DAYS\n }\n\n private opportunityChoices() {\n const answered = this.quotation?.opportunity\n return answered && !this.opportunities.some(one => one.id === answered.id) ? [answered, ...this.opportunities] : this.opportunities\n }\n\n private configure() {\n this.gristConfig = documentLinesConfig({ editable: this.editable, currency: this.form.currency || 'KRW' })\n }\n\n private input() {\n const input: DocumentValue = Object.fromEntries(HEAD.map(key => [key, this.form[key] === '' ? null : this.form[key] ?? null]))\n input.items = linesOf(this.grist).map(({ receivedTaxAmount, ...line }: any) => line)\n input.discountAmount = input.discountAmount === null ? 0 : Number(input.discountAmount)\n return input\n }\n\n /** A new one is opened once it is made; the edits sent are cleared once the save answered. Answers the quotation's id. */\n private async save(): Promise<string | undefined> {\n if (this.busy) return undefined\n const id = this.quotationId\n const saved = await this.draft.submit(() => (id ? this.saves.update.run({ id, quotation: this.input() }) : this.saves.create.run({ quotation: this.input() })))\n if (!saved) return undefined\n if (!id) {\n /* The lines went with it: the grid keeps them as saved while the new quotation opens. */\n this.grist?.commit()\n navigate(`quotation-editor?id=${saved.quotation.id}`)\n }\n return saved.quotation.id\n }\n\n /** Asked first - to whom and how much, fixed after - then save what is on screen and send it. */\n private async send() {\n const purchase = this.form.direction === 'PURCHASE'\n const words = {\n party: (purchase ? this.form.supplierName : this.form.buyerName) || '—',\n total: documentAmount(this.amounts.totalAmount ?? 0, this.form.currency || 'KRW')\n }\n const confirmed = await OxPrompt.open({\n title: i18next.t('button.quotation-send'),\n text: purchase ? i18next.t('text.quotation-send-confirm-purchase', words) : i18next.t('text.quotation-send-confirm', words),\n confirmButton: { text: i18next.t('button.quotation-send') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n if (!confirmed) return\n const saved = await this.save()\n if (saved) await this.change('sendQuotation', undefined, saved)\n }\n\n /** A step of the quotation's life; a revision opens the new version. */\n private async change(name: 'sendQuotation' | 'expireQuotation' | 'acceptQuotation' | 'reviseQuotation' | 'rejectQuotation', reason?: string, id = this.quotationId) {\n if (this.busy) return undefined\n const changed = await this.saves[name].run({ id, ...(reason === undefined ? {} : { reason }) })\n if (changed && changed.quotation.id !== id) navigate(`quotation-editor?id=${changed.quotation.id}`)\n return changed\n }\n\n /**\n * An invoice draft of an accepted quotation (ADR-0170 decision 11): its parties, currency, language, terms, account,\n * notes, discount and lines as the quotation has them, issued today and due the company's days after, the quotation\n * named as its source - then opened to be checked and issued. The counterparty is the one of the other party's name,\n * as the invoice editor links it.\n */\n private async makeInvoice() {\n if (this.busy) return\n const quotation = this.quotation!\n this.making = true\n try {\n /* Looked up for the invoice, shown nowhere: the number after the last sales invoice's, and the counterparty. */\n const last = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n invoices(filters: $filters, pagination: $pagination, sortings: $sortings) { items { number } }\n }\n `,\n variables: { filters: [{ name: 'direction', operator: 'eq', value: 'SALES' }], pagination: { page: 1, limit: 1 }, sortings: [{ name: 'createdAt', desc: true }] },\n fetchPolicy: 'no-cache'\n })\n const issueDate = today()\n const party = await partyOfName(quotation.direction === 'PURCHASE' ? quotation.supplierName : quotation.buyerName)\n const made = await this.saves.invoice.run({\n invoice: {\n number: nextInvoiceNumber(last.data?.invoices?.items?.[0]?.number, Number(issueDate.slice(0, 4))),\n counterpartyId: party?.id ?? null,\n ...Object.fromEntries(INVOICE_HEAD.map(key => [key, quotation[key] ?? null])),\n issueDate,\n dueDate: daysAfter(issueDate, this.defaults?.paymentDays ?? PAYMENT_DAYS),\n sourceReference: i18next.t('text.quotation-invoice-source', { number: quotation.number, version: quotation.version }),\n taxBasis: 'CALCULATED',\n discountAmount: Number(quotation.discountAmount ?? 0),\n items: quotation.items.map(({ description, quantity, unit, unitPrice, discount, taxKind, taxRate }: any) => ({\n description,\n quantity,\n unit: unit ?? null,\n unitPrice,\n discount,\n taxKind,\n taxRate\n }))\n }\n })\n const created = made?.created\n if (created) navigate(`invoice-editor?id=${created.id}`)\n } catch {\n /* The look-up's failure is told by the GraphQL link. */\n } finally {\n this.making = false\n }\n }\n\n /**\n * The saved quotation as it goes out (ADR-0170 decision 10) - the server's page in the language chosen there, the\n * quotation's own first, to download as PDF or print. What is on screen and not saved is not in it.\n */\n private preview() {\n const { id, number, version, language } = this.quotation!\n openDocumentPreview(\n async (format: DocumentFileFormat, lng: string) => {\n const response = await client.query({\n query: gql`\n query ($id: String!, $format: DocumentFileFormat!, $language: String) {\n quotationDocumentFile(id: $id, format: $format, language: $language) { fileName mimeType content }\n }\n `,\n variables: { id, format, language: lng },\n fetchPolicy: 'no-cache'\n })\n if (!response.data?.quotationDocumentFile) throw response.errors?.[0] ?? new Error(i18next.t('text.quotation-not-found'))\n return response.data.quotationDocumentFile\n },\n language,\n `${i18next.t('title.preview')} · ${number} · v${version}`\n )\n }\n}\n\n/** A counterparty as the other side of `form`: the buyer of a sale, the supplier of a purchase. */\nfunction partyFields(form: DocumentValue, party: DocumentParty): DocumentValue {\n const side = form.direction === 'PURCHASE' ? 'supplier' : 'buyer'\n return { party, [`${side}Name`]: party.name, [`${side}RegistrationNumber`]: party.businessNumber ?? form[`${side}RegistrationNumber`] ?? '' }\n}\n\nfunction blank(): DocumentValue {\n return { number: '', direction: 'SALES', currency: 'KRW', language: 'ko', supplierName: '', buyerName: '', issueDate: today(), validUntil: '', discountAmount: 0, items: [] }\n}\n"]}
|
|
@@ -15,7 +15,6 @@ export declare class QuotationList extends QuotationList_base {
|
|
|
15
15
|
gristConfig: any;
|
|
16
16
|
private statuses;
|
|
17
17
|
private period;
|
|
18
|
-
private statusCounts;
|
|
19
18
|
private grist;
|
|
20
19
|
get context(): {
|
|
21
20
|
title: string;
|
|
@@ -41,10 +40,15 @@ export declare class QuotationList extends QuotationList_base {
|
|
|
41
40
|
};
|
|
42
41
|
render(): import("lit-html").TemplateResult<1>;
|
|
43
42
|
pageInitialized(): Promise<void>;
|
|
44
|
-
|
|
43
|
+
private conditions;
|
|
44
|
+
countHandler({ filters, search, signal }: FetchOption): Promise<{
|
|
45
|
+
status: {
|
|
46
|
+
[k: string]: any;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
fetchHandler({ page, limit, sortings, ...asked }: FetchOption): Promise<{
|
|
45
50
|
total: any;
|
|
46
51
|
records: any;
|
|
47
52
|
}>;
|
|
48
|
-
private countStatuses;
|
|
49
53
|
}
|
|
50
54
|
export {};
|
|
@@ -27,7 +27,6 @@ let QuotationList = class QuotationList extends localize(i18next)(PageView) {
|
|
|
27
27
|
super(...arguments);
|
|
28
28
|
this.statuses = [];
|
|
29
29
|
this.period = '';
|
|
30
|
-
this.statusCounts = [];
|
|
31
30
|
}
|
|
32
31
|
static { this.styles = [WorkSurfacePageStyles, CommonGristStyles, CommonHeaderStyles, ScrollbarStyles]; }
|
|
33
32
|
get context() {
|
|
@@ -63,6 +62,8 @@ let QuotationList = class QuotationList extends localize(i18next)(PageView) {
|
|
|
63
62
|
.mode=${isMobileDevice() ? 'CARD' : 'GRID'}
|
|
64
63
|
.config=${this.gristConfig}
|
|
65
64
|
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
65
|
+
.countHandler=${this.countHandler.bind(this)}
|
|
66
|
+
@counts-change=${() => this.requestUpdate()}
|
|
66
67
|
>
|
|
67
68
|
<div slot="headroom" class="header">
|
|
68
69
|
<div class="filters">
|
|
@@ -70,7 +71,7 @@ let QuotationList = class QuotationList extends localize(i18next)(PageView) {
|
|
|
70
71
|
<ox-input-select-buttons
|
|
71
72
|
multiple
|
|
72
73
|
.value=${this.statuses}
|
|
73
|
-
.options=${this.
|
|
74
|
+
.options=${Object.entries(this.grist?.counts?.status ?? {}).map(([value, count]) => ({ value, display: quotationStatusWord(value), count }))}
|
|
74
75
|
@change=${(e) => {
|
|
75
76
|
this.statuses = e.currentTarget.value ?? [];
|
|
76
77
|
this.grist.fetch();
|
|
@@ -113,13 +114,30 @@ let QuotationList = class QuotationList extends localize(i18next)(PageView) {
|
|
|
113
114
|
sorters: [{ name: 'issueDate', desc: true }]
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
/* The list's conditions before the statuses are added: the grid's, the issue period and the search. */
|
|
118
|
+
conditions(filters = [], search) {
|
|
118
119
|
const period = issuePeriodOf(this.period, today());
|
|
119
|
-
filters
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
return { filters: [...filters, ...(period ? [{ name: 'issueDate', operator: 'between', value: period }] : [])], search: search?.trim() || undefined };
|
|
121
|
+
}
|
|
122
|
+
/* The status chips and their numbers, under the list's other conditions; a chip keeps its number until the next land. */
|
|
123
|
+
async countHandler({ filters, search, signal }) {
|
|
124
|
+
const response = await client.query({
|
|
125
|
+
query: gql `
|
|
126
|
+
query ($filters: [Filter!], $search: String) {
|
|
127
|
+
quotationStatusCounts(filters: $filters, search: $search) { value count }
|
|
128
|
+
}
|
|
129
|
+
`,
|
|
130
|
+
variables: this.conditions(filters, search),
|
|
131
|
+
fetchPolicy: 'no-cache',
|
|
132
|
+
context: { fetchOptions: { signal }, queryDeduplication: false }
|
|
133
|
+
});
|
|
134
|
+
if (response.errors?.length)
|
|
135
|
+
throw response.errors[0];
|
|
136
|
+
return { status: Object.fromEntries(response.data.quotationStatusCounts.map((row) => [row.value, row.count])) };
|
|
137
|
+
}
|
|
138
|
+
async fetchHandler({ page = 1, limit = 50, sortings = [], ...asked }) {
|
|
139
|
+
const { filters: others, search } = this.conditions(asked.filters, asked.search);
|
|
140
|
+
const filters = this.statuses.length ? [...others, { name: 'status', operator: 'in', value: this.statuses }] : others;
|
|
123
141
|
const response = await client.query({
|
|
124
142
|
query: gql `
|
|
125
143
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!], $search: String) {
|
|
@@ -148,21 +166,6 @@ let QuotationList = class QuotationList extends localize(i18next)(PageView) {
|
|
|
148
166
|
throw response;
|
|
149
167
|
return { total: response.data.responses.total, records: response.data.responses.items };
|
|
150
168
|
}
|
|
151
|
-
/* The status chips and their numbers, on the list's filters before the statuses are added. */
|
|
152
|
-
async countStatuses(filters, search) {
|
|
153
|
-
const response = await client.query({
|
|
154
|
-
query: gql `
|
|
155
|
-
query ($filters: [Filter!], $search: String) {
|
|
156
|
-
quotationStatusCounts(filters: $filters, search: $search) { value count }
|
|
157
|
-
}
|
|
158
|
-
`,
|
|
159
|
-
variables: { filters, search },
|
|
160
|
-
fetchPolicy: 'no-cache'
|
|
161
|
-
});
|
|
162
|
-
if (response.errors?.length)
|
|
163
|
-
return console.error(response.errors);
|
|
164
|
-
this.statusCounts = response.data.quotationStatusCounts;
|
|
165
|
-
}
|
|
166
169
|
};
|
|
167
170
|
__decorate([
|
|
168
171
|
state(),
|
|
@@ -176,10 +179,6 @@ __decorate([
|
|
|
176
179
|
state(),
|
|
177
180
|
__metadata("design:type", Object)
|
|
178
181
|
], QuotationList.prototype, "period", void 0);
|
|
179
|
-
__decorate([
|
|
180
|
-
state(),
|
|
181
|
-
__metadata("design:type", Array)
|
|
182
|
-
], QuotationList.prototype, "statusCounts", void 0);
|
|
183
182
|
__decorate([
|
|
184
183
|
query('ox-grist'),
|
|
185
184
|
__metadata("design:type", DataGrist)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotation-list.js","sourceRoot":"","sources":["../../client/pages/quotation-list.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,2CAA2C,CAAA;AAElD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAA;AACxF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAElG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExD,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAA;AAE1D;;;;;;GAMG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;IAAvD;;QAIY,aAAQ,GA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,SAAS,CAAC,KAAK,EAAE,CAAA;IACzF,CAAC;IAED,8FAA8F;IACtF,KAAK,CAAC,aAAa,CAAC,OAAc,EAAE,MAAe;QACzD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;OAIT;YACD,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;YAC9B,WAAW,EAAE,UAAU;SACxB,CAAC,CAAA;QACF,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM;YAAE,OAAO,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAClE,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAA;IACzD,CAAC;;AAhJQ;IAAR,KAAK,EAAE;;kDAAiB;AACR;IAAhB,KAAK,EAAE;;+CAAgC;AACvB;IAAhB,KAAK,EAAE;;6CAAoB;AACX;IAAhB,KAAK,EAAE;;mDAA8D;AAC3C;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;4CAAA;AAPjC,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAoJzB","sourcesContent":["import '@operato/data-grist/ox-grist.js'\nimport '@operato/input/ox-input-select-buttons.js'\n\nimport gql from 'graphql-tag'\nimport { html } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\n\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { navigate, PageView } from '@operato/shell'\nimport { CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { SELECTION_ROW_PICKER } from '@things-factory/ai-assistant/dist-client/index.js'\nimport { counterpartOf, documentAmount, issuePeriodOf } from '@things-factory/invoice/dist-client'\n\nimport { headroomChoice } from '../headroom-choice'\nimport { quotationStatusWord } from '../quotation-words'\n\nconst today = () => new Date().toLocaleDateString('en-CA')\n\n/**\n * 견적 — every version of every quotation; the latest of a number is the one still in play. Rows picked go to the\n * assistant (「AI와 작업」) as `quotation:<uuid>`, read by the quotation list's read (sales-read.ts).\n *\n * The headroom narrows it by issue period, as the invoice list does, and by status chips, each with how many quotations\n * it holds under the other conditions - counted by the server. With no status pressed every status shows.\n */\n@customElement('quotation-list')\nexport class QuotationList extends localize(i18next)(PageView) {\n static styles = [WorkSurfacePageStyles, CommonGristStyles, CommonHeaderStyles, ScrollbarStyles]\n\n @state() gristConfig: any\n @state() private statuses: string[] = []\n @state() private period = ''\n @state() private statusCounts: { value: string; count: number }[] = []\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.quotation-list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n /* The issue period and the statuses narrow it in the headroom, and this folds it. */\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n actions: [{ title: i18next.t('button.quotation-new'), icon: 'add', emphasis: { raised: true }, action: () => navigate('quotation-editor') }],\n exportable: { name: i18next.t('title.quotation-list'), data: () => this.grist.exportRecords() }\n }\n }\n\n render() {\n return html`<ox-assistant-selection-bar\n .gridOf=${() => this.grist}\n name=${i18next.t('title.quotation-list')}\n list=\"quotations\"\n axis=\"quotation\"\n .labelOf=${(row: any) => [row.number && `${row.number} v${row.version}`, counterpartOf(row)].filter(Boolean).join(' · ')}\n ></ox-assistant-selection-bar>\n <ox-grist\n class=\"page-fill\"\n search-mode=\"term\"\n .mode=${isMobileDevice() ? 'CARD' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n >\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n ${headroomChoice(\n i18next.t('field.quotation-issue-date'),\n this.period,\n ['', 'this-month', 'last-month', 'this-year', 'last-year'].map(value => ({ value, display: i18next.t(`text.invoice-period-${value || 'all'}`) })),\n value => ((this.period = value), this.grist.fetch())\n )}\n <ox-input-select-buttons\n multiple\n .value=${this.statuses}\n .options=${this.statusCounts.map(({ value, count }) => ({ value, display: quotationStatusWord(value), count }))}\n @change=${(e: CustomEvent) => {\n this.statuses = (e.currentTarget as any).value ?? []\n this.grist.fetch()\n }}\n ></ox-input-select-buttons>\n </div>\n </div>\n </ox-grist>`\n }\n\n async pageInitialized() {\n const open = (record: any) => record?.id && navigate(`quotation-editor?id=${record.id}`)\n const readonly = (type: string, name: string, header: string, width: number, extra: any = {}) => ({\n type,\n name,\n header,\n width,\n sortable: true,\n ...extra,\n record: { editable: false, ...extra.record }\n })\n this.gristConfig = {\n rows: { appendable: false, selectable: { multiple: true } },\n pagination: { limit: 50, pages: [50, 100, 500] },\n emptyNote: { title: i18next.t('text.quotation-empty'), description: i18next.t('text.quotation-empty-description') },\n list: { fields: ['counterpart', 'number'], details: ['status', 'validUntil', 'totalAmount'] },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n SELECTION_ROW_PICKER,\n { type: 'gutter', gutterName: 'button', icon: 'edit_note', handlers: { click: (_c: any, _d: any, _col: any, record: any) => open(record) } },\n readonly('string', 'counterpart', i18next.t('field.quotation-counterpart'), 200, { sortable: false, record: { renderer: (_v: any, _c: any, record: any) => counterpartOf(record) } }),\n readonly('string', 'number', i18next.t('field.quotation-number'), 140),\n readonly('integer', 'version', i18next.t('field.quotation-version'), 60),\n readonly('string', 'status', i18next.t('field.quotation-status'), 90, { record: { renderer: (value: string) => quotationStatusWord(value) } }),\n readonly('string', 'issueDate', i18next.t('field.quotation-issue-date'), 110),\n readonly('string', 'validUntil', i18next.t('field.quotation-valid-until'), 110),\n readonly('float', 'totalAmount', i18next.t('field.quotation-total-amount'), 160, {\n record: { align: 'right', renderer: (value: number, _c: any, record: any) => documentAmount(value, record?.currency || 'KRW') }\n })\n ],\n sorters: [{ name: 'issueDate', desc: true }]\n }\n }\n\n async fetchHandler({ page = 1, limit = 50, sortings = [], filters = [], search }: FetchOption) {\n search = search?.trim() || undefined\n const period = issuePeriodOf(this.period, today())\n filters = [...filters, ...(period ? [{ name: 'issueDate', operator: 'between', value: period } as any] : [])]\n this.countStatuses(filters, search)\n if (this.statuses.length) filters = [...filters, { name: 'status', operator: 'in', value: this.statuses }]\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!], $search: String) {\n responses: quotations(filters: $filters, pagination: $pagination, sortings: $sortings, search: $search) {\n items {\n id\n number\n version\n status\n direction\n currency\n supplierName\n buyerName\n issueDate\n validUntil\n totalAmount\n }\n total\n }\n }\n `,\n variables: { filters, pagination: { page, limit }, sortings, search },\n fetchPolicy: 'network-only'\n })\n if (response.errors?.length) throw response\n return { total: response.data.responses.total, records: response.data.responses.items }\n }\n\n /* The status chips and their numbers, on the list's filters before the statuses are added. */\n private async countStatuses(filters: any[], search?: string) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $search: String) {\n quotationStatusCounts(filters: $filters, search: $search) { value count }\n }\n `,\n variables: { filters, search },\n fetchPolicy: 'no-cache'\n })\n if (response.errors?.length) return console.error(response.errors)\n this.statusCounts = response.data.quotationStatusCounts\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"quotation-list.js","sourceRoot":"","sources":["../../client/pages/quotation-list.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,2CAA2C,CAAA;AAElD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAA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rH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;OAmBT;YACD,SAAS,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;YACrE,WAAW,EAAE,cAAc;SAC5B,CAAC,CAAA;QACF,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM;YAAE,MAAM,QAAQ,CAAA;QAC3C,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAA;IACzF,CAAC;;AArJQ;IAAR,KAAK,EAAE;;kDAAiB;AACR;IAAhB,KAAK,EAAE;;+CAAgC;AACvB;IAAhB,KAAK,EAAE;;6CAAoB;AACD;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;4CAAA;AANjC,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAyJzB","sourcesContent":["import '@operato/data-grist/ox-grist.js'\nimport '@operato/input/ox-input-select-buttons.js'\n\nimport gql from 'graphql-tag'\nimport { html } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\n\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { navigate, PageView } from '@operato/shell'\nimport { CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { SELECTION_ROW_PICKER } from '@things-factory/ai-assistant/dist-client/index.js'\nimport { counterpartOf, documentAmount, issuePeriodOf } from '@things-factory/invoice/dist-client'\n\nimport { headroomChoice } from '../headroom-choice'\nimport { quotationStatusWord } from '../quotation-words'\n\nconst today = () => new Date().toLocaleDateString('en-CA')\n\n/**\n * 견적 — every version of every quotation; the latest of a number is the one still in play. Rows picked go to the\n * assistant (「AI와 작업」) as `quotation:<uuid>`, read by the quotation list's read (sales-read.ts).\n *\n * The headroom narrows it by issue period, as the invoice list does, and by status chips, each with how many quotations\n * it holds under the other conditions - counted by the server. With no status pressed every status shows.\n */\n@customElement('quotation-list')\nexport class QuotationList extends localize(i18next)(PageView) {\n static styles = [WorkSurfacePageStyles, CommonGristStyles, CommonHeaderStyles, ScrollbarStyles]\n\n @state() gristConfig: any\n @state() private statuses: string[] = []\n @state() private period = ''\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.quotation-list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n /* The issue period and the statuses narrow it in the headroom, and this folds it. */\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n actions: [{ title: i18next.t('button.quotation-new'), icon: 'add', emphasis: { raised: true }, action: () => navigate('quotation-editor') }],\n exportable: { name: i18next.t('title.quotation-list'), data: () => this.grist.exportRecords() }\n }\n }\n\n render() {\n return html`<ox-assistant-selection-bar\n .gridOf=${() => this.grist}\n name=${i18next.t('title.quotation-list')}\n list=\"quotations\"\n axis=\"quotation\"\n .labelOf=${(row: any) => [row.number && `${row.number} v${row.version}`, counterpartOf(row)].filter(Boolean).join(' · ')}\n ></ox-assistant-selection-bar>\n <ox-grist\n class=\"page-fill\"\n search-mode=\"term\"\n .mode=${isMobileDevice() ? 'CARD' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .countHandler=${this.countHandler.bind(this)}\n @counts-change=${() => this.requestUpdate()}\n >\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n ${headroomChoice(\n i18next.t('field.quotation-issue-date'),\n this.period,\n ['', 'this-month', 'last-month', 'this-year', 'last-year'].map(value => ({ value, display: i18next.t(`text.invoice-period-${value || 'all'}`) })),\n value => ((this.period = value), this.grist.fetch())\n )}\n <ox-input-select-buttons\n multiple\n .value=${this.statuses}\n .options=${Object.entries(this.grist?.counts?.status ?? {}).map(([value, count]) => ({ value, display: quotationStatusWord(value), count }))}\n @change=${(e: CustomEvent) => {\n this.statuses = (e.currentTarget as any).value ?? []\n this.grist.fetch()\n }}\n ></ox-input-select-buttons>\n </div>\n </div>\n </ox-grist>`\n }\n\n async pageInitialized() {\n const open = (record: any) => record?.id && navigate(`quotation-editor?id=${record.id}`)\n const readonly = (type: string, name: string, header: string, width: number, extra: any = {}) => ({\n type,\n name,\n header,\n width,\n sortable: true,\n ...extra,\n record: { editable: false, ...extra.record }\n })\n this.gristConfig = {\n rows: { appendable: false, selectable: { multiple: true } },\n pagination: { limit: 50, pages: [50, 100, 500] },\n emptyNote: { title: i18next.t('text.quotation-empty'), description: i18next.t('text.quotation-empty-description') },\n list: { fields: ['counterpart', 'number'], details: ['status', 'validUntil', 'totalAmount'] },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n SELECTION_ROW_PICKER,\n { type: 'gutter', gutterName: 'button', icon: 'edit_note', handlers: { click: (_c: any, _d: any, _col: any, record: any) => open(record) } },\n readonly('string', 'counterpart', i18next.t('field.quotation-counterpart'), 200, { sortable: false, record: { renderer: (_v: any, _c: any, record: any) => counterpartOf(record) } }),\n readonly('string', 'number', i18next.t('field.quotation-number'), 140),\n readonly('integer', 'version', i18next.t('field.quotation-version'), 60),\n readonly('string', 'status', i18next.t('field.quotation-status'), 90, { record: { renderer: (value: string) => quotationStatusWord(value) } }),\n readonly('string', 'issueDate', i18next.t('field.quotation-issue-date'), 110),\n readonly('string', 'validUntil', i18next.t('field.quotation-valid-until'), 110),\n readonly('float', 'totalAmount', i18next.t('field.quotation-total-amount'), 160, {\n record: { align: 'right', renderer: (value: number, _c: any, record: any) => documentAmount(value, record?.currency || 'KRW') }\n })\n ],\n sorters: [{ name: 'issueDate', desc: true }]\n }\n }\n\n /* The list's conditions before the statuses are added: the grid's, the issue period and the search. */\n private conditions(filters: any[] = [], search?: string) {\n const period = issuePeriodOf(this.period, today())\n return { filters: [...filters, ...(period ? [{ name: 'issueDate', operator: 'between', value: period }] : [])], search: search?.trim() || undefined }\n }\n\n /* The status chips and their numbers, under the list's other conditions; a chip keeps its number until the next land. */\n async countHandler({ filters, search, signal }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $search: String) {\n quotationStatusCounts(filters: $filters, search: $search) { value count }\n }\n `,\n variables: this.conditions(filters, search),\n fetchPolicy: 'no-cache',\n context: { fetchOptions: { signal }, queryDeduplication: false }\n })\n if (response.errors?.length) throw response.errors[0]\n return { status: Object.fromEntries(response.data.quotationStatusCounts.map((row: { value: string; count: number }) => [row.value, row.count])) }\n }\n\n async fetchHandler({ page = 1, limit = 50, sortings = [], ...asked }: FetchOption) {\n const { filters: others, search } = this.conditions(asked.filters, asked.search)\n const filters = this.statuses.length ? [...others, { name: 'status', operator: 'in', value: this.statuses }] : others\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!], $search: String) {\n responses: quotations(filters: $filters, pagination: $pagination, sortings: $sortings, search: $search) {\n items {\n id\n number\n version\n status\n direction\n currency\n supplierName\n buyerName\n issueDate\n validUntil\n totalAmount\n }\n total\n }\n }\n `,\n variables: { filters, pagination: { page, limit }, sortings, search },\n fetchPolicy: 'network-only'\n })\n if (response.errors?.length) throw response\n return { total: response.data.responses.total, records: response.data.responses.items }\n }\n}\n"]}
|
|
@@ -14,7 +14,8 @@ export declare class SalesProductList extends SalesProductList_base {
|
|
|
14
14
|
static styles: import("lit").CSSResult[];
|
|
15
15
|
gristConfig: any;
|
|
16
16
|
private inUse;
|
|
17
|
-
private
|
|
17
|
+
private saving;
|
|
18
|
+
private deleting;
|
|
18
19
|
private grist;
|
|
19
20
|
get context(): {
|
|
20
21
|
title: string;
|
|
@@ -47,11 +48,15 @@ export declare class SalesProductList extends SalesProductList_base {
|
|
|
47
48
|
};
|
|
48
49
|
render(): import("lit-html").TemplateResult<1>;
|
|
49
50
|
pageInitialized(): Promise<void>;
|
|
51
|
+
countHandler({ filters, search, signal }: FetchOption): Promise<{
|
|
52
|
+
active: {
|
|
53
|
+
[k: string]: any;
|
|
54
|
+
};
|
|
55
|
+
}>;
|
|
50
56
|
fetchHandler({ page, limit, sortings, filters, search }: FetchOption): Promise<{
|
|
51
57
|
total: any;
|
|
52
58
|
records: any;
|
|
53
59
|
}>;
|
|
54
|
-
private countActive;
|
|
55
60
|
/** New, changed and deleted rows together; a refusal is said in the server's words and nothing is kept. */
|
|
56
61
|
private save;
|
|
57
62
|
private delete;
|