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
49 lines
1.8 KiB
C#
49 lines
1.8 KiB
C#
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.Administration.Settings;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
using Centron.Interfaces;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.Tests.UpdatePurchasePriceInReceipts;
|
|
|
|
public class UpdatePurchasePriceInReceiptTests : EndToEndTest
|
|
{
|
|
public UpdatePurchasePriceInReceiptTests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
this.PrepareDatabase();
|
|
|
|
this.TestReceipt(CentronObjectKindNumeric.OfferClass, 6691);
|
|
this.TestReceipt(CentronObjectKindNumeric.OfferClass, 6675);
|
|
|
|
this.TestReceipt(CentronObjectKindNumeric.OfferClass, 6716);
|
|
this.TestReceipt(CentronObjectKindNumeric.OfferClass, 6716, suffix:"SecondTime");
|
|
}
|
|
|
|
private void PrepareDatabase()
|
|
{
|
|
// Enable setting for "secondary warehouses have own purchase-prices"
|
|
this.Sql($"UPDATE dbo.Stammdat SET Wert = 1 WHERE I3D = {(int)AppSettingsConst.SelfSecondstockPurchasePrice}");
|
|
// Enable "warehouse has own purchase-price" for warehouse 7 (which is used a lot in Offer 6691)
|
|
this.Sql($"UPDATE dbo.Warehouses SET IsOwnPurchasePriceActive = 1 WHERE I3D = 7");
|
|
}
|
|
|
|
private void TestReceipt(CentronObjectKindNumeric receiptKind, int receiptI3D, string suffix = "")
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var result = session.GetBL<ReceiptWebServiceBL>().UpdatePurchasePriceInReceipt(
|
|
receiptI3D,
|
|
receiptKind,
|
|
saveUpdatedReceipt: true,
|
|
this.GetLoggedInUser().User);
|
|
|
|
this.Verifier.Verify($"{receiptKind}_{receiptI3D}_{suffix}", result);
|
|
}
|
|
}
|
|
} |