Two things:
* User views its devices, from a /manage index link * Yavsc.Server resurection
This commit is contained in:
28
Yavsc.Abstract/:w
Normal file
28
Yavsc.Abstract/:w
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Yavsc.Services;
|
||||
|
||||
namespace Yavsc.Billing
|
||||
{
|
||||
public interface IBillable {
|
||||
string GetDescription ();
|
||||
List<IBillItem> GetBillItems();
|
||||
long Id { get; set; }
|
||||
|
||||
string ActivityCode { get; set; }
|
||||
|
||||
string PerformerId { get; set; }
|
||||
string ClientId { get; set; }
|
||||
/// <summary>
|
||||
/// Date de validation de la demande par le client
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
DateTime? ValidationDate { get; }
|
||||
|
||||
bool GetIsAcquitted ();
|
||||
|
||||
string GetFileBaseName (IBillingService service);
|
||||
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Yavsc.Services;
|
||||
|
||||
namespace Yavsc.Billing
|
||||
{
|
||||
@ -21,7 +22,7 @@ namespace Yavsc.Billing
|
||||
|
||||
bool GetIsAcquitted ();
|
||||
|
||||
string GetFileBaseName ();
|
||||
string GetFileBaseName (IBillingService service);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +1,29 @@
|
||||
namespace Yavsc.Services
|
||||
{
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Yavsc.Abstract.Workflow;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Yavsc.Abstract.Workflow;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public interface IBillingService
|
||||
{
|
||||
/// <summary>
|
||||
/// Renvoye la facture associée à une clé de facturation:
|
||||
/// le couple suivant :
|
||||
///
|
||||
/// * un code de facturation
|
||||
/// (identifiant associé à un type de facturation d'un flux de travail)
|
||||
/// * un entier long identifiant la demande du client
|
||||
/// (à une demande, on associe au maximum une seule facture)
|
||||
/// </summary>
|
||||
/// <param name="billingCode">Identifiant du type de facturation</param>
|
||||
/// <param name="queryId">Identifiant de la demande du client</param>
|
||||
/// <returns>La facture</returns>
|
||||
Task<INominativeQuery> GetBillAsync(string billingCode, long queryId);
|
||||
Task<IQueryable<ISpecializationSettings>> GetPerformersSettingsAsync(string activityCode);
|
||||
|
||||
Task<ISpecializationSettings> GetPerformerSettingsAsync(string activityCode, string userId);
|
||||
public interface IBillingService
|
||||
{
|
||||
/// <summary>
|
||||
/// Renvoye la facture associée à une clé de facturation,
|
||||
/// à partir du couple suivant :
|
||||
///
|
||||
/// * un code de facturation
|
||||
/// (identifiant associé à un type de demande du client)
|
||||
/// * un entier long identifiant la demande du client
|
||||
/// (à une demande, on associe au maximum une seule facture)
|
||||
/// </summary>
|
||||
/// <param name="billingCode">Identifiant du type de facturation</param>
|
||||
/// <param name="queryId">Identifiant de la demande du client</param>
|
||||
/// <returns>La facture</returns>
|
||||
Dictionary<string,string> BillingMap { get; }
|
||||
Task<INominativeQuery> GetBillAsync(string billingCode, long queryId);
|
||||
Task<IQueryable<ISpecializationSettings>> GetPerformersSettingsAsync(string activityCode);
|
||||
|
||||
}
|
||||
}
|
||||
Task<ISpecializationSettings> GetPerformerSettingsAsync(string activityCode, string userId);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ using System.Linq;
|
||||
using Yavsc.Abstract.FileSystem;
|
||||
using Yavsc.Billing;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Services;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
@ -21,10 +22,10 @@ namespace Yavsc.Helpers
|
||||
return bill;
|
||||
}
|
||||
|
||||
public static FileInfo GetBillInfo(this IBillable bill)
|
||||
public static FileInfo GetBillInfo(this IBillable bill, IBillingService service)
|
||||
{
|
||||
var suffix = bill.GetIsAcquitted() ? "-ack":null;
|
||||
var filename = bill.GetFileBaseName()+".pdf";
|
||||
var filename = bill.GetFileBaseName(service)+".pdf";
|
||||
return new FileInfo(Path.Combine(AbstractFileSystemHelpers.UserBillsDirName, filename));
|
||||
}
|
||||
}
|
8
Yavsc.Server/Interfaces/IBillingService.cs
Normal file
8
Yavsc.Server/Interfaces/IBillingService.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace Yavsc {
|
||||
interface IBillingService_deux {
|
||||
}
|
||||
|
||||
}
|
@ -89,11 +89,11 @@ namespace Yavsc.Models.Billing
|
||||
return Regularisation?.IsOk() ?? false;
|
||||
}
|
||||
|
||||
public string GetFileBaseName()
|
||||
public string GetFileBaseName(IBillingService billingService)
|
||||
{
|
||||
string type = GetType().Name;
|
||||
string ack = GetIsAcquitted() ? "-ack" : null;
|
||||
var bcode = BillingService.BillingMap[type];
|
||||
var bcode = billingService.BillingMap[type];
|
||||
return $"facture-{bcode}-{Id}{ack}";
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user