This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
|
|
||||||
test one wo per invoice vs multiple per invoice
|
|
||||||
test wo with mulitple items
|
|
||||||
|
|
||||||
change accounting integration status to be appropriate for viewing in workorder
|
change accounting integration status to be appropriate for viewing in workorder
|
||||||
Proper case and something like "Accounting integration edit".
|
Proper case and something like "Accounting integration edit".
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace AyaNovaQBI
|
|||||||
get { return new Guid("{82CD3609-4601-4C1A-9633-7836F92D2D06}"); }
|
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 TEST_ROUTE = "notify/hello";
|
||||||
public const string API_BASE_ROUTE = "api/v8/";
|
public const string API_BASE_ROUTE = "api/v8/";
|
||||||
@@ -2818,8 +2818,8 @@ namespace AyaNovaQBI
|
|||||||
|
|
||||||
//filter out any redundant information
|
//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
|
//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(filteroutname + "\r\n", "");
|
||||||
b.DeliveryAddress=b.DeliveryAddress.Replace(filteroutcontact + "\r\n", "");
|
b.DeliveryAddress = b.DeliveryAddress.Replace(filteroutcontact + "\r\n", "");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -6168,7 +6168,6 @@ namespace AyaNovaQBI
|
|||||||
|
|
||||||
#endregion wo_mismatch_scan
|
#endregion wo_mismatch_scan
|
||||||
|
|
||||||
|
|
||||||
#region Invoice
|
#region Invoice
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -6718,14 +6717,9 @@ namespace AyaNovaQBI
|
|||||||
}
|
}
|
||||||
#endregion loan item expense
|
#endregion loan item expense
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//Set memo field
|
//Set memo field
|
||||||
if (QDat.SetMemoField)
|
if (QDat.SetMemoField)
|
||||||
@@ -6734,19 +6728,14 @@ namespace AyaNovaQBI
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//This is intended to be called after already sucessfully connected
|
//This is intended to be called after already sucessfully connected
|
||||||
//to get version info so no special safety checks here
|
//to get version info so no special safety checks here
|
||||||
sessionManager.OpenConnection2("", "AyaNova QBI", ENConnectionType.ctLocalQBDLaunchUI);
|
sessionManager.OpenConnection2("", "AyaNova QBI", ENConnectionType.ctLocalQBDLaunchUI);
|
||||||
sessionManager.BeginSession("", ENOpenMode.omDontCare);
|
sessionManager.BeginSession("", ENOpenMode.omDontCare);
|
||||||
booSessionBegun = true;
|
booSessionBegun = true;
|
||||||
|
|
||||||
|
|
||||||
IMsgSetResponse responseSet = sessionManager.DoRequests(requestSet);
|
IMsgSetResponse responseSet = sessionManager.DoRequests(requestSet);
|
||||||
|
|
||||||
|
|
||||||
IResponse response = responseSet.ResponseList.GetAt(0);
|
IResponse response = responseSet.ResponseList.GetAt(0);
|
||||||
//nonzero indicates an error this is unrecoverable
|
//nonzero indicates an error this is unrecoverable
|
||||||
//so throw an exception
|
//so throw an exception
|
||||||
@@ -6768,28 +6757,10 @@ namespace AyaNovaQBI
|
|||||||
booSessionBegun = false;
|
booSessionBegun = false;
|
||||||
sessionManager.CloseConnection();
|
sessionManager.CloseConnection();
|
||||||
|
|
||||||
//If Successful post:
|
|
||||||
//Loop through all workorders again and set their invoice number, status and close them
|
|
||||||
|
|
||||||
//Loop through alworkorders
|
//Loop through alworkorders
|
||||||
foreach (long WorkOrderId in selectedWorkOrderIdList)
|
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
|
//First, set status to editable one and also to show that QBI made changes
|
||||||
|
|
||||||
var a = await GetAsync($"workorder/{WorkOrderId}");
|
var a = await GetAsync($"workorder/{WorkOrderId}");
|
||||||
WorkOrder w = a.ObjectResponse["data"].ToObject<WorkOrder>();
|
WorkOrder w = a.ObjectResponse["data"].ToObject<WorkOrder>();
|
||||||
if (w != null)
|
if (w != null)
|
||||||
@@ -6839,15 +6810,10 @@ namespace AyaNovaQBI
|
|||||||
alErrors.Add("Invoice: Invoicing failed due to the following error:\r\n" + ex.Message);
|
alErrors.Add("Invoice: Invoicing failed due to the following error:\r\n" + ex.Message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add text to the invoice
|
/// Add text to the invoice
|
||||||
/// chopping into chunks less than the max 4095 characters limit
|
/// 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)
|
#endregion qbi stuff (anything not api)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user