GetInvoiceBasesForCostBearerAndIdAndIsUsed

This commit is contained in:
2024-10-22 13:01:39 +02:00
parent 1b0680da11
commit 4ce1b499f2
10 changed files with 66 additions and 11 deletions

View File

@@ -24,7 +24,7 @@ namespace BeWo
{
#if DEBUG
return _CurrentConfig ?? (_CurrentConfig = SimpleAutoLogin);
return _CurrentConfig ?? (_CurrentConfig = Feature_Dakota);
#endif

View File

@@ -9596,6 +9596,12 @@ namespace BeWo.ServiceProxy
"ault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceBaseDC> GetInvoiceBasesForCostBearerAndId(System.Nullable<System.DateTime> startDate, System.Nullable<System.DateTime> endDate, long costBearerOid, string invoiceId);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetInvoiceBasesForCostBearerAndIdAndIsUsed", ReplyAction="http://tempuri.org/IAccountingService/GetInvoiceBasesForCostBearerAndIdAndIsUsedR" +
"esponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetInvoiceBasesForCostBearerAndIdAndIsUsedB" +
"eWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceBaseDC> GetInvoiceBasesForCostBearerAndIdAndIsUsed(System.Nullable<System.DateTime> startDate, System.Nullable<System.DateTime> endDate, long costBearerOid, string invoiceId);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetGeneralInvoiceBasesForCustomer", ReplyAction="http://tempuri.org/IAccountingService/GetGeneralInvoiceBasesForCustomerResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetGeneralInvoiceBasesForCustomerBeWoFaultF" +
"ault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
@@ -9807,6 +9813,11 @@ namespace BeWo.ServiceProxy
return base.Channel.GetInvoiceBasesForCostBearerAndId(startDate, endDate, costBearerOid, invoiceId);
}
public System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceBaseDC> GetInvoiceBasesForCostBearerAndIdAndIsUsed(System.Nullable<System.DateTime> startDate, System.Nullable<System.DateTime> endDate, long costBearerOid, string invoiceId)
{
return base.Channel.GetInvoiceBasesForCostBearerAndIdAndIsUsed(startDate, endDate, costBearerOid, invoiceId);
}
public System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceBaseDC> GetGeneralInvoiceBasesForCustomer(long customerOid)
{
return base.Channel.GetGeneralInvoiceBasesForCustomer(customerOid);

View File

@@ -40,5 +40,4 @@
<Style BasedOn="{StaticResource BaseRadioButton}" TargetType="RadioButton" />
<Style BasedOn="{StaticResource TextBoxBase}" TargetType="TextBox" />
<Style BasedOn="{StaticResource BaseTextEdit}" TargetType="dxe:TextEdit" />
</ResourceDictionary>

View File

@@ -123,11 +123,9 @@ namespace BeWo.View.Detail.Accounting
{
var checked_invoice_bases = _NewGkvAbrechnungPopUpView.ViewModel.InvoiceBases.Where(x => x.IsChecked).Select(x => x.DataContract.InvoiceBaseOid.Value).ToList();
// MessageBox.Show("Sie haben keine Rechnung hinzugefügt.", "GKV-Abrechnung erstellen", MessageBoxButton.OK, MessageBoxImage.Warning);
if (checked_invoice_bases.Count == 0)
{
MessageBox.Show("Sie haben keine Rechnung hinzugefügt.", "GKV-Abrechnung erstellen", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
MainControl.CloseCurrentPopUp();

View File

@@ -15,7 +15,8 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Focusable="True"
Loaded="BeWoView_Loaded">
Loaded="BeWoView_Loaded"
Unloaded="BeWoView_Unloaded">
<Grid>
<uc:ShadowChrome>

View File

@@ -67,16 +67,16 @@ namespace BeWo.View.Master
{
var lDoSave = true;
if (root.SelectedItem != null)
if (root.SelectedItem is TabItem selected)
{
if (_OpenViews.ContainsKey(root.SelectedItem as TabItem))
if (_OpenViews.ContainsKey(selected))
{
lDoSave = _OpenViews[root.SelectedItem as TabItem].DoSaveCheck();
lDoSave = _OpenViews[selected].DoSaveCheck();
if (lDoSave && IsDirty)
{
_SavePerformed = true;
_OpenViews.Remove(root.SelectedItem as TabItem);
_OpenViews.Remove(selected);
}
}
}
@@ -307,5 +307,13 @@ namespace BeWo.View.Master
_AlreadyLoaded = true;
}
private void BeWoView_Unloaded(object sender, RoutedEventArgs e)
{
if(root.SelectedItem != tabitem_gkvabrechnung)
{
RemoveView(tabitem_gkvabrechnung);
}
}
}
}

View File

@@ -83,7 +83,6 @@ namespace BeWo.Service.DCEntityMapper
isReady = false;
tooltip = "Organisation fehlen Informationen";
}
}
pDataContract.IsReady2Send = isReady;

View File

@@ -44,6 +44,10 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<InvoiceBaseDC> GetInvoiceBasesForCostBearerAndId(DateTime? startDate, DateTime? endDate, long costBearerOid, String invoiceId);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<InvoiceBaseDC> GetInvoiceBasesForCostBearerAndIdAndIsUsed(DateTime? startDate, DateTime? endDate, long costBearerOid, String invoiceId);
[FaultContract(typeof(BeWoFault))]
[OperationContract]

View File

@@ -160,6 +160,38 @@ namespace BeWo.Service.ServiceImplementations
}
}
public List<InvoiceBaseDC> GetInvoiceBasesForCostBearerAndIdAndIsUsed(DateTime? startDate, DateTime? endDate, long costBearerOid, String invoiceId)
{
try
{
var gkv_abrechnungen = DAOFactory.GenericDAO.GetAllActive<GkvAbrechnung>();
var s = PluginLoader.FindClass<AccountingService>();
var rtn = s.GetInvoiceBases(startDate, endDate, costBearerOid, invoiceId);
HashSet<long> invoices = new HashSet<long>();
foreach (var gkv_abrechnung in gkv_abrechnungen)
{
foreach (var invoice in gkv_abrechnung.InvoiceBases)
{
invoices.Add(invoice.Oid.Value);
}
}
foreach (var invoice in rtn)
{
invoice.IsAlreadyInActiveGkvAbrechnung = invoices.Contains(invoice.InvoiceBaseOid.Value);
}
return rtn;
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public List<InvoiceBaseDC> GetGeneralInvoiceBasesForCustomer(long customerOid)
{
try

View File

@@ -25,6 +25,9 @@ namespace BS.Shared.DataContracts
[DataMember]
public string CreatorLastName { get; set; }
[DataMember]
public bool IsAlreadyInActiveGkvAbrechnung { get; set; }
[DataMember]
public bool IsGkvValid { get; set; }