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
75 lines
3.3 KiB
C#
75 lines
3.3 KiB
C#
using System.Collections.Generic;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.Administration.Settings;
|
|
using Centron.BusinessLogic.EmployeeArea;
|
|
using Centron.BusinessLogic.Sales.CustomerAssets.TimerBilling;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
using Centron.Data.WebServices.Sales.Receipts;
|
|
using Centron.Data.WebServices.Sales.Receipts.Invoices;
|
|
using Centron.Interfaces;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using CentronSoftware.Centron.WebServices.Entities.Sales.CustomerAssets.TimerBilling;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.TicketTests.Ticket119415
|
|
{
|
|
public class Ticket119415Test : EndToEndTest
|
|
{
|
|
public Ticket119415Test(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
this.Verifier.Settings.IgnoreProperty<ReceiptInvoiceItemDTO>(f => f.BalanceID);
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
// We used to ignore the timer-type in timer-billing when billing special-articles, but as of Ticket 119415 that is not quite correct
|
|
// If the timer doesn't have the checkbox set for special-articles, then we should also ignore all special-articles that are in the table
|
|
this.PrepareDatabase();
|
|
|
|
// This timer has special-articles, but timer-type NULL
|
|
this.CreateReceipt(7454);
|
|
|
|
// This timer has special-articles, and a timer-type
|
|
this.CreateReceipt(10509);
|
|
}
|
|
|
|
private void PrepareDatabase()
|
|
{
|
|
this.Sql("UPDATE dbo.hlpdsk_timer_typen SET WithAddressSpecialArticle = 0, WithCustomerSpecialArticle = 0");
|
|
this.Sql($"UPDATE dbo.Stammdat SET WertText = 'g' WHERE I3D = {(int)AppSettingsConst.HelpdeskTimerStartTimeFormat}");
|
|
this.Sql($"UPDATE dbo.Stammdat SET WertText = 'g' WHERE I3D = {(int)AppSettingsConst.HelpdeskTimerEndTimeFormat}");
|
|
}
|
|
|
|
private ReceiptBaseDTO CreateReceipt(int timerI3D)
|
|
{
|
|
var timerI3Ds = new List<int> { timerI3D };
|
|
|
|
var settings = new TimerBillingSettingsDTO
|
|
{
|
|
InsertHelpdeskDescription = true,
|
|
InsertHelpdeskShortDescription = true,
|
|
InsertTimerText = true,
|
|
InsertTimerTime = true,
|
|
InsertTheFollowingAreTimersFromHelpdeskText = true,
|
|
Sorting = Interfaces.Sales.Receipts.TimerBilling.TimerSorting.ChronologicalUp,
|
|
|
|
ReceiptKind = CentronObjectKindNumeric.InvoiceClass,
|
|
AdditionalText = "Hier mein Text!"
|
|
};
|
|
|
|
using (var session = new BLSession())
|
|
{
|
|
var timers = session.GetBL<TimerBillingBL>().SearchTimers(new TimerBillingFilter { HelpdeskTimerI3Ds = timerI3Ds });
|
|
this.Verifier.Verify($"TimerBillingSearch_{timerI3D}", timers);
|
|
|
|
var user = session.GetBL<AppUserBL>().GetAppUser(f => f.I3D == 11);
|
|
var invoiceResult = session.GetBL<ReceiptWebServiceBL>().CreateNewReceiptForHelpdekTimers(timerI3Ds, settings, user);
|
|
|
|
this.Verifier.Verify($"TimerI3D_{timerI3D}", invoiceResult);
|
|
|
|
return invoiceResult.Data;
|
|
}
|
|
}
|
|
}
|
|
} |