Exemplo n.º 1
0
        /// <summary>
        /// Crea una nota de crédito por el monto especificado.
        /// </summary>
        /// <param name="creditNoteTS"></param>
        /// <param name="amount"></param>
        /// <returns></returns>
        private bool SaveCreditNote(CreditNote creditNoteTS, double amount)
        {
            CreditNoteManager creditNoteManager = new CreditNoteManager();

            CreditNote creditNote = new CreditNote();

            creditNote.Amount      = amount * -1;
            creditNote.Date        = DateTime.Now;
            creditNote.Status      = CreditNote.StatusType.Aprobada;
            creditNote.Observation = "Remanente de pago: " + creditNoteTS.Id + " (monto original: " + creditNote.Amount + ")";
            creditNote.User        = creditNoteTS.User;
            creditNote.InvoiceId   = creditNoteTS.InvoiceId;
            return(creditNoteManager.Save(creditNote));
        }