@limetech/limepkg-cpq-order 2.11.0-dev.1 → 2.11.0-dev.10

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.
@@ -21,6 +21,7 @@ export declare class Item implements Iitem {
21
21
  guid?: string;
22
22
  deleted: boolean;
23
23
  additionalProperties: {};
24
+ overviewProperties: {};
24
25
  constructor(props?: Iitem);
25
26
  get totalVat(): number;
26
27
  get discountedPricePerUnit(): number;
@@ -1,7 +1,17 @@
1
1
  import { LimeType, LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Translator } from '@limetech/lime-web-components';
2
2
  import { EventEmitter } from '../../stencil-public-runtime';
3
- import { IconfigItemMapping } from '../../interfaces';
3
+ import { IconfigGeneral, IconfigItemMapping } from '../../interfaces';
4
4
  import { Item } from '../../classes';
5
+ import { FormSchema } from '@limetech/lime-elements';
6
+ export interface IitemFormSchema extends FormSchema {
7
+ description: string;
8
+ quantity: number;
9
+ pricePerUnit: number;
10
+ vat: number;
11
+ discountPerUnit: number;
12
+ discountPercent: number;
13
+ discountTotal: number;
14
+ }
5
15
  export declare class ItemForm implements LimeWebComponent {
6
16
  /**
7
17
  * @inherit
@@ -15,112 +25,27 @@ export declare class ItemForm implements LimeWebComponent {
15
25
  currency: string;
16
26
  itemMapping: IconfigItemMapping;
17
27
  limetype: LimeType;
28
+ generalConfig: IconfigGeneral;
29
+ private itemCopy;
18
30
  validate: EventEmitter;
31
+ change: EventEmitter<Item>;
32
+ private percentageDiscountIsUsed;
33
+ private amountPerUnitDiscountIsUsed;
34
+ private totalAmountDiscountIsUsed;
35
+ private schema;
36
+ private discountClass;
37
+ private shouldShowArticleInfo;
19
38
  get translate(): Translator;
39
+ componentWillLoad(): void;
40
+ watchItemData(): void;
41
+ watchGeneralConfig(newValue: IconfigGeneral, oldValue: IconfigGeneral): void;
20
42
  render(): any[];
21
43
  private renderGrossMarginRatio;
22
44
  private renderSummary;
23
45
  private renderHelperText;
46
+ private calculateDiscount;
24
47
  private renderSubtotalAndDiscount;
25
- get schema(): {
26
- type: string;
27
- lime: {
28
- layout: {
29
- type: string;
30
- columns: number;
31
- dense: boolean;
32
- };
33
- };
34
- required: string[];
35
- properties: {
36
- description: {
37
- type: string;
38
- title: string;
39
- maxLength: number;
40
- lime: {
41
- layout: {
42
- colSpan: string;
43
- };
44
- };
45
- };
46
- quantity: {
47
- type: string;
48
- title: string;
49
- minimum: number;
50
- lime: {
51
- component: {
52
- props: {
53
- suffix: string;
54
- };
55
- };
56
- };
57
- };
58
- pricePerUnit: {
59
- type: string;
60
- title: string;
61
- description: string;
62
- lime: {
63
- component: {
64
- props: {
65
- suffix: string;
66
- };
67
- };
68
- };
69
- };
70
- vat: {
71
- title: string;
72
- minimum: number;
73
- lime: {
74
- component: {
75
- name: string;
76
- props: {
77
- value: number;
78
- };
79
- };
80
- };
81
- };
82
- discountClass: {
83
- type: string;
84
- title: string;
85
- oneOf: {
86
- type: string;
87
- const: string;
88
- title: string;
89
- }[];
90
- lime: {
91
- component: {
92
- props: {
93
- readonly: boolean;
94
- };
95
- };
96
- };
97
- };
98
- discountPerUnit: {
99
- type: string;
100
- title: string;
101
- description: string;
102
- lime: {
103
- component: {
104
- props: {
105
- prefix: string;
106
- readonly: boolean;
107
- };
108
- };
109
- };
110
- };
111
- discountPercent: {
112
- type: string[];
113
- title: string;
114
- description: string;
115
- lime: {
116
- component: {
117
- props: {
118
- prefix: string;
119
- readonly: boolean;
120
- };
121
- };
122
- };
123
- };
124
- };
125
- };
48
+ private buildSchema;
49
+ private handleFormChange;
50
+ private shouldHideDiscount;
126
51
  }
@@ -1,4 +1,5 @@
1
1
  import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Translator } from '@limetech/lime-web-components';
2
+ import { IconfigGeneral } from 'src/interfaces';
2
3
  export declare class ItemSummary implements LimeWebComponent {
3
4
  /**
4
5
  * @inherit
@@ -14,7 +15,12 @@ export declare class ItemSummary implements LimeWebComponent {
14
15
  vat: number;
15
16
  totalInclVat: number;
16
17
  currency: string;
18
+ generalConfig?: IconfigGeneral;
19
+ private vatBehaviour;
17
20
  get translate(): Translator;
21
+ componentWillLoad(): void;
18
22
  render(): any;
23
+ private renderPriceInfoWithoutTax;
24
+ private renderPriceInfoWithTax;
19
25
  private renderSubtotalAndDiscount;
20
26
  }
@@ -1,4 +1,5 @@
1
1
  import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Translator } from '@limetech/lime-web-components';
2
+ import { EventEmitter } from '../../stencil-public-runtime';
2
3
  import { IconfigItemMapping } from '../../interfaces';
3
4
  import { Item } from '../../classes';
4
5
  export declare class ItemTable implements LimeWebComponent {
@@ -16,8 +17,10 @@ export declare class ItemTable implements LimeWebComponent {
16
17
  tableIsReadonly: boolean;
17
18
  itemMapping: IconfigItemMapping;
18
19
  private limetypes;
20
+ activate: EventEmitter<Item>;
19
21
  get translate(): Translator;
20
22
  render(): any;
23
+ private handleActivate;
21
24
  private defineColumns;
22
25
  private filterItems;
23
26
  }
@@ -8,6 +8,7 @@ export declare class Loader implements LimePluginLoader {
8
8
  get dialogService(): DialogRenderer;
9
9
  get eventDispatcher(): EventDispatcher;
10
10
  get commandBus(): CommandBus;
11
+ private get webComponentRegistry();
11
12
  componentWillLoad(): void;
12
13
  componentWillUpdate(): void;
13
14
  disconnectedCallback(): void;
@@ -16,4 +17,5 @@ export declare class Loader implements LimePluginLoader {
16
17
  private openNewOrderDialog;
17
18
  private onDestroyDialog;
18
19
  private isEmpty;
20
+ private registerWebComponents;
19
21
  }
@@ -1,6 +1,6 @@
1
1
  import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Translator } from '@limetech/lime-web-components';
2
2
  import { EventEmitter } from '../../stencil-public-runtime';
3
- import { DocumentTemplate } from 'src/services/documenttemplate.service.interface';
3
+ import { DocumentTemplate } from '@limetech/limepkg-document-templates';
4
4
  export declare class TemplateSelector implements LimeWebComponent {
5
5
  /**
6
6
  * @inherit
@@ -1,6 +1,7 @@
1
1
  import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
2
  import { FormComponent } from '@limetech/lime-elements';
3
3
  import { EventEmitter } from '../../stencil-public-runtime';
4
+ import { VatBehaviour } from 'src/interfaces';
4
5
  export declare class VatSelector implements LimeWebComponent, FormComponent {
5
6
  platform: LimeWebComponentPlatform;
6
7
  context: LimeWebComponentContext;
@@ -10,6 +11,7 @@ export declare class VatSelector implements LimeWebComponent, FormComponent {
10
11
  readonly?: boolean;
11
12
  disabled?: boolean;
12
13
  helperText?: string;
14
+ vatBehaviour: VatBehaviour;
13
15
  change: EventEmitter<number>;
14
16
  vatValue: string;
15
17
  private readonly hundred;
@@ -18,4 +20,6 @@ export declare class VatSelector implements LimeWebComponent, FormComponent {
18
20
  private roundToOneDecimal;
19
21
  render(): any;
20
22
  private handleChange;
23
+ private shouldHideVatField;
24
+ private shouldBeReadOnly;
21
25
  }
@@ -6,10 +6,11 @@
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { LimeProperty, LimeType, LimeWebComponentContext, LimeWebComponentPlatform } from "@limetech/lime-web-components";
9
- import { ErpStatus, Iarticle, IarticleGroup, Iconfig, IconfigItemMapping, Iitem } from "./interfaces";
9
+ import { ErpStatus, Iarticle, IarticleGroup, Iconfig, IconfigGeneral, IconfigItemMapping, Iitem } from "./interfaces";
10
10
  import { Deal, Item, Order } from "./classes";
11
11
  import { StatusLabelMapping } from "./components/erp-status/flow-items";
12
- import { DocumentTemplate } from "src/services/documenttemplate.service.interface";
12
+ import { IconfigGeneral as IconfigGeneral1, VatBehaviour } from "src/interfaces";
13
+ import { DocumentTemplate } from "@limetech/limepkg-document-templates";
13
14
  export namespace Components {
14
15
  interface CocArticleGroupPicker {
15
16
  "config"?: Iconfig;
@@ -148,6 +149,7 @@ export namespace Components {
148
149
  */
149
150
  "context": LimeWebComponentContext;
150
151
  "currency": string;
152
+ "generalConfig": IconfigGeneral;
151
153
  "itemData": Item;
152
154
  "itemMapping": IconfigItemMapping;
153
155
  "limetype": LimeType;
@@ -165,6 +167,7 @@ export namespace Components {
165
167
  "context": LimeWebComponentContext;
166
168
  "currency": string;
167
169
  "discount": number;
170
+ "generalConfig"?: IconfigGeneral1;
168
171
  /**
169
172
  * Reference to the platform
170
173
  * @inherit
@@ -279,6 +282,7 @@ export namespace Components {
279
282
  * The value of the current property
280
283
  */
281
284
  "value": number;
285
+ "vatBehaviour": VatBehaviour;
282
286
  }
283
287
  interface LwcLimepkgCpqOrderLoader {
284
288
  /**
@@ -319,6 +323,10 @@ export interface CocItemFormCustomEvent<T> extends CustomEvent<T> {
319
323
  detail: T;
320
324
  target: HTMLCocItemFormElement;
321
325
  }
326
+ export interface CocItemTableCustomEvent<T> extends CustomEvent<T> {
327
+ detail: T;
328
+ target: HTMLCocItemTableElement;
329
+ }
322
330
  export interface CocNewOrderDialogCustomEvent<T> extends CustomEvent<T> {
323
331
  detail: T;
324
332
  target: HTMLCocNewOrderDialogElement;
@@ -612,9 +620,11 @@ declare namespace LocalJSX {
612
620
  */
613
621
  "context"?: LimeWebComponentContext;
614
622
  "currency"?: string;
623
+ "generalConfig"?: IconfigGeneral;
615
624
  "itemData"?: Item;
616
625
  "itemMapping"?: IconfigItemMapping;
617
626
  "limetype"?: LimeType;
627
+ "onChange"?: (event: CocItemFormCustomEvent<Item>) => void;
618
628
  "onValidate"?: (event: CocItemFormCustomEvent<any>) => void;
619
629
  /**
620
630
  * Reference to the platform
@@ -630,6 +640,7 @@ declare namespace LocalJSX {
630
640
  "context"?: LimeWebComponentContext;
631
641
  "currency"?: string;
632
642
  "discount"?: number;
643
+ "generalConfig"?: IconfigGeneral1;
633
644
  /**
634
645
  * Reference to the platform
635
646
  * @inherit
@@ -650,6 +661,7 @@ declare namespace LocalJSX {
650
661
  "discount"?: number;
651
662
  "itemMapping"?: IconfigItemMapping;
652
663
  "items"?: Item[];
664
+ "onActivate"?: (event: CocItemTableCustomEvent<Item>) => void;
653
665
  /**
654
666
  * Reference to the platform
655
667
  * @inherit
@@ -751,6 +763,7 @@ declare namespace LocalJSX {
751
763
  * The value of the current property
752
764
  */
753
765
  "value"?: number;
766
+ "vatBehaviour"?: VatBehaviour;
754
767
  }
755
768
  interface LwcLimepkgCpqOrderLoader {
756
769
  /**
@@ -47,6 +47,7 @@ export interface IconfigItemMapping {
47
47
  propertyDiscount: string;
48
48
  propertyTotalvalue: string;
49
49
  propertyPosition: string;
50
+ overviewProperties: string[];
50
51
  }
51
52
  export interface IconfigBaseMapping {
52
53
  limetype: string;
@@ -98,9 +99,28 @@ export interface IconfigOrder {
98
99
  orderrowMapping: IconfigOrderrowMapping;
99
100
  orderFromDealMapping: IconfigOrderFromDealMapping[];
100
101
  }
102
+ export interface IconfigGeneral {
103
+ vat: IconfigVatBehaviour;
104
+ discount: IconfigDiscountBehaviour;
105
+ gross_margin_cost_price: IconfigGrossMarginCostPrice;
106
+ }
107
+ interface IconfigVatBehaviour {
108
+ vat_behaviour: VatBehaviour;
109
+ }
110
+ interface IconfigDiscountBehaviour {
111
+ percentage_discount: boolean;
112
+ amount_per_unit_discount: boolean;
113
+ total_amount_discount: boolean;
114
+ }
115
+ interface IconfigGrossMarginCostPrice {
116
+ should_show_article_info: boolean;
117
+ }
118
+ export declare type VatBehaviour = 'hide' | 'show' | 'show_and_edit';
101
119
  export interface Iconfig {
102
120
  article: IconfigArticle;
103
121
  customization?: IconfigCustomization;
104
122
  cpq?: IconfigCpq;
105
123
  order?: IconfigOrder;
124
+ general_config?: IconfigGeneral;
106
125
  }
126
+ export {};
@@ -21,6 +21,7 @@ export interface Iitem<T extends {} = Record<string, any>> {
21
21
  guid?: string;
22
22
  deleted: boolean;
23
23
  additionalProperties?: T;
24
+ overviewProperties?: T;
24
25
  }
25
26
  export interface Iarticle {
26
27
  id: number;
@@ -70,4 +71,4 @@ export declare enum ErpStatus {
70
71
  senttoerp = "senttoerp",
71
72
  error = "error"
72
73
  }
73
- export declare type DiscountClasses = 'amount' | 'percent';
74
+ export declare type DiscountClasses = 'amount' | 'percent' | 'total';
@@ -1,35 +1,4 @@
1
- export declare const ServerCommandServiceName = "limepkg-server-commands.service";
2
- export interface ServerCommandService {
3
- /**
4
- * Posts the commands to the command endpoint.
5
- *
6
- * @param {ServerCommand[]} payload The commands.
7
- * @returns {Promise<ServerCommandBatchResponse>} The response.
8
- */
9
- postCommands(payload: ServerCommand[]): Promise<ServerCommandBatchResponse>;
10
- }
11
- export interface ServerCommand {
12
- name: string;
13
- parameters: object;
14
- }
15
- export interface ServerCommandResponse {
16
- successful: boolean;
17
- command: object;
18
- data: any;
19
- error: ServerCommandError;
20
- }
21
- export interface ServerCommandError {
22
- code: string;
23
- message: string;
24
- }
25
- export interface ServerCommandBatch {
26
- commands: ServerCommand[];
27
- }
28
- export interface ServerCommandBatchResponse {
29
- successful: boolean;
30
- id: string;
31
- commands: ServerCommandResponse[];
32
- }
1
+ export * from '@limetech/limepkg-server-commands';
33
2
  export declare enum ServerCommandName {
34
3
  upsert = "upsert-limeobject",
35
4
  delete = "delete-limeobject"
@@ -1,4 +1,4 @@
1
1
  import { CreateLimeobjectDialogCommand, LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
- import { DocumentTemplate } from './documenttemplate.service.interface';
2
+ import { DocumentTemplate } from '@limetech/limepkg-document-templates';
3
3
  export declare function loadAllTemplates(platform: LimeWebComponentPlatform, limetype: string): Promise<DocumentTemplate[]>;
4
4
  export declare function openGenerateQuotationDialog(platform: LimeWebComponentPlatform, command: CreateLimeobjectDialogCommand): void;
@@ -0,0 +1,10 @@
1
+ import { LimeObject, LimeType, LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
+ export declare const limeTypes: {
3
+ readonly person: LimeType;
4
+ readonly company: LimeType;
5
+ };
6
+ export declare const limeObjects: {
7
+ readonly person1: LimeObject;
8
+ readonly company1: LimeObject;
9
+ };
10
+ export declare function createTestPlatform(): LimeWebComponentPlatform;
@@ -0,0 +1,8 @@
1
+ import { LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
+ export declare class TestPlatform implements LimeWebComponentPlatform {
3
+ get type(): LimeWebComponentPlatform['type'];
4
+ private services;
5
+ get(name: string): any;
6
+ has(name: string): boolean;
7
+ register(name: string, service: any): void;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/limepkg-cpq-order",
3
- "version": "2.11.0-dev.1",
3
+ "version": "2.11.0-dev.10",
4
4
  "description": "Type definitions for limepkg-cpq-order frontend",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.cjs.js",
@@ -1,142 +0,0 @@
1
- import { FileInfo } from '@limetech/lime-elements';
2
- export interface Template {
3
- id: number;
4
- extension?: string;
5
- last_modified?: string;
6
- mimetype?: string;
7
- filename?: string;
8
- size?: number;
9
- storage_type?: string;
10
- metadata?: {
11
- [key: string]: any;
12
- };
13
- filetype: TemplateFileType;
14
- }
15
- export declare enum TemplateFileType {
16
- DOCUMENT_TEMPLATE = 113,
17
- DOCUMENT_TEMPLATE_2 = 115
18
- }
19
- /**
20
- * The registered name of the document template service.
21
- */
22
- export declare const DocumentTemplateServiceName = "limepkg-document-templates.documenttemplateservice";
23
- /**
24
- * Array of supported document template extensions. Currently allowed ones are: .docx, .pdf, .xlsx
25
- */
26
- export declare const SupportedDocumentTemplateExtensions: readonly ["docx", "pdf", "xlsx"];
27
- /**
28
- * The supported document template extension.
29
- */
30
- export declare type SupportedDocumentTemplateExtension = (typeof SupportedDocumentTemplateExtensions)[number];
31
- /**
32
- * The available options used when getting templates.
33
- */
34
- export declare type GetOptions = {
35
- /**
36
- * Only return templates compatible with this lime type.
37
- */
38
- limetype?: string;
39
- /**
40
- * Only return templates matching this extension.
41
- */
42
- extension?: SupportedDocumentTemplateExtension[];
43
- };
44
- /**
45
- * Defines the document template service.
46
- */
47
- export interface DocumentTemplateService {
48
- /**
49
- * Returns a list of available templates based
50
- * on the provided options.
51
- *
52
- * @param {GetOptions} options The options for the request
53
- * @returns {Promise<DocumentTemplate[]>} The document templates.
54
- */
55
- getTemplates(options?: GetOptions): Promise<DocumentTemplate[]>;
56
- /**
57
- * Returns a file info representation of a document template.
58
- *
59
- * @param {DocumentTemplate} template The document template
60
- * @returns {FileInfo} The file info representation
61
- */
62
- templateToFileInfo(template: DocumentTemplate): FileInfo;
63
- /**
64
- * Returns a document template representation of a file info.
65
- *
66
- * @param {FileInfo} file The file info
67
- * @returns {DocumentTemplate} The document template representation
68
- */
69
- fileInfoToTemplate(file: FileInfo): DocumentTemplate;
70
- }
71
- export interface Locale {
72
- /**
73
- * The locale code.
74
- * For example "en_US".
75
- */
76
- code?: string;
77
- /**
78
- * The locale display name.
79
- */
80
- displayName?: string;
81
- }
82
- /**
83
- * The available document template types.
84
- */
85
- export declare type DocumentTemplateType = 'document_template' | 'legacy_template' | 'field_file';
86
- export interface DocumentTemplate {
87
- /**
88
- * The id of the document template.
89
- *
90
- * When this value is a string it has a custom template id which will
91
- * stay persisted even if the document template file changes.
92
- * When this value is a number it is the same as {@link DocumentTemplate#id}.
93
- */
94
- templateId: string | number;
95
- /**
96
- * The id of the document template's file.
97
- *
98
- * IMPORTANT!
99
- * This id is volatile since it is the id of the document template
100
- * file and thus will change when the template document file changes.
101
- */
102
- fileId: number;
103
- /**
104
- * The name of the document template file.
105
- */
106
- fileName: string;
107
- /**
108
- * The extension of the document template file.
109
- */
110
- extension: string;
111
- /**
112
- * Additional tags for this document template.
113
- */
114
- tags?: string[];
115
- /**
116
- * An optional category for this document template.
117
- *
118
- * NOTE! Only used with legacy templates.
119
- */
120
- category?: string;
121
- /**
122
- * Defines the default locale for this document template.
123
- */
124
- locale?: Locale;
125
- /**
126
- * The type of this document template.
127
- */
128
- type?: DocumentTemplateType;
129
- }
130
- export interface TemplatePickerComponent {
131
- /**
132
- * The name of the web component.
133
- */
134
- name: string;
135
- /**
136
- * The optional web component properties.
137
- */
138
- props?: object;
139
- }
140
- export interface LoadTemplateOptions {
141
- limetype?: string;
142
- }