예제 #1
0
 public void InitData(InvoiceOwnerDTO saleOwners, List <ReportInvoiceTransDTO> List_InvoiceTrans, CTransactionsDTO cTransactions, ReportInvoice reports)
 {
     objectDataSource1.DataSource = saleOwners;
     objectDataSource2.DataSource = List_InvoiceTrans;
     objectDataSource3.DataSource = cTransactions;
     objectDataSource4.DataSource = reports;
 }
예제 #2
0
        public void PrintInvoiceReport(InvoiceOwnerDTO InvoiceOwner, List <ReportInvoiceTransDTO> reportInvoiceTrans, CTransactionsDTO cTransactions, ReportInvoice reports)
        {
            InvoiceReport_Sablon1 report = new InvoiceReport_Sablon1();

            foreach (DevExpress.XtraReports.Parameters.Parameter p in report.Parameters)
            {
                p.Visible = false;
            }
            report.InitData(InvoiceOwner, reportInvoiceTrans, cTransactions, reports);
            documentViewer1.DocumentSource = report;
            report.CreateDocument();
        }
예제 #3
0
        private void do_edit()
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Update, (int)DocumentType.InvoiceList, AppMain.CompanyRecId))
            {
                return;
            }
            InvoiceOwnerDTO oRow = (InvoiceOwnerDTO)gcv_Invoice.GetFocusedRow();

            if (oRow != null)
            {
                InvoiceEdit frm = new InvoiceEdit();
                frm.MdiParent     = this.MdiParent;
                frm.invoice       = invoice;
                frm._FormOpenType = FormOpenType.Edit;
                frm.RecId         = oRow.RecId;
                frm.Show();
            }
        }
예제 #4
0
        private void bbi_Print_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            InvoiceOwnerDTO oRow = (InvoiceOwnerDTO)gcv_Invoice.GetFocusedRow();

            if (oRow != null)
            {
                var trans = _repository.Run <InvoiceService, List <InvoiceTransDTO> >(x => x.Get_Edit_List_Trans(oRow.RecId));
                CTransactionsDTO             cTransactions = _currentTransactionsList.FirstOrDefault(x => x.CurID == oRow.CariRecId);
                List <ReportInvoiceTransDTO> reportTrans   = new List <ReportInvoiceTransDTO>();
                foreach (var item in trans)
                {
                    reportTrans.Add(new ReportInvoiceTransDTO
                    {
                        ProductName = AppMain.Products.FirstOrDefault(x => x.PID == item.ProductId).PName,
                        Tutar       = item.Tutar,
                        Unit        = item.Quentity + " " + _list_UnitsDTO.FirstOrDefault(x => x.UID == item.UnitID.GetValueOrDefault()).UName,
                        PTax        = item.KDVPrice
                    });
                }

                ReportInvoice reportInvoice = new ReportInvoice
                {
                    CustomerName    = cTransactions.CurAccountName,
                    CustomerAddress = cTransactions.CurAdress,
                    CustomerCity    = cTransactions.CurCity,
                    CustomerCountry = cTransactions.CurCountryName,
                    FaturaNo        = oRow.FicheDocumentNo,
                    FichDate        = oRow.FicDate.GetValueOrDefault(),
                    InvoiceType     = oRow.InvoiceType.GetValueOrDefault(),
                    trans           = reportTrans
                };


                frmPrint frm = new frmPrint();
                frm.PrintInvoiceReport(oRow, reportTrans, cTransactions, reportInvoice);
                frm.ShowDialog();
            }
        }
예제 #5
0
        private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.InvoiceList, AppMain.CompanyRecId))
            {
                return;
            }
            InvoiceOwnerDTO oRow = (InvoiceOwnerDTO)gcv_Invoice.GetFocusedRow();

            if (oRow != null)
            {
                if (MspTool.get_Question("Fatura Silincektir. Onaylıyor musunu?"))
                {
                    var response = _repository.Run <InvoiceService, ActionResponse <InvoiceOwnerDTO> >(x => x.Deleted_InvoiceOwner(oRow.RecId));
                    if (response.ResponseType != ResponseType.Ok)
                    {
                        DevExpress.XtraEditors.XtraMessageBox.Show(response.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    }
                    else
                    {
                        do_refresh();
                    }
                }
            }
        }
예제 #6
0
 public void InitData(InvoiceOwnerDTO saleOwners)
 {
     objectDataSource1.DataSource = saleOwners;
 }
