Project

General

Profile

Specification » History » Version 72

Soh Keong, 11/11/2024 03:15 PM

1 1 Soh Keong
{{toc}}
2
3
h1. Specification
4
5
h1. Programming Guide
6
7
h2. Jar version 
8
9
|_. version |_. Description                                |
10
| 1.0       | Init                                         |
11 65 Soh Keong
| 1.1       | Response Object --> Object List              |
12 69 Soh Keong
| 1.3       | Append all error with pipe symbol            |
13 70 Soh Keong
| 1.4       | Added connection rollback                    |
14 71 Soh Keong
| 1.5       | Added more than 1 Entity                     |
15 72 Soh Keong
| 1.7       | Added eCosway's state name                   |
16 1 Soh Keong
17
h2. Jar File Download
18
19 72 Soh Keong
"Jar":/redmine/attachments/816
20 56 Soh Keong
"Lib":/redmine/attachments/803
21 1 Soh Keong
"Properties":
22
23
h3. Classes
24
25
* *my.aisino.einvoice.bean* 
26
* *my.aisino.einvoice.bean.transaction* 
27
* *my.aisino.einvoice.constant* 
28
* *my.aisino.einvoice.service* 
29
* *my.aisino.einvoice.util* 
30
31
h3. properties file
32
33
* *service.properties*
34
35
# *merchant.id*       -
36
37
h2. Aisino Service
38
39
<pre>
40
my.aisino.einvoice.service.TransactionService service = new my.aisino.einvoice.service.TransactionService();
41
</pre>
42
43 8 Soh Keong
h3. submitEInvoice
44 1 Soh Keong
45
<pre>
46 13 Soh Keong
InvoiceSubmissionResponseBean responseBean = service.submitEInvoice(Connection conn, List<InvoiceSubmissionRequestBean> beanList);
47 37 Soh Keong
InvoiceSubmissionResponseBean responseBean = service.submitEInvoice(Connection conn, List<InvoiceSubmissionRequestBean> beanList, boolean insertTable);
48 1 Soh Keong
</pre>
49
50 10 Soh Keong
<pre>
51
CommonConstant = my.aisino.einvoice.constant.CommonConstant
52
</pre>
53
54 1 Soh Keong
# *conn*           - Database connection.
55 13 Soh Keong
# *beanList*       - InvoiceSubmissionRequestBean List.
56 31 Soh Keong
57 32 Soh Keong
> * *docCode*         - From Keys (TAX_DOC_SUMMARY)
58 39 Soh Keong
> * *issueMode*       - CommonConstant.ISSUE_MODE_EINVOICE_* (YES=e-invoice; NO=consolidate)
59 1 Soh Keong
> * *orderId*
60 26 Soh Keong
> * *orderDate*       - Format(yyyy-MM-dd)
61
> * *orderTime*       - Format(HH:mm:ssZ)
62
> * *originalOrderId* - For Credit Note/ Debit Note/ Refund Note
63
> * *orderTypeCode*   - CommonConstant.INVOICE_TYPE_CODE_* (https://sdk.myinvois.hasil.gov.my/codes/e-invoice-types/)
64
> * *currencyCode*    - CommonConstant.CURRENCY_CODE_* (https://sdk.myinvois.hasil.gov.my/codes/currencies/)
65 10 Soh Keong
> * *totalExcludingTax* 
66 1 Soh Keong
> * *totalIncludingTax* 
67
> * *totalPayableAmount* 
68
> * *businessSystem*  - CommonConstant.BUSINESS_SYSTEM_*
69 71 Soh Keong
> * *entity*          - CommonConstant.ENTITY_*
70 64 Soh Keong
> * *exchangeRate*    - (Optional)
71
> * *k1*              - (Optional)
72
> * *incoterms*       - (Optional)
73
> * *ftaInformation*  - (Optional)
74
> * *k2*              - (Optional)
75 60 Soh Keong
76
NON-POSTING
77 1 Soh Keong
> * *storeCode*
78 64 Soh Keong
-> * *shopperId*- (Moved to BuyerBean)
79 60 Soh Keong
80 52 Soh Keong
> * *supplierBean* : For Full Bean [new TaxDocDao().getSupplierBySupplierCode(Connection, PropBean.getCoswaySupplierCode())]
81 14 Soh Keong
> ** *addressBean* 
82
> *** *country*  - CommonConstant.COUNTRY_* (https://sdk.myinvois.hasil.gov.my/codes/countries/)
83
> *** *state*    - CommonConstant.STATE_* (https://sdk.myinvois.hasil.gov.my/codes/state-codes/)
84
> *** *city*     - Max length : 50
85
> *** *postal*   - Max length : 50
86
> *** *address1* - Max length : 150
87
> *** *address2* - Max length : 150
88
> *** *address3* - Max length : 150
89
> ** *contactNumber* - Max length : 20
90
> ** *name*          - Max length : 300
91 41 Soh Keong
> ** *msic*    - https://sdk.myinvois.hasil.gov.my/codes/msic-codes/ 
92 14 Soh Keong
> ** *registrationBean*
93 17 Soh Keong
> *** *tin*      
94 29 Soh Keong
> *** *regSchemeId*  - CommonConstant.ID_TYPE_*
95
> *** *regNo* 
96 24 Soh Keong
> *** *sst*      (Optional)
97 14 Soh Keong
98 1 Soh Keong
> * *buyerBean* 
99
> ** *buyerCode* - From keys (TAX_DOC_BUYER)
100 64 Soh Keong
> ** *shopperId*
101 14 Soh Keong
> ** *addressBean* 
102 11 Soh Keong
> *** *country*  - CommonConstant.COUNTRY_* (https://sdk.myinvois.hasil.gov.my/codes/countries/)
103 10 Soh Keong
> *** *state*    - CommonConstant.STATE_* (https://sdk.myinvois.hasil.gov.my/codes/state-codes/)
104
> *** *city*     - Max length : 50
105
> *** *address1* - Max length : 150
106
> *** *address2* - Max length : 150
107
> *** *address3* - Max length : 150
108 1 Soh Keong
> ** *contactNumber* - Max length : 20
109
> ** *name*          - Max length : 300
110
> ** *email*         
111 28 Soh Keong
> ** *registrationBean*
112
> *** *tin*      
113 29 Soh Keong
> *** *regSchemeId*  - CommonConstant.ID_TYPE_*
114
> *** *regNo* 
115 2 Soh Keong
> *** *sst*      (Optional)
116 6 Soh Keong
117 11 Soh Keong
> * *productList*
118 31 Soh Keong
> ** *docLineCode*            - From Keys (TAX_DOC_DETAIL)
119 19 Soh Keong
> ** *productName*            - Max length : 300
120
> ** *productCode*            - Max length :  18
121
> ** *measurement* (Optional) - CommonConstant.MEASUREMENT_* (https://sdk.myinvois.hasil.gov.my/codes/unit-types/)
122
> ** *quantity*    (Optional) 
123 6 Soh Keong
> ** *totalExcludingTax*
124 11 Soh Keong
> ** *unitPrice*
125
> ** *subtotal*
126 42 Soh Keong
> ** *totalDiscountAmount*   - (Optional)
127 11 Soh Keong
> ** *classificationList* 
128 19 Soh Keong
> *** *code*                 - CommonConstant.CLASSIFICATION_CODE_* (https://sdk.myinvois.hasil.gov.my/codes/classification-codes/)
129
> *** *group*                - CommonConstant.CLASSIFICATION_GROUP_* 
130 6 Soh Keong
> ** *taxTotalBean*
131 12 Soh Keong
> *** *totalTaxAmount*
132 8 Soh Keong
> *** *taxSubTotalList*
133 1 Soh Keong
> **** *taxType*          - CommonConstant.TAX_TYPE_* (https://sdk.myinvois.hasil.gov.my/codes/tax-types/)
134
> **** *percent*          (Optional)
135 8 Soh Keong
> **** *perUnitAmount*    (Optional)
136 14 Soh Keong
> **** *measurement*      (Optional) - CommonConstant.MEASUREMENT_* (https://sdk.myinvois.hasil.gov.my/codes/unit-types/)
137 16 Soh Keong
> **** *quantity*         (Optional)
138 3 Soh Keong
> **** *netAmount*        (Optional)
139
> **** *tax*
140 6 Soh Keong
141
> * *taxTotalBean*
142
> ** *totalTaxAmount*
143 1 Soh Keong
> ** *taxSubTotalList*
144 33 Soh Keong
> *** *taxType*       - CommonConstant.TAX_TYPE_* (https://sdk.myinvois.hasil.gov.my/codes/tax-types/)
145
> *** *percent*       - Optional
146
> *** *perUnitAmount* - Optional
147
> *** *measurement*   - Optional
148
> *** *quantity*      - Optional
149
> *** *netAmount*     - Optional
150
> *** *tax*           - 
151 1 Soh Keong
152
  3. *responseBean*
153
154 58 Soh Keong
> * *httpResponseCode*
155
> * *returnCode*
156
> * *returnMsg*
157 1 Soh Keong
158 66 Soh Keong
> * *responseBeanList*
159
> ** *submissionUid*
160
> ** *acceptedDocumentList*
161
> *** *orderId*
162
> *** *uuid*
163
> ** *rejectedDocumentList*
164
> *** *orderId*
165
> *** *errorList*
166
> **** *code*
167
> **** *message*
168 8 Soh Keong
169 10 Soh Keong
h3. queryEInvoice
170 8 Soh Keong
171
<pre>
172 67 Soh Keong
InvoiceInquiryResponseBean responseBean = service.queryEInvoice(InvoiceInquiryRequestBean bean);
173 8 Soh Keong
</pre>
174
175
# *conn*           - Database connection.
176 9 Soh Keong
# *bean*           - Object.
177
> * *documentNum*
178
> * *submissionUid*
179
> * *invoiceUuid*
180
> * *invoiceTypeCode*
181
> * *buyerTin*
182
> * *buyerName*
183 15 Soh Keong
> * *supplierTin*
184
> * *supplierName*
185 9 Soh Keong
> * *totalAmountFrom*
186
> * *totalAmountTo*
187
> * *invoiceStatus*
188
> * *confirmStatusCode*
189
> * *issuedDateFrom*
190
> * *issuedDateTo*
191 49 Soh Keong
> * *pageNo* (Mandatory)
192 9 Soh Keong
> * *pageSize* (Mandatory)
193
194
  3. *responseBean*
195
196
> * *page*
197
> ** *pageCount*
198
> ** *pageNo*
199
> ** *pageSize*
200
> ** *totalSize*
201
202
> * *recordList*
203
> ** *buyerTin*
204 59 Soh Keong
> ** *buyerName*
205 9 Soh Keong
> ** *confirmStatusCode*
206
> ** *currency*
207 1 Soh Keong
> ** *description*
208
> ** *documentNum*
209
> ** *excludingTaxAmount*
210
> ** *includingTaxAmount*
211
> ** *invoiceId*
212
> ** *invoiceStatus*
213
> ** *invoiceTypeCode*
214
> ** *invoiceUuid*
215
> ** *issuedDate*
216
> ** *nowTime*
217
> ** *operationDate*
218
> ** *operator*
219
> ** *pageIndex*
220
> ** *pageNo*
221
> ** *pageSize*
222 15 Soh Keong
> ** *supplierTin*
223
> ** *supplierName*
224 1 Soh Keong
> ** *submissionUid*
225 9 Soh Keong
> ** *transactionId*
226 10 Soh Keong
227
h3. cancelEInvoice
228
229
<pre>
230
InvoiceCancelResponseBean responseBean = service.cancelEInvoice(InvoiceCancelRequestBean bean);
231
</pre>
232
233
# *conn*           - Database connection.
234
# *bean*           - Object.
235 12 Soh Keong
> * *cancelCode*   - CommonConstant.CANCEL_CODE_* 
236
> * *cancelReason* - (Mandatory for CommonConstant.CANCEL_CODE_OTHERS) 
237 10 Soh Keong
> * *invoiceIds* - List of Integer
238
239
  3. *responseBean*
240
241 1 Soh Keong
> * *success* - true / false
242 67 Soh Keong
243
244
h3. queryTransaction
245
246
<pre>
247
InvoiceInquiryResponseBean responseBean = service.queryTransaction(TransactionInquiryRequestBean bean);
248
</pre>
249
250
# *conn*           - Database connection.
251
# *bean*           - Object.
252
> * *invoiceTypeCode*
253
> * *documentNum*
254
> * *supplierTin*
255
> * *businessSystem*
256
> * *buyerTin*
257
> * *buyerName*
258
> * *dateFrom*
259
> * *dateTo*
260
> * *issuedFlag*
261
> * *invoiceUuid*
262
> * *invoiceStatus*
263
> * *confirmStatusCode*
264
> * *pageNo* (Mandatory)
265
> * *pageSize* (Mandatory)
266
267
  3. *responseBean*
268
269
> * *page*
270
> ** *pageCount*
271
> ** *pageNo*
272
> ** *pageSize*
273
> ** *totalSize*
274
275
> * *recordList*
276
> ** *businessSystem*
277
> ** *storeCode*
278
> ** *buyerName*
279
> ** *buyerTin*
280
> ** *confirmStatusCode*
281
> ** *createDate*
282
> ** *currency*
283
> ** *documentNum*
284
> ** *invoiceTypeCode*
285
> ** *id*
286
> ** *invoiceUuid*
287
> ** *issuedDate*
288
> ** *issuedFlag*
289
> ** *invoiceStatus*
290
> ** *issuedDate*
291
> ** *issuedFlag*
292
> ** *nowTime*
293
> ** *operationDate*
294
> ** *operator*
295
> ** *pageIndex*
296
> ** *pageNo*
297
> ** *pageSize*
298
> ** *payableAmount*
299
> ** *submissionUid*
300
> ** *subtotal*
301
> ** *supplierId*
302
> ** *supplierName*
303
> ** *supplierTin*
304
> ** *tax*
305
> ** *total*
306
> ** *transactionDate*
307
> ** *invalidReasons*
308
309 34 Soh Keong
310
h2. CommonConstant
311
312 36 Soh Keong
|_. Name                 |_. values                                                                                                     |
313
| INTERFACE_             | LOGIN, INVOICE_ISSUANCE, INVOICE_INQUIRY, INVOICE_CANCEL, INVOICE_PURCHASE_INQUIRY, INVOICE_PURCHASE_REJECT  |
314
| RETURN_CODE_           | SUCCESS, ABNORMAL                                                                                            |
315
| INVOICE_STATUS_        | VALID, INVALID, CANCELLED, SUBMITTED                                                                         |
316
| CONFIRM_STATUS_CODE_   | AWAITING, ACCEPTED, REJECTED                                                                                 |
317
| CANCEL_CODE_           | WRONG_BUYER, WRONG_INVOICE, OTHERS                                                                           |
318
| INVOICE_TYPE_CODE_     | INVOICE, CREDIT_NOTE, DEBIT_NOTE, REFUND_NOTE, SELF_BILLED_INVOICE, SELF_BILLED_CREDIT_NOTE, SELF_BILLED_DEBIT_NOTE, SELF_BILLED_REFUND_NOTE  |
319
| TAX_DOC_STATUS_        | PENDING, VERIFIED, SUCCESS, FAIL, REJECT, DELETED                                                            |
320
| CURRENCY_CODE_         | MALAYSIA_RINGGIT                                                                                             |
321
| COUNTRY_               | MALAYSIA, SINGAPORE, BRUNEI_DARUSSALAM, THAILAND, INDONESIA, TAIWAN                                          |
322
| COUNTRY_CODE_          | MALAYSIA, SINGAPORE, BRUNEI_DARUSSALAM, THAILAND, INDONESIA, TAIWAN                                          |
323
| STATE_                 | ALL, JOHOR, KEDAH, KELANTAN, MELAKA, NEGERI_SEMBILAN, PAHANG, PULAU_PENANG, PERAK, PERLIS, SELANGOR, TERRENGANU, SABAH, SARAWAK, WILAYAH_PERSEKUTUAN_KUALA_LUMPUR, WILAYAH_PERSEKUTUAN_LABUAN, WILAYAH_PERSEKUTUAN_PUTRAJAYA, NOT_APPLICABLE                    |
324
| MEASUREMENT_           | METRE, CENTIMETRE, KILOMETRE, LITRE, KILOGRAM, GRAM                                                          |
325
| CLASSIFICATION_REF_NO_ | CONSOLIDATED, OTHERS, VOUCHER_GIFT_CARD                                                                      |
326
| CLASSIFICATION_CODE_   | CONSOLIDATED, ECOMMERCE_TO_BUYER, ECOMMERCE_SELF_BILLED_TO_SELLER, OTHERS, CLASSIFICATION_CODE_SELF_BILLED_OTHERS, CLASSIFICATION_CODE_SELF_BILLED_MONETARY_PAYMENT_TO_AGENTS, CLASSIFICATION_CODE_VOUCHER_GIFT_CARD                                       |
327
| CLASSIFICATION_GROUP_  | CLASS, PRODUCT_TARIFF_CODE                                                                                   |
328
| TAX_TYPE_              | SALES, SERVICE, TOURISM, HIGH_VALUE_GOODS, LOW_VALUE_GOODS, NOT_APPLICABLE, TAX_EXEMPTION                    |
329
| ID_TYPE_               | BRN, NRIC, PASSPORT, ARMY                                                                                    |
330
| TIN_                   | GENERAL_PUBLIC, FOREIGN_BUYER, FOREIGN_SUPPLIER, BUYER                                                       |
331
| ENTITY_                | COSWAY, ECOSWAY, RANK_DISTRIBUTOR, KIMIA_SUCHI, KIMIA_SUCHI_MARKETING, VITAL_DEGREE                          |
332
|                        | EINVOICE_REQUEST_IND, EXCLUDING_POSTING                                                                      |
333
| BUSINESS_SYSTEM_       | SALES, BONUS, HFEE                                                                                           |
334 39 Soh Keong
| ISSUE_MODE_EINVOICE_   | YES, NO                                                                                                      |
335 36 Soh Keong
| _DEFAULT               | BUYER_NAME_DEFAULT, MANDATORY_VALUES_DEFAULT                                                                 |