This commit is contained in:
2021-06-03 19:07:05 +00:00
parent 5668deaf4d
commit 8858abda97
4 changed files with 16 additions and 9 deletions

2
.vscode/launch.json vendored
View File

@@ -53,7 +53,7 @@
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
"AYANOVA_SERVER_TEST_MODE": "false",
"AYANOVA_SERVER_TEST_MODE": "true",
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"

View File

@@ -233,11 +233,18 @@ namespace AyaNova.Biz
//values must add up
if (proposedObj.Balance != (proposedObj.Quantity + (proposedObj.LastBalance ?? 0)))
{
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Balance", "Balance incorrect (LastBalance + Quantity not equal to Balance");
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Balance", "Balance incorrect (LastBalance + Quantity not equal to Balance)");
return;
}
//Balance must not be negative
if (proposedObj.Balance < 0 )
{
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Balance", "Transaction would result in a negative balance (not enough inventory to process this transaction)");
return;
}
//date is newer than last entry date?
if (proposedObj.LastEntryDate != null && proposedObj.LastEntryDate > proposedObj.EntryDate)
{

View File

@@ -416,7 +416,7 @@ namespace AyaNova.Biz
dtInternalPartInventory i = new dtInternalPartInventory();
i.PartId = poItem.PartId;
i.PartWarehouseId = poItem.PartWarehouseId;
i.Quantity = poItem.QuantityReceived *= -1;
i.Quantity = poItem.QuantityReceived * -1;
i.SourceType = null;//null because the po no longer exists so this is technically a manual adjustment
i.SourceId = null;//''
i.Description = await Translate("PurchaseOrder") + $" {oldObj.Serial} " + await Translate("EventDeleted");
@@ -488,7 +488,7 @@ namespace AyaNova.Biz
dtInternalPartInventory i = new dtInternalPartInventory();
i.PartId = oldItem.PartId;
i.PartWarehouseId = oldItem.PartWarehouseId;
i.Quantity = oldItem.QuantityReceived *= -1;
i.Quantity = oldItem.QuantityReceived * -1;
i.SourceType = AyaType.PurchaseOrder;
i.SourceId = oldObj.Id;
i.Description = await Translate("PurchaseOrder") + $" {oldObj.Serial} " + await Translate("PurchaseOrderItem") + " " + await Translate("EventDeleted");
@@ -553,7 +553,7 @@ namespace AyaNova.Biz
dtInternalPartInventory i = new dtInternalPartInventory();
i.PartId = oldItem.PartId;
i.PartWarehouseId = oldItem.PartWarehouseId;
i.Quantity = oldItem.QuantityReceived *= -1;
i.Quantity = oldItem.QuantityReceived * -1;
i.SourceType = AyaType.PurchaseOrder;
i.SourceId = oldObj.Id;
i.Description = await Translate("PurchaseOrder") + $" {oldObj.Serial} " + await Translate("PurchaseOrderItem") + " " + await Translate("EventModified") + " " + await Translate("Part") + "/" + await Translate("PartWarehouse");

View File

@@ -3342,7 +3342,7 @@ namespace AyaNova.Biz
{
PartId = oldObj.PartId,
PartWarehouseId = oldObj.PartWarehouseId,
Quantity = oldObj.Quantity *= -1,
Quantity = oldObj.Quantity,
SourceType = null,//null because the po no longer exists so this is technically a manual adjustment
SourceId = null,//''
Description = await Translate("WorkOrderItemPart") + $" {oldObj.Serials} " + await Translate("EventDeleted")
@@ -3368,7 +3368,7 @@ namespace AyaNova.Biz
{
PartId = newObj.PartId,
PartWarehouseId = newObj.PartWarehouseId,
Quantity = newObj.Quantity,
Quantity = newObj.Quantity * -1,
SourceType = AyaType.WorkOrderItemPart,
SourceId = newObj.Id,
Description = await Translate("WorkOrderItemPart") + $" {newObj.Serials} " + await Translate("EventCreated")
@@ -3397,7 +3397,7 @@ namespace AyaNova.Biz
{
PartId = oldObj.PartId,
PartWarehouseId = oldObj.PartWarehouseId,
Quantity = oldObj.Quantity *= -1,
Quantity = oldObj.Quantity,
SourceType = null,//null because the po no longer exists so this is technically a manual adjustment
SourceId = null,//''
Description = await Translate("WorkOrderItemPart") + $" {oldObj.Serials} " + await Translate("EventDeleted")
@@ -3418,7 +3418,7 @@ namespace AyaNova.Biz
{
PartId = newObj.PartId,
PartWarehouseId = newObj.PartWarehouseId,
Quantity = newObj.Quantity,
Quantity = newObj.Quantity * -1,
SourceType = AyaType.WorkOrderItemPart,
SourceId = newObj.Id,
Description = await Translate("WorkOrderItemPart") + $" {newObj.Serials} " + await Translate("EventCreated")