- Neue Einstellung im Mandator View: Halbe Monate auswählen im QB

- Bugfix Rechnung Pool für ChristopherusHaus
This commit is contained in:
Christian
2025-04-23 00:26:10 +02:00
parent 213b3ffbbf
commit e6e6e000a8
13 changed files with 130 additions and 73 deletions

View File

@@ -43,12 +43,12 @@
<TargetCulture>de-DE</TargetCulture>
<ProductName>BeWoPlaner</ProductName>
<PublisherName>ownSoft GmbH</PublisherName>
<MinimumRequiredVersion>2.0.1.260</MinimumRequiredVersion>
<MinimumRequiredVersion>2.0.1.263</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.htm</WebPage>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<TrustUrlParameters>true</TrustUrlParameters>
<ApplicationRevision>261</ApplicationRevision>
<ApplicationRevision>264</ApplicationRevision>
<ApplicationVersion>2.0.1.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>

View File

@@ -258,7 +258,7 @@
<TextBlock
Grid.Row="3"
Grid.Row="0"
Grid.Column="0"
Margin="3,5,3,5"
VerticalAlignment="Center"
@@ -268,7 +268,7 @@
</TextBlock>
<dxe:SpinEdit
x:Name="LockUITimeSpinEdit"
Grid.Row="3"
Grid.Row="0"
Grid.Column="1"
Height="23"
Margin="3,5,3,5"
@@ -278,7 +278,7 @@
MinValue="0" />
<TextBlock
Grid.Row="4"
Grid.Row="1"
Grid.Column="0"
Margin="3,5,3,5"
VerticalAlignment="Center"
@@ -288,7 +288,7 @@
</TextBlock>
<dxe:SpinEdit
x:Name="MoKSessionTimeoutSpinEdit"
Grid.Row="4"
Grid.Row="1"
Grid.Column="1"
Height="23"
Margin="3,5,3,5"
@@ -296,9 +296,17 @@
IsFloatValue="False"
MaxValue="60"
MinValue="20" />
<CheckBox
Grid.Row="2"
Grid.ColumnSpan="2"
Margin="3,5,3,5"
IsChecked="{Binding Path=ShowServicesOverviewHalfOrWholeMonth}">
<CheckBox.Content>
<TextBlock TextWrapping="Wrap" Text="{markup:Translate In Mobilversion die Zeitraumauswahl für Quittierungsbelege ändern\, so dass nur noch Monatshälften oder der gesamte Monat ausgewählt werden kann.}" />
</CheckBox.Content>
</CheckBox>
<TextBlock
Grid.Row="5"
Grid.Row="3"
Grid.Column="0"
Margin="3,5,3,5"
VerticalAlignment="Center"
@@ -307,7 +315,7 @@
TextWrapping="Wrap" />
<dxe:SpinEdit
x:Name="helpplan"
Grid.Row="5"
Grid.Row="3"
Grid.Column="1"
Height="23"
Margin="3,5,3,5"
@@ -317,7 +325,7 @@
MinValue="0" />
<CheckBox
Grid.Row="7"
Grid.Row="4"
Grid.ColumnSpan="2"
Margin="3,5,3,5"
Content="Passwortsicherheit aktivieren"

View File

