@limetech/limepkg-cpq-order 2.11.0-dev.2 → 2.11.0-dev.4

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,19 @@
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
+ discount: {
12
+ discountPerUnit: number;
13
+ discountPercent: number;
14
+ discountTotal: number;
15
+ };
16
+ }
5
17
  export declare class ItemForm implements LimeWebComponent {
6
18
  /**
7
19
  * @inherit
@@ -15,112 +27,26 @@ export declare class ItemForm implements LimeWebComponent {
15
27
  currency: string;
16
28
  itemMapping: IconfigItemMapping;
17
29
  limetype: LimeType;
30
+ generalConfig: IconfigGeneral;
31
+ private itemCopy;
18
32
  validate: EventEmitter;
33
+ change: EventEmitter<Item>;
34
+ private percentageDiscountIsUsed;
35
+ private amountPerUnitDiscountIsUsed;
36
+ private totalAmountDiscountIsUsed;
37
+ private schema;
38
+ private discountClass;
39
+ private shouldShowArticleInfo;
19
40
  get translate(): Translator;
41
+ componentWillLoad(): void;
42
+ watchItemData(): void;
43
+ watchGeneralConfig(newValue: IconfigGeneral, oldValue: IconfigGeneral): void;
20
44
  render(): any[];
21
45
  private renderGrossMarginRatio;
22
46
  private renderSummary;
23
47
  private renderHelperText;
24
48
  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
- };
49
+ private buildSchema;
50
+ private handleFormChange;
51
+ private shouldHideDiscount;
126
52
  }
@@ -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
  }
@@ -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,9 +6,10 @@
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 { IconfigGeneral as IconfigGeneral1, VatBehaviour } from "src/interfaces";
12
13
  import { DocumentTemplate } from "@limetech/limepkg-document-templates";
13
14
  export namespace Components {
14
15
  interface CocArticleGroupPicker {
@@ -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';
@@ -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.2",
3
+ "version": "2.11.0-dev.4",
4
4
  "description": "Type definitions for limepkg-cpq-order frontend",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.cjs.js",