* Estimates as Tex or Pdf

* Estimate edition [mix Mvc&Ajax]
* Billable&Bankable properties on profiles
This commit is contained in:
Paul Schneider 2014-10-25 23:54:19 +02:00
commit b39a444cf0
31 changed files with 1101 additions and 218 deletions

View file

@ -1,15 +1,30 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
namespace Yavsc.Model.WorkFlow
{
public class Estimate
[Serializable]
public class Estimate
{
public Estimate ()
{
}
[Required]
[DisplayName("Titre")]
public string Title { get; set; }
public string Owner { get; set; }
[Required]
[DisplayName("Description")]
public string Description { get; set; }
[Required]
[DisplayName("Responsable")]
public string Responsible { get; set; }
[Required]
[DisplayName("Client")]
public string Client { get; set; }
public long Id { get; set; }
[DisplayName("Chiffre")]
public decimal Ciffer {
get {
decimal total = 0;
@ -20,6 +35,7 @@ namespace Yavsc.Model.WorkFlow
return total;
}
}
public Writting[] Lines { get; set; }
}
}

View file

@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
namespace Yavsc.Model.WorkFlow
{
public interface IContent
{
object Data { get; set; }
string MimeType { get; set; }
}
}

View file

@ -42,7 +42,7 @@ namespace Yavsc.Model.WorkFlow
/// <returns>The estimate.</returns>
/// <param name="client">Client.</param>
/// <param name="title">Title.</param>
long CreateEstimate (string client, string title);
Estimate CreateEstimate (string responsible, string client, string title, string description);
/// <summary>
/// Add a line to the specified estimate by id,
/// using the specified desc, ucost, count and productid.
@ -97,13 +97,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// <param name="estid">Estid.</param>
/// <param name="newTitle">New title.</param>
void SetTitle (long estid, string newTitle);
/// <summary>
/// Sets the descripton for a writting.
/// </summary>
/// <param name="writid">Writid.</param>
/// <param name="newDesc">New desc.</param>
void SetDesc (long writid, string newDesc);
void UpdateEstimate (Estimate estim);
/// <summary>
/// Sets the writting status.
/// </summary>

View file

@ -8,19 +8,11 @@ namespace Yavsc.Model.WorkFlow
{
public class NewEstimateEvenArgs: EventArgs
{
private string clientName;
private string estimateTitle;
private long eid;
public string ClientName{ get { return clientName; } }
public string EstimateTitle { get { return estimateTitle; } }
public long EstimateId { get { return eid; } }
public NewEstimateEvenArgs(long estid, string client, string title)
private Estimate data=null;
public Estimate Data{ get { return data; } }
public NewEstimateEvenArgs(Estimate created)
{
clientName = client;
estimateTitle = title;
eid = estid;
data = created;
}
}

View file

@ -17,9 +17,9 @@ namespace Yavsc.Model.WorkFlow
public static Catalog Catalog { get; set; }
public static void SetTitle (long id, string title)
public static void UpdateEstimate (Estimate estim)
{
ContentProvider.SetTitle (id, title);
ContentProvider.UpdateEstimate (estim);
}
public static event EventHandler NewOrder;
@ -95,12 +95,13 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// <returns>The estimate identifier.</returns>
/// <param name="title">Title.</param>
public static long CreateEstimate(string client, string title)
public static Estimate CreateEstimate(string responsible, string client, string title, string description)
{
long estid = ContentProvider.CreateEstimate (client, title);
Estimate created = ContentProvider.CreateEstimate (responsible, client, title, description);
if (NewOrder != null)
NewOrder.Invoke(ContentProvider, new NewEstimateEvenArgs(estid,client,title));
return estid;
NewOrder.Invoke(ContentProvider, new NewEstimateEvenArgs(created));
return created;
}
public static long Write(long estid, string desc, decimal ucost, int count, string productid)

View file

@ -7,6 +7,7 @@ namespace Yavsc.Model.WorkFlow
/// A Writting.
/// Une ligne d'écriture dans un devis ou une facture
/// </summary>
[Serializable]
public class Writting
{
/// <summary>