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
76 lines
2.7 KiB
C#
76 lines
2.7 KiB
C#
using System.Linq;
|
|
using Centron.BusinessLogic.Sales.Receipts.DataAndResults;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
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.Ticket138750;
|
|
|
|
public class Ticket138750Tests : EndToEndTest
|
|
{
|
|
public Ticket138750Tests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
public const int OfferTemplateI3D = 5503;
|
|
public const int ArticleI3D = 122;
|
|
public const decimal ArticlePrice = 5;
|
|
public const decimal VolumePrice = 20;
|
|
public const int CustomerI3D = 10000;
|
|
|
|
public override void Execute()
|
|
{
|
|
// In this ticket the problem was:
|
|
// - you have a receipt-template
|
|
// - in there is a article
|
|
// - that article has a volume-price
|
|
// - you use the receipt-template for a new receipt
|
|
// - and you say "I want to update the prices"
|
|
// => the volume-price was not used
|
|
|
|
this.PrepareDatabase();
|
|
|
|
var copiedReceipt = this.WithSession(s => s.GetBL<ReceiptWebServiceBL>().CopyReceipt(
|
|
CentronObjectKindNumeric.OfferClass,
|
|
this.GetLoggedInUser().User,
|
|
new CopyReceiptData
|
|
{
|
|
TakeoverOption = ReceiptItemTakeoverOption.None,
|
|
IgnoreCallbacks = true,
|
|
CreateReceiptData = new()
|
|
{
|
|
IgnoreCallbacks = true,
|
|
},
|
|
CreateReceiptItemsFromExistingItemsData = new()
|
|
{
|
|
IgnoreCallbacks = true,
|
|
},
|
|
},
|
|
OfferTemplateI3D,
|
|
CustomerI3D,
|
|
addressI3D: null,
|
|
contactPersonI3D: null)).ThrowIfError();
|
|
|
|
var item = copiedReceipt.Receipt.GetReceiptItems().Single(f => f.ArticleI3D == ArticleI3D);
|
|
|
|
// Should be volume-price now
|
|
Assert.Equal(VolumePrice, item.BasePrice);
|
|
}
|
|
|
|
private void PrepareDatabase()
|
|
{
|
|
// Update offer-receipt-template to have the article with the volume-price
|
|
this.Sql($"UPDATE dbo.AngPos SET ArtikelI3D = {ArticleI3D} WHERE AngKopfI3D = {OfferTemplateI3D} AND ArtikelI3D IS NOT NULL");
|
|
|
|
// Make volume-prices a bit nicer
|
|
this.Sql($"UPDATE dbo.ArtikStaffelpreise SET VK_1 = {VolumePrice}, VK_2 = {VolumePrice}, VK_3 = {VolumePrice}, VK_4 = {VolumePrice} WHERE I3D = 3");
|
|
|
|
// And give the article some prices too
|
|
this.Sql($"UPDATE dbo.Artik SET VK_1 = {ArticlePrice}, VK_2 = {ArticlePrice}, VK_3 = {ArticlePrice}, VK_4 = {ArticlePrice} WHERE I3D = {ArticleI3D}");
|
|
}
|
|
} |