Skip to content

Instantly share code, notes, and snippets.

View kulvirTAC's full-sized avatar

Kulvir Kaila kulvirTAC

View GitHub Profile
@kulvirTAC
kulvirTAC / CreateSO.cs
Created October 18, 2020 03:11
Amazon Integration Change
private void SetSOHeaderObjectsData(PrepareAndImportOrdersParams orderParams)
{
SOOrder newOrder = new SOOrder();
if (orderParams.objSOOrderEntry.sosetup.Current != null)
{
if (orderParams.objSOAmazonSetup.GuestCustID.HasValue)
{
newOrder.OrderType = orderParams.objSOAmazonSetup.OrderType;
newOrder = (SOOrder)orderParams.objSOOrderEntry.Document.Cache.Insert(newOrder);
newOrder.CustomerID = orderParams.objSOAmazonSetup.GuestCustID;
"TaxDetails": [
{
"id": "bc0fc7b0-ce58-47eb-a1cf-dba9eee671aa",
"rowNumber": 1,
"note": null,
"TaxableAmount": {
"value": 0.0000
},
"TaxAmount": {
"value": 0.0000
//Update price and repair item type when inventory ID of repair item
//is updated.
protected void _(Events.FieldUpdated<RSSVRepairItem,
RSSVRepairItem.inventoryID> e)
{
RSSVRepairItem row = e.Row;
if (row.InventoryID != null && row.RepairItemType == null)
{
//Use the PXSelector attribute to select the stock item.
@kulvirTAC
kulvirTAC / UnitTestOrder.cs
Last active May 15, 2023 20:38
Unit Test Order
public UnitTestOrder(ITestOutputHelper output)
{
this.output = output;
var config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddUserSecrets<UnitTestOrder>()
.AddEnvironmentVariables()
.Build();
@kulvirTAC
kulvirTAC / OrderMissingInventoryTest.cs
Created May 15, 2023 20:40
Order Missing Inventory Test
/// <summary>
/// Test error when inventory is missing from Acumatica
/// when adding order
/// </summary>
[Fact]
public void OrderMissingInventoryTest()
{
try
{
string createdOrder = service.AddOrder(Properties.Resources.OrderMissingInventory);
@kulvirTAC
kulvirTAC / Missing.json
Created May 15, 2023 20:41
Missing Inventory Json
{
"id": "xxxxx",
"rowNumber": 1,
"note": {
"value": ""
},
"error": "Unit conversion is missing.; Unit conversion is missing.",
}
{
"id": "xxxxx",
"rowNumber": 1,
"InventoryID": {
"error": "'Inventory ID' cannot be empty."
},
"UOM": {
"error": "'UOM' cannot be empty."
}
}
var textBytes = Encoding.UTF8.GetBytes("Hello world!");
// after: 72 101 108 108 111 32 119 111 114 108 100 33
var base64String = Convert.ToBase64String(textBytes, 6, 6);
// after: d29ybGQh