@@ -477,7 +477,6 @@ namespace BeWo.View
var _login = new Login(kundennummer, "kihqx-PiGka", "cb", "bewo", "0b50c09aff87f20d9ced75340e04e5ccaa11dd3e7bcf25e9c4f94dc20d3cbb97");
#if DEBUG
var ownChatTextFilePath = "C:\\Users\\Lyndon Jetten\\Desktop\\ownchat.txt";
if(File.Exists(ownChatTextFilePath))
{
@@ -506,10 +505,8 @@ namespace BeWo.View
}
}
#endif
//_login = new Login("4368658436", "B7x0b-FhhJA", "jettenl", "", "0000");
//_login = new Login("3629696651", "2qsJH-qXBh3", "m59", "test123!", "C4UtAx8itmba2OZ2HKzYuK3F9jV3bEQbkRL6hNxvZGGFtFs1CgWWGRLFKYvEBmo6");
#if DEBUG
var loginControl = new ChatController.LoginControl();
loginControl.OnLogin += (c) =>
@@ -537,12 +534,7 @@ namespace BeWo.View
loginWindow.Content = grid;
loginWindow.Show();
#else
var x1 = _login.AnmeldevorgangDurchFuehren();
ServiceChatView = new ChatView(x1);
ServiceChatView.Show();
#endif
return;
#endif
@@ -578,12 +570,7 @@ namespace BeWo.View
string _passwort = BeWoApp.UserPassword;
string _apikey;
#endif
//string _ChatCode = "";
//if (xxx.EmployeeCode != null && !xxx.EmployeeCode.Equals(""))
//{
// _ChatCode = xxx.EmployeeCode;
//}
_apikey = BeWoApp.Mandator.Apikey ?? "0000";
if(!_Code.Equals(""))
@@ -609,24 +596,6 @@ namespace BeWo.View
MessageBox.Show("Sie benötigen einen gültigen Zugang zum Chat. Bitte wenden Sie sich an den Support.", "Info");
}
}
//else if (ServiceChatView.Visibility == Visibility.Visible)
//{
// ServiceChatView.Visibility = Visibility.Hidden;
//}
//else if (ServiceChatView.Visibility == Visibility.Hidden)
//{
// ServiceChatView.Visibility = Visibility.Visible;
// if (ServiceChatView.WindowState == WindowState.Minimized)
// {
// ServiceChatView.WindowState = WindowState.Normal;
// ServiceChatView.Height = 700;
// ServiceChatView.Width = 900;
// }
// ServiceChatView.Activate();
//}
//#endif
}
private void ServiceChatViewClosed(object sender, EventArgs e)

View File

@@ -168,6 +168,20 @@ namespace BeWo.ViewModel
}
}
}
public bool ShowServicesOverviewHalfOrWholeMonth
{
get { return BeWoApp.AppSettings.ShowServicesOverviewHalfOrWholeMonth; }
set
{
if (this.AreDifferent(BeWoApp.AppSettings.ShowServicesOverviewHalfOrWholeMonth, value))
{
BeWoApp.AppSettings.ShowServicesOverviewHalfOrWholeMonth = value;
this.Settings = UserSettingsUtils.CreateNewSettingValue(this._Settings, "ShowServicesOverviewHalfOrWholeMonth", value ? "1" : "0");
}
}
}
public bool FilterGroupServiceCategories
{
get { return BeWoApp.AppSettings.FilterGroupServiceCategories; }

View File

@@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<ProjectView>ShowAllFiles</ProjectView>
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<NameOfLastUsedPublishProfile>BeWo2.0</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress>false</Use64BitIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />

View File

@@ -82,6 +82,7 @@ namespace ChristopherusHausMID.Invoicing
//var items = base.CreateInvoiceItems(serviceRecordsInPeriod, invoicePeriod, scap, calc);
var fehltage = PoolHelper.GetAbwesenheitsTage(scap.CostBearer2SupportConcept.SupportConcept.Customer, invoicePeriod);
var items = new List<InvoiceItem>();
decimal maxBetreuteTage = 0;
if (qbelegRos.Count > 0)
{
foreach (var s in qbelegRos[0].Services)
@@ -89,19 +90,53 @@ namespace ChristopherusHausMID.Invoicing
InvoiceItem ii = CreateInvoiceItem(s, scap, calc);
if (ii != null && ii.UnitCount.HasValue && ii.UnitCount > 0)
{
maxBetreuteTage++;
items.Add(ii);
}
}
}
decimal betreuteTage = maxBetreuteTage - fehltage;
decimal betreuteTagePoolKinder = 0;
//IList<ServiceInvoice> poolRechnungen = null;
//if (BerechnePoolKinder)
//{
// poolRechnungen = ErstellePoolRechnungen(invoicePeriod, scap);
if (BerechnePoolKinder)
{
var poolKinder = PoolHelper.GetWeiterePoolKinder(scap.CostBearer2SupportConcept.SupportConcept.Customer, invoicePeriod.StartDate);
if (poolKinder.Count > 0)
{
// //BerechnePoolFaktorenUndAbwesenheiten(scap.CostBearer2SupportConcept.SupportConcept.Customer, invoicePeriod, items, poolRechnungen);
//}
foreach (var poolKind in poolKinder)
{
var invoice = PoolHelper.ErstelleRechnung(poolKind, invoicePeriod.StartDate, invoicePeriod.EndDate);
if (invoice != null)
{
//Berechne Rechnungsanteil anhand der Abwesenheitstage
var fehltagePoolKind = PoolHelper.GetAbwesenheitsTage(poolKind, invoicePeriod);
betreuteTagePoolKinder += maxBetreuteTage - fehltagePoolKind;
//var ro = new RechnungsPositionRO();
//positionen.Add(ro);
//var newInvoiceRo = ServiceInvoiceRO.Create(MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(invoice));
//BerechneRechnungsPositionSummen(poolKind, ro, newInvoiceRo);
//ro.Position = position++;
}
}
}
//BerechnePoolFaktorenUndAbwesenheiten(scap.CostBearer2SupportConcept.SupportConcept.Customer, invoicePeriod, items, poolRechnungen);
}
var betreutetageGesamt = betreuteTagePoolKinder + betreuteTage; // Anzahl Tage insegesamt, die irgendein Pool Kind betreut wurde
decimal rechnungsanteil = 1;
if (betreutetageGesamt > 0 && betreuteTagePoolKinder > 0)
{
rechnungsanteil = Math.Round(betreuteTage / betreutetageGesamt, 4, MidpointRounding.AwayFromZero);
}
//if (poolRechnungen == null || poolRechnungen.Count == 0)
//{
@@ -116,6 +151,12 @@ namespace ChristopherusHausMID.Invoicing
foreach (var item in summaryItems)
{
item.CustomNumber1 = fehltage;
item.CustomNumber2 = rechnungsanteil;
if (rechnungsanteil < 1)
{
item.GrossAmountTotal = Math.Round((item.GrossAmountTotal ?? 0) * rechnungsanteil, 2, MidpointRounding.AwayFromZero);
}
}
return summaryItems;

