This commit is contained in:
2022-07-12 21:19:18 +00:00
parent e09b083c1f
commit b501b9dc83
2 changed files with 4 additions and 42 deletions

View File

@@ -22,7 +22,7 @@ namespace AyaNovaQBI
get { return new Guid("{82CD3609-4601-4C1A-9633-7836F92D2D06}"); }
}
private const string ACCOUNTING_INTEGRATION_WORK_ORDER_STATUS_NAME = "z_ACCOUNTING_INTEGRATION_REQUIRED_STATUS";
private const string ACCOUNTING_INTEGRATION_WORK_ORDER_STATUS_NAME = "z_Accounting integration edit";
public const string TEST_ROUTE = "notify/hello";
public const string API_BASE_ROUTE = "api/v8/";
@@ -2818,8 +2818,8 @@ namespace AyaNovaQBI
//filter out any redundant information
//v8: QB Sample data has redundant contact and company / person name in first two address rows, not sure if this is convention or not but filtering it out if it is present
b.DeliveryAddress=b.DeliveryAddress.Replace(filteroutname+"\r\n", "");
b.DeliveryAddress=b.DeliveryAddress.Replace(filteroutcontact + "\r\n", "");
b.DeliveryAddress = b.DeliveryAddress.Replace(filteroutname + "\r\n", "");
b.DeliveryAddress = b.DeliveryAddress.Replace(filteroutcontact + "\r\n", "");
@@ -6168,7 +6168,6 @@ namespace AyaNovaQBI
#endregion wo_mismatch_scan
#region Invoice
/// <summary>
@@ -6718,14 +6717,9 @@ namespace AyaNovaQBI
}
#endregion loan item expense
}
}
}
//Set memo field
if (QDat.SetMemoField)
@@ -6734,19 +6728,14 @@ namespace AyaNovaQBI
}
//This is intended to be called after already sucessfully connected
//to get version info so no special safety checks here
sessionManager.OpenConnection2("", "AyaNova QBI", ENConnectionType.ctLocalQBDLaunchUI);
sessionManager.BeginSession("", ENOpenMode.omDontCare);
booSessionBegun = true;
IMsgSetResponse responseSet = sessionManager.DoRequests(requestSet);
IResponse response = responseSet.ResponseList.GetAt(0);
//nonzero indicates an error this is unrecoverable
//so throw an exception
@@ -6768,28 +6757,10 @@ namespace AyaNovaQBI
booSessionBegun = false;
sessionManager.CloseConnection();
//If Successful post:
//Loop through all workorders again and set their invoice number, status and close them
//Loop through alworkorders
foreach (long WorkOrderId in selectedWorkOrderIdList)
{
/*
* var a = await util.GetAsync($"workorder/{mm.WorkOrderId}");
WorkOrder w = a.ObjectResponse["data"].ToObject<WorkOrder>();
if (w == null)
throw new Exception($"FixInvoiceProblems:CHANGEAYA:PRICE: WorkOrder with id {mm.WorkOrderId} was not found in AyaNova and may have just been deleted.\r\nUnable to update wo.");
var wip = w.Items.First(z => z.Id == mm.WorkOrderItemId).Parts.First(z => z.Id == mm.WorkOrderItemPartId);
long PartId = wip.PartId;
wip.PriceOverride = mm.QBPrice;
await PutAsync("workorder/items/parts", Newtonsoft.Json.JsonConvert.SerializeObject(wip));
CREATE STATUS: {"data":{"id":0, "name":"zACCOUNTING_INTEGRATION_REQUIRED_STATUS","active":true,"notes":"Special status required for Accounting integration applications to enable modifying locked work orders.","color":"#000000FF","selectRoles":64,"removeRoles":64,"completed":false,"locked":false}}
POST STATE TO WO: {"workOrderId":557,"workOrderStatusId":8,"userId":5,"userViz":"Marian Green - Service","created":"2022-07-11T22:54:11.528Z"}
*/
//First, set status to editable one and also to show that QBI made changes
var a = await GetAsync($"workorder/{WorkOrderId}");
WorkOrder w = a.ObjectResponse["data"].ToObject<WorkOrder>();
if (w != null)
@@ -6839,15 +6810,10 @@ namespace AyaNovaQBI
alErrors.Add("Invoice: Invoicing failed due to the following error:\r\n" + ex.Message);
}
}
/// <summary>
/// Add text to the invoice
/// chopping into chunks less than the max 4095 characters limit
@@ -6900,9 +6866,7 @@ namespace AyaNovaQBI
}
#endregion
#endregion invoice
#endregion qbi stuff (anything not api)