-
Notifications
You must be signed in to change notification settings - Fork 33
/
OrderEntryTransactionCreate.ts
109 lines (85 loc) · 3.72 KB
/
OrderEntryTransactionCreate.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
/**
* @module Intacct/SDK/Functions/OrderEntry
*/
/**
* Copyright 2020 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "LICENSE" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
import IaXmlWriter from "../../Xml/IaXmlWriter";
import AbstractOrderEntryTransaction from "./AbstractOrderEntryTransaction";
export default class OrderEntryTransactionCreate extends AbstractOrderEntryTransaction {
public writeXml(xml: IaXmlWriter): void {
xml.writeStartElement("function");
xml.writeAttribute("controlid", this.controlId, true);
xml.writeStartElement("create_sotransaction");
xml.writeElement("transactiontype", this.transactionDefinition, true);
xml.writeStartElement("datecreated");
xml.writeDateSplitElements(this.transactionDate, true);
xml.writeEndElement(); // datecreated
if (this.glPostingDate != null) {
xml.writeStartElement("dateposted");
xml.writeDateSplitElements(this.glPostingDate);
xml.writeEndElement(); // dateposted
}
xml.writeElement("createdfrom", this.createdFrom);
xml.writeElement("customerid", this.customerId, true);
xml.writeElement("documentno", this.documentNumber);
if (this.originalDocumentDate != null) {
xml.writeStartElement("origdocdate");
xml.writeDateSplitElements(this.originalDocumentDate);
xml.writeEndElement(); // origdocdate
}
xml.writeElement("referenceno", this.referenceNumber);
xml.writeElement("termname", this.paymentTerm);
if (this.dueDate != null) {
xml.writeStartElement("datedue");
xml.writeDateSplitElements(this.dueDate, true);
xml.writeEndElement(); // datedue
}
xml.writeElement("message", this.message);
xml.writeElement("shippingmethod", this.shippingMethod);
if (this.shipToContactName != null) {
xml.writeStartElement("shipto");
xml.writeElement("contactname", this.shipToContactName, true);
xml.writeEndElement(); // shipto
}
if (this.billToContactName != null) {
xml.writeStartElement("billto");
xml.writeElement("contactname", this.billToContactName, true);
xml.writeEndElement(); // billto
}
xml.writeElement("supdocid", this.attachmentsId);
xml.writeElement("externalid", this.externalId);
this.writeXmlMultiCurrencySection(xml);
xml.writeElement("vsoepricelist", this.vsoePriceList);
xml.writeCustomFieldsExplicit(this.customFields);
xml.writeElement("state", this.state);
xml.writeElement("projectid", this.projectId);
xml.writeStartElement("sotransitems");
if (this.lines != null && this.lines.length > 0) {
for (const line of this.lines) {
line.writeXml(xml);
}
}
xml.writeEndElement(); // sotransitems
if (this.subtotals != null && this.subtotals.length > 0) {
xml.writeStartElement("subtotals");
for (const subtotal of this.subtotals) {
subtotal.writeXml(xml);
}
xml.writeEndElement(); // subtotals
}
xml.writeEndElement(); // create_sotransaction
xml.writeEndElement(); // function
}
}