forked from headintheclouddev/typings-suitescript-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSuiteGL.d.ts
181 lines (176 loc) · 8.43 KB
/
SuiteGL.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/**
* Represents the accounting book passed to a Custom GL Lines plug-in implementation when you save a transaction.
* Use the methods available to the book object to determine if the book is a primary or secondary book or get
* the internal NetSuite ID of the accounting book. If you use the Multi-Book Accounting feature, the
* AccountingBook object represents a different accounting book each time the plug-in implementation executes.
*/
interface AccountingBook {
/** Returns the internal NetSuite ID for the accounting book to be passed to a Custom GL Lines plug-in implementation. */
getId(): number;
/** Returns true if the book object is the primary accounting book for the NetSuite account or returns false if the accounting book is a secondary accounting book. */
isPrimary(): boolean;
}
/** These methods exist for both Custom lines and Standard lines. */
interface GLLine {
/** Get Account ID for a line. */
getAccountId(): number;
/** Returns the internal NetSuite ID for the class on a StandardLine or CustomLine object. */
getClassId(): number;
/** Returns the credit amount for a StandardLine or CustomLine object. */
getCreditAmount(): string;
/** Returns the debit amount for a StandardLine or CustomLine object. */
getDebitAmount(): string;
/** Returns the internal NetSuite ID for the department on a StandardLine or CustomLine object. */
getDepartmentId(): number;
/** Returns the internal NetSuite ID of the entity for a standard line. */
getEntityId(): number;
/** Returns the internal NetSuite ID for the location on a StandardLine or CustomLine object. */
getLocationId(): number;
/** Returns the Memo field on a StandardLine or CustomLine object. */
getMemo(): string;
/**
* Returns the internal NetSuite ID for the custom segment value set on the line on a StandardLine or CustomLine object.
* @param {string} segmentId
*/
getSegmentValueId(segmentId: string): number;
}
/**
* Contains all properties for a single custom line for the GL impact on a transaction.
* Use the methods available to the CustomLine object to set the values for the custom
* line and define plug-in implementation functionality based on the values. The CustomLines
* object contains a reference to each custom GL impact line.
*/
interface CustomLine extends GLLine {
/**
* Sets the account ID property for a CustomLine object in a primary or secondary book.
* @param {number} accountId Internal NetSuite ID for an account.
*/
setAccountId (accountId: number): void;
/**
* Sets the class ID property for a CustomLine object in a primary or secondary book.
* @param {number} classId Internal NetSuite ID for a class
*/
setClassId (classId: number): void;
/**
* Sets the credit amount of a CustomLine object in a primary or secondary book.
* @param {string|number} credit String value of a credit on a general ledger account. Requires a positive value.
*/
setCreditAmount (credit: string|number): void;
/**
* Sets the credit amount of a CustomLine object in a primary or secondary book.
* @param {string|number} debit String value of a debit on a general ledger account. Requires a positive value.
*/
setDebitAmount (debit: string|number): void;
/**
* Sets the department ID of a CustomLine object in a primary or secondary book.
* @param {number} departmentId
*/
setDepartmentId (departmentId: number): void;
/**
* Sets the entity ID property for a CustomLine object in a primary or secondary book to the internal NetSuite ID.
* @param {number} entityId
*/
setEntityId (entityId: number): void;
/**
* Sets the Location ID of a CustomLine object in a primary or secondary book.
* @param {number} locationId
*/
setLocationId (locationId: number): void;
/**
* Sets the Memo field on a CustomLine object. See also getMemo().
* @param {string} memo
*/
setMemo (memo: string): void;
/**
* Sets custom segment values on a CustomLine object. See also getSegmentValueId().
* @param {string} segmentId
* @param {string} segmentValueId
*/
setSegmentValueId (segmentId: string, segmentValueId: number): void;
/**
* Sets a custom GL impact line to affect only the primary book in a Custom GL plug-in implementation.
* If you use this method and set the value to false,
* the plug-in implementation copies the custom line to secondary books and the custom line is also subject to the any mapping set up for the Multi-Book Accounting feature.
*
* If you do not use this method or set the value to true, the custom GL impact line only applies to the primary accounting book and is not copied to secondary accounting books.
* @param {boolean} bookSpecific
*/
setBookSpecific(bookSpecific: boolean): void;
/**
* Returns true if the custom line is specific to the primary book and should not be copied to the secondary accounting books.
* Returns false if the custom line is not specific to the primary accounting book.
*/
isBookSpecific(): boolean;
}
/**
* Contains an array of all custom lines with GL impact in a transaction as CustomLine objects.
* Use this object to add and modify custom lines with GL impact on a transaction.
* Create a new CustomLine object with addNewLine().
*/
interface CustomLines {
/**
* Adds a CustomLine object to the parent CustomLines object in a Custom GL Lines plug-in
* implementation and returns the new object. Use this method to add a custom line with
* GL impact to a transaction. After you create the custom line, use the methods available
* to the CustomLine object to set the properties of the custom line, including the general
* ledger account ID and the amount of the custom line.
*/
addNewLine(): CustomLine;
/**
* Returns the number of custom lines with GL impact for a specific accounting book in a transaction.
* Use this method in conjunction with getLine(index) to read individual custom lines.
*/
getCount(): number;
/**
* Returns a CustomLine object that represents a custom line with GL impact.
* CustomLine objects are stored in the CustomLines object starting at index 0.
* @param {number} index
*/
getLine (index: number): CustomLine;
}
/**
* Contains all properties for a single standard line on the GL impact on a transaction.
* Use the methods available to the StandardLine object to get the values for the standard
* line and define plug-in implementation functionality based on the values. The
* StandardLines object has a StandardLine object for each standard GL impact line.
*/
interface StandardLine extends GLLine {
/**
* Returns the internal NetSuite database ID for a standard GL impact line.
* The summary line for the GL impact on a transaction occurs for most transaction types at ID of 0.
* Some transactions, like journals, do not have a summary line.
*/
getId(): number;
/** Returns the internal NetSuite ID of the subsidiary for the entity associated with a standard GL impact line. */
getSubsidiaryId(): number;
/** Returns a string that represents the amount of a standard GL line that was subject to tax. */
getTaxableAmount(): string;
/** Returns a string that represents the amount of tax charged on a standard GL line. */
getTaxAmount(): string;
/** Returns the internal NetSuite ID of the tax code for a standard GL line. */
getTaxItemId(): number;
/** Returns the tax type for a standard GL line that was subject to tax. */
getTaxType(): string;
/** Returns true if the transaction is a posting transaction and the associated standard GL impact line posts to the general ledger. */
isPosting(): boolean;
/** Returns true if a standard GL impact line is a credit to a tax account. */
isTaxable(): boolean;
}
/**
* Contains an array of all standard lines with GL impact in a transaction as StandardLine objects.
* Standard lines are the general ledger impacts that appear on the GL Impact report for a transaction.
* Use this object to access individual standard lines for an accounting book in a transaction.
*/
interface StandardLines {
/**
* Returns the number of standard lines with GL impact for a specific accounting book in a transaction.
* Use this method in conjunction with getLine(index) to read individual standard lines.
*/
getCount(): number;
/**
* Returns a StandardLine object that represents a standard line with GL impact.
* StandardLine objects are stored in the StandardLines object starting at index 0.
* @param {number} index
*/
getLine (index: number): StandardLine;
}