@things-factory/sales 10.1.298 → 10.1.302

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.
@@ -10,6 +10,7 @@ export declare class QuotationOverviewSection extends LitElement {
10
10
  static styles: import("lit").CSSResult[];
11
11
  subject?: Entity360Subject;
12
12
  private quotation;
13
+ private revise;
13
14
  get answer(): import("@operato/layout").Entity360DoorAnswer<any> | undefined;
14
15
  render(): import("lit-html").TemplateResult<1>;
15
16
  }
@@ -2,9 +2,10 @@ import { __decorate, __metadata } from "tslib";
2
2
  import gql from 'graphql-tag';
3
3
  import { css, html, LitElement } from 'lit';
4
4
  import { customElement, property } from 'lit/decorators.js';
5
- import { QueryController } from '@operato/graphql';
5
+ import { client, QueryController } from '@operato/graphql';
6
6
  import { i18next } from '@operato/i18n';
7
- import { entity360Answer, entity360Link, registerEntity360Kind, registerEntity360Section } from '@operato/layout';
7
+ import { entity360Answer, entity360Link, notify, registerEntity360Kind, registerEntity360Section } from '@operato/layout';
8
+ import { navigate } from '@operato/shell';
8
9
  import { ButtonStyles } from '@operato/styles';
9
10
  import { counterpartOf, DocumentFormStyles, renderDocumentTotals } from '@things-factory/invoice/dist-client';
10
11
  import { previewQuotation } from '../quotation-preview';
@@ -65,6 +66,21 @@ let QuotationOverviewSection = class QuotationOverviewSection extends LitElement
65
66
  }
66
67
  `
67
68
  ]; }
69
+ /*
70
+ * Changed while it is written; once confirmed or mailed it moves on as a new version of the same number, opened to
71
+ * be written (the user 2026-11-20: 「확정하기 전에는 수정이 가능해야하고, 확정 및 송부 이후에도 버전업이 가능하도록」).
72
+ */
73
+ async revise(id) {
74
+ try {
75
+ const response = await client.mutate({ mutation: gql `mutation ($id: String!) { quotation: reviseQuotation(id: $id) { id } }`, variables: { id } });
76
+ if (response.errors?.length)
77
+ throw response.errors[0];
78
+ navigate(`quotation-editor?id=${response.data.quotation.id}`);
79
+ }
80
+ catch (error) {
81
+ notify({ level: 'error', message: error?.graphQLErrors?.[0]?.message ?? error?.message ?? String(error) });
82
+ }
83
+ }
68
84
  get answer() {
69
85
  return entity360Answer(this.quotation, data => data?.quotation);
70
86
  }
@@ -72,6 +88,12 @@ let QuotationOverviewSection = class QuotationOverviewSection extends LitElement
72
88
  const one = this.answer?.data;
73
89
  return html `<ox-entity360-section .heading=${i18next.t('title.quotation')} .state=${this.answer?.state ?? 'loading'} .message=${this.answer?.message ?? ''}>
74
90
  ${one ? html `<button slot="actions" quiet small @click=${() => previewQuotation(one)}>${i18next.t('button.preview')}</button>` : ''}