예제 #7
0
        private void InvoiceEdit_Load(object sender, EventArgs e)
        {
            MspTool.Get_Layout(this);

            switch (invoice)
            {
            case InvoiceType.AlımFaturası:
                this.Text = "Alım Faturası";
                lytSatisFaturasi.Visibility   = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lc_IrsaliyeSaat.Visibility    = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lcgr_FatutaBilgisi.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lc_FaturaTuru.Visibility      = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lc_VadeGun.Visibility         = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lc_VadeTarih.Visibility       = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lc_OdemeTuru.Visibility       = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                bbi_İrsaliyeCagir.Enabled     = true;
                bbi_Tahsilat.Caption          = "Ödeme";
                break;

            case InvoiceType.SatisFaturasi:
                this.Text = "Satış Faturası";
                lytSatisFaturasi.Visibility   = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lc_IrsaliyeSaat.Visibility    = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lcgr_FatutaBilgisi.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lc_FaturaTuru.Visibility      = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lc_VadeGun.Visibility         = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lc_VadeTarih.Visibility       = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lc_OdemeTuru.Visibility       = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                bbi_İrsaliyeCagir.Enabled     = true;
                bbi_Tahsilat.Caption          = "Tahsilat";
                break;

            case InvoiceType.AlisIrsaliye:
                this.Text = "Alış İrsaliyesi";
                lc_IrsaliyeSaat.Visibility    = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lcgr_FatutaBilgisi.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lc_FaturaTuru.Visibility      = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lc_VadeGun.Visibility         = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lc_VadeTarih.Visibility       = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lc_OdemeTuru.Visibility       = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                bbi_İrsaliyeCagir.Enabled     = false;
                bbi_Tahsilat.Visibility       = DevExpress.XtraBars.BarItemVisibility.Never;
                break;

            case InvoiceType.SatisIrsaliye:
                this.Text = "Satış İrsaliyesi";
                lcgr_FatutaBilgisi.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lc_IrsaliyeSaat.Visibility    = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                lc_FaturaTuru.Visibility      = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lc_VadeGun.Visibility         = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lc_VadeTarih.Visibility       = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                lc_OdemeTuru.Visibility       = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                bbi_İrsaliyeCagir.Enabled     = false;
                bbi_Tahsilat.Visibility       = DevExpress.XtraBars.BarItemVisibility.Never;
                break;

            default:
                break;
            }

            _currencyTypes             = _repository.Run <DefinitionsService, List <CurrencyTypeDTO> >(x => x.Get_List_CurrencyType());
            bs_CurrencyType.DataSource = _currencyTypes;

            _company = _repository.Run <StartUp, List <CompanyDTO> >(x => x.GetList_Company());
            bs_company.DataSource = _company;

            if (_FormOpenType == FormOpenType.New)
            {
                __dll_InvoiceOwner             = new InvoiceOwnerDTO();
                __dll_List_InoviceTrans        = new List <InvoiceTransDTO>();
                __dll_InvoiceOwner.InvoiceType = (int)invoice;
                __dll_InvoiceOwner.FicDate     = DateTime.Now;
                __dll_InvoiceOwner.VadeTarih   = DateTime.Now;
                __dll_InvoiceOwner.VadeGun     = 0;
                __dll_InvoiceOwner.KDV         = "Dahil";
                __dll_InvoiceOwner.CompanyId   = AppMain.CompanyRecId;
                lc_Company.EditValue           = AppMain.Company;
                if (_currencyTypes.Count > 0)
                {
                    __dll_InvoiceOwner.DovizTuru = _currencyTypes.FirstOrDefault(x => x.Remark == "TL").RecId;
                    lc_DovizTuru.EditValue       = _currencyTypes.FirstOrDefault(x => x.Remark == "TL").Remark;
                }
                if (CariId != 0)
                {
                    txtCariHesapAdi.EditValue = CariId;
                }
            }
            if (_FormOpenType == FormOpenType.Edit)
            {
                __dll_InvoiceOwner      = _repository.Run <InvoiceService, InvoiceOwnerDTO>(x => x.Get_Invoice(RecId));
                __dll_List_InoviceTrans = _repository.Run <InvoiceService, List <InvoiceTransDTO> >(x => x.Get_Edit_List_Trans(RecId));
            }
            if (_FormOpenType == FormOpenType.View)
            {
                gc_invoiceTrans.Enabled = false;
                bbi_save.Enabled        = false;
            }

            txtFaturaTipi.Properties.DataSource    = FaturaTuru;
            txtFaturaTipi.Properties.ValueMember   = "Id";
            txtFaturaTipi.Properties.DisplayMember = "Value";

            _list_UnitsDTO     = _repository.Run <DepotStockService, List <UnitsDTO> >(x => x.GetListUnit());
            bs_Unit.DataSource = _list_UnitsDTO;

            _productlist          = _repository.Run <DepotStockService, List <ProductDTO> >(x => x.GetListProduct());
            bs_Product.DataSource = _productlist;

            _currentTransactionsList = _repository.Run <CurrentTransactionsService, List <CTransactionsDTO> >(x => x.GetListCurrentTransactions());
            bs_CariHesap.DataSource  = _currentTransactionsList;



            _depotList          = _repository.Run <DepotService, List <DepotDTO> >(x => x.GetListDepot());
            bs_Depot.DataSource = _depotList;

            rp_KDV.DataSource    = KdvOrani;
            rp_KDV.ValueMember   = "Id";
            rp_KDV.DisplayMember = "Value";

            bs_InvoiceOwner.DataSource = __dll_InvoiceOwner;
            bs_InvoiceTrans.DataSource = __dll_List_InoviceTrans;
        }