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
108 lines
3.8 KiB
C#
108 lines
3.8 KiB
C#
using System.Collections.Generic;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.Sales.Receipts.DataAndResults;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
using Centron.Interfaces;
|
|
using Centron.Interfaces.Sales.Receipts.InsertReceipts;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using CentronSoftware.Centron.WebServices.EntitiesWrongPlace.Sales.Receipts.DataAndResults;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.TicketTests.Ticket128146;
|
|
|
|
public class Ticket128146Tests : EndToEndTest
|
|
{
|
|
public Ticket128146Tests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
// This order has items with QuantityPicked < CurrentQuantity
|
|
public const int OrderI3D = 1336;
|
|
public const int OrderItemI3D = 3732;
|
|
|
|
public override void Execute()
|
|
{
|
|
this.PrepareDatabase();
|
|
|
|
// In this ticket we added a callback to CreateReceiptItemsFromExistingItems
|
|
// When forwarding a receipt with QuantityPicked < CurrentQuantity, the user should get a warning message
|
|
|
|
this.ForwardReceipt(takePickedQuantity: null);
|
|
this.ForwardReceipt(takePickedQuantity: true);
|
|
this.ForwardReceipt(takePickedQuantity: false);
|
|
}
|
|
|
|
private void PrepareDatabase()
|
|
{
|
|
this.Sql("UPDATE dbo.ARTIK SET BarcodeScanen = 0 WHERE I3D = 1316");
|
|
this.Sql($"UPDATE dbo.AufPos SET Stk = 10, Kommisioniert = 5 WHERE I3D = {OrderItemI3D}");
|
|
}
|
|
|
|
private void ForwardReceipt(bool? takePickedQuantity)
|
|
{
|
|
using var session = new BLSession();
|
|
|
|
var usePickedQuantityFromItem = takePickedQuantity switch
|
|
{
|
|
null => null,
|
|
true => new List<UsePickedQuantityFromItem>
|
|
{
|
|
new UsePickedQuantityFromItem
|
|
{
|
|
ReceiptKind = CentronObjectKindNumeric.OrderClass,
|
|
ReceiptI3D = OrderI3D,
|
|
ReceiptItemI3D = OrderItemI3D,
|
|
|
|
UseOnlyPickedQuantity = true,
|
|
}
|
|
},
|
|
false => new List<UsePickedQuantityFromItem>
|
|
{
|
|
new UsePickedQuantityFromItem
|
|
{
|
|
ReceiptKind = CentronObjectKindNumeric.OrderClass,
|
|
ReceiptI3D = OrderI3D,
|
|
ReceiptItemI3D = OrderItemI3D,
|
|
|
|
UseOnlyPickedQuantity = false,
|
|
}
|
|
}
|
|
};
|
|
|
|
var forwardResult = session.GetBL<ReceiptWebServiceBL>().ForwardReceipt(
|
|
CentronObjectKindNumeric.DeliveryListClass,
|
|
this.GetLoggedInUser().User,
|
|
new ForwardReceiptData
|
|
{
|
|
IgnoreCallbacks = true,
|
|
CreateReceiptData = new CreateReceiptData
|
|
{
|
|
IgnoreCallbacks = true
|
|
},
|
|
CreateReceiptItemsFromExistingItemsData = new List<CreateReceiptItemsFromExistingItemsData>
|
|
{
|
|
new()
|
|
{
|
|
IgnoreCallbacks = false,
|
|
UsePickedQuantityFromItems = usePickedQuantityFromItem
|
|
},
|
|
},
|
|
},
|
|
new List<ReceiptToForward>
|
|
{
|
|
new ReceiptToForward
|
|
{
|
|
ReceiptKind = CentronObjectKindNumeric.OrderClass,
|
|
ReceiptI3D = OrderI3D,
|
|
ReceiptItemI3Ds = new []{ OrderItemI3D },
|
|
}
|
|
},
|
|
receiptProjectLayoutItemI3DsToForward: null,
|
|
takeoverOptions: InsertReceiptTakeoverOptions.Reference,
|
|
onlyTakeoverAvailableQuantity: false,
|
|
ignoreDefaultContract: false);
|
|
|
|
this.Verifier.Verify($"ForwardReceipt_TakePickedQuantity_{takePickedQuantity?.ToString() ?? "NULL"}", forwardResult);
|
|
}
|
|
} |