Skip to content

Commit

Permalink
Updates for v2.0.6 (#82)
Browse files Browse the repository at this point in the history
* Add memo and arpaymentitems missing tags (Issue #67)
* Resolve create AR payment missing check number (Issue #75)
* Add SourceLineRecordNo property to Order Entry, Purchasing, and Inventory Lines (Issue #76)
* Add DropShip and LineShipToContactName to OrderEntryTransactionLine (Issue #77)
* Remove OverrideTaxAmount and Tax from PurchasingTransactionLineUpdate XML (Issue #78)
* Change updateitemdetails to itemdetails in PurchasingTransactionLineUpdate to match schema (Issue #79)
* Add LineDeliverToContactName, Form1099Type, and Form1099Box to PurchasingTransactionLine (Issue #80)
* Add LineLevelSimpleTaxType to OrderEntryTransactionLine and PurchasingTransactionLine (Issue #73)
* Add DeliverToContactName to PurchasingTransaction (Issue #81)
  • Loading branch information
jimmymcpeter authored Nov 1, 2018
1 parent 3f96e0d commit 32db092
Show file tree
Hide file tree
Showing 19 changed files with 227 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void GetXmlTest()
<create_arpayment>
<customerid>C0020</customerid>
<paymentamount>1922.12</paymentamount>
<refid>1000</refid>
<overpaylocid>1020</overpaylocid>
<overpaydeptid>900</overpaydeptid>
<datereceived>
Expand All @@ -53,6 +54,7 @@ public void GetXmlTest()
TransactionPaymentAmount = 1922.12M,
ReceivedDate = new DateTime(2016, 06, 30),
PaymentMethod = "Printed Check",
ReferenceNumber = "1000",
OverpaymentDepartmentId = "900",
OverpaymentLocationId = "1020"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public void GetAllXmlTest()
<warehouseid>93294</warehouseid>
<quantity>2340</quantity>
<unit>593</unit>
<linelevelsimpletaxtype>Test</linelevelsimpletaxtype>
<discountpercent>10.00</discountpercent>
<price>32.35</price>
<discsurchargememo>None</discsurchargememo>
Expand Down Expand Up @@ -108,6 +109,7 @@ public void GetAllXmlTest()
WarehouseId = "93294",
Quantity = 2340,
Unit = "593",
LineLevelSimpleTaxType = "Test",
DiscountPercent = 10.00M,
Price = 32.35M,
DiscountSurchargeMemo = "None",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void GetAllXmlTest()
<warehouseid>93294</warehouseid>
<quantity>2340</quantity>
<unit>593</unit>
<linelevelsimpletaxtype>Test</linelevelsimpletaxtype>
<discountpercent>10.00</discountpercent>
<price>32.35</price>
<discsurchargememo>None</discsurchargememo>
Expand Down Expand Up @@ -110,6 +111,7 @@ public void GetAllXmlTest()
WarehouseId = "93294",
Quantity = 2340,
Unit = "593",
LineLevelSimpleTaxType = "Test",
DiscountPercent = 10.00M,
Price = 32.35M,
DiscountSurchargeMemo = "None",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public void GetAllXmlTest()
<warehouseid>93294</warehouseid>
<quantity>2340</quantity>
<unit>593</unit>
<linelevelsimpletaxtype>Test</linelevelsimpletaxtype>
<price>32.35</price>
<overridetaxamount>1.23</overridetaxamount>
<tax>9.23</tax>
Expand Down Expand Up @@ -93,6 +94,7 @@ public void GetAllXmlTest()
WarehouseId = "93294",
Quantity = 2340,
Unit = "593",
LineLevelSimpleTaxType = "Test",
Price = 32.35M,
OverrideTaxAmount = 1.23M,
Tax = 9.23M,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/*
* Copyright 2018 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.
*/

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using Intacct.SDK.Functions.InventoryControl;
using Intacct.SDK.Functions.Purchasing;
using Intacct.SDK.Functions;
using Intacct.SDK.Tests.Xml;
using Intacct.SDK.Xml;
using Xunit;

namespace Intacct.SDK.Tests.Functions.Purchasing
{
public class PurchasingTransactionLineUpdateTest : XmlObjectTestHelper
{
[Fact]
public void GetXmlTest()
{
string expected = @"<?xml version=""1.0"" encoding=""utf-8""?>
<updatepotransitem line_num=""1"">
<itemid>26323</itemid>
<quantity>2340</quantity>
</updatepotransitem>";

PurchasingTransactionLineUpdate record = new PurchasingTransactionLineUpdate()
{
LineNo = 1,
ItemId = "26323",
Quantity = 2340,
};

this.CompareXml(expected, record);
}

[Fact]
public void GetAllXmlTest()
{
string expected = @"<?xml version=""1.0"" encoding=""utf-8""?>
<updatepotransitem line_num=""1"">
<itemid>26323</itemid>
<itemdesc>Item Description</itemdesc>
<taxable>true</taxable>
<warehouseid>93294</warehouseid>
<quantity>2340</quantity>
<unit>593</unit>
<linelevelsimpletaxtype>Test</linelevelsimpletaxtype>
<price>32.35</price>
<locationid>SF</locationid>
<departmentid>Purchasing</departmentid>
<memo>Memo</memo>
<itemdetails>
<itemdetail>
<quantity>52</quantity>
<lotno>3243</lotno>
</itemdetail>
</itemdetails>
<form1099>true</form1099>
<customfields>
<customfield>
<customfieldname>customfield1</customfieldname>
<customfieldvalue>customvalue1</customfieldvalue>
</customfield>
</customfields>
<projectid>235</projectid>
<customerid>23423434</customerid>
<vendorid>797656</vendorid>
<employeeid>90295</employeeid>
<classid>243609</classid>
<contractid>9062</contractid>
<billable>true</billable>
</updatepotransitem>";

PurchasingTransactionLineUpdate record = new PurchasingTransactionLineUpdate() {
LineNo = 1,
ItemId = "26323",
ItemDescription = "Item Description",
Taxable = true,
WarehouseId = "93294",
Quantity = 2340,
Unit = "593",
LineLevelSimpleTaxType = "Test",
Price = 32.35M,
Memo = "Memo",
Billable = true,
Form1099 = true,
LocationId = "SF",
DepartmentId = "Purchasing",
ProjectId = "235",
CustomerId = "23423434",
VendorId = "797656",
EmployeeId = "90295",
ClassId = "243609",
ContractId = "9062",
CustomFields = new Dictionary<string, dynamic>
{
{ "customfield1", "customvalue1" }
}
};

TransactionItemDetail detail1 = new TransactionItemDetail()
{
Quantity = 52,
LotNumber = "3243",
};
record.ItemDetails.Add(detail1);

this.CompareXml(expected, record);
}
}
}
6 changes: 6 additions & 0 deletions Intacct.SDK/Functions/AccountsReceivable/ArPaymentApply.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class ArPaymentApply : AbstractArPayment
{

public int? SummaryRecordNo;

public string Memo;

public ArPaymentApply(string controlId = null) : base(controlId)
{
Expand All @@ -40,15 +42,19 @@ public override void WriteXml(ref IaXmlWriter xml)
xml.WriteEndElement(); //paymentdate

xml.WriteElement("batchkey", SummaryRecordNo);
xml.WriteElement("memo", Memo);
xml.WriteElement("overpaylocid", OverpaymentLocationId);
xml.WriteElement("overpaydeptid", OverpaymentDepartmentId);

if (ApplyToTransactions.Count > 0)
{
xml.WriteStartElement("arpaymentitems");
foreach (ArPaymentItem applyToTransaction in ApplyToTransactions)
{
applyToTransaction.WriteXml(ref xml);
}

xml.WriteEndElement(); //arpaymentitems
}

xml.WriteEndElement(); //apply_arpayment
Expand Down
2 changes: 2 additions & 0 deletions Intacct.SDK/Functions/AccountsReceivable/ArPaymentCreate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public override void WriteXml(ref IaXmlWriter xml)
xml.WriteElement("bankaccountid", BankAccountId);
}

xml.WriteElement("refid", ReferenceNumber);

xml.WriteElement("overpaylocid", OverpaymentLocationId);
xml.WriteElement("overpaydeptid", OverpaymentDepartmentId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace Intacct.SDK.Functions.InventoryControl
{
public class InventoryTransactionLineCreate : AbstractInventoryTransactionLine
{

public int? SourceLineRecordNo;

public InventoryTransactionLineCreate()
{
Expand All @@ -34,6 +36,7 @@ public override void WriteXml(ref IaXmlWriter xml)
xml.WriteElement("quantity", Quantity, true);
xml.WriteElement("unit", Unit);
xml.WriteElement("cost", Cost);
xml.WriteElement("sourcelinekey", SourceLineRecordNo);
xml.WriteElement("locationid", LocationId);
xml.WriteElement("departmentid", DepartmentId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public abstract class AbstractOrderEntryTransactionLine : IXmlObject
public decimal? Quantity;

public string Unit;

public string LineLevelSimpleTaxType;

public decimal? DiscountPercent;

Expand All @@ -58,6 +60,10 @@ public abstract class AbstractOrderEntryTransactionLine : IXmlObject
public string TaskNumber;

public string BillingTemplate;

public bool? DropShip;

public string LineShipToContactName;

public List<AbstractTransactionItemDetail> ItemDetails = new List<AbstractTransactionItemDetail>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace Intacct.SDK.Functions.OrderEntry
{
public class OrderEntryTransactionLineCreate : AbstractOrderEntryTransactionLine
{

public int? SourceLineRecordNo;

public OrderEntryTransactionLineCreate()
{
Expand All @@ -36,8 +38,10 @@ public override void WriteXml(ref IaXmlWriter xml)
xml.WriteElement("warehouseid", WarehouseId);
xml.WriteElement("quantity", Quantity, true);
xml.WriteElement("unit", Unit);
xml.WriteElement("linelevelsimpletaxtype", LineLevelSimpleTaxType);
xml.WriteElement("discountpercent", DiscountPercent);
xml.WriteElement("price", Price);
xml.WriteElement("sourcelinekey", SourceLineRecordNo);
xml.WriteElement("discsurchargememo", DiscountSurchargeMemo);
xml.WriteElement("locationid", LocationId);
xml.WriteElement("departmentid", DepartmentId);
Expand Down Expand Up @@ -81,6 +85,15 @@ public override void WriteXml(ref IaXmlWriter xml)
xml.WriteElement("fulfillmentstatus", FulfillmentStatus);
xml.WriteElement("taskno", TaskNumber);
xml.WriteElement("billingtemplate", BillingTemplate);

xml.WriteElement("dropship", DropShip);

if (!string.IsNullOrWhiteSpace(LineShipToContactName))
{
xml.WriteStartElement("shipto");
xml.WriteElement("contactname", LineShipToContactName, true);
xml.WriteEndElement(); //shipto
}

xml.WriteEndElement(); //sotransitem
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public override void WriteXml(ref IaXmlWriter xml)
xml.WriteElement("warehouseid", WarehouseId);
xml.WriteElement("quantity", Quantity, true);
xml.WriteElement("unit", Unit);
xml.WriteElement("linelevelsimpletaxtype", LineLevelSimpleTaxType);
xml.WriteElement("discountpercent", DiscountPercent);
xml.WriteElement("price", Price);
xml.WriteElement("discsurchargememo", DiscountSurchargeMemo);
Expand Down Expand Up @@ -99,6 +100,15 @@ public override void WriteXml(ref IaXmlWriter xml)
xml.WriteElement("fulfillmentstatus", FulfillmentStatus);
xml.WriteElement("taskno", TaskNumber);
xml.WriteElement("billingtemplate", BillingTemplate);

xml.WriteElement("dropship", DropShip);

if (!string.IsNullOrWhiteSpace(LineShipToContactName))
{
xml.WriteStartElement("shipto");
xml.WriteElement("contactname", LineShipToContactName, true);
xml.WriteEndElement(); //shipto
}

xml.WriteEndElement(); //updatesotransitem
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public abstract class AbstractPurchasingTransaction : AbstractFunction
public string ReturnToContactName;

public string PayToContactName;

public string DeliverToContactName;

public string AttachmentsId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public abstract class AbstractPurchasingTransactionLine : IXmlObject
public decimal? Quantity;

public string Unit;

public string LineLevelSimpleTaxType;

public decimal? Price;

Expand All @@ -44,7 +46,13 @@ public abstract class AbstractPurchasingTransactionLine : IXmlObject

public bool? Form1099;

public string Form1099Type;

public string Form1099Box;

public bool? Billable;

public string LineDeliverToContactName;

public List<AbstractTransactionItemDetail> ItemDetails = new List<AbstractTransactionItemDetail>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ public override void WriteXml(ref IaXmlWriter xml)
xml.WriteStartElement("payto");
xml.WriteElement("contactname", PayToContactName, true);
xml.WriteEndElement(); //payto

if (!string.IsNullOrWhiteSpace(DeliverToContactName))
{
xml.WriteStartElement("deliverto");
xml.WriteElement("contactname", DeliverToContactName, true);
xml.WriteEndElement(); //deliverto
}

xml.WriteElement("supdocid", AttachmentsId);
xml.WriteElement("externalid", ExternalId);
Expand Down
Loading

0 comments on commit 32db092

Please sign in to comment.