/// <summary> /// bouton d'actions diverses /// </summary> /// <param name="invoice"></param> /// <returns></returns> public static HtmlString ShowBtnActions(HtmlHelper helper, INVOICE.Invoice invoice) { if (invoice == null) { return(new HtmlString(string.Empty)); } StringBuilder retour = new StringBuilder(); try { UrlHelper urlHelper = new UrlHelper(helper.ViewContext.RequestContext); retour.Append("<div class='btn-group'>"); retour.Append("<a class='btn btn-circle btn-default btn-sm' href='javascript:;' style='margin-left:3px;' data-toggle='dropdown' aria-expanded='false'>Actions<i class='fa fa-angle-down'></i></a>"); retour.Append("<ul class='dropdown-menu pull-right'>"); retour.AppendFormat("<li><a href = '{0}' target='_blank'><i class='fa fa-eye'></i> Visualiser</a></li>", urlHelper.Action("ViewInvoice", "Invoices", new { IDInvoice = invoice.IDInvoice })); retour.Append("<li class='divider'> </li>"); if (true) // on peut pas toujours la supprimer { retour.AppendFormat("<li><a href = '{0}' title='Delete'><i style = 'color:red;' class='fa fa-remove'></i> Supprimer</a></li>", urlHelper.Action("DeleteFile", "Invoices", new { IDInvoice = invoice.IDInvoice })); } retour.Append("</ul></div>"); return(new HtmlString(retour.ToString())); } catch (System.Exception) { return(new HtmlString(string.Empty)); } }
/// <summary> /// bouton d'actions diverses /// </summary> /// <param name="invoice"></param> /// <returns></returns> public static HtmlString ShowBtnOpen(HtmlHelper helper, INVOICE.Invoice invoice) { if (invoice == null) { return(new HtmlString(string.Empty)); } StringBuilder retour = new StringBuilder(); try { UrlHelper urlHelper = new UrlHelper(helper.ViewContext.RequestContext); if (invoice.InvoiceState == ENUM.InvoiceStateEnum.PREPARE) { retour.AppendFormat("<a href='{1}' class='btn btn-primary btn-sm'><i class='fa fa-edit'></i> {0}</a>", "Modifier", urlHelper.Action("Invoice", "Invoices", new { IDInvoice = invoice.IDInvoice })); } else { retour.AppendFormat("<a href='{1}' class='btn btn-default btn-sm'><i class='fa fa-sticky-note'></i> {0}</a>", "Consulter", urlHelper.Action("DownloadFile", "Invoices", new { IDInvoice = invoice.IDInvoice })); } return(new HtmlString(retour.ToString())); } catch (System.Exception) { return(new HtmlString(string.Empty)); } }
public void ToPo(INVOICE.Invoice invoicepo, INVOICE.ENUM.ContactInvoiceTypeEnum ContactType) { if (ContactType == INVOICE.ENUM.ContactInvoiceTypeEnum.BUYER) { ToPo(invoicepo.BuyerAddress); } else if (ContactType == INVOICE.ENUM.ContactInvoiceTypeEnum.SELLER) { ToPo(invoicepo.SellerAddress); } }
/// <summary> /// Affichage du bouton status suivant /// </summary> /// <param name="invoice"></param> /// <returns></returns> public static HtmlString ShowBtnNextStep(HtmlHelper helper, INVOICE.Invoice invoice) { if (invoice == null) { return(new HtmlString(string.Empty)); } StringBuilder retour = new StringBuilder(); try { UrlHelper urlHelper = new UrlHelper(helper.ViewContext.RequestContext); if (invoice.IDInvoice < 0) // la facture n'est pas encore créer en base { retour.Append("<a class='btn btn-primary' type='submit' name='submit' value='create'><i class='fa fa-save'></i> Créer la facture</a>"); return(new HtmlString(retour.ToString())); } if (invoice.InvoiceState == ENUM.InvoiceStateEnum.PREPARE) // passer automatiquement à envoyer si pas besoin de la valider { //if(true) // retour.AppendFormat("<a class='btn btn-primary' href='{0}' title='La facture sera scellé, il ne sera plus possible de la modifier'><i class='fa fa-check-circle-o'></i> Valider la facture</a>", urlHelper.Action("invoicework", "invoices", new { invoice.IDInvoice, work = "validate" })); } else if (invoice.InvoiceState == ENUM.InvoiceStateEnum.VALIDATE) { retour.Append("<div class='btn-group'>"); retour.AppendFormat("<a href='{0}' class='btn btn-primary btn-sm'><i class='fa fa-send-o'></i> Envoyer la facture</a>", urlHelper.Action("invoicework", "invoices", new { invoice.IDInvoice, work = "send" })); // !!!choix par default dans la campagne retour.Append("<a type='button' class='btn btn-primary dropdown-toggle btn-sm' data-toggle='dropdown' aria-expanded='false'> <i class='fa fa-angle-down'></i></a>"); retour.Append("<ul class='dropdown-menu' role='menu'>"); retour.AppendFormat("<li><a href = '{0}' >Envoyer la facture par Mail</a></li>", urlHelper.Action("invoicework", "invoices", new { invoice.IDInvoice, work = "send", workvalue = "mail" })); retour.AppendFormat("<li><a href = '{0}' disabled>Envoyer la facture par Courrier postal</a></li>", urlHelper.Action("invoicework", "invoices", new { invoice.IDInvoice, work = "send", workvalue = "letter" })); retour.AppendFormat("<li><a href = '{0}' >Simplement valider, je vais l'envoyer moi même</a></li>", urlHelper.Action("invoicework", "invoices", new { invoice.IDInvoice, work = "send", workvalue = "self" })); retour.Append("</ul></div>"); } else if (invoice.InvoiceState == ENUM.InvoiceStateEnum.SEND) { //!!! déclenchement d'une popup, proposant les choix // - la facture à été payé (+ input date de paiment , avec la date du jour prérenseigné) // - annuler la facture (la facture n'a pas été payé) retour.Append("<button class='btn btn-primary btn-block' type='submit' name='submit' value='save'><i class='fa fa-gavel'></i> Cloturer la facture</button>"); } return(new HtmlString(retour.ToString())); } catch (System.Exception) { return(new HtmlString(string.Empty)); } }
public static HtmlString ShowInvoiceSteps(INVOICE.Invoice invoice) { try { StringBuilder retour = new StringBuilder(); retour.Append("<div class='row step-thin'>"); retour.AppendFormat(itemstrformatStep, 1, (invoice.InvoiceState == ENUM.InvoiceStateEnum.PREPARE ? "active" : ""), (invoice.InvoiceState >= ENUM.InvoiceStateEnum.PREPARE ? "done" : ""), "PREPARATION", "Edition de la facture"); retour.AppendFormat(itemstrformatStep, 2, (invoice.InvoiceState == ENUM.InvoiceStateEnum.VALIDATE ? "active" : ""), (invoice.InvoiceState >= ENUM.InvoiceStateEnum.VALIDATE ? "done" : ""), "VALIDATION", "Attente de validation"); retour.AppendFormat(itemstrformatStep, 4, (invoice.InvoiceState == ENUM.InvoiceStateEnum.END ? "active" : ""), (invoice.InvoiceState >= ENUM.InvoiceStateEnum.END ? "done" : ""), "FIN", "Facture payé"); retour.Append("</div>"); return(new HtmlString(retour.ToString())); } catch (System.Exception) { return(new HtmlString(string.Empty)); } }
/// <summary> /// bouton d'actions diverses /// </summary> /// <param name="invoice"></param> /// <returns></returns> public static HtmlString ShowBtnDownload(HtmlHelper helper, INVOICE.Invoice invoice) { if (invoice == null) { return(new HtmlString(string.Empty)); } StringBuilder retour = new StringBuilder(); try { UrlHelper urlHelper = new UrlHelper(helper.ViewContext.RequestContext); if (invoice.IDInvoice > 0) { retour.AppendFormat("<a href='{1}' class='btn btn-circle btn-default btn-sm'><i class='fa fa-download'></i> {0}</a>", "Télécharger la facture", urlHelper.Action("DownloadFile", "Invoices", new { IDInvoice = invoice.IDInvoice })); //DataInvoice.Resources.Resources.downloadFile } return(new HtmlString(retour.ToString())); } catch (System.Exception) { return(new HtmlString(string.Empty)); } }
/// <summary> /// Affichage du status du dossier /// </summary> /// <param name="invoice"></param> /// <returns></returns> public static HtmlString ShowInvoiceStateLabel(INVOICE.Invoice invoice) { if (invoice == null) { return(new HtmlString(string.Empty)); } StringBuilder retour = new StringBuilder(); try { if (invoice.IDInvoice == 0) { retour.AppendFormat("<span class='label label-{0}' title='{2}'>{1}</span>", "default", "non enregistrée", "Vous devez enregistrer la facture"); return(new HtmlString(retour.ToString())); } string title = ""; string color = "primary"; string texte = ""; if (invoice.InvoiceState == ENUM.InvoiceStateEnum.END) { //color = "bg-green-meadow"; color = "success"; if (invoice.DatePaid.HasValue) { title = "Payé le " + invoice.DatePaid.Value.ToShortDateString(); texte = "Payée"; } else { title = "Terminée"; texte = "Terminée"; } } else if (invoice.InvoiceState == ENUM.InvoiceStateEnum.CANCEL) { color = "default"; title = "Facture annulée"; texte = "Annulée"; } else if (invoice.InvoiceState == ENUM.InvoiceStateEnum.PREPARE) { color = "info"; title = "Edition de la facture en cours"; texte = "Edition"; } else if (invoice.InvoiceState == ENUM.InvoiceStateEnum.VALIDATE) { color = "info"; if (false) { title = "En attente de validation par tous les intervenants"; } else { title = "En attente de validation"; } texte = "Validation"; } else if (invoice.InvoiceState == ENUM.InvoiceStateEnum.SEND) { color = "blue-dark"; title = string.Format("Facture envoyée, en attente du paiement"); // envoyé par quel moyen et quand? !!! texte = "Envoyée"; } retour.AppendFormat("<span class='label label-{0}' title='{2}'>{1}</span>", color, texte, title); // icone dépassement if (invoice.InvoiceState == ENUM.InvoiceStateEnum.SEND && invoice.DateInvoice.HasValue) { int nbjour = 30; // payable en x jours if (invoice.DateInvoice.Value.AddDays(nbjour) > DateTime.Now.Date) { retour.AppendFormat("<i class='text-warning fa fa-hourglass-end' title='Le délais de paiement à été dépassé ({0} jours)'></i>", nbjour); } } return(new HtmlString(retour.ToString())); } catch (System.Exception) { return(new HtmlString(string.Empty)); } }
public void FromPo(INVOICE.Invoice invoicepo) { this.RefSeller = invoicepo.RefSeller; this.RefBuyer = invoicepo.RefBuyer; this.InvoiceComment = invoicepo.Flux.GetString("/param/data/Comment", NGLib.DATA.BASICS.DataAccessorOptionEnum.Nullable); }
public void ToPo(INVOICE.Invoice invoicepo) { invoicepo.RefSeller = this.RefSeller; invoicepo.RefBuyer = this.RefBuyer; invoicepo.Flux.SetString("/param/data/Comment", this.InvoiceComment); }