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
123 lines
5.0 KiB
C#
123 lines
5.0 KiB
C#
using System.Collections.Generic;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.EmployeeArea;
|
|
using Centron.BusinessLogic.Sales.Receipts.DataAndResults;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
using Centron.Data.WebServices.Sales.Receipts;
|
|
using Centron.Data.WebServices.Sales.Receipts.Invoices;
|
|
using Centron.Interfaces;
|
|
using Centron.Interfaces.Administration.Environment;
|
|
using Centron.Interfaces.BL;
|
|
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.Ticket121492
|
|
{
|
|
public class Ticket121492Test : EndToEndTest
|
|
{
|
|
public Ticket121492Test(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
this.Verifier.Settings.IgnoreProperty<ReceiptLogDTO>(f => f.CentronVersion);
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
// The problem in Ticket 121492 is:
|
|
// No ReceiptLog-entry is created when a receipt is closed because it got forwarded
|
|
|
|
const int OrderI3D = 4382;
|
|
|
|
var invoice = this.ForwardOrderToInvoice(OrderI3D);
|
|
this.SaveInvoice(invoice);
|
|
|
|
this.VerifyReceiptLogEntryGotCreated(OrderI3D);
|
|
}
|
|
|
|
private ReceiptInvoiceDTO ForwardOrderToInvoice(int orderI3D)
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var user = session.GetBL<AppUserBL>().GetAppUser(f => f.I3D == 11);
|
|
|
|
var result = session.GetBL<ReceiptWebServiceBL>().ForwardReceipt(
|
|
CentronObjectKindNumeric.InvoiceClass,
|
|
user,
|
|
new ForwardReceiptData
|
|
{
|
|
IgnoreCallbacks = true,
|
|
|
|
CreateReceiptData = new CreateReceiptData
|
|
{
|
|
IgnoreCallbacks = true,
|
|
},
|
|
CreateReceiptItemsFromExistingItemsData = new List<CreateReceiptItemsFromExistingItemsData>
|
|
{
|
|
new()
|
|
{
|
|
IgnoreCallbacks = true,
|
|
UsePickedQuantityFromItems = new List<UsePickedQuantityFromItem>
|
|
{
|
|
new UsePickedQuantityFromItem
|
|
{
|
|
ReceiptKind = CentronObjectKindNumeric.OrderClass,
|
|
ReceiptI3D = 4382,
|
|
ReceiptItemI3D = 7337,
|
|
UseOnlyPickedQuantity = false
|
|
},
|
|
new UsePickedQuantityFromItem
|
|
{
|
|
ReceiptKind = CentronObjectKindNumeric.OrderClass,
|
|
ReceiptI3D = 4382,
|
|
ReceiptItemI3D = 7338,
|
|
UseOnlyPickedQuantity = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
},
|
|
new List<ReceiptToForward>
|
|
{
|
|
new()
|
|
{
|
|
ReceiptKind = CentronObjectKindNumeric.OrderClass,
|
|
ReceiptI3D = orderI3D,
|
|
ReceiptItemI3Ds = null
|
|
}
|
|
},
|
|
null,
|
|
InsertReceiptTakeoverOptions.Reference,
|
|
onlyTakeoverAvailableQuantity: false,
|
|
ignoreDefaultContract: true).ThrowIfError();
|
|
|
|
return (ReceiptInvoiceDTO)result.Receipt;
|
|
}
|
|
}
|
|
|
|
private void SaveInvoice(ReceiptInvoiceDTO invoice)
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var user = session.GetBL<AppUserBL>().GetAppUser(f => f.I3D == 11);
|
|
session.GetBL<ReceiptWebServiceBL>().SaveReceipt(
|
|
invoice,
|
|
user,
|
|
new SaveReceiptData { IgnoreCallbacks = true },
|
|
autoLockIfNewReceipt: false,
|
|
CreatedThroughApplication.WebServices,
|
|
receiptTemplateFolderI3D: null).ThrowIfError();
|
|
}
|
|
}
|
|
|
|
private void VerifyReceiptLogEntryGotCreated(int orderI3D)
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var logs = session.GetBL<ReceiptLogWebServiceBL>().GetLogs(orderI3D, CentronObjectKindNumeric.OrderClass);
|
|
this.Verifier.Verify("ReceiptLogs", logs);
|
|
}
|
|
}
|
|
}
|
|
} |