QuellCode/CentronERP war nur als Gitlink (Submodul-Referenz auf 79c1142) getrackt, ohne .gitmodules und ohne erreichbares Remote. Der Untersuchungsgegenstand der Versuchsreihe war damit nicht reproduzierbar gesichert: Ein Klon haette ein leeres Verzeichnis erhalten, und die Belege der 3.287 Anforderungen waeren nicht ueberpruefbar gewesen. Umstellung: - Historie nach c:\DEV\CentronERP_git_snapshot_79c1142 ausgelagert (vollstaendig lesbar, enthaelt 79c1142 und Vorgaenger 89ccfd6) - Gitlink aus dem Index entfernt - Dateiinhalt aufgenommen: 24.557 Dateien, rund 333 MB Die verschachtelte .gitignore der Codebasis gilt weiter, Build-Artefakte bleiben ausgeschlossen. Details in Versuche/Versuch_01/_Codebasis-Nachweis.md
475 lines
23 KiB
C#
475 lines
23 KiB
C#
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.Sales.Receipts.DataAndResults;
|
|
using Centron.BusinessLogic.Sales.Receipts.SupplierOrders;
|
|
using Centron.BusinessLogic.WebServices.Purchasing.OrderSuggestionList;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts.DataAndResults;
|
|
using Centron.Data.Entities.Administration.Logins;
|
|
using Centron.Data.WebServices.Sales.Receipts;
|
|
using Centron.Data.WebServices.Sales.Receipts.Invoices;
|
|
using Centron.Data.WebServices.Sales.Receipts.Orders;
|
|
using Centron.Interfaces;
|
|
using Centron.Interfaces.Administration.Environment;
|
|
using Centron.Interfaces.BL;
|
|
using Centron.Interfaces.Purchasing.OrderSuggestionList;
|
|
using Centron.Interfaces.Sales.Receipts;
|
|
using Centron.Interfaces.Sales.Receipts.InsertReceipts;
|
|
using Centron.Interfaces.Warehousing;
|
|
using Centron.Tests.EndToEnd.Infrastructure.Verifier;
|
|
using CentronSoftware.Centron.WebServices.Entities.Purchasing.OrderSuggestionList;
|
|
using CentronSoftware.Centron.WebServices.Entities.Sales.Receipts.SupplierDeliveryLists;
|
|
using CentronSoftware.Centron.WebServices.Entities.Sales.Receipts.SupplierInvoices;
|
|
using CentronSoftware.Centron.WebServices.Entities.Sales.Receipts.SupplierOrders;
|
|
using CentronSoftware.Centron.WebServices.EntitiesWrongPlace.Sales.Receipts.DataAndResults;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Xunit;
|
|
|
|
namespace Centron.Tests.EndToEnd.Tests.SupplierReceipts
|
|
{
|
|
public class SupplierReceiptTestsSharedCode
|
|
{
|
|
private readonly CentronVerifier _verifier;
|
|
|
|
public SupplierReceiptTestsSharedCode(CentronVerifier verifier)
|
|
{
|
|
_verifier = verifier;
|
|
}
|
|
|
|
internal int CreateCustomerOrder(LoggedInUser currentUser, string verifierPrefix)
|
|
{
|
|
Result<CreateReceiptResultDTO> newOrderResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
newOrderResult = session.GetBL<ReceiptWebServiceBL>().CreateNewReceipt(
|
|
CentronObjectKindNumeric.OrderClass,
|
|
currentUser, 10020, new CreateReceiptData()
|
|
{
|
|
IgnoreCallbacks = true
|
|
}, null, null, false, true, false);
|
|
Assert.True(newOrderResult.Status == ResultStatus.Success, newOrderResult.Message);
|
|
}
|
|
|
|
var newOrder = (ReceiptOrderDTO)newOrderResult.Data.Receipt;
|
|
|
|
// Insert PATCHKABEL Article. It has no scan barcodes. With 5 Quantity
|
|
Result<ArticleReceiptItemsResultDTO> receiptItemsResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
receiptItemsResult = session.GetBL<ReceiptItemWebServiceBL>().CreateArticleReceiptItems(
|
|
newOrder, false, 36, null, null, -1, currentUser);
|
|
Assert.True(receiptItemsResult.Status == ResultStatus.Success, receiptItemsResult.Message);
|
|
}
|
|
receiptItemsResult.Data.ReceiptItems.First().QuantityComplete = 5;
|
|
newOrder.Items.AddRange(receiptItemsResult.Data.ReceiptItems.Cast<ReceiptOrderItemDTO>());
|
|
|
|
// Insert 11056050 Article. It has scan barcodes. With 7 Quantity
|
|
using (var session = new BLSession())
|
|
{
|
|
receiptItemsResult = session.GetBL<ReceiptItemWebServiceBL>().CreateArticleReceiptItems(
|
|
newOrder, false, 23, null, null, -1, currentUser);
|
|
Assert.True(receiptItemsResult.Status == ResultStatus.Success, receiptItemsResult.Message);
|
|
}
|
|
receiptItemsResult.Data.ReceiptItems.First().QuantityComplete = 7;
|
|
newOrder.Items.AddRange(receiptItemsResult.Data.ReceiptItems.Cast<ReceiptOrderItemDTO>());
|
|
|
|
Result<SaveReceiptResultDTO> saveReceiptResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
saveReceiptResult = session.GetBL<ReceiptWebServiceBL>().SaveReceipt(newOrder, currentUser.User,
|
|
new SaveReceiptData()
|
|
{
|
|
IgnoreCallbacks = true
|
|
}, false, CreatedThroughApplication.CentronNet, null);
|
|
Assert.True(saveReceiptResult.Status == ResultStatus.Success, saveReceiptResult.Message);
|
|
}
|
|
|
|
if (!string.IsNullOrWhiteSpace(verifierPrefix))
|
|
{
|
|
Verify_Article_Fields(verifierPrefix, "AfterOrderCreated");
|
|
}
|
|
|
|
return saveReceiptResult.Data.Receipt.I3D;
|
|
}
|
|
|
|
internal ReceiptSupplierOrderDTO CreateSupplierOrderForCustomerOrder(LoggedInUser currentUser,
|
|
string verifierPrefix, int customerOrderI3D)
|
|
{
|
|
Result<CreateReceiptResultDTO> receiptCreatedResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
receiptCreatedResult = session.GetBL<ReceiptWebServiceBL>().CreateNewReceipt(
|
|
CentronObjectKindNumeric.SupplierOrder,
|
|
currentUser, 70012, new CreateReceiptData()
|
|
{
|
|
IgnoreCallbacks = true
|
|
}, null, null, false, true, false);
|
|
Assert.True(receiptCreatedResult.Status == ResultStatus.Success, receiptCreatedResult.Message);
|
|
}
|
|
|
|
var newReceipt = (ReceiptSupplierOrderDTO)receiptCreatedResult.Data.Receipt;
|
|
|
|
Result<IList<SuggestionBaseDTO>> suggestionResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
suggestionResult = session.GetBL<OrderSuggestionListWebServiceBL>().GetOrderSuggestionOrder(currentUser,
|
|
new OrderSuggestionFilter() { OrderI3Ds = new List<int>() { customerOrderI3D } });
|
|
Assert.True(suggestionResult.Status == ResultStatus.Success, suggestionResult.Message);
|
|
}
|
|
|
|
// Fill alt. delivery address
|
|
newReceipt.DeliveryAddress = "Supplier Delivery Address Example\nStreet 123\nCity, Country";
|
|
newReceipt.DeliveryAddressInformation = "Leave at the front desk.";
|
|
newReceipt.DeliveryAddressCustomerI3D = 10008;
|
|
newReceipt.DeliveryAddressAddressI3D = 29;
|
|
newReceipt.DeliveryAddressContactPersonI3D = 43;
|
|
newReceipt.ReceiptReceiverDelivery = new CentronSoftware.Centron.WebServices.Entities.Sales.Receipts.ReceiptReceiver.ReceiptReceiverDTO()
|
|
{
|
|
CompanyName = "Supplier Company",
|
|
Street = "Supplier Street 1",
|
|
Zip = "12345",
|
|
City = "Supplier City",
|
|
Country = "Supplier Country",
|
|
ContactName = "Supplier Contact",
|
|
AdditionalAddressSupplement = "",
|
|
ContactDepartment = "Sales",
|
|
Department = "Purchasing",
|
|
HasPostOfficeBox = false,
|
|
HouseNumber = "1",
|
|
PostOfficeBox = "",
|
|
CountryI3D = 1,
|
|
AccountI3D = 7,
|
|
CustomerNumber = 10008,
|
|
SupplierNumber = null
|
|
};
|
|
|
|
foreach (var orderPositionSuggestion in suggestionResult.Data)
|
|
{
|
|
Result<ArticleReceiptItemsResultDTO> newArticleResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
newArticleResult = session.GetBL<ReceiptItemWebServiceBL>().CreateArticleReceiptItems(newReceipt, false,
|
|
orderPositionSuggestion.ArticleI3D, null, null, orderPositionSuggestion.WarehouseI3D.GetValueOrDefault(-1),
|
|
currentUser);
|
|
Assert.True(newArticleResult.Status == ResultStatus.Success, newArticleResult.Message);
|
|
}
|
|
|
|
bool articleDone = false;
|
|
foreach (var receiptItem in newArticleResult.Data.ReceiptItems)
|
|
{
|
|
ReceiptSupplierOrderItemDTO supplierOrderItem = (ReceiptSupplierOrderItemDTO)receiptItem;
|
|
if (!articleDone && receiptItem.ArticleI3D == orderPositionSuggestion.ArticleI3D)
|
|
{
|
|
var quantity = orderPositionSuggestion.OrderItemQuantity - orderPositionSuggestion.OrderItemQuantityProcessed - orderPositionSuggestion.OrderItemIntake - orderPositionSuggestion.ConsignmentQuantity;
|
|
receiptItem.QuantityComplete = quantity;
|
|
supplierOrderItem.QuantityNeeded = quantity;
|
|
// Force a issue from ticket 146205. There is a order item I3D reference, but order I3D is 0. After safe it should be filled again.
|
|
// supplierOrderItem.ReceiptOrderI3D = orderPositionSuggestion.OrderI3D;
|
|
supplierOrderItem.ReceiptOrderItemI3D = orderPositionSuggestion.OrderItemI3D;
|
|
supplierOrderItem.PurchaseInformations = orderPositionSuggestion.PosInfo;
|
|
if (orderPositionSuggestion.CostCenterI3D.GetValueOrDefault(0) > 0)
|
|
{
|
|
supplierOrderItem.CostCenterI3D = orderPositionSuggestion.CostCenterI3D;
|
|
}
|
|
if (orderPositionSuggestion.CostObjectI3D.GetValueOrDefault(0) > 0)
|
|
{
|
|
supplierOrderItem.CostObjectI3D = orderPositionSuggestion.CostObjectI3D;
|
|
}
|
|
|
|
if (!String.IsNullOrWhiteSpace(orderPositionSuggestion.ArticleText))
|
|
supplierOrderItem.Text = orderPositionSuggestion.ArticleText;
|
|
|
|
if ((orderPositionSuggestion.SpecialAgreementI3D > 0) &&
|
|
orderPositionSuggestion.PurchasePrice > 0)
|
|
{
|
|
supplierOrderItem.BasePrice = orderPositionSuggestion.PurchasePrice;
|
|
}
|
|
|
|
articleDone = true;
|
|
}
|
|
newReceipt.Items.Add(supplierOrderItem);
|
|
}
|
|
|
|
if (!String.IsNullOrWhiteSpace(orderPositionSuggestion.SpecialAgreementReason))
|
|
{
|
|
string text = String.Empty;
|
|
if (!String.IsNullOrWhiteSpace(orderPositionSuggestion.SpecialAgreement))
|
|
{
|
|
text = orderPositionSuggestion.SpecialAgreement + Environment.NewLine;
|
|
}
|
|
text += orderPositionSuggestion.SpecialAgreementReason;
|
|
ReceiptSupplierOrderItemDTO newPosResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
newPosResult = (ReceiptSupplierOrderItemDTO)session.GetBL<ReceiptItemWebServiceBL>()
|
|
.CreateFreetextReceiptItem(newReceipt, text);
|
|
}
|
|
newReceipt.Items.Add(newPosResult);
|
|
|
|
// Insert a empty pos
|
|
using (var session = new BLSession())
|
|
{
|
|
newPosResult = (ReceiptSupplierOrderItemDTO)session.GetBL<ReceiptItemWebServiceBL>()
|
|
.CreateFreetextReceiptItem(newReceipt, "");
|
|
}
|
|
newReceipt.Items.Add(newPosResult);
|
|
}
|
|
}
|
|
|
|
Result<SaveReceiptResultDTO> savedReceiptResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
savedReceiptResult = session.GetBL<ReceiptWebServiceBL>().SaveReceipt(newReceipt, currentUser.User,
|
|
new SaveReceiptData()
|
|
{
|
|
IgnoreCallbacks = true
|
|
}, false, CreatedThroughApplication.CentronNet, null);
|
|
Assert.True(savedReceiptResult.Status == ResultStatus.Success, savedReceiptResult.Message);
|
|
}
|
|
|
|
// Verify issue from Ticket 146205
|
|
Assert.True(((ReceiptSupplierOrderDTO)savedReceiptResult.Data.Receipt).Items.Where(f => f.ReceiptOrderItemI3D > 0).All(a => a.ReceiptOrderI3D > 0), "ReceiptOrderI3D is not filled after save");
|
|
|
|
if (!string.IsNullOrWhiteSpace(verifierPrefix))
|
|
{
|
|
Verify_Article_Fields(verifierPrefix, "AfterSupplierOrderCreated");
|
|
Verify_Intake_Table(verifierPrefix, "AfterSupplierOrderCreated", savedReceiptResult.Data.Receipt.I3D);
|
|
}
|
|
return (ReceiptSupplierOrderDTO)savedReceiptResult.Data.Receipt;
|
|
}
|
|
|
|
internal ReceiptSupplierDeliveryListDTO CreateSupplierDeliveryList(LoggedInUser currentUser,
|
|
string verifierPrefix, int supplierOrderI3D, bool lateBooking, bool onlyHalfQuantity = false)
|
|
{
|
|
Result<ForwardReceiptResultDTO> receiptCreatedResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
receiptCreatedResult = session.GetBL<ReceiptWebServiceBL>().ForwardReceipt(
|
|
CentronObjectKindNumeric.SupplierDeliveryList,
|
|
currentUser.User, new ForwardReceiptData()
|
|
{
|
|
IgnoreCallbacks = true,
|
|
CreateReceiptData = new CreateReceiptData()
|
|
{
|
|
IgnoreCallbacks = true
|
|
},
|
|
CreateReceiptItemsFromExistingItemsData = new List<CreateReceiptItemsFromExistingItemsData>
|
|
{
|
|
new()
|
|
{
|
|
IgnoreCallbacks = true,
|
|
},
|
|
},
|
|
}, new List<ReceiptToForward>()
|
|
{
|
|
new ReceiptToForward()
|
|
{
|
|
ReceiptI3D = supplierOrderI3D,
|
|
ReceiptKind = CentronObjectKindNumeric.SupplierOrder
|
|
}
|
|
}, null, InsertReceiptTakeoverOptions.Reference, false, false);
|
|
Assert.True(receiptCreatedResult.Status == ResultStatus.Success, receiptCreatedResult.Message);
|
|
}
|
|
|
|
var newReceipt = (ReceiptSupplierDeliveryListDTO)receiptCreatedResult.Data.Receipt;
|
|
newReceipt.LateBooking = lateBooking;
|
|
|
|
var nonBarcodeArticle = newReceipt.Items.First(f => f.ArticleCode == "PATCHKABEL");
|
|
var barcodeArticle = newReceipt.Items.First(f => f.ArticleCode == "11056050");
|
|
if (onlyHalfQuantity)
|
|
{
|
|
nonBarcodeArticle.QuantityComplete = Math.Round(nonBarcodeArticle.QuantityComplete.GetValueOrDefault(0) / 2, 0);
|
|
barcodeArticle.QuantityComplete = Math.Round(barcodeArticle.QuantityComplete.GetValueOrDefault(0) / 2, 0);
|
|
}
|
|
|
|
for (int i = 1; i <= (int)barcodeArticle.QuantityComplete.GetValueOrDefault(0); i++)
|
|
{
|
|
barcodeArticle.Barcodes.Add(new ReceiptItemBarcode()
|
|
{
|
|
IsActive = true,
|
|
BarcodeCaption = $"20210902{(onlyHalfQuantity ? "H" : "")}{i}",
|
|
BarcodeI3D = 0,
|
|
WarehouseI3D = -1,
|
|
WarehouseCaption = "Hauptlager",
|
|
CurrentBarcodeState = BarcodeState.InIntake
|
|
});
|
|
}
|
|
|
|
Result<SaveReceiptResultDTO> savedReceiptResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
savedReceiptResult = session.GetBL<ReceiptWebServiceBL>().SaveReceipt(newReceipt, currentUser.User,
|
|
new SaveReceiptData()
|
|
{
|
|
IgnoreCallbacks = true
|
|
}, false, CreatedThroughApplication.CentronNet, null);
|
|
Assert.True(savedReceiptResult.Status == ResultStatus.Success, savedReceiptResult.Message);
|
|
}
|
|
|
|
if (!string.IsNullOrWhiteSpace(verifierPrefix))
|
|
{
|
|
Verify_Article_Fields(verifierPrefix, "AfterSupplierDeliveryListCreated");
|
|
Verify_Intake_Table(verifierPrefix, "AfterSupplierDeliveryListCreated", supplierOrderI3D);
|
|
}
|
|
return (ReceiptSupplierDeliveryListDTO)savedReceiptResult.Data.Receipt;
|
|
}
|
|
|
|
internal ReceiptSupplierInvoiceDTO CreateSupplierInvoice(LoggedInUser currentUser,
|
|
string verifierPrefix, int supplierOrderI3D, int supplierDeliveryListI3D, bool closeInvoice = true)
|
|
{
|
|
Result<ForwardReceiptResultDTO> receiptCreatedResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
receiptCreatedResult = session.GetBL<ReceiptWebServiceBL>().ForwardReceipt(
|
|
CentronObjectKindNumeric.SupplierInvoice,
|
|
currentUser.User, new ForwardReceiptData()
|
|
{
|
|
IgnoreCallbacks = true,
|
|
CreateReceiptData = new CreateReceiptData()
|
|
{
|
|
IgnoreCallbacks = true
|
|
},
|
|
CreateReceiptItemsFromExistingItemsData = new List<CreateReceiptItemsFromExistingItemsData>
|
|
{
|
|
new()
|
|
{
|
|
IgnoreCallbacks = true,
|
|
},
|
|
},
|
|
}, new List<ReceiptToForward>()
|
|
{
|
|
new ReceiptToForward()
|
|
{
|
|
ReceiptI3D = supplierDeliveryListI3D,
|
|
ReceiptKind = CentronObjectKindNumeric.SupplierDeliveryList
|
|
}
|
|
}, null, InsertReceiptTakeoverOptions.Reference, false, false);
|
|
Assert.True(receiptCreatedResult.Status == ResultStatus.Success, receiptCreatedResult.Message);
|
|
}
|
|
|
|
var newReceipt = (ReceiptSupplierInvoiceDTO)receiptCreatedResult.Data.Receipt;
|
|
if (closeInvoice)
|
|
{
|
|
newReceipt.State = ReceiptState.Completed;
|
|
}
|
|
|
|
Result<SaveReceiptResultDTO> savedReceiptResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
savedReceiptResult = session.GetBL<ReceiptWebServiceBL>().SaveReceipt(newReceipt, currentUser.User,
|
|
new SaveReceiptData()
|
|
{
|
|
IgnoreCallbacks = true
|
|
}, false, CreatedThroughApplication.CentronNet, null);
|
|
Assert.True(savedReceiptResult.Status == ResultStatus.Success, savedReceiptResult.Message);
|
|
}
|
|
|
|
if (!string.IsNullOrWhiteSpace(verifierPrefix))
|
|
{
|
|
Verify_Article_Fields(verifierPrefix, "AfterSupplierInvoiceCreated");
|
|
Verify_Intake_Table(verifierPrefix, "AfterSupplierInvoiceCreated", supplierOrderI3D);
|
|
}
|
|
return (ReceiptSupplierInvoiceDTO)savedReceiptResult.Data.Receipt;
|
|
}
|
|
|
|
internal ReceiptInvoiceDTO CreateInvoice(LoggedInUser currentUser,
|
|
string verifierPrefix, int customerOrderI3D)
|
|
{
|
|
Result<ForwardReceiptResultDTO> receiptCreatedResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
receiptCreatedResult = session.GetBL<ReceiptWebServiceBL>().ForwardReceipt(
|
|
CentronObjectKindNumeric.InvoiceClass,
|
|
currentUser.User, new ForwardReceiptData()
|
|
{
|
|
IgnoreCallbacks = true,
|
|
CreateReceiptData = new CreateReceiptData()
|
|
{
|
|
IgnoreCallbacks = true
|
|
},
|
|
CreateReceiptItemsFromExistingItemsData = new List<CreateReceiptItemsFromExistingItemsData>
|
|
{
|
|
new()
|
|
{
|
|
IgnoreCallbacks = true,
|
|
},
|
|
},
|
|
}, new List<ReceiptToForward>()
|
|
{
|
|
new ReceiptToForward()
|
|
{
|
|
ReceiptI3D = customerOrderI3D,
|
|
ReceiptKind = CentronObjectKindNumeric.OrderClass
|
|
}
|
|
}, null, InsertReceiptTakeoverOptions.Reference, true, false);
|
|
Assert.True(receiptCreatedResult.Status == ResultStatus.Success, receiptCreatedResult.Message);
|
|
}
|
|
|
|
var newReceipt = (ReceiptInvoiceDTO)receiptCreatedResult.Data.Receipt;
|
|
|
|
Result<SaveReceiptResultDTO> savedReceiptResult;
|
|
using (var session = new BLSession())
|
|
{
|
|
savedReceiptResult = session.GetBL<ReceiptWebServiceBL>().SaveReceipt(newReceipt, currentUser.User,
|
|
new SaveReceiptData()
|
|
{
|
|
IgnoreCallbacks = true
|
|
}, false, CreatedThroughApplication.CentronNet, null);
|
|
Assert.True(savedReceiptResult.Status == ResultStatus.Success, savedReceiptResult.Message);
|
|
}
|
|
|
|
if (!string.IsNullOrWhiteSpace(verifierPrefix))
|
|
{
|
|
Verify_Article_Fields(verifierPrefix, "AfterInvoiceCreated");
|
|
}
|
|
return (ReceiptInvoiceDTO)savedReceiptResult.Data.Receipt;
|
|
}
|
|
|
|
internal void Verify_Article_Fields(string prefix, string step)
|
|
{
|
|
var sql = @"SELECT article.I3D, article.Artikelcode, article.AuftragsBestand AS OrderQuantity, ISNULL(article.LieferBestand,0) AS DeliveryQuantity,
|
|
ISNULL(intake.IntakeOrd,0) AS Intake, cnt.cnt AS InStock
|
|
FROM dbo.ARTIK article
|
|
INNER JOIN dbo.cvw_ArticleCount cnt ON cnt.ArtikelI3D = article.I3D AND cnt.LagerI3D = -1
|
|
LEFT OUTER JOIN (select ap.ArtikelI3D ArticleI3D, bp.NebenlagerI3D WarehouseI3D, Cast(sum(i.Intake) AS FLoat) IntakeOrd
|
|
from intake i
|
|
inner join BestPos2 bp on bp.i3d = i.BookingID
|
|
INNER JOIN AufPos ap ON ap.I3D = bp.EKAusAufPosI3D
|
|
inner join BestKopf2 bk on bk.I3D = bp.BestKopfI3D -- and bk.Status = 1
|
|
WHERE bk.Direktlieferung = 0
|
|
AND i.Intake > 0
|
|
AND IsNull(ap.SondervereinbarungI3D,0) <= 0
|
|
GROUP BY ap.ArtikelI3D, bp.NebenlagerI3D) intake ON intake.ArticleI3D = article.I3D AND intake.WarehouseI3D = cnt.LagerI3D
|
|
WHERE article.I3D IN (36, 23)";
|
|
|
|
_verifier.VerifySql($"{prefix}_ArticleFieldsVerifier_{step}", sql);
|
|
}
|
|
|
|
internal void Verify_Intake_Table(string prefix, string step, int supplierOrderI3D)
|
|
{
|
|
var sql = $@"SELECT intake.*
|
|
FROM dbo.Intake2 intake
|
|
INNER JOIN dbo.BestPos2 bp ON bp.I3D = intake.BookingID
|
|
INNER JOIN dbo.BestKopf2 bk ON bk.I3D = bp.BestKopfI3D
|
|
WHERE bk.AktuelleVersion = 1
|
|
AND bk.I3D = {supplierOrderI3D}";
|
|
|
|
_verifier.VerifySql($"{prefix}_IntakeFieldsVerifier_{step}", sql);
|
|
}
|
|
|
|
internal void Verify_Receipt(LoggedInUser currentUser, string prefix, string step,
|
|
int receiptI3D, CentronObjectKindNumeric receiptKind)
|
|
{
|
|
using var session = new BLSession();
|
|
var receipt = session.GetBL<ReceiptWebServiceBL>().GetReceiptByI3D(receiptI3D, receiptKind, currentUser);
|
|
var testCaption = $"{prefix}_{receiptKind}ReceiptVerifier_{step}";
|
|
_verifier.Verify(testCaption, receipt, new CentronVerifierSettings()
|
|
{
|
|
CleanupDateTimeValues = true,
|
|
CleanupGuidValues = true,
|
|
CleanupDateTimeOffsetValues = true
|
|
});
|
|
}
|
|
}
|
|
} |