View File

@@ -343,7 +343,7 @@ namespace ChristopherusHausMID
this.xrTableCell32.StylePriority.UsePadding = false;
this.xrTableCell32.StylePriority.UseTextAlignment = false;
this.xrTableCell32.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell32.TextFormatString = "{0:0}%";
this.xrTableCell32.TextFormatString = "{0:0.##}%";
this.xrTableCell32.Weight = 1.9334990413834123D;
//
// xrTableCell33
@@ -1095,7 +1095,7 @@ namespace ChristopherusHausMID
this.xrTableCell18.StylePriority.UsePadding = false;
this.xrTableCell18.StylePriority.UseTextAlignment = false;
this.xrTableCell18.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell18.TextFormatString = "{0:0}%";
this.xrTableCell18.TextFormatString = "{0:0.##}%";
this.xrTableCell18.Weight = 1.9334990413834123D;
//
// xrTableCell19

View File

@@ -48,6 +48,18 @@ namespace ChristopherusHausMID
List<RechnungsPositionRO> poolPositionen = BerechnePoolKinderRechnungen(kind, pRO);
foreach (var item in poolPositionen)
{
item.Betrag5Prozent10 -= ro.MainRechnungsposition.Betrag5Prozent10;
item.BetragStunden10 -= ro.MainRechnungsposition.BetragStunden10;
item.BetragStunden11 -= ro.MainRechnungsposition.BetragStunden11;
item.BetragStunden12 -= ro.MainRechnungsposition.BetragStunden12;
item.BetragStunden13 -= ro.MainRechnungsposition.BetragStunden13;
item.BetragStunden14 -= ro.MainRechnungsposition.BetragStunden14;
item.BetragStunden15 -= ro.MainRechnungsposition.BetragStunden15;
item.GesamtBetrag -= ro.MainRechnungsposition.GesamtBetrag;
}
ro.WeitereRechnungspositionen.AddRange(poolPositionen);
@@ -82,15 +94,8 @@ namespace ChristopherusHausMID
foreach (var item in ip.ServiceInvoiceItems)
{
decimal betrag = 0;
if (!String.IsNullOrEmpty(item.GrossAmount))
{
if (Decimal.TryParse(item.GrossAmount.Replace("€", "").Trim(), out var b))
{
betrag = b;
}
}
decimal betrag = GetBetragFromString(item.GrossAmount);
if (!String.IsNullOrEmpty(item.UnitDescription))
{
if (item.UnitDescription == "Faktor 1.0")
@@ -146,12 +151,25 @@ namespace ChristopherusHausMID
span.StartDate = pRO.AccountingPeriodStart;
span.EndDate = pRO.AccountingPeriodEnd;
var fehltage = PoolHelper.GetAbwesenheitsTage(customer, span);
ro.Fehltage = fehltage;
ro.Fehltage = fehltage * -1;
}
}
}
private decimal GetBetragFromString(string amount)
{
decimal betrag = 0;
if (!String.IsNullOrEmpty(amount))
{
if (Decimal.TryParse(amount.Replace("€", "").Trim(), out var b))
{
betrag = b;
}
}
return betrag;
}
private List<RechnungsPositionRO> BerechnePoolKinderRechnungen(Customer customer, ServiceInvoiceRO pRO)
{
var positionen = new List<RechnungsPositionRO>();
@@ -174,6 +192,8 @@ namespace ChristopherusHausMID
var newInvoiceRo = ServiceInvoiceRO.Create(MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(invoice));
BerechneRechnungsPositionSummen(poolKind, ro, newInvoiceRo);
//ro.GesamtBetrag = pRO.cla
ro.Position = position++;
}
}
@@ -194,15 +214,15 @@ namespace ChristopherusHausMID
summenPosition.BetragStunden14 += item.BetragStunden14;
summenPosition.BetragStunden15 += item.BetragStunden15;
summenPosition.BetreuteStunden10 += item.BetreuteStunden10;
summenPosition.BetreuteStunden11 += item.BetreuteStunden11;
summenPosition.BetreuteStunden12 += item.BetreuteStunden12;
summenPosition.BetreuteStunden13 += item.BetreuteStunden13;
summenPosition.BetreuteStunden14 += item.BetreuteStunden14;
summenPosition.BetreuteStunden15 += item.BetreuteStunden15;
summenPosition.BetreuteStunden10 = item.BetreuteStunden10;
summenPosition.BetreuteStunden11 = item.BetreuteStunden11;
summenPosition.BetreuteStunden12 = item.BetreuteStunden12;
summenPosition.BetreuteStunden13 = item.BetreuteStunden13;
summenPosition.BetreuteStunden14 = item.BetreuteStunden14;
summenPosition.BetreuteStunden15 = item.BetreuteStunden15;
summenPosition.GesamtBetrag += item.GesamtBetrag;
summenPosition.GesamtStunden += item.GesamtStunden;
summenPosition.GesamtStunden = item.GesamtStunden;
}

