Two things:

* User views its devices, from a /manage index link
* Yavsc.Server resurection
main
Paul Schneider 8 years ago
parent a77b83bf24
commit f7d4447594
201 changed files with 3756 additions and 502 deletions

@ -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;
using System.Collections.Generic; using System.Collections.Generic;
using Yavsc.Services;
namespace Yavsc.Billing namespace Yavsc.Billing
{ {
@ -21,7 +22,7 @@ namespace Yavsc.Billing
bool GetIsAcquitted (); bool GetIsAcquitted ();
string GetFileBaseName (); string GetFileBaseName (IBillingService service);
} }
} }

@ -3,21 +3,23 @@ namespace Yavsc.Services
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Yavsc.Abstract.Workflow; using Yavsc.Abstract.Workflow;
using System.Collections.Generic;
public interface IBillingService public interface IBillingService
{ {
/// <summary> /// <summary>
/// Renvoye la facture associée à une clé de facturation: /// Renvoye la facture associée à une clé de facturation,
/// le couple suivant : /// à partir du couple suivant :
/// ///
/// * un code de facturation /// * un code de facturation
/// (identifiant associé à un type de facturation d'un flux de travail) /// (identifiant associé à un type de demande du client)
/// * un entier long identifiant la demande du client /// * un entier long identifiant la demande du client
/// (à une demande, on associe au maximum une seule facture) /// (à une demande, on associe au maximum une seule facture)
/// </summary> /// </summary>
/// <param name="billingCode">Identifiant du type de facturation</param> /// <param name="billingCode">Identifiant du type de facturation</param>
/// <param name="queryId">Identifiant de la demande du client</param> /// <param name="queryId">Identifiant de la demande du client</param>
/// <returns>La facture</returns> /// <returns>La facture</returns>
Dictionary<string,string> BillingMap { get; }
Task<INominativeQuery> GetBillAsync(string billingCode, long queryId); Task<INominativeQuery> GetBillAsync(string billingCode, long queryId);
Task<IQueryable<ISpecializationSettings>> GetPerformersSettingsAsync(string activityCode); Task<IQueryable<ISpecializationSettings>> GetPerformersSettingsAsync(string activityCode);

@ -5,6 +5,7 @@ using System.Linq;
using Yavsc.Abstract.FileSystem; using Yavsc.Abstract.FileSystem;
using Yavsc.Billing; using Yavsc.Billing;
using Yavsc.Models.Billing; using Yavsc.Models.Billing;
using Yavsc.Services;
namespace Yavsc.Helpers namespace Yavsc.Helpers
{ {
@ -21,10 +22,10 @@ namespace Yavsc.Helpers
return bill; 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 suffix = bill.GetIsAcquitted() ? "-ack":null;
var filename = bill.GetFileBaseName()+".pdf"; var filename = bill.GetFileBaseName(service)+".pdf";
return new FileInfo(Path.Combine(AbstractFileSystemHelpers.UserBillsDirName, filename)); return new FileInfo(Path.Combine(AbstractFileSystemHelpers.UserBillsDirName, filename));
} }
} }

@ -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; return Regularisation?.IsOk() ?? false;
} }
public string GetFileBaseName() public string GetFileBaseName(IBillingService billingService)
{ {
string type = GetType().Name; string type = GetType().Name;
string ack = GetIsAcquitted() ? "-ack" : null; string ack = GetIsAcquitted() ? "-ack" : null;
var bcode = BillingService.BillingMap[type]; var bcode = billingService.BillingMap[type];
return $"facture-{bcode}-{Id}{ack}"; return $"facture-{bcode}-{Id}{ack}";
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…