public static decimal GetIVANotaCredito(NotaCreditoDto notaCredito, DateTime data) { try { if (notaCredito != null && notaCredito.Resos != null) { var resi = (from q in notaCredito.Resos where q.Data <= data select q); if (resi != null) { decimal IVA = 0; foreach (var reso in resi) { var iva = UtilityValidation.GetDecimal(reso.IVA); IVA += iva; } return(IVA); } } } catch (Exception ex) { UtilityError.Write(ex); } return(0); }
public static decimal GetImponibileNotaCredito(NotaCreditoDto notaCredito, DateTime data) { try { if (notaCredito != null && notaCredito.Resos != null) { var resi = (from q in notaCredito.Resos where q.Data <= data select q); if (resi != null) { decimal imponibile = 0; foreach (var reso in resi) { var importo = UtilityValidation.GetDecimal(reso.Importo); imponibile += importo; } return(imponibile); } } } catch (Exception ex) { UtilityError.Write(ex); } return(0); }
private void BindViewCodiceNotaCredito(NotaCreditoDto notaCredito) { try { var codice = BusinessLogic.Reso.GetCodice(notaCredito); editCodice.Value = codice; } catch (Exception ex) { UtilityError.Write(ex); } }
private void BindViewNotaCredito(NotaCreditoDto notaCredito) { try { editNotaCredito.Model = notaCredito; editNotaCredito.Value = BusinessLogic.Fattura.GetCodifica(notaCredito); } catch (Exception ex) { UtilityError.Write(ex); } }
public ResoModel(NotaCreditoDto notaCredito) { InitializeComponent(); try { this.notaCredito = notaCredito; } catch (Exception ex) { UtilityError.Write(ex); } }
public static string GetCodifica(NotaCreditoDto notaCredito) { try { if (notaCredito != null) { string codfica = notaCredito.Numero + " DEL " + UtilityValidation.GetDataND(notaCredito.Data); return(codfica); } } catch (Exception ex) { UtilityError.Write(ex); } return(null); }
internal FornitoreDto ReadFornitore(NotaCreditoDto notaCredito) { try { if (notaCredito != null) { var fornitoreId = notaCredito.FornitoreId; var fornitore = (FornitoreDto)Read(fornitoreId); return(fornitore); } } catch (Exception ex) { UtilityError.Write(ex); } return(null); }
private void BindViewTotali(NotaCreditoDto obj) { try { if (obj != null) { var data = UtilityValidation.GetData(editData.Value); editImponibile.Value = BusinessLogic.Fattura.GetImponibileNotaCredito(obj, data); editIVA.Value = BusinessLogic.Fattura.GetIVANotaCredito(obj, data); editTotale.Value = BusinessLogic.Fattura.GetTotaleNotaCredito(obj, data); } } catch (Exception ex) { UtilityError.Write(ex); } }
public static string GetCodice(NotaCreditoDto notaCredito) { try { if (notaCredito != null) { var progressivo = 1; var resi = notaCredito.Resos; if (resi != null) { progressivo = resi.Count + 1; } var codice = notaCredito.Numero + "/" + DateTime.Today.Year.ToString() + "/" + progressivo.ToString("000"); //numerofattura/anno/progressivo return(codice); } } catch (Exception ex) { UtilityError.Write(ex); } return(null); }