Exemplo n.º 1
0
        public override void ExecuteNewCreditNote()
        {
            var cn = new ORIN_ClientCreditNotes()
            {
                CardCode     = SelectedDownPayment.CardCode,
                DocTotal     = DownPaymentDetail.Price ?? 0,
                DocDate      = SelectedDownPayment.DocDate,
                Comments     = DownPaymentDetail.Dscription,
                DocDueDate   = SelectedDownPayment.DocDueDate,
                Series       = 3, //serie correspondiente a nota de credito
                NumAtCard    = SelectedDownPayment.NumAtCard,
                WhsCode      = SelectedDownPayment.WhsCode,
                PaymentTypeL = SelectedDownPayment.PaymentType,
                CnTypeL      = ClientCreditNoteType.DownPayment
            };


            var vm = new ClientCreditNoteViewModel
            {
                CreditNote = cn,
                FormTitle  = "Nueva Nota de Crédito de Anticipo",
            };

            ShowDialog(new DownPaymentCreditNoteView(), vm);
        }
Exemplo n.º 2
0
        public override void ExecuteNewCreditNote()
        {
            var cn = new ORIN_ClientCreditNotes()
            {
                CardCode     = SelectedSale.CardCode,
                DocDate      = SelectedSale.DocDate,
                Comments     = SelectedSale.Comments,
                Series       = 3, //serie correspondiente a nota de credito
                NumAtCard    = SelectedSale.NumAtCard,
                DocTotal     = SelectedSale.DocTotal,
                WhsCode      = SelectedSale.WhsCode,
                PaymentTypeL = SelectedSale.PaymentType,
                CnTypeL      = ClientCreditNoteType.Sale
            };

            SalesDetailsCollection.ToList()
            .ForEach(pdc =>
            {
                var article = ArticlesHelper.GetArticle(pdc.ItemCode);
                cn.RIN1_ClientCreditNoteDetail.Add(

                    new RIN1_ClientCreditNoteDetail()
                {
                    ItemCode      = pdc.ItemCode,
                    Quantity      = pdc.Quantity,
                    Price         = pdc.Price,
                    LineTotal     = pdc.LineTotal,
                    OITM_Articles = article,
                    BaseDocNum    = selectedSale.DocNum,
                    BaseEntry     = selectedSale.DocEntry,
                    Dscription    = article.ItemName,
                    TaxCode       = pdc.TaxCode,
                });
            }
                     );


            var vm = new ClientCreditNoteViewModel
            {
                CreditNote = cn, FormTitle = "Nueva Nota de Crédito de Venta",
                //todo: reemplazar esto
                Exento      = SelectedSale.INV1_SalesDetail.Any(d => d.TaxCode == Config.IVACOM),
                WithHolding = !Exento && SelectedSale.INV1_SalesDetail.Any(d => d.TaxCode == Config.IVARET),
            };

            ShowDialog(new NewClientCreditNote(), vm);
        }