91
+ ${one?.status === 'DRAFT'
92
+ ? html `<button slot="actions" quiet small @click=${() => navigate(`quotation-editor?id=${one.id}`)}>${i18next.t('button.edit')}</button>`
93
+ : ''}
94
+ ${one && ['SENT', 'REJECTED', 'EXPIRED'].includes(one.status)
95
+ ? html `<button slot="actions" quiet small @click=${() => this.revise(one.id)}>${i18next.t('button.quotation-revise')}</button>`
96
+ : ''}
75
97
  ${one
76
98
  ? html `<dl>
77
99
  <dt>${i18next.t('field.quotation-number')}</dt>
@@ -111,6 +111,8 @@ export declare class QuotationEditor extends QuotationEditor_base {
111
111
  * as the invoice editor links it.
112
112
  */
113
113
  private makeInvoice;
114
+ /** Save what is on screen, then open the mail window of the saved quotation; read it again once it has gone. */
115
+ private mail;
114
116
  private preview;
115
117
  }
116
118
  export {};
@@ -17,13 +17,14 @@ import { hasPrivilege } from '@things-factory/auth-base/dist-client';
17
17
  import { daysAfter, documentAmount, DocumentFormStyles, documentLinesConfig, linesOf, onLineChange, reckonLines, renderDocumentHead, renderDocumentTotals, DOCUMENT_DEFAULTS, DOCUMENT_DEFAULTS_READER, headFromDefaults, nextInvoiceNumber, OUR_SIDE_FIELDS, oursFromLast, partyOfName } from '@things-factory/invoice/dist-client';
18
18
  import '@things-factory/biz-base/dist-client';
19
19
  import { quotationSection } from '../quotation-attach';
20
+ import { mailQuotationPopup } from '../quotation-mail';
20
21
  import { previewQuotation } from '../quotation-preview';
21
22
  import '../sales-product-pick';
22
23
  import { lineOfProduct } from '../sales-product-pick';
23
24
  import { quotationStatusWord } from '../quotation-words';
24
25
  const FIELDS = `
25
- id number version status validUntil outcomeReason opportunityId opportunity { id name } direction currency language supplierName supplierAddress supplierRegistrationNumber
26
- buyerName buyerAddress buyerRegistrationNumber issueDate purchaseOrder paymentTerms bankDetails notes sourceReference
26
+ id number version status validUntil outcomeReason opportunityId opportunity { id name } direction currency language supplierName supplierAddress supplierRegistrationNumber supplierContact
27
+ buyerName buyerAddress buyerRegistrationNumber buyerContact issueDate purchaseOrder paymentTerms bankDetails notes sourceReference
27
28
  discountAmount lineSupplyAmount supplyAmount taxAmount totalAmount taxRounding currencyDigits
28
29
  items { position description quantity unit unitPrice discount taxKind taxRate supplyAmount }
29
30
  taxGroups { taxKind taxRate supplyAmount taxAmount }
@@ -36,9 +37,11 @@ const HEAD = [
36
37
  'supplierName',
37
38
  'supplierAddress',
38
39
  'supplierRegistrationNumber',
40
+ 'supplierContact',
39
41
  'buyerName',
40
42
  'buyerAddress',
41
43
  'buyerRegistrationNumber',
44
+ 'buyerContact',
42
45
  'issueDate',
43
46
  'purchaseOrder',
44
47
  'paymentTerms',
@@ -58,9 +61,11 @@ const INVOICE_HEAD = [
58
61
  'supplierName',
59
62
  'supplierAddress',
60
63
  'supplierRegistrationNumber',
64
+ 'supplierContact',
61
65
  'buyerName',
62
66
  'buyerAddress',
63
67
  'buyerRegistrationNumber',
68
+ 'buyerContact',
64
69
  'paymentTerms',
65
70
  'bankDetails',
66
71
  'notes'
@@ -219,10 +224,14 @@ let QuotationEditor = class QuotationEditor extends localize(i18next)(PageView)
219
224
  get context() {
220
225
  const status = this.quotation?.status;
221
226
  const actions = [];
227
+ /* A sales quotation goes by mail from the person signed in - a draft is sent by it, a sent one goes again (the user 2026-11-20). */
228
+ const mailable = this.form.direction !== 'PURCHASE' && (this.editable || (status === 'SENT' && this.quotation.validUntil >= today()));
222
229
  if (this.editable) {
223
230
  actions.push({ title: i18next.t('button.save'), icon: 'save', action: () => this.save() });
224
- actions.push({ title: i18next.t('button.quotation-send'), icon: 'send', emphasis: { raised: true }, action: () => this.send() });
231
+ actions.push({ title: i18next.t('button.quotation-send'), icon: 'send', ...(mailable ? {} : { emphasis: { raised: true } }), action: () => this.send() });
225
232
  }
233
+ if (mailable)
234
+ actions.push({ title: i18next.t('button.quotation-mail'), icon: 'mail', emphasis: { raised: true }, action: () => this.mail() });
226
235
  if (status === 'SENT') {
227
236
  if (this.quotation.validUntil < today())
228
237
  actions.push({ title: i18next.t('button.quotation-expire'), action: () => this.change('expireQuotation') });
@@ -548,6 +557,16 @@ let QuotationEditor = class QuotationEditor extends localize(i18next)(PageView)
548
557
  this.making = false;
549
558
  }
550
559
  }
560
+ /** Save what is on screen, then open the mail window of the saved quotation; read it again once it has gone. */
561
+ async mail() {
562
+ if (this.busy)
563
+ return;
564
+ const id = this.editable ? await this.save() : this.quotationId;
565
+ if (!id)
566
+ return;
567
+ const { number, status, supplierName, buyerContact } = { ...this.form, ...(this.quotation ?? {}) };
568
+ mailQuotationPopup({ id, number, status: status ?? 'DRAFT', supplierName, buyerContact }, () => this.record.refetch());
569
+ }
551
570
  preview() {
552
571
  const { id, number, version, language } = this.quotation;
553
572
  previewQuotation({ id, number, version, language });
@@ -0,0 +1,42 @@
1
+ import '@material/web/button/text-button.js';
2
+ import '@material/web/button/filled-button.js';
3
+ import '@operato/popup/ox-popup-actions.js';
4
+ import { LitElement } from 'lit';
5
+ import type { CSSResultGroup } from 'lit';
6
+ /** What the mail window needs of a quotation - its number for the subject and the file, its parties for the words. */
7
+ export type MailedQuotation = {
8
+ id: string;
9
+ number: string;
10
+ status: string;
11
+ supplierName?: string | null;
12
+ buyerContact?: string | null;
13
+ };
14
+ declare const QuotationMailPopup_base: (new (...args: any[]) => LitElement) & typeof LitElement;
15
+ /**
16
+ * A sales quotation mailed to its buyer from the person signed in, its PDF attached (the user 2026-11-20: 「바로 메일로
17
+ * 송부」 · 「보내는 사람을 현재 사용자로」). The sender is shown, not chosen - the mail leaves their own mailbox. The subject
18
+ * and the message start written and are changed as the person likes. A draft is sent by it; the window says so.
19
+ */
20
+ export declare class QuotationMailPopup extends QuotationMailPopup_base {
21
+ static styles: CSSResultGroup;
22
+ quotation: MailedQuotation;
23
+ private to;
24
+ private cc;
25
+ private subject;
26
+ private body;
27
+ private message;
28
+ private sending;
29
+ /** The addresses the domain copies every mailed quotation to - shown, not chosen. */
30
+ private copies;
31
+ private get sender();
32
+ connectedCallback(): void;
33
+ private get sendable();
34
+ private onSend;
35
+ render(): import("lit-html").TemplateResult<1>;
36
+ }
37
+ /** Open the mail window of a saved quotation; `onMailed` runs once it has gone. */
38
+ export declare function mailQuotationPopup(quotation: MailedQuotation, onMailed?: (mailed: {
39
+ id: string;
40
+ status: string;
41
+ }) => void): import("@operato/layout").PopupHandle<unknown>;
42
+ export {};
@@ -0,0 +1,205 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/web/button/text-button.js';
3
+ import '@material/web/button/filled-button.js';
4
+ import '@operato/popup/ox-popup-actions.js';
5
+ import gql from 'graphql-tag';
6
+ import { css, html, LitElement, nothing } from 'lit';
7
+ import { customElement, property, state } from 'lit/decorators.js';
8
+ import { client } from '@operato/graphql';
9
+ import { i18next, localize } from '@operato/i18n';
10
+ import { notify, openPopup } from '@operato/layout';
11
+ import { store } from '@operato/shell';
12
+ import { CommonPopupStyles, FormFieldStyles, PopupBodyStyles, PopupFieldStyles } from '@operato/styles';
13
+ /**
14
+ * A sales quotation mailed to its buyer from the person signed in, its PDF attached (the user 2026-11-20: 「바로 메일로
15
+ * 송부」 · 「보내는 사람을 현재 사용자로」). The sender is shown, not chosen - the mail leaves their own mailbox. The subject
16
+ * and the message start written and are changed as the person likes. A draft is sent by it; the window says so.
17
+ */
18
+ let QuotationMailPopup = class QuotationMailPopup extends localize(i18next)(LitElement) {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.to = '';
22
+ this.cc = '';
23
+ this.subject = '';
24
+ this.body = '';
25
+ this.message = '';
26
+ this.sending = false;
27
+ /** The addresses the domain copies every mailed quotation to - shown, not chosen. */
28
+ this.copies = [];
29
+ }
30
+ /* The house shape of a popup (page-standard §7·§8), as user-invite: only the body scrolls, fields are labels over native inputs. */
31
+ static { this.styles = [
32
+ CommonPopupStyles,
33
+ PopupBodyStyles,
34
+ FormFieldStyles,
35
+ PopupFieldStyles,
36
+ css `
37
+ [invalid] {
38
+ color: var(--ui-crit, var(--md-sys-color-error));
39
+ font-size: var(--ui-t-small, 11.5px);
40
+ }
41
+
42
+ [invalid]:empty {
43
+ display: none;
44
+ }
45
+
46
+ [hint] {
47
+ color: var(--ui-muted);
48
+ font-size: var(--ui-t-small, 11.5px);
49
+ }
50
+
51
+ textarea {
52
+ min-height: 12em;
53
+ resize: vertical;
54
+ }
55
+
56
+ [fixed] {
57
+ padding: 2px 0;
58
+ color: var(--ui-ink);
59
+ }
60
+ `
61
+ ]; }
62
+ get sender() {
63
+ return store.getState().auth?.user ?? {};
64
+ }
65
+ connectedCallback() {
66
+ super.connectedCallback();
67
+ const { number, supplierName, buyerContact } = this.quotation;
68
+ const sender = this.sender.name || this.sender.email || '';
69
+ const supplier = supplierName ?? '';
70
+ const greeting = buyerContact ? i18next.t('text.quotation-mail-greeting-named', { name: buyerContact }) : i18next.t('text.quotation-mail-greeting');
71
+ this.subject = i18next.t('text.quotation-mail-subject', { number, supplier }).trim();
72
+ this.body = i18next.t('text.quotation-mail-body', { greeting, supplier, sender });
73
+ client
74
+ .query({ query: gql `query { quotationMailCopies }`, fetchPolicy: 'no-cache' })
75
+ .then(response => (this.copies = response.data?.quotationMailCopies ?? []))
76
+ .catch(() => (this.copies = []));
77
+ }
78
+ get sendable() {
79
+ return !this.sending && !!this.to.trim() && !!this.subject.trim();
80
+ }
81
+ async onSend() {
82
+ if (!this.sendable)
83
+ return;
84
+ this.sending = true;
85
+ this.message = '';
86
+ try {
87
+ const response = await client.mutate({
88
+ mutation: gql `
89
+ mutation ($id: String!, $mail: QuotationMail!) {
90
+ mailQuotation(id: $id, mail: $mail) {
91
+ id
92
+ status
93
+ }
94
+ }
95
+ `,
96
+ variables: { id: this.quotation.id, mail: { to: [this.to], cc: this.cc.trim() ? [this.cc] : [], subject: this.subject, body: this.body } }
97
+ });
98
+ if (response.errors?.length)
99
+ throw response.errors[0];
100
+ notify({ message: i18next.t('text.quotation-mail-sent', { to: this.to.trim() }) });
101
+ this.dispatchEvent(new CustomEvent('quotation-mailed', { detail: response.data?.mailQuotation }));
102
+ }
103
+ catch (error) {
104
+ this.message = error?.graphQLErrors?.[0]?.message ?? error?.message ?? String(error);
105
+ }
106
+ finally {
107
+ this.sending = false;
108
+ }
109
+ }
110
+ render() {
111
+ const { email, name } = this.sender;
112
+ return html `
113
+ <div class="body">
114
+ <label class="field">
115
+ <span>${i18next.t('field.quotation-mail-from')}</span>
116
+ <div fixed>${name ? `${name} <${email ?? ''}>` : email ?? ''}</div>
117
+ </label>
118
+
119
+ <label class="field">
120
+ <span>${i18next.t('field.quotation-mail-to')}</span>
121
+ <input name="to" type="text" .value=${this.to} placeholder="name@company.com" @input=${(e) => (this.to = e.target.value)} />
122
+ <span hint>${i18next.t('text.quotation-mail-addresses-hint')}</span>
123
+ </label>
124
+
125
+ <label class="field">
126
+ <span>${i18next.t('field.quotation-mail-cc')}</span>
127
+ <input name="cc" type="text" .value=${this.cc} @input=${(e) => (this.cc = e.target.value)} />
128
+ ${this.copies.length ? html `<span hint>${i18next.t('text.quotation-mail-always-cc', { addresses: this.copies.join(', ') })}</span>` : nothing}
129
+ </label>
130
+
131
+ <label class="field">
132
+ <span>${i18next.t('field.quotation-mail-subject')}</span>
133
+ <input name="subject" type="text" .value=${this.subject} @input=${(e) => (this.subject = e.target.value)} />
134
+ </label>
135
+
136
+ <label class="field">
137
+ <span>${i18next.t('field.quotation-mail-body')}</span>
138
+ <textarea name="body" .value=${this.body} @input=${(e) => (this.body = e.target.value)}></textarea>
139
+ </label>
140
+
141
+ <label class="field">
142
+ <span>${i18next.t('field.quotation-mail-attachment')}</span>
143
+ <div fixed>${i18next.t('title.quotation-print')}-${this.quotation.number}.pdf</div>
144
+ </label>
145
+
146
+ ${this.quotation.status === 'DRAFT' ? html `<div hint>${i18next.t('text.quotation-mail-draft-note')}</div>` : nothing}
147
+ <span invalid>${this.message}</span>
148
+ </div>
149
+
150
+ <ox-popup-actions>
151
+ <md-text-button slot="cancel" @click=${() => this.dispatchEvent(new CustomEvent('close'))}>${i18next.t('button.cancel')}</md-text-button>
152
+ <md-filled-button slot="confirm" ?disabled=${!this.sendable} @click=${() => this.onSend()}>${i18next.t('button.quotation-mail')}</md-filled-button>
153
+ </ox-popup-actions>
154
+ `;
155
+ }
156
+ };
157
+ __decorate([
158
+ property({ attribute: false }),
159
+ __metadata("design:type", Object)
160
+ ], QuotationMailPopup.prototype, "quotation", void 0);
161
+ __decorate([
162
+ state(),
163
+ __metadata("design:type", Object)
164
+ ], QuotationMailPopup.prototype, "to", void 0);
165
+ __decorate([
166
+ state(),
167
+ __metadata("design:type", Object)
168
+ ], QuotationMailPopup.prototype, "cc", void 0);
169
+ __decorate([
170
+ state(),
171
+ __metadata("design:type", Object)
172
+ ], QuotationMailPopup.prototype, "subject", void 0);
173
+ __decorate([
174
+ state(),
175
+ __metadata("design:type", Object)
176
+ ], QuotationMailPopup.prototype, "body", void 0);
177
+ __decorate([
178
+ state(),
179
+ __metadata("design:type", Object)
180
+ ], QuotationMailPopup.prototype, "message", void 0);
181
+ __decorate([
182
+ state(),
183
+ __metadata("design:type", Object)
184
+ ], QuotationMailPopup.prototype, "sending", void 0);
185
+ __decorate([
186
+ state(),
187
+ __metadata("design:type", Array)
188
+ ], QuotationMailPopup.prototype, "copies", void 0);
189
+ QuotationMailPopup = __decorate([
190
+ customElement('quotation-mail')
191
+ ], QuotationMailPopup);
192
+ export { QuotationMailPopup };
193
+ /** Open the mail window of a saved quotation; `onMailed` runs once it has gone. */
194
+ export function mailQuotationPopup(quotation, onMailed) {
195
+ const popup = openPopup(html `<quotation-mail
196
+ .quotation=${quotation}
197
+ @close=${() => popup.close()}
198
+ @quotation-mailed=${(e) => {
199
+ popup.close();
200
+ onMailed?.(e.detail);
201
+ }}
202
+ ></quotation-mail>`, { backdrop: true, size: 'large', title: i18next.t('title.quotation-mail') });
203
+ return popup;
204
+ }
205
+ //# sourceMappingURL=quotation-mail.js.map
@@ -14,7 +14,7 @@ export * from './sales-product/sales-product-rules';
14
14
  export * from './sales-product/sales-product-service';
15
15
  export * from './sales-product/sales-product-type';
16
16
  export * from './sales-read';
17
- export declare const entities: (typeof import("./sales-product/sales-product").SalesProduct | typeof import("./quotation/quotation").Quotation | typeof import("./quotation/quotation-event").QuotationEvent | typeof import("./quotation/quotation-item").QuotationItem | typeof import("./opportunity/opportunity").Opportunity | typeof import("./opportunity/opportunity-event").OpportunityEvent)[];
17
+ export declare const entities: (typeof import("./sales-product/sales-product").SalesProduct | typeof import("./quotation/quotation").Quotation | typeof import("./quotation/quotation-item").QuotationItem | typeof import("./quotation/quotation-event").QuotationEvent | typeof import("./opportunity/opportunity").Opportunity | typeof import("./opportunity/opportunity-event").OpportunityEvent)[];
18
18
  export declare const subscribers: any[];
19
19
  export declare const schema: {
20
20
  resolverClasses: (typeof import("./sales-product/sales-product-query").SalesProductQuery | typeof import("./sales-product/sales-product-mutation").SalesProductMutation | typeof import("./quotation/quotation-query").QuotationQuery | typeof import("./quotation/quotation-mutation").QuotationMutation | typeof import("./quotation/quotation-item-query").QuotationItemQuery | typeof import("./quotation/quotation-event-query").QuotationEventQuery | typeof import("./opportunity/opportunity-query").OpportunityQuery | typeof import("./opportunity/opportunity-mutation").OpportunityMutation | typeof import("./opportunity/opportunity-event-query").OpportunityEventQuery)[];
@@ -5,6 +5,6 @@ import { QuotationItem } from './quotation-item';
5
5
  import { QuotationItemQuery } from './quotation-item-query';
6
6
  import { QuotationMutation } from './quotation-mutation';
7
7
  import { QuotationQuery } from './quotation-query';
8
- export declare const entities: (typeof Quotation | typeof QuotationEvent | typeof QuotationItem)[];
8
+ export declare const entities: (typeof Quotation | typeof QuotationItem | typeof QuotationEvent)[];
9
9
  export declare const resolvers: (typeof QuotationQuery | typeof QuotationMutation | typeof QuotationItemQuery | typeof QuotationEventQuery)[];
10
10
  export declare const subscribers: any[];
@@ -35,12 +35,12 @@ tslib_1.__decorate([
35
35
  ], QuotationEvent.prototype, "quotationId", void 0);
36
36
  tslib_1.__decorate([
37
37
  (0, typeorm_1.Column)(),
38
- (0, type_graphql_1.Field)({ description: 'What happened: CREATED, UPDATED, SENT, ACCEPTED, REJECTED, EXPIRED, REVISED or SUPERSEDED' }),
38
+ (0, type_graphql_1.Field)({ description: 'What happened: CREATED, UPDATED, SENT, MAILED, ACCEPTED, REJECTED, EXPIRED, REVISED or SUPERSEDED' }),
39
39
  tslib_1.__metadata("design:type", String)
40
40
  ], QuotationEvent.prototype, "action", void 0);
41
41
  tslib_1.__decorate([
42
42
  (0, typeorm_1.Column)({ nullable: true }),
43
- (0, type_graphql_1.Field)({ nullable: true, description: 'Why, when the buyer declined' }),
43
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Why, when the buyer declined; to whom, when mailed' }),
44
44
  tslib_1.__metadata("design:type", String)
45
45
  ], QuotationEvent.prototype, "reason", void 0);
46
46
  tslib_1.__decorate([
@@ -1,9 +1,10 @@
1
1
  import { Quotation } from './quotation';
2
- import { NewQuotation } from './quotation-type';
2
+ import { NewQuotation, QuotationMail } from './quotation-type';
3
3
  export declare class QuotationMutation {
4
4
  createQuotation(quotation: NewQuotation, context: ResolverContext): Promise<Quotation>;
5
5
  updateQuotation(id: string, quotation: NewQuotation, context: ResolverContext): Promise<Quotation>;
6
6
  sendQuotation(id: string, context: ResolverContext): Promise<Quotation>;
7
+ mailQuotation(id: string, mail: QuotationMail, context: ResolverContext): Promise<Quotation>;
7
8
  acceptQuotation(id: string, context: ResolverContext): Promise<Quotation>;
8
9
  rejectQuotation(id: string, reason: string, context: ResolverContext): Promise<Quotation>;
9
10
  expireQuotation(id: string, context: ResolverContext): Promise<Quotation>;
@@ -20,6 +20,9 @@ let QuotationMutation = class QuotationMutation {
20
20
  const { tx, domain, user } = context.state;
21
21
  return (0, quotation_service_1.transitionQuotation)(tx, domain, user, id, 'SENT');
22
22
  }
23
+ mailQuotation(id, mail, context) {
24
+ return (0, quotation_service_1.mailQuotation)(context.state.tx, context, id, mail);
25
+ }
23
26
  acceptQuotation(id, context) {
24
27
  const { tx, domain, user } = context.state;
25
28
  return (0, quotation_service_1.transitionQuotation)(tx, domain, user, id, 'ACCEPTED');
@@ -69,6 +72,17 @@ tslib_1.__decorate([
69
72
  tslib_1.__metadata("design:paramtypes", [String, Object]),
70
73
  tslib_1.__metadata("design:returntype", void 0)
71
74
  ], QuotationMutation.prototype, "sendQuotation", null);
75
+ tslib_1.__decorate([
76
+ (0, type_graphql_1.Directive)('@transaction'),
77
+ (0, type_graphql_1.Directive)('@privilege(category: "sales", privilege: "mutation", domainOwnerGranted: true)'),
78
+ (0, type_graphql_1.Mutation)(type => quotation_1.Quotation, { description: 'To mail a sales quotation to its buyer from the person signed in, its PDF attached; a draft is sent by it' }),
79
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
80
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('mail', type => quotation_type_1.QuotationMail)),
81
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
82
+ tslib_1.__metadata("design:type", Function),
83
+ tslib_1.__metadata("design:paramtypes", [String, quotation_type_1.QuotationMail, Object]),
84
+ tslib_1.__metadata("design:returntype", void 0)
85
+ ], QuotationMutation.prototype, "mailQuotation", null);
72
86
  tslib_1.__decorate([
73
87
  (0, type_graphql_1.Directive)('@transaction'),
74
88
  (0, type_graphql_1.Directive)('@privilege(category: "sales", privilege: "mutation", domainOwnerGranted: true)'),
@@ -16,6 +16,7 @@ export declare class QuotationQuery {
16
16
  quotationVersions(number: string, context: ResolverContext): Promise<Quotation[]>;
17
17
  quotationEvents(quotationId: string, context: ResolverContext): Promise<QuotationEvent[]>;
18
18
  quotationDocumentFile(id: string, format: DocumentFileFormat, language: string, context: ResolverContext): Promise<DocumentFile>;
19
+ quotationMailCopies(context: ResolverContext): Promise<string[]>;
19
20
  items(quotation: Quotation): Promise<QuotationItem[]>;
20
21
  taxGroups(quotation: Quotation): Promise<import("@things-factory/invoice").TaxGroup[]>;
21
22
  lineSupplyAmount(quotation: Quotation): Promise<number>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.QuotationQuery = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const auth_base_1 = require("@things-factory/auth-base");
6
+ const email_base_1 = require("@things-factory/email-base");
6
7
  const invoice_1 = require("@things-factory/invoice");
7
8
  const shell_1 = require("@things-factory/shell");
8
9
  const type_graphql_1 = require("type-graphql");
@@ -38,16 +39,11 @@ let QuotationQuery = class QuotationQuery {
38
39
  /* The quotation as its buyer reads it (ADR-0170 decision 10) - the page to preview and print, or the PDF to download. */
39
40
  async quotationDocumentFile(id, format, language, context) {
40
41
  const quotation = await (0, quotation_service_1.quotationInDomain)((0, shell_1.getRepository)(quotation_1.Quotation).manager, context.state.domain, id);
41
- const print = (0, invoice_1.printTranslator)(context, language || quotation.language);
42
- return (0, invoice_1.documentFileOf)(quotation, format, {
43
- ...print,
44
- title: print.t('title.quotation-print'),
45
- numberLabel: 'field.quotation-number',
46
- terms: [
47
- { label: print.t('field.quotation-version'), value: `v${quotation.version}` },
48
- { label: print.t('field.quotation-valid-until'), value: quotation.validUntil }
49
- ]
50
- });
42
+ return (0, quotation_service_1.quotationFileOf)(context, quotation, format, language);
43
+ }
44
+ /* The addresses every mailed quotation is copied to - shown in the mail window, added by the mail service (email-base). */
45
+ quotationMailCopies(context) {
46
+ return (0, email_base_1.alwaysCcOf)(context.state.domain);
51
47
  }
52
48
  async items(quotation) {
53
49
  return quotation.items ?? (0, shell_1.getRepository)(quotation_item_1.QuotationItem).find({ where: { quotation: { id: quotation.id } }, order: { position: 'ASC' } });
@@ -128,6 +124,14 @@ tslib_1.__decorate([
128
124
  tslib_1.__metadata("design:paramtypes", [String, String, String, Object]),
129
125
  tslib_1.__metadata("design:returntype", Promise)
130
126
  ], QuotationQuery.prototype, "quotationDocumentFile", null);
127
+ tslib_1.__decorate([
128
+ (0, type_graphql_1.Directive)('@privilege(category: "sales", privilege: "query", domainOwnerGranted: true)'),
129
+ (0, type_graphql_1.Query)(type => [String], { description: 'The addresses the domain copies every mailed quotation to (Mail::alwaysCc)' }),
130
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
131
+ tslib_1.__metadata("design:type", Function),
132
+ tslib_1.__metadata("design:paramtypes", [Object]),
133
+ tslib_1.__metadata("design:returntype", Promise)
134
+ ], QuotationQuery.prototype, "quotationMailCopies", null);
131
135
  tslib_1.__decorate([
132
136
  (0, type_graphql_1.FieldResolver)(type => [quotation_item_1.QuotationItem]),
133
137
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
@@ -1,8 +1,9 @@
1
+ import { DocumentFileFormat } from '@things-factory/invoice';
1
2
  import { Domain, ListParam } from '@things-factory/shell';
2
3
  import { EntityManager } from 'typeorm';
3
4
  import { Quotation, QuotationStatus } from './quotation';
4
5
  import { QuotationAction } from './quotation-rules';
5
- import { NewQuotation } from './quotation-type';
6
+ import { NewQuotation, QuotationMail } from './quotation-type';
6
7
  export declare function quotationInDomain(tx: EntityManager, domain: Domain, id: string): Promise<Quotation>;
7
8
  export declare function saveQuotation(tx: EntityManager, domain: Domain, user: any, input: NewQuotation, id?: string): Promise<Quotation>;
8
9
  export declare function transitionQuotation(tx: EntityManager, domain: Domain, user: any, id: string, action: QuotationAction, reason?: string): Promise<Quotation>;
@@ -31,3 +32,17 @@ export declare function quotationStatusCounts(tx: EntityManager, domain: Domain,
31
32
  value: QuotationStatus;
32
33
  count: number;
33
34
  }[]>;
35
+ /** The quotation as its buyer reads it (ADR-0170 decision 10), in `language` - its own when none is named. */
36
+ export declare function quotationFileOf(context: any, quotation: Quotation, format: DocumentFileFormat, language?: string | null): Promise<import("@things-factory/invoice").DocumentFile>;
37
+ /** The addresses of a list as typed - trimmed, empty ones dropped, each one an address or the whole send is refused. */
38
+ export declare function mailAddressesOf(addresses: string[] | null | undefined): string[];
39
+ /** How long the same quotation to the same people counts as the send just made - a retry after a slow answer, a second tab. */
40
+ export declare const MAIL_AGAIN_AFTER_MS: number;
41
+ /** What was typed as the body, as HTML - its lines kept, nothing of it read as markup. */
42
+ export declare const mailHtmlOf: (body: string) => string;
43
+ /**
44
+ * Mail a sales quotation to its buyer from the person signed in, its PDF attached (the user 2026-11-20: 「바로 메일로
45
+ * 송부」 · 「보내는 사람을 현재 사용자로」). A draft is sent by it - its amounts fixed as 「발송」 fixes them - and a sent one
46
+ * may go again, to another person. The mail goes last: when it is refused nothing is recorded and a draft stays a draft.
47
+ */
48
+ export declare function mailQuotation(tx: EntityManager, context: any, id: string, mail: QuotationMail): Promise<Quotation>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QUOTATION_SEARCHABLES = void 0;
3
+ exports.mailHtmlOf = exports.MAIL_AGAIN_AFTER_MS = exports.QUOTATION_SEARCHABLES = void 0;
4
4
  exports.quotationInDomain = quotationInDomain;
5
5
  exports.saveQuotation = saveQuotation;
6
6
  exports.transitionQuotation = transitionQuotation;
@@ -8,6 +8,10 @@ exports.reviseQuotation = reviseQuotation;
8
8
  exports.snapshotOf = snapshotOf;
9
9
  exports.quotationsOfOpportunity = quotationsOfOpportunity;
10
10
  exports.quotationStatusCounts = quotationStatusCounts;
11
+ exports.quotationFileOf = quotationFileOf;
12
+ exports.mailAddressesOf = mailAddressesOf;
13
+ exports.mailQuotation = mailQuotation;
14
+ const email_base_1 = require("@things-factory/email-base");
11
15
  const invoice_1 = require("@things-factory/invoice");
12
16
  const shell_1 = require("@things-factory/shell");
13
17
  const opportunity_1 = require("../opportunity/opportunity");
@@ -134,4 +138,82 @@ async function quotationStatusCounts(tx, domain, params) {
134
138
  const counted = await (0, shell_1.countListByField)({ domain, params, repository: tx.getRepository(quotation_1.Quotation), searchables: exports.QUOTATION_SEARCHABLES, field: 'status' });
135
139
  return Object.values(quotation_1.QuotationStatus).map(value => ({ value, count: counted.get(value) ?? 0 }));
136
140
  }
141
+ /** The quotation as its buyer reads it (ADR-0170 decision 10), in `language` - its own when none is named. */
142
+ function quotationFileOf(context, quotation, format, language) {
143
+ const print = (0, invoice_1.printTranslator)(context, language || quotation.language);
144
+ return (0, invoice_1.documentFileOf)(quotation, format, {
145
+ ...print,
146
+ title: print.t('title.quotation-print'),
147
+ numberLabel: 'field.quotation-number',
148
+ totalLabel: 'field.quotation-total-amount',
149
+ bandLabel: 'field.quotation-total-amount',
150
+ linesTitle: print.t('text.quotation-print-lines'),
151
+ notesTitle: print.t('text.quotation-print-notes'),
152
+ letter: { greeting: print.t('text.quotation-print-greeting') },
153
+ /* The version is the office's own bookkeeping - the buyer reads the number and how long the offer holds (the user 2026-11-20). */
154
+ terms: [{ label: print.t('field.quotation-valid-until'), value: quotation.validUntil }]
155
+ });
156
+ }
157
+ /** The addresses of a list as typed - trimmed, empty ones dropped, each one an address or the whole send is refused. */
158
+ function mailAddressesOf(addresses) {
159
+ const list = (addresses ?? []).flatMap(one => String(one ?? '').split(/[,;\s]+/)).map(one => one.trim()).filter(Boolean);
160
+ const wrong = list.find(one => !(0, email_base_1.isMailAddress)(one));
161
+ if (wrong)
162
+ throw new shell_1.Refusal('quotation-mail-address-invalid', { address: wrong }, `${wrong} is not a mail address`);
163
+ /* An address is one whatever its case. */
164
+ return [...new Set(list.map(one => one.toLowerCase()))];
165
+ }
166
+ /** How long the same quotation to the same people counts as the send just made - a retry after a slow answer, a second tab. */
167
+ exports.MAIL_AGAIN_AFTER_MS = 2 * 60 * 1000;
168
+ /** What was typed as the body, as HTML - its lines kept, nothing of it read as markup. */
169
+ const mailHtmlOf = (body) => `<div style="font-family:'Malgun Gothic','Apple SD Gothic Neo',sans-serif;font-size:14px;line-height:1.6">${String(body ?? '')
170
+ .replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c])
171
+ .replace(/\r?\n/g, '<br>')}</div>`;
172
+ exports.mailHtmlOf = mailHtmlOf;
173
+ /**
174
+ * Mail a sales quotation to its buyer from the person signed in, its PDF attached (the user 2026-11-20: 「바로 메일로
175
+ * 송부」 · 「보내는 사람을 현재 사용자로」). A draft is sent by it - its amounts fixed as 「발송」 fixes them - and a sent one
176
+ * may go again, to another person. The mail goes last: when it is refused nothing is recorded and a draft stays a draft.
177
+ */
178
+ async function mailQuotation(tx, context, id, mail) {
179
+ const { domain, user } = context.state;
180
+ const found = await quotationInDomain(tx, domain, id);
181
+ if (found.direction !== 'SALES')
182
+ throw new shell_1.Refusal('quotation-mail-purchase', {}, 'Only a quotation we send goes by mail');
183
+ if (!['DRAFT', 'SENT'].includes(found.status))
184
+ throw new shell_1.Refusal('quotation-mail-status', {}, 'Only a draft or a sent quotation goes by mail');
185
+ /* An offer past its last day is not sent again as it is - a new version carries a new day. */
186
+ if (found.validUntil && found.validUntil < (0, shell_1.calendarDay)(domain.timezone))
187
+ throw new shell_1.Refusal('quotation-mail-expired', { validUntil: found.validUntil }, 'The offer has passed its last day - make a new version to send it');
188
+ const to = mailAddressesOf(mail.to);
189
+ const cc = mailAddressesOf(mail.cc).filter(one => !to.includes(one));
190
+ if (!to.length)
191
+ throw new shell_1.Refusal('quotation-mail-to-required', {}, 'Name whom the quotation goes to');
192
+ const subject = String(mail.subject ?? '').trim();
193
+ if (!subject)
194
+ throw new shell_1.Refusal('quotation-mail-subject-required', {}, 'Give the mail a subject');
195
+ const from = String(user?.email ?? '').trim();
196
+ if (!(0, email_base_1.isMailAddress)(from))
197
+ throw new shell_1.Refusal('quotation-mail-sender-unknown', {}, 'Your account has no mail address to send from');
198
+ /* Copied as the mail service copies it, so the record says everyone it went to. */
199
+ const recipients = [...to, ...cc, ...(await (0, email_base_1.alwaysCcOf)(domain)).filter(one => !to.includes(one) && !cc.includes(one))].join(', ');
200
+ /* The same quotation to the same people a moment ago is that send, not a new one - a retry after a slow answer. */
201
+ const last = await tx.getRepository(quotation_event_1.QuotationEvent).findOne({ where: { quotation: { id }, action: 'MAILED' }, order: { createdAt: 'DESC' } });
202
+ if (last && last.reason === recipients && Date.now() - new Date(last.createdAt).getTime() < exports.MAIL_AGAIN_AFTER_MS)
203
+ throw new shell_1.Refusal('quotation-mail-just-sent', { to: recipients }, 'This quotation went to the same people a moment ago');
204
+ /* The PDF is made before the domain is held: a draft's amounts are the ones confirming fixes. */
205
+ const file = await quotationFileOf(context, found, invoice_1.DocumentFileFormat.PDF);
206
+ const quotation = found.status === 'DRAFT' ? await transitionQuotation(tx, domain, user, id, 'SENT') : found;
207
+ /* Recorded first; the mail goes last, so only the commit follows it. A refused mail takes the record back with it. */
208
+ await recordQuotationEvent(tx, domain, user, quotation, 'MAILED', recipients);
209
+ await (0, email_base_1.sendMailAsPerson)(domain, {
210
+ from,
211
+ to,
212
+ cc,
213
+ subject,
214
+ html: (0, exports.mailHtmlOf)(mail.body),
215
+ attachments: [{ name: file.fileName, contentType: file.mimeType, contentBase64: file.content }]
216
+ });
217
+ return quotationInDomain(tx, domain, id);
218
+ }
137
219
  //# sourceMappingURL=quotation-service.js.map
@@ -4,6 +4,12 @@ export declare class NewQuotation extends DocumentInput {
4
4
  validUntil: string;
5
5
  opportunityId?: string;
6
6
  }
7
+ export declare class QuotationMail {
8
+ to: string[];
9
+ cc?: string[];
10
+ subject: string;
11
+ body: string;
12
+ }
7
13
  export declare class QuotationList {
8
14
  items: Quotation[];
9
15
  total: number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuotationList = exports.NewQuotation = void 0;
3
+ exports.QuotationList = exports.QuotationMail = exports.NewQuotation = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const invoice_1 = require("@things-factory/invoice");
6
6
  const type_graphql_1 = require("type-graphql");
@@ -19,6 +19,28 @@ tslib_1.__decorate([
19
19
  exports.NewQuotation = NewQuotation = tslib_1.__decorate([
20
20
  (0, type_graphql_1.InputType)({ description: 'A quotation draft to create or replace' })
21
21
  ], NewQuotation);
22
+ let QuotationMail = class QuotationMail {
23
+ };
24
+ exports.QuotationMail = QuotationMail;
25
+ tslib_1.__decorate([
26
+ (0, type_graphql_1.Field)(type => [String], { description: 'The addresses it goes to' }),
27
+ tslib_1.__metadata("design:type", Array)
28
+ ], QuotationMail.prototype, "to", void 0);
29
+ tslib_1.__decorate([
30
+ (0, type_graphql_1.Field)(type => [String], { nullable: true, description: 'The addresses copied; none when empty' }),
31
+ tslib_1.__metadata("design:type", Array)
32
+ ], QuotationMail.prototype, "cc", void 0);
33
+ tslib_1.__decorate([
34
+ (0, type_graphql_1.Field)({ description: 'The subject of the mail' }),
35
+ tslib_1.__metadata("design:type", String)
36
+ ], QuotationMail.prototype, "subject", void 0);
37
+ tslib_1.__decorate([
38
+ (0, type_graphql_1.Field)({ description: 'The body of the mail, as typed - its lines kept' }),
39
+ tslib_1.__metadata("design:type", String)
40
+ ], QuotationMail.prototype, "body", void 0);
41
+ exports.QuotationMail = QuotationMail = tslib_1.__decorate([
42
+ (0, type_graphql_1.InputType)({ description: 'A quotation mailed to its buyer from the person signed in, its PDF attached' })
43
+ ], QuotationMail);
22
44
  let QuotationList = class QuotationList {
23
45
  };
24
46
  exports.QuotationList = QuotationList;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/sales",
3
- "version": "10.1.298",
3
+ "version": "10.1.302",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "files": [
@@ -56,11 +56,12 @@
56
56
  "@operato/shell": "^10.29.69",
57
57
  "@operato/styles": "^10.29.1",
58
58
  "@operato/utils": "^10.0.0",
59
- "@things-factory/ai-assistant": "^10.1.298",
60
- "@things-factory/auth-base": "^10.1.298",
61
- "@things-factory/biz-base": "^10.1.298",
62
- "@things-factory/invoice": "^10.1.298",
63
- "@things-factory/shell": "^10.1.298"
59
+ "@things-factory/ai-assistant": "^10.1.302",
60
+ "@things-factory/auth-base": "^10.1.302",
61
+ "@things-factory/biz-base": "^10.1.302",
62
+ "@things-factory/email-base": "^10.1.302",
63
+ "@things-factory/invoice": "^10.1.302",
64
+ "@things-factory/shell": "^10.1.302"
64
65
  },
65
- "gitHead": "5b5dce33c891a02896ef3a9cb3974abefc3f53d6"
66
+ "gitHead": "2e754aaeafcd39f5c6f4b7c8847a6c60ffe0789c"
66
67
  }
@@ -4,8 +4,8 @@
4
4
  "button.quotation-expire": "Mark expired",
5
5
  "button.quotation-new": "New quotation",
6
6
  "button.quotation-reject": "Mark declined",
7
- "button.quotation-revise": "Revise",
8
- "button.quotation-send": "Send",
7
+ "button.quotation-revise": "New version",
8
+ "button.quotation-send": "Confirm",
9
9
  "error.quotation-draft-required": "Revise a sent quotation to change it.",
10
10
  "error.quotation-issue-date-required": "Enter the issue date before sending.",
11
11
  "error.quotation-latest-required": "Revise the latest version.",
@@ -27,7 +27,7 @@
27
27
  "text.quotation-status-draft": "Draft",
28
28
  "text.quotation-status-expired": "Expired",
29
29
  "text.quotation-status-rejected": "Declined",
30
- "text.quotation-status-sent": "Sent",
30
+ "text.quotation-status-sent": "Confirmed",
31
31
  "text.quotation-status-superseded": "Superseded",
32
32
  "title.quotation": "Quotation",
33
33
  "title.quotation-list": "Quotations",
@@ -139,12 +139,39 @@
139
139
  "error.sales-product-price-decimals": "Unit price {value} has more than {max} decimals.",
140
140
  "error.sales-product-not-found": "A product was not found - reload and try again.",
141
141
  "text.quotation-invoice-source": "Quotation {number} · v{version}",
142
- "text.quotation-send-confirm": "To {party} · total {total}. Once sent, its amounts cannot be changed - revise it to change them.",
143
- "text.quotation-send-confirm-purchase": "From {party} · total {total}. Once sent, its amounts cannot be changed - revise it to change them.",
142
+ "text.quotation-send-confirm": "To {party} · total {total}. Once confirmed, its amounts cannot be changed - make a new version to change them.",
143
+ "text.quotation-send-confirm-purchase": "From {party} · total {total}. Once confirmed, its amounts cannot be changed - make a new version to change them.",
144
144
  "error.opportunity-not-won": "Only a won opportunity is opened again this way.",
145
145
  "error.opportunity-reopen-reason-required": "Enter why it is opened again.",
146
146
  "text.opportunity-event-reopened": "Reopened",
147
147
  "work.sales.opportunities": "Sales opportunities",
148
148
  "work.sales.quotations": "Quotations",
149
- "work.sales.products": "Sales products"
149
+ "work.sales.products": "Sales products",
150
+ "text.quotation-print-lines": "Quotation details",
151
+ "text.quotation-print-notes": "Remarks",
152
+ "text.quotation-print-greeting": "We are pleased to quote as follows.",
153
+ "error.quotation-mail-purchase": "A quotation we received is not mailed.",
154
+ "error.quotation-mail-status": "Only a draft or a sent quotation can be mailed.",
155
+ "error.quotation-mail-to-required": "Enter the address the quotation goes to.",
156
+ "error.quotation-mail-address-invalid": "{address} is not a mail address.",
157
+ "error.quotation-mail-subject-required": "Enter the subject of the mail.",
158
+ "error.quotation-mail-sender-unknown": "Your account has no mail address to send from.",
159
+ "button.quotation-mail": "Send by mail",
160
+ "title.quotation-mail": "Mail the quotation",
161
+ "field.quotation-mail-from": "From",
162
+ "field.quotation-mail-to": "To",
163
+ "field.quotation-mail-cc": "Cc",
164
+ "field.quotation-mail-subject": "Subject",
165
+ "field.quotation-mail-body": "Message",
166
+ "field.quotation-mail-attachment": "Attachment",
167
+ "text.quotation-mail-addresses-hint": "Separate several addresses with commas.",
168
+ "text.quotation-mail-draft-note": "Once mailed, the quotation is confirmed and its amounts can no longer be changed - make a new version to change them.",
169
+ "text.quotation-mail-subject": "Quotation {number} from {supplier}",
170
+ "text.quotation-mail-body": "{greeting}\n\nPlease find attached our quotation as requested.\nIf you have any questions, simply reply to this mail.\n\nBest regards,\n{sender}\n{supplier}",
171
+ "text.quotation-mail-greeting-named": "Dear {name},",
172
+ "text.quotation-mail-greeting": "Hello,",
173
+ "text.quotation-mail-sent": "The quotation was mailed to {to}.",
174
+ "text.quotation-mail-always-cc": "Always copied to {addresses}",
175
+ "error.quotation-mail-expired": "The offer passed its last day ({validUntil}). Make a new version to send it.",
176
+ "error.quotation-mail-just-sent": "This quotation went to the same people ({to}) a moment ago."
150
177
  }
@@ -146,5 +146,32 @@
146
146
  "text.opportunity-event-reopened": "Reabierta",
147
147
  "work.sales.opportunities": "Oportunidades de venta",
148
148
  "work.sales.quotations": "Presupuestos",
149
- "work.sales.products": "Productos de venta"
149
+ "work.sales.products": "Productos de venta",
150
+ "text.quotation-print-lines": "Detalle de la cotización",
151
+ "text.quotation-print-notes": "Observaciones",
152
+ "text.quotation-print-greeting": "Nos complace presentarle la siguiente cotización.",
153
+ "error.quotation-mail-purchase": "Una cotización recibida no se envía por correo.",
154
+ "error.quotation-mail-status": "Solo se puede enviar por correo una cotización en borrador o enviada.",
155
+ "error.quotation-mail-to-required": "Introduzca la dirección del destinatario.",
156
+ "error.quotation-mail-address-invalid": "{address} no es una dirección de correo.",
157
+ "error.quotation-mail-subject-required": "Introduzca el asunto del correo.",
158
+ "error.quotation-mail-sender-unknown": "Su cuenta no tiene una dirección de correo para enviar.",
159
+ "button.quotation-mail": "Enviar por correo",
160
+ "title.quotation-mail": "Enviar la cotización por correo",
161
+ "field.quotation-mail-from": "De",
162
+ "field.quotation-mail-to": "Para",
163
+ "field.quotation-mail-cc": "CC",
164
+ "field.quotation-mail-subject": "Asunto",
165
+ "field.quotation-mail-body": "Mensaje",
166
+ "field.quotation-mail-attachment": "Adjunto",
167
+ "text.quotation-mail-addresses-hint": "Separe varias direcciones con comas.",
168
+ "text.quotation-mail-draft-note": "Al enviarla por correo, la cotización queda enviada y sus importes ya no se pueden cambiar.",
169
+ "text.quotation-mail-subject": "Cotización {number} de {supplier}",
170
+ "text.quotation-mail-body": "{greeting}\n\nAdjuntamos la cotización solicitada.\nSi tiene alguna pregunta, responda a este correo.\n\nSaludos cordiales,\n{sender}\n{supplier}",
171
+ "text.quotation-mail-greeting-named": "Estimado/a {name}:",
172
+ "text.quotation-mail-greeting": "Hola:",
173
+ "text.quotation-mail-sent": "La cotización se envió a {to}.",
174
+ "text.quotation-mail-always-cc": "Siempre con copia a {addresses}",
175
+ "error.quotation-mail-expired": "La oferta venció ({validUntil}). Cree una nueva versión para enviarla.",
176
+ "error.quotation-mail-just-sent": "Esta cotización se acaba de enviar a las mismas personas ({to})."
150
177
  }
@@ -146,5 +146,32 @@
146
146
  "text.opportunity-event-reopened": "再開",
147
147
  "work.sales.opportunities": "営業機会の管理",
148
148
  "work.sales.quotations": "見積の作成・送付",
149
- "work.sales.products": "販売商品の管理"
149
+ "work.sales.products": "販売商品の管理",
150
+ "text.quotation-print-lines": "見積明細",
151
+ "text.quotation-print-notes": "特記事項",
152
+ "text.quotation-print-greeting": "下記のとおりお見積り申し上げます。",
153
+ "error.quotation-mail-purchase": "受け取った見積はメールで送りません。",
154
+ "error.quotation-mail-status": "作成中または送付済みの見積だけメールで送れます。",
155
+ "error.quotation-mail-to-required": "宛先のメールアドレスを入力してください。",
156
+ "error.quotation-mail-address-invalid": "{address} はメールアドレスではありません。",
157
+ "error.quotation-mail-subject-required": "件名を入力してください。",
158
+ "error.quotation-mail-sender-unknown": "アカウントに差出人として使うメールアドレスがありません。",
159
+ "button.quotation-mail": "メールで送る",
160
+ "title.quotation-mail": "見積書をメールで送る",
161
+ "field.quotation-mail-from": "差出人",
162
+ "field.quotation-mail-to": "宛先",
163
+ "field.quotation-mail-cc": "CC",
164
+ "field.quotation-mail-subject": "件名",
165
+ "field.quotation-mail-body": "本文",
166
+ "field.quotation-mail-attachment": "添付",
167
+ "text.quotation-mail-addresses-hint": "複数のアドレスはカンマで区切ります。",
168
+ "text.quotation-mail-draft-note": "メールを送るとこの見積は送付済みになり、金額を変更できなくなります。",
169
+ "text.quotation-mail-subject": "[見積書] {number} {supplier}",
170
+ "text.quotation-mail-body": "{greeting}\n{supplier}の{sender}です。\n\nご依頼の見積書を添付いたします。\nご不明な点がございましたらご返信ください。\n\nよろしくお願いいたします。\n{sender}",
171
+ "text.quotation-mail-greeting-named": "{name} 様",
172
+ "text.quotation-mail-greeting": "お世話になっております。",
173
+ "text.quotation-mail-sent": "{to} に見積書を送りました。",
174
+ "text.quotation-mail-always-cc": "自動 CC: {addresses}",
175
+ "error.quotation-mail-expired": "有効期限({validUntil})を過ぎた見積は再送しません。新しいバージョンを作って送ってください。",
176
+ "error.quotation-mail-just-sent": "先ほど同じ宛先({to})にこの見積を送りました。"
150
177
  }
@@ -4,8 +4,8 @@
4
4
  "button.quotation-expire": "만료 처리",
5
5
  "button.quotation-new": "견적 작성",
6
6
  "button.quotation-reject": "거절 처리",
7
- "button.quotation-revise": "개정",
8
- "button.quotation-send": "발송",
7
+ "button.quotation-revise": "새 버전 만들기",
8
+ "button.quotation-send": "확정",
9
9
  "error.quotation-draft-required": "발송한 견적을 수정하려면 개정본을 생성해 주세요.",
10
10
  "error.quotation-issue-date-required": "보내기 전에 작성일을 입력하세요.",
11
11
  "error.quotation-latest-required": "최신 버전의 견적을 선택한 후 개정해 주세요.",
@@ -27,7 +27,7 @@
27
27
  "text.quotation-status-draft": "작성 중",
28
28
  "text.quotation-status-expired": "기한 만료",
29
29
  "text.quotation-status-rejected": "거절",
30
- "text.quotation-status-sent": "발송",
30
+ "text.quotation-status-sent": "확정",
31
31
  "text.quotation-status-superseded": "개정됨",
32
32
  "title.quotation": "견적",
33
33
  "title.quotation-list": "견적",
@@ -139,12 +139,39 @@
139
139
  "error.sales-product-price-decimals": "단가 {value}은(는) 소수점 아래 {max}자리까지만 쓸 수 있습니다.",
140
140
  "error.sales-product-not-found": "상품을 찾을 수 없습니다. 새로 고친 뒤 다시 해 주세요.",
141
141
  "text.quotation-invoice-source": "견적 {number} · v{version}",
142
- "text.quotation-send-confirm": "받는 곳 {party} · 합계 {total}. 보낸 뒤에는 금액을 고칠 수 없습니다 — 고치려면 새 버전을 만듭니다.",
143
- "text.quotation-send-confirm-purchase": "보낸 곳 {party} · 합계 {total}. 보낸 뒤에는 금액을 고칠 수 없습니다 — 고치려면 새 버전을 만듭니다.",
142
+ "text.quotation-send-confirm": "받는 곳 {party} · 합계 {total}. 확정한 뒤에는 금액을 고칠 수 없습니다. 고치려면 새 버전을 만듭니다.",
143
+ "text.quotation-send-confirm-purchase": "보낸 곳 {party} · 합계 {total}. 확정한 뒤에는 금액을 고칠 수 없습니다. 고치려면 새 버전을 만듭니다.",
144
144
  "error.opportunity-not-won": "수주한 영업 기회만 이렇게 다시 열 수 있습니다.",
145
145
  "error.opportunity-reopen-reason-required": "다시 여는 사유를 입력하세요.",
146
146
  "text.opportunity-event-reopened": "다시 열림",
147
147
  "work.sales.opportunities": "영업 기회 관리",
148
148
  "work.sales.quotations": "견적 작성 · 발송",
149
- "work.sales.products": "판매 상품 관리"
149
+ "work.sales.products": "판매 상품 관리",
150
+ "text.quotation-print-lines": "견적 내역",
151
+ "text.quotation-print-notes": "특기 사항",
152
+ "text.quotation-print-greeting": "아래와 같이 견적합니다.",
153
+ "error.quotation-mail-purchase": "받은 견적은 메일로 보내지 않습니다.",
154
+ "error.quotation-mail-status": "작성 중이거나 발송한 견적만 메일로 보낼 수 있습니다.",
155
+ "error.quotation-mail-to-required": "받는 사람의 메일 주소를 입력하세요.",
156
+ "error.quotation-mail-address-invalid": "{address} 는 메일 주소가 아닙니다.",
157
+ "error.quotation-mail-subject-required": "메일 제목을 입력하세요.",
158
+ "error.quotation-mail-sender-unknown": "내 계정에 보내는 사람으로 쓸 메일 주소가 없습니다.",
159
+ "button.quotation-mail": "메일로 보내기",
160
+ "title.quotation-mail": "견적서 메일 보내기",
161
+ "field.quotation-mail-from": "보내는 사람",
162
+ "field.quotation-mail-to": "받는 사람",
163
+ "field.quotation-mail-cc": "참조",
164
+ "field.quotation-mail-subject": "제목",
165
+ "field.quotation-mail-body": "본문",
166
+ "field.quotation-mail-attachment": "첨부",
167
+ "text.quotation-mail-addresses-hint": "여러 주소는 쉼표로 구분합니다.",
168
+ "text.quotation-mail-draft-note": "메일을 보내면 이 견적이 확정되고, 이후에는 금액을 고칠 수 없습니다. 고치려면 새 버전을 만듭니다.",
169
+ "text.quotation-mail-subject": "[견적서] {number} {supplier}",
170
+ "text.quotation-mail-body": "{greeting}\n{supplier} {sender}입니다.\n\n요청하신 견적서를 첨부하여 보내드립니다.\n검토하신 뒤 궁금하신 점이 있으면 회신 부탁드립니다.\n\n감사합니다.\n{sender} 드림",
171
+ "text.quotation-mail-greeting-named": "{name} 님, 안녕하세요.",
172
+ "text.quotation-mail-greeting": "안녕하세요.",
173
+ "text.quotation-mail-sent": "{to} 에게 견적서를 보냈습니다.",
174
+ "text.quotation-mail-always-cc": "자동 참조: {addresses}",
175
+ "error.quotation-mail-expired": "유효기한({validUntil})이 지난 견적은 다시 보내지 않습니다. 새 버전을 만들어 보내세요.",
176
+ "error.quotation-mail-just-sent": "방금 같은 사람들({to})에게 이 견적을 보냈습니다."
150
177
  }
@@ -146,5 +146,32 @@
146
146
  "text.opportunity-event-reopened": "Dibuka semula",
147
147
  "work.sales.opportunities": "Peluang jualan",
148
148
  "work.sales.quotations": "Sebut harga",
149
- "work.sales.products": "Produk jualan"
149
+ "work.sales.products": "Produk jualan",
150
+ "text.quotation-print-lines": "Butiran sebut harga",
151
+ "text.quotation-print-notes": "Catatan",
152
+ "text.quotation-print-greeting": "Dengan sukacitanya kami mengemukakan sebut harga seperti berikut.",
153
+ "error.quotation-mail-purchase": "Sebut harga yang diterima tidak dihantar melalui mel.",
154
+ "error.quotation-mail-status": "Hanya sebut harga draf atau yang telah dihantar boleh dihantar melalui mel.",
155
+ "error.quotation-mail-to-required": "Masukkan alamat penerima.",
156
+ "error.quotation-mail-address-invalid": "{address} bukan alamat mel.",
157
+ "error.quotation-mail-subject-required": "Masukkan subjek mel.",
158
+ "error.quotation-mail-sender-unknown": "Akaun anda tiada alamat mel untuk menghantar.",
159
+ "button.quotation-mail": "Hantar melalui mel",
160
+ "title.quotation-mail": "Hantar sebut harga melalui mel",
161
+ "field.quotation-mail-from": "Daripada",
162
+ "field.quotation-mail-to": "Kepada",
163
+ "field.quotation-mail-cc": "SK",
164
+ "field.quotation-mail-subject": "Subjek",
165
+ "field.quotation-mail-body": "Mesej",
166
+ "field.quotation-mail-attachment": "Lampiran",
167
+ "text.quotation-mail-addresses-hint": "Pisahkan beberapa alamat dengan koma.",
168
+ "text.quotation-mail-draft-note": "Setelah dihantar, sebut harga ini menjadi dihantar dan amaunnya tidak boleh diubah lagi.",
169
+ "text.quotation-mail-subject": "Sebut harga {number} daripada {supplier}",
170
+ "text.quotation-mail-body": "{greeting}\n\nBersama ini dilampirkan sebut harga yang diminta.\nJika ada pertanyaan, sila balas mel ini.\n\nSekian, terima kasih.\n{sender}\n{supplier}",
171
+ "text.quotation-mail-greeting-named": "Kepada {name},",
172
+ "text.quotation-mail-greeting": "Salam sejahtera,",
173
+ "text.quotation-mail-sent": "Sebut harga telah dihantar kepada {to}.",
174
+ "text.quotation-mail-always-cc": "Sentiasa disalin kepada {addresses}",
175
+ "error.quotation-mail-expired": "Tawaran telah tamat ({validUntil}). Buat versi baharu untuk menghantarnya.",
176
+ "error.quotation-mail-just-sent": "Sebut harga ini baru sahaja dihantar kepada orang yang sama ({to})."
150
177
  }
@@ -146,5 +146,32 @@
146
146
  "text.opportunity-event-reopened": "重新打开",
147
147
  "work.sales.opportunities": "销售机会管理",
148
148
  "work.sales.quotations": "报价编写与发送",
149
- "work.sales.products": "销售产品管理"
149
+ "work.sales.products": "销售产品管理",
150
+ "text.quotation-print-lines": "报价明细",
151
+ "text.quotation-print-notes": "特别事项",
152
+ "text.quotation-print-greeting": "兹报价如下。",
153
+ "error.quotation-mail-purchase": "收到的报价不通过邮件发送。",
154
+ "error.quotation-mail-status": "只有草稿或已发送的报价可以通过邮件发送。",
155
+ "error.quotation-mail-to-required": "请输入收件人邮箱地址。",
156
+ "error.quotation-mail-address-invalid": "{address} 不是邮箱地址。",
157
+ "error.quotation-mail-subject-required": "请输入邮件主题。",
158
+ "error.quotation-mail-sender-unknown": "您的账户没有可用作发件人的邮箱地址。",
159
+ "button.quotation-mail": "邮件发送",
160
+ "title.quotation-mail": "邮件发送报价单",
161
+ "field.quotation-mail-from": "发件人",
162
+ "field.quotation-mail-to": "收件人",
163
+ "field.quotation-mail-cc": "抄送",
164
+ "field.quotation-mail-subject": "主题",
165
+ "field.quotation-mail-body": "正文",
166
+ "field.quotation-mail-attachment": "附件",
167
+ "text.quotation-mail-addresses-hint": "多个地址用逗号分隔。",
168
+ "text.quotation-mail-draft-note": "发送邮件后,该报价变为已发送,金额无法再修改。",
169
+ "text.quotation-mail-subject": "[报价单] {number} {supplier}",
170
+ "text.quotation-mail-body": "{greeting}\n我是{supplier}的{sender}。\n\n附上您所需的报价单。\n如有疑问,请直接回复此邮件。\n\n谢谢。\n{sender}",
171
+ "text.quotation-mail-greeting-named": "{name},您好。",
172
+ "text.quotation-mail-greeting": "您好。",
173
+ "text.quotation-mail-sent": "已将报价单发送给 {to}。",
174
+ "text.quotation-mail-always-cc": "自动抄送:{addresses}",
175
+ "error.quotation-mail-expired": "已过有效期({validUntil})的报价不再发送。请创建新版本后发送。",
176
+ "error.quotation-mail-just-sent": "刚刚已将此报价发送给相同的收件人({to})。"
150
177
  }