View File

@@ -60,6 +60,11 @@ namespace ChristopherusHausMID.Service
return schule;
}
//public override bool HatAbwesenheit(DateTime start, Customer customer)
//{
// return base.HatAbwesenheit(start, customer);
//}
protected override IList<ServiceRecord> CreateServiceRecords(Arbeitszeit arbeitszeit, DateTime datum, CostBearer2SupportConcept c2s, ServiceDescription defaultSd, List<ServiceRecord> existingList)
{
var ferien = GetVacationService().GetFerien(datum, "nrw");

View File

@@ -101,7 +101,7 @@ namespace BeWo.Service.Plugins
return serviceRecords;
}
private bool HatAbwesenheit(DateTime start, Customer customer)
public virtual bool HatAbwesenheit(DateTime start, Customer customer)
{
foreach (var at in customer.AbsenceTimes)
{

View File

@@ -349,7 +349,7 @@ namespace BeWo.Service.Plugins
//t = "6971328056"; // SKM Krefeld
//t = "4199238586"; // MeZ Menden;
//t = "3226307161"; // Roman Roger Puth
//t = "3522103738"; // AWO Münsterland-Recklinghausen
t = "3522103738"; // AWO Münsterland-Recklinghausen
//t = "5592509446"; // Kontakt Verein für psychosoziale Hilfen e.V
//t = "5344902949"; // SHK Service GmbH SBD
//t = "1422963536"; // Malteser-Johanniter-Johanneshaus gGmbH
@@ -408,7 +408,7 @@ namespace BeWo.Service.Plugins
//t = "1159580198"; // Wendepunkt Velbert gGmbH
//t = "5094575560"; // Christopherus Haus MID
//t = "5261046426"; // SelbstWerk EN / Bettina Heckrodt
t = "6652893693"; // Claudia Heizmann
//t = "6652893693"; // Claudia Heizmann
return t;
#else

View File

@@ -4139,7 +4139,7 @@ namespace BeWo.Service.ServiceImplementations
var employeeOid = false == user.CheckForRights(new List<UserRightType> { UserRightType.ViewAll, UserRightType.CustomerView_View }) ? user.Employee.Oid : null;
return GetAllActiveCustomersCompact(fetchReferenceNumbers, employeeOid).OrderBy(d => d.LastNameFirstName).ToList();
return GetAllActiveCustomersCompact(fetchReferenceNumbers, employeeOid).OrderBy(d => d.LastNameFirstName).Where(c => c.IsRelatedToEmployee || !employeeOid.HasValue).ToList();
}
private static ApplicationUser GetLoggedInUser()