Files
Christoph Schwörer f045b99a25 Codebasis als Dateien ins Arbeitsrepo statt als Gitlink
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
2026-08-26 07:43:51 +02:00

43 lines
1.6 KiB
C#

using Centron.BusinessLogic;
using Centron.BusinessLogic.Sales.Receipts.ArticleSearch;
using Centron.BusinessLogic.Sales.Receipts.Internal;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.TicketTests.Ticket126433;
public class Ticket126433Tests : EndToEndTest
{
public Ticket126433Tests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
public override void Execute()
{
// In this Ticket 126433 the issue was a DivideByZeroException
//
// There was a contract with a fixed-price-discount
// This fixed-price-discount has to be converted to a percentage-discount (because the receipt-items only have a percentage-discount internally)
// To do that conversation, we basically do this calculation: discountAsPercentage = (discountAsFixedPrice / basePrice) * 100;
// This fails with a DivideByZeroException, if basePrice is 0
this.PrepareDatabase();
using var session = new BLSession();
var contractI3D = 22;
var article = session.GetBL<ArticleSearchBL>().GetSearchedArticle(isExternalArticle: false, articleI3D: 5, calculatePrices: false);
var (basePrice, discount) = session.GetBL<ReceiptItemPriceBL>().GetBasePrice(purchaseBasePrice: 0, article, customer: null, contractI3D);
Assert.Equal(0, basePrice);
Assert.Equal(0, discount);
}
private void PrepareDatabase()
{
this.Sql($"UPDATE dbo.VertragBepreisungArtikel SET Aenderungsart = 1");
}
}