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
69 lines
2.4 KiB
C#
69 lines
2.4 KiB
C#
using System.Linq;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
using Centron.Data.WebServices.Sales.Receipts.Orders;
|
|
using Centron.Interfaces;
|
|
using Centron.Interfaces.BL;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using CentronSoftware.Centron.WebServices.Extensions;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.TicketTests.Ticket133365;
|
|
|
|
public class Ticket133365Tests : EndToEndTest
|
|
{
|
|
public Ticket133365Tests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
public const int SpecialAgreementI3D = 11;
|
|
public const int ReceiptOrderI3D = 4349;
|
|
public const int ReceiptOrderItemI3D = 6924;
|
|
|
|
public override void Execute()
|
|
{
|
|
this.PrepareDatabase();
|
|
|
|
this.UpdatePurchasePrices("Before", expectUpdatedPurchasePrice: false);
|
|
|
|
this.ChangeProjectPrice();
|
|
|
|
this.UpdatePurchasePrices("After", expectUpdatedPurchasePrice: true);
|
|
}
|
|
|
|
private void PrepareDatabase()
|
|
{
|
|
// Update the Order purchase-prices once to make sure that all purchase-prices are up to date
|
|
using var session = new BLSession();
|
|
var result = session.GetBL<ReceiptWebServiceBL>().UpdatePurchasePriceInReceipt(
|
|
ReceiptOrderI3D,
|
|
CentronObjectKindNumeric.OrderClass,
|
|
saveUpdatedReceipt:true,
|
|
this.GetLoggedInUser().User);
|
|
}
|
|
|
|
private void ChangeProjectPrice()
|
|
{
|
|
this.Sql($"UPDATE dbo.Sondervereinbarung SET EKVKAbschlag = 1, EKAbschlagProzent = 50 WHERE I3D = {SpecialAgreementI3D}");
|
|
}
|
|
|
|
private void UpdatePurchasePrices(string name, bool expectUpdatedPurchasePrice)
|
|
{
|
|
using var session = new BLSession();
|
|
|
|
var result = session.GetBL<ReceiptWebServiceBL>().UpdatePurchasePriceInReceipt(
|
|
ReceiptOrderI3D,
|
|
CentronObjectKindNumeric.OrderClass,
|
|
saveUpdatedReceipt: false,
|
|
this.GetLoggedInUser().User).ThrowIfError();
|
|
|
|
Assert.Equal(expectUpdatedPurchasePrice, result is not null);
|
|
|
|
var order = (ReceiptOrderDTO)session.GetBL<ReceiptWebServiceBL>().GetReceiptByI3D(ReceiptOrderI3D, CentronObjectKindNumeric.OrderClass).ThrowIfError();
|
|
var orderItem = order.Items.FirstOrDefault(f => f.I3D == ReceiptOrderItemI3D);
|
|
|
|
this.Verifier.Verify($"{name}_PurchaseBasePrice", orderItem.PurchaseBasePrice);
|
|
}
|
|
} |