示例#1
0
        private void SaveNewDetails()
        {
            if (ConfirmDialog("Desea Guardar los Cambios", "Guardar"))
            {
                // issue resolved Factura consumidor final no tiene cuenta contable.
                if (serie.SeriesName == "ANC")
                {
                    SelectedDownPayment.CardCode = SelectedPartner.CardCode;
                }

                if (SelectedDownPayment.IdDownPayment == 0)
                {
                    DownPaymentHelper.Add(SelectedDownPayment);
                }

                DownPaymentDetail.WhsCode      = SelectedDownPayment.WhsCode;
                DownPaymentDetail.AcctCode     = Config.DownPaymentAcc;
                DownPaymentDetail.TaxCode      = SelectedDownPayment != null && SelectedDownPayment.Series == 31 ? Config.IVACOF : "IVACRF";
                SelectedDownPayment.DocTotal   = (decimal)DownPaymentDetail.Price;
                SelectedDownPayment.PaymentAcc = SelectedDownPayment.PaymentType.AcctCode;
                if (DownPaymentDetail.IdDownPaymentL == 0)
                {
                    SelectedDownPayment.DPI1_DownPaymentDetail.Add(DownPaymentDetail);
                }
                SaveChanges();
            }
            else
            {
                UndoChanges();
            }
            CheckBookHelper.SetNextCheckBookNumber(SelectedDownPayment.Series, SelectedDownPayment.NumAtCard, onErrorAction: ShowErrorMessageBox);
            ForceRefresh = true;
            RaisePropertyChanged("DownPaymentCollection");
            ViewModelManager.CloseModal();
        }
示例#2
0
        private void NewProcess()
        {
            DownPaymentHelper.Add(SelectedDownPayment);
            IsBusy = true;
            var confirmed = ConfirmDialog("Desea guardar y procesar los Cambios", "Procesar");

            ShowProcessLoader(this);

            AsyncHelper.DoAsync(() =>
            {
                if (confirmed)
                {
                    if (SelectedDownPayment.IdDownPayment == 0)
                    {
                        // issue resolved Factura consumidor final no tiene cuenta contable.
                        if (serie.SeriesName == "ANC")
                        {
                            SelectedDownPayment.CardCode = SelectedPartner.CardCode;
                        }

                        //SelectedDownPayment.StateL = LocalStatus.Pendiente;
                        DownPaymentDetail.WhsCode  = SelectedDownPayment.WhsCode;
                        DownPaymentDetail.AcctCode = Config.DownPaymentAcc;
                        DownPaymentDetail.TaxCode  = SelectedDownPayment != null && SelectedDownPayment.Series == 31 ? Config.IVACOF : "IVACRF";
                        if (DownPaymentDetail != null && DownPaymentDetail.Price.HasValue)
                        {
                            SelectedDownPayment.DocTotal = (decimal)DownPaymentDetail.Price;
                        }
                        SelectedDownPayment.DPI1_DownPaymentDetail.Add(DownPaymentDetail);

                        SaveChanges();
                        CheckBookHelper.SetNextCheckBookNumber((int)SelectedDownPayment.Series,
                                                               Convert.ToInt32(SelectedDownPayment.NumAtCard));

                        SaveChanges();
                    }
                }
                else
                {
                    UndoChanges();
                }
                Synchronization.Synchronize(SelectedDownPayment);
                IsBusy = false;
                SaveChanges();

                RefreshItemSource();
            }, ViewModelManager.CloseProcessLoader);
        }