示例#1
0
        private void VisualizzaMovimentoSpesa()
        {
            if (MetaData.Empty(this))
            {
                return;
            }
            if (DS.Tables["csa_contracttaxepexp"] == null)
            {
                return;
            }
            //Calcola e riempie i campi relativi alla fase precedente:
            object    idepexp = DS.Tables["csa_contracttaxepexp"].Rows[0]["idepexp"];
            string    filter  = QHS.CmpEq("idepexp", idepexp);
            DataTable DT      = Conn.RUN_SELECT("epexp", "idepexp,yepexp,nepexp,nphase", null, filter, null, true);

            if (DT.Rows.Count == 0)
            {
                return;
            }
            txtEsercizioImpegno.Text = DT.Rows[0]["yepexp"].ToString();
            txtNumImpegno.Text       = DT.Rows[0]["nepexp"].ToString();
            if (DS.epexp.Rows.Count > 0)
            {
                object currtipo = DS.Tables["epexp"].Rows[0]["nphase"];
                HelpForm.SetComboBoxValue(cmbFaseImpBudget, currtipo);
            }
        }
示例#2
0
        private void ValorizzaControlloCustom(string tag)
        {
            if (tag == "")
            {
                return;
            }
            int    dotpos = tag.IndexOf(".");
            string tipo   = tag.Substring(0, dotpos);
            string valore = HelpForm.GetLastField(tag, 1);

            switch (tipo.ToLower())
            {
            case "costant":
                rdoCostant.Checked = true;
                chkHidden.Checked  = (valore == "hidden"?true:false);
                break;

            case "check":
                rdoCheck.Checked = true;
                txtCheck.Text    = valore;
                break;

            case "radio":
                rdoRadio.Checked = true;
                txtRadio.Text    = valore;
                break;

            case "custom":
                rdoCustom.Checked = true;
                HelpForm.SetComboBoxValue(cboCustom, valore);
                break;
            }
        }
示例#3
0
        private void RiempiControlli(DataRow RStockview)
        {
            grpDettaglio.Enabled = false;
            if (RStockview == null)
            {
                return;
            }
            txtDescrizioneListino.Text = RStockview["list"].ToString();
            txtListino.Text            = RStockview["intcode"].ToString();
            DataRow Rlist = Conn.RUN_SELECT("list", "*", null, QHS.CmpEq("idlist", RStockview["idlist"]), null, true).Rows[0];

            FreshLogo(Rlist);

            HelpForm.SetComboBoxValue(cmbMagazzino, RStockview["idstore"]);
            cmbMagazzino.Enabled = (RStockview["idmankind"] == DBNull.Value);
            if (RStockview["expiry"] != DBNull.Value)
            {
                DateTime Texpiry = (DateTime)RStockview["expiry"];
                txtExpiry.Text = Texpiry.ToShortDateString();
            }
            has_expiry             = (Rlist["has_expiry"].ToString() != "S")? false : true;
            txtIdUbicazione.Text   = RStockview["stocklocationcode"].ToString();
            txtDescUbicazione.Text = RStockview["stocklocation"].ToString();

            idstocklocation = RStockview["idstocklocation"];
        }
示例#4
0
        public FrmAskFase(decimal importoIncasso, DataTable upbTable, DataTable finviewTable,
                          MetaDataDispatcher Disp, DataAccess Conn)
        {
            InitializeComponent();
            this.Disp    = Disp;
            this.Conn    = Conn;
            this.upb     = upbTable;
            this.finview = finviewTable;
            this.importo = importoIncasso;

            cmbUpb.DataSource    = upb;
            cmbUpb.ValueMember   = "idupb";
            cmbUpb.DisplayMember = "codeupb";
            Selected             = null;


            QHC = new CQueryHelper();
            QHS = this.Conn.GetQueryHelper();

            HelpForm.SetComboBoxValue(cmbUpb, "0001");
            DataRow[] RUPB = upb.Select(QHC.CmpEq("idupb", "0001"));
            if (RUPB.Length > 0)
            {
                txtDescrizioneUpb.Text = RUPB[0]["title"].ToString();
            }
        }
示例#5
0
        void SetComboCausaleFattura()
        {
            ClearComboCausale();
            EnableTipoMovimento(1, "Contabilizzazione importo totale documento");
            int currtipo = 1;

            HelpForm.SetComboBoxValue(cmbCausale, currtipo);
        }
示例#6
0
        public FrmAskBilancio(object upbParent, object finParent, decimal importoLiquidazione,
                              MetaDataDispatcher Disp, DataAccess Conn)
        {
            InitializeComponent();
            QHC = new CQueryHelper();
            QHS = Conn.GetQueryHelper();

            this.upbParent = upbParent;
            this.finParent = finParent;
            this.Disp      = Disp;
            this.Conn      = Conn;
            this.importo   = importoLiquidazione;

            MetaUpb = Disp.Get("upb");
            Meta    = Disp.Get("finview");

            finview = DataAccess.CreateTableByName(Conn, "finview", "*");
            upb     = DataAccess.CreateTableByName(Conn, "upb", "*");
            GetData.MarkToAddBlankRow(upb);
            GetData.Add_Blank_Row(upb);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, upb, null, null, null, true);

            cmbUpb.DataSource    = upb;
            cmbUpb.ValueMember   = "idupb";
            cmbUpb.DisplayMember = "codeupb";

            if (upbParent != DBNull.Value)
            {
                string  filterUpb = QHC.CmpEq("idupb", upbParent);
                DataRow UPBRow    = upb.Select(filterUpb)[0];
                txtDescrizioneUpb.Text = UPBRow["title"].ToString();
                HelpForm.SetComboBoxValue(cmbUpb, upbParent);

                if (finParent != DBNull.Value)
                {
                    string filterFinView = QHS.AppAnd(QHS.CmpEq("idfin", finParent), QHS.CmpEq("idupb", upbParent));
                    DataAccess.RUN_SELECT_INTO_TABLE(Conn, finview, null, filterFinView, null, true);

                    if (finview.Rows.Count > 0)
                    {
                        DataRow finRow = finview.Rows[0];
                        txtCodiceBilancio.Text        = finRow["codefin"].ToString();
                        txtDenominazioneBilancio.Text = finRow["title"].ToString();
                    }
                }
            }

            responsabile = DataAccess.CreateTableByName(Meta.Conn, "manager", "*");
            GetData.MarkToAddBlankRow(responsabile);
            GetData.Add_Blank_Row(responsabile);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, responsabile, null, null, null, true);

            cmbResponsabile.DataSource    = responsabile;
            cmbResponsabile.ValueMember   = "idman";
            cmbResponsabile.DisplayMember = "title";

            Selected = null;
        }
示例#7
0
        public void MetaData_AfterRowSelect(DataTable T, DataRow R)
        {
            if (T.TableName == "tax")
            {
                if (!Meta.DrawStateIsDone)
                {
                    return;
                }
                //if (Meta.IsEmpty) return;
                //DataRow Curr = DS.expensetaxofficialview.Rows[0];
                if (R == null)
                {
                    grpCity.Visible   = false;
                    grpRegion.Visible = false;
                    //Curr["idcity"] = DBNull.Value;
                    //Curr["idfiscaltaxregion"] = DBNull.Value;
                }
                else
                {
                    DataRow[] Tax = DS.tax.Select(QHC.CmpEq("taxcode", R["taxcode"]));
                    if (Tax.Length > 0)
                    {
                        DataRow rTax = Tax[0];
                        string  geo  = rTax["geoappliance"].ToString().ToUpper();
                        switch (geo)
                        {
                        case "C": {
                            grpCity.Visible   = true;
                            grpRegion.Visible = false;
                            //Curr["idfiscaltaxregion"] = DBNull.Value;
                            HelpForm.SetComboBoxValue(cmbRegioneFiscale, -1);
                            break;
                        }

                        case "R": {
                            grpCity.Visible   = false;
                            grpRegion.Visible = true;
                            //Curr["idcity"] = DBNull.Value;
                            txtGeoComune0101.Text = "";
                            txtProvincia.Text     = "";
                            break;
                        }

                        default: {
                            grpCity.Visible   = false;
                            grpRegion.Visible = false;
                            //Curr["idcity"] = DBNull.Value;
                            //Curr["idfiscaltaxregion"] = DBNull.Value;
                            txtGeoComune0101.Text = "";
                            txtProvincia.Text     = "";
                            HelpForm.SetComboBoxValue(cmbRegioneFiscale, -1);
                            break;
                        }
                        }
                    }
                }
            }
        }
示例#8
0
        private void btnCopy_Click(object sender, EventArgs e)
        {
            // Ricopiatura delle informazioni del dettaglio annullato, nel nuovo dettaglio
            if (CfgFn.GetNoNullInt32(cmbOldTipoIva.SelectedValue) != 0)
            {
                HelpForm.SetComboBoxValue(cmbNewTipoIva, cmbOldTipoIva.SelectedValue);
            }

            if (CfgFn.GetNoNullInt32(cmbOldUnitaMisuraAcquisto.SelectedValue) != 0)
            {
                HelpForm.SetComboBoxValue(cmbNewUnitaMisuraAcquisto, cmbOldUnitaMisuraAcquisto.SelectedValue);
            }

            if (CfgFn.GetNoNullInt32(cmbOldUnitaMisuraCS.SelectedValue) != 0)
            {
                HelpForm.SetComboBoxValue(cmbNewUnitaMisuraCS, cmbOldUnitaMisuraCS.SelectedValue);
            }

            txtNewCoeffConversione.Text = txtOldCoeffConversione.Text;

            txtNewAliquota.Text            = txtOldAliquota.Text;
            txtNewPercIndet.Text           = txtOldPercIndet.Text;
            txtNewQuantitaConfezioni.Text  = txtOldQuantitaConfezioni.Text;
            txtNewQuantita.Text            = txtOldQuantita.Text;
            txtNewImportoUnitario.Text     = txtOldImportoUnitario.Text;
            txtNewSconto.Text              = txtOldSconto.Text;
            txtNewImponibileValuta.Text    = txtOldImponibileValuta.Text;
            txtNewImponibileEuro.Text      = txtOldImponibileEuro.Text;
            txtNewIvaEuro.Text             = txtOldIvaEuro.Text;
            txtNewIvaIndetraibileEuro.Text = txtOldIvaIndetraibileEuro.Text;
            chkNewPromiscuo.Checked        = chkOldPromiscuo.Checked;
            rdoNewAttivita1.Checked        = rdoOldAttivita1.Checked;
            rdoNewAttivita2.Checked        = rdoOldAttivita2.Checked;
            rdoNewAttivita3.Checked        = rdoOldAttivita3.Checked;
            rdoNewAttivita4.Checked        = rdoOldAttivita4.Checked;
            txtNewDescrizione.Text         = txtOldDescrizione.Text;

            txtNewCoeffConversione.Text   = txtOldCoeffConversione.Text;
            txNewListino.Text             = txtOldListino.Text;
            txtNewDescrizioneListino.Text = txtOldDescrizioneListino.Text;

            new_idlist      = idlist;
            new_idinv       = idinv;
            new_assetkind   = assetkind;
            new_va3type     = va3type;
            new_idaccmotive = idaccmotive;
            if (new_idaccmotive != DBNull.Value)
            {
                DataTable Accmotive = Conn.RUN_SELECT("accmotive", "*", null, QHS.CmpEq("idaccmotive", new_idaccmotive),
                                                      null, false);
                if (Accmotive.Rows.Count > 0)
                {
                    DataRow RAccMotive = Accmotive.Rows[0];
                    txtCodiceCausale.Text      = RAccMotive["codemotive"].ToString();
                    txtDescrizioneCausale.Text = RAccMotive["title"].ToString();
                }
            }
        }
示例#9
0
        private void riempiOggetti(DataRow listRow)
        {
            txtListino.Text            = (listRow != null) ? listRow["intcode"].ToString() : "";
            txtDescrizioneListino.Text = (listRow != null) ? listRow["description"].ToString() : "";
            txtCoeffConversione.Text   = (listRow != null) ? listRow["unitsforpackage"].ToString() : "";

            HelpForm.SetComboBoxValue(cmbUnitaMisuraCS, listRow["idunit"]);
            HelpForm.SetComboBoxValue(cmbUnitaMisuraAcquisto, listRow["idpackage"]);
        }
示例#10
0
 public void MetaData_AfterClear()
 {
     DataRow[] r = DS.treasurer.Select(QHC.CmpEq("flagdefault", "S"));
     if (r.Length > 0)
     {
         HelpForm.SetComboBoxValue(cmbIstitutoCassiere, r[0]["idtreasurer"]);
     }
     Text = "Trasmissione elettronica delle distinte alla banca";
 }
示例#11
0
        void ImpostaCassiere(DataRow UPB)
        {
            if (Meta.IsEmpty)
            {
                return;
            }
            DataRow Curr = DS.proceedspart.Rows[0];

            if (UPB["idtreasurer"] != DBNull.Value)
            {
                //Curr["idtreasurer"] = UPB["idtreasurer"];
                HelpForm.SetComboBoxValue(cmbCassiereUscita, UPB["idtreasurer"]);
            }
        }
示例#12
0
        public void MetaData_AfterFill()
        {
            SetDefaultForIdstoreload_motive();
            object  curridstore = (cmbMagazzino.SelectedValue != null) ? cmbMagazzino.SelectedValue : DBNull.Value;
            DataRow rStore      = null;

            if (curridstore != DBNull.Value && curridstore.ToString() != "")
            {
                rStore = DS.store.Select(QHC.CmpEq("idstore", curridstore))[0];
            }

            if (!Meta.IsEmpty)
            {
                if (rStore != null)
                {
                    int idstore = CfgFn.GetNoNullInt32(rStore["idstore"]);
                    MetaData.SetDefault(DS.stock, "idstore", idstore);
                }
            }

            object  currdddt_in_motive = (cmbCausale.SelectedValue != null) ? cmbCausale.SelectedValue : DBNull.Value;
            DataRow Rddt_in_motive     = null;

            if (currdddt_in_motive != DBNull.Value && currdddt_in_motive.ToString() != "")
            {
                Rddt_in_motive = DS.ddt_in_motive.Select(QHC.CmpEq("idddt_in_motive", currdddt_in_motive))[0];
            }

            if (!Meta.IsEmpty)
            {
                if (Rddt_in_motive != null)
                {
                    int idstoreload_motive = CfgFn.GetNoNullInt32(Rddt_in_motive["idstoreload_motive"]);
                    MetaData.SetDefault(DS.stock, "idstoreload_motive", idstoreload_motive);
                    HelpForm.SetComboBoxValue(cmbCausaleCarico, Rddt_in_motive["idstoreload_motive"]);
                }
            }

            if (Meta.EditMode)
            {
                EnableDisableMagazzino();
            }
            if (!Meta.IsEmpty)
            {
                EnabledDisableStoreRegistry();
            }
        }
示例#13
0
        public void MetaData_AfterFill()
        {
            if (!Meta.InsertMode)
            {
                return;
            }

            DataRow CurrRow = DS.viewcolumn.Rows[0];

            if (SourceRow["realtable"].ToString() == "")
            {
                SourceRow["realtable"] = MainTable;
                HelpForm.SetComboBoxValue(comboTab, MainTable);
            }

            SetDefaultField();
        }
示例#14
0
 private void RichiestaCambioResponsabile(object currIdman)
 {
     if ((currIdman != DBNull.Value) &&
         ((cmbResponsabile.SelectedValue == null) ||
          ((cmbResponsabile.SelectedValue != null) &&
           (cmbResponsabile.SelectedValue.ToString() != currIdman.ToString()))
         )
         )
     {
         if ((cmbResponsabile.SelectedIndex <= 0) ||
             MessageBox.Show("Cambio il responsabile in base alla voce di bilancio selezionata?",
                             "Conferma", MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             HelpForm.SetComboBoxValue(cmbResponsabile, currIdman);
         }
     }
 }
示例#15
0
        private void btnCopy_Click(object sender, EventArgs e)
        {
            // Ricopiatura delle informazioni del dettaglio annullato, nel nuovo dettaglio
            if (CfgFn.GetNoNullInt32(cmbOldTipoIva.SelectedValue) != 0)
            {
                HelpForm.SetComboBoxValue(cmbNewTipoIva, cmbOldTipoIva.SelectedValue);
            }

            txtNewAliquota.Text         = txtOldAliquota.Text;
            txtNewQuantita.Text         = txtOldQuantita.Text;
            txtNewImportoUnitario.Text  = txtOldImportoUnitario.Text;
            txtNewSconto.Text           = txtOldSconto.Text;
            txtNewImponibileValuta.Text = txtOldImponibileValuta.Text;
            txtNewIvaValuta.Text        = txtOldIvaValuta.Text;
            txtNewImponibileEuro.Text   = txtOldImponibileEuro.Text;
            txtNewIvaEuro.Text          = txtOldIvaEuro.Text;
            txtNewDescrizione.Text      = txtOldDescrizione.Text;
        }
示例#16
0
        private void riempiOggetti(DataRow listRow)
        {
            txtListino.Text            = (listRow != null) ? listRow["intcode"].ToString() : "";
            txtDescrizioneListino.Text = (listRow != null) ? listRow["description"].ToString() : "";
            txtCoeffConversione.Text   = (listRow != null) ? listRow["unitsforpackage"].ToString() : "";
            bool has_expiry = (listRow["has_expiry"].ToString() != "S") ? false : true;

            if (!has_expiry)
            {
                lblScadenza.Visible     = false;
                txtValiditystop.Visible = false;
            }
            else
            {
                lblScadenza.Visible     = true;
                txtValiditystop.Visible = true;
            }
            DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.unit, null, QHS.CmpEq("idunit", listRow["idunit"]), null, true);
            HelpForm.SetComboBoxValue(cmbUnitaMisuraCS, listRow["idunit"]);
            DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.package, null, QHS.CmpEq("idpackage", listRow["idpackage"]), null, true);
            HelpForm.SetComboBoxValue(cmbUnitaMisuraAcquisto, listRow["idpackage"]);

            if (listRow["idunit"] != DBNull.Value)
            {
                string UnitaCarico = listRow["unit"].ToString();
                lblQuantita.Text = "N. " + UnitaCarico;
            }
            else
            {
                lblQuantita.Text = "Quantità";
            }
            if (listRow["idpackage"] != DBNull.Value)
            {
                string UnitaAcquisto = listRow["package"].ToString();
                lblQuantitaConfezioni.Text = "N. " + UnitaAcquisto;
            }
            else
            {
                lblQuantitaConfezioni.Text = "Quantità totale";
            }
            FreshLogo(listRow);
        }
示例#17
0
        private void btnCopy_Click(object sender, EventArgs e)
        {
            // Ricopiatura delle informazioni del dettaglio annullato, nel nuovo dettaglio
            if (CfgFn.GetNoNullInt32(cmbOldTipoIva.SelectedValue) != 0)
            {
                HelpForm.SetComboBoxValue(cmbNewTipoIva, cmbOldTipoIva.SelectedValue);
            }

            if (CfgFn.GetNoNullInt32(cmbOldUnitaMisuraAcquisto.SelectedValue) != 0)
            {
                HelpForm.SetComboBoxValue(cmbNewUnitaMisuraAcquisto, cmbOldUnitaMisuraAcquisto.SelectedValue);
            }

            if (CfgFn.GetNoNullInt32(cmbOldUnitaMisuraCS.SelectedValue) != 0)
            {
                HelpForm.SetComboBoxValue(cmbNewUnitaMisuraCS, cmbOldUnitaMisuraCS.SelectedValue);
            }
            txtNewCoeffConversione.Text = txtOldCoeffConversione.Text;

            txtNewAliquota.Text            = txtOldAliquota.Text;
            txtNewPercIndet.Text           = txtOldPercIndet.Text;
            txtNewQuantitaConfezioni.Text  = txtOldQuantitaConfezioni.Text;
            txtNewQuantita.Text            = txtOldQuantita.Text;
            txtNewImportoUnitario.Text     = txtOldImportoUnitario.Text;
            txtNewSconto.Text              = txtOldSconto.Text;
            txtNewImponibileValuta.Text    = txtOldImponibileValuta.Text;
            txtNewImponibileEuro.Text      = txtOldImponibileEuro.Text;
            txtNewIvaEuro.Text             = txtOldIvaEuro.Text;
            txtNewIvaIndetraibileEuro.Text = txtOldIvaIndetraibileEuro.Text;
            chkNewPromiscuo.Checked        = chkOldPromiscuo.Checked;
            rdoNewAttivita1.Checked        = rdoOldAttivita1.Checked;
            rdoNewAttivita2.Checked        = rdoOldAttivita2.Checked;
            rdoNewAttivita3.Checked        = rdoOldAttivita3.Checked;
            rdoNewAttivita4.Checked        = rdoOldAttivita4.Checked;
            txtNewDescrizione.Text         = txtOldDescrizione.Text;

            txtNewCoeffConversione.Text   = txtOldCoeffConversione.Text;
            txNewListino.Text             = txtOldListino.Text;
            txtNewDescrizioneListino.Text = txtOldDescrizioneListino.Text;
        }
示例#18
0
        public FrmSelectDetailsFromBooking(MetaData Meta, string filtersql, vistaForm DS)
        {
            InitializeComponent();
            this.Meta      = Meta;
            this.Conn      = Meta.Conn;
            this.Disp      = Meta.Dispatcher;
            this.filtersql = filtersql;
            this.DS        = DS;
            QHC            = new CQueryHelper();
            QHS            = Meta.Conn.GetQueryHelper();

            // Magazzino
            DataTable store = Conn.CreateTableByName("store", "*", false);
            DataSet   D     = new DataSet();

            D.Tables.Add(store);
            Conn.RUN_SELECT_INTO_TABLE(store, "description", filtersql, null, true);
            cmbMagazzino.DataSource    = store;
            cmbMagazzino.ValueMember   = "idstore";
            cmbMagazzino.DisplayMember = "description";
            HelpForm.SetComboBoxValue(cmbMagazzino, store.Rows[0]["idstore"]);
            cmbMagazzino.Enabled = false;

            // Responsabile
            DataTable manager = Conn.CreateTableByName("manager", "*", false);

            D.Tables.Add(manager);
            GetData.MarkToAddBlankRow(manager);
            GetData.Add_Blank_Row(manager);
            Conn.RUN_SELECT_INTO_TABLE(manager, "title", null, null, true);
            cmbResponsabile.DataSource    = manager;
            cmbResponsabile.ValueMember   = "idman";
            cmbResponsabile.DisplayMember = "title";

            Conn.DeleteAllUnselectable(manager);
            //RiempiGrid();
            FormInit();
        }
示例#19
0
        private void ImpostaOggetti()
        {
            if (idexp != DBNull.Value)
            {
                chkSpesa.Checked = true;
                EnableDisable(false);

                DataRow rExpense = Conn.RUN_SELECT("expense", "*", null, QHS.CmpEq("idexp", idexp), null, true).Rows[0];
                txtNum.Text   = rExpense["nmov"].ToString();
                txtEserc.Text = rExpense["ymov"].ToString();
                cmbFaseSpesa.SelectedValue = rExpense["nphase"];
            }
            else
            {
                chkSpesa.Checked = false;
                EnableDisable(true);
            }

            if (idmanager != DBNull.Value && idmanager.ToString() != "" && responsabile.Rows.Count > 0)
            {
                HelpForm.SetComboBoxValue(cmbResponsabile, idmanager);
            }
            else
            {
                cmbResponsabile.SelectedIndex = 0;
            }
            if (idupb != null && idupb.ToString() != "" && upb.Rows.Count > 0)
            {
                HelpForm.SetComboBoxValue(cmbUPB, idupb);
            }
            if (idfin != DBNull.Value)
            {
                txtBilancio.Text = fin.Rows[0]["codefin"].ToString();
                txtDenominazioneBilancio.Text = fin.Rows[0]["title"].ToString();
            }
        }
示例#20
0
        private void btnSelect_Click(object sender, EventArgs e)
        {
            MetaDettaglio = Disp.Get("estimatedetailgroupview");
            MetaDettaglio.FilterLocked = true;
            MetaDettaglio.DS           = new DataSet();

            string filter = QHS.AppAnd(QHS.MCmp(rContratto, new string[] { "idestimkind", "yestim", "nestim" })
                                       , QHS.IsNull("stop"));
            int count = Conn.RUN_SELECT_COUNT("estimatedetailgroupview", filter, true);

            if (count == 0)
            {
                MessageBox.Show(this, "Nel contratto selezionato non esistono dettagli da annullare", "Avviso",
                                MessageBoxButtons.OK);
                return;
            }
            DataRow rDett = MetaDettaglio.SelectOne("dettaglio", filter, null, null);

            if (rDett == null)
            {
                MessageBox.Show(this, "Non è stata selezionata alcuna riga", "Avviso",
                                MessageBoxButtons.OK);
                return;
            }

            // Valorizzazione degli oggetti:

            HelpForm.SetComboBoxValue(cmbOldTipoIva, rDett["idivakind"]);
            DataRow[] IvaKind = tOldIvaKind.Select(QHC.CmpEq("idivakind", rDett["idivakind"]));
            if (IvaKind.Length > 0)
            {
                DataRow rIvaKind = IvaKind[0];
                double  perc     = CfgFn.GetNoNullDouble(rIvaKind["rate"]);

                txtOldAliquota.Text = HelpForm.StringValue(perc, "x.y.fixed.4..%.100");
            }

            double quantita = CfgFn.GetNoNullDouble(rDett["number"]);

            txtOldQuantita.Text = quantita.ToString("n");

            double importoUnitario = CfgFn.GetNoNullDouble(rDett["taxable"]);

            txtOldImportoUnitario.Text = importoUnitario.ToString();

            double sconto = CfgFn.GetNoNullDouble(rDett["discount"]);

            txtOldSconto.Text = sconto.ToString("p");

            double imponibileValuta = CfgFn.RoundValuta((importoUnitario * quantita * (1 - sconto)));

            txtOldImponibileValuta.Text = imponibileValuta.ToString();

            double ivaValuta = CfgFn.GetNoNullDouble(rDett["tax"]);

            txtOldIvaValuta.Text = ivaValuta.ToString();

            decimal imponibileEuro = CfgFn.GetNoNullDecimal(rDett["taxable_euro"]);

            txtOldImponibileEuro.Text = imponibileEuro.ToString("c");

            decimal ivaEuro = CfgFn.GetNoNullDecimal(rDett["iva_euro"]);

            txtOldIvaEuro.Text = ivaEuro.ToString("c");

            txtOldDescrizione.Text = rDett["detaildescription"].ToString();
            txtOldIdGroup.Text     = rDett["idgroup"].ToString();

            btnCopy.Enabled = true;
            rOldDettaglio   = rDett;
            btnOK.Enabled   = true;
        }
示例#21
0
        public void MetaData_AfterRowSelect(DataTable T, DataRow R)
        {
            if (T.TableName == "ddt_in_motive")
            {
                if (!Meta.DrawStateIsDone)
                {
                    return;
                }
                if (Meta.IsEmpty)
                {
                    return;
                }
                if (R == null)
                {
                    if (cmbCausaleCarico.SelectedIndex > 0)
                    {
                        cmbCausaleCarico.SelectedIndex = -1;
                    }
                    // Pulisce anche i dettagli
                    //foreach (DataRow Dett in DS.stock.Rows){
                    //   Dett["idstoreload_motive"] = DBNull.Value;
                    //}
                    MetaData.SetDefault(DS.stock, "idstoreload_motive", DBNull.Value);

                    return;
                }
                if (R["idstoreload_motive"] == DBNull.Value)
                {
                    if (cmbCausaleCarico.SelectedIndex > 0)
                    {
                        cmbCausaleCarico.SelectedIndex = -1;
                    }
                    MetaData.SetDefault(DS.stock, "idstoreload_motive", DBNull.Value);
                }
                else
                {
                    HelpForm.SetComboBoxValue(cmbCausaleCarico, R["idstoreload_motive"]);
                    // Ora opera sui dettagli
                    object idstoreload_motive_selected = R["idstoreload_motive"];
                    foreach (DataRow Dett in DS.stock.Rows)
                    {
                        if (!Dett["idstoreload_motive"].Equals(idstoreload_motive_selected))
                        {
                            Dett["idstoreload_motive"] = idstoreload_motive_selected;
                        }
                    }
                    MetaData.SetDefault(DS.stock, "idstoreload_motive", idstoreload_motive_selected);
                }
            }

            if (T.TableName == "store")
            {
                if (!Meta.DrawStateIsDone)
                {
                    return;
                }
                if (R == null)
                {
                    if (cmbMagazzino.SelectedIndex > 0)
                    {
                        cmbMagazzino.SelectedIndex = -1;
                    }
                    // Pulisce anche i dettagli
                    foreach (DataRow Dett in DS.stock.Rows)
                    {
                        Dett["idstore"] = DBNull.Value;
                    }
                    MetaData.SetDefault(DS.stock, "idstore", DBNull.Value);

                    return;
                }
                if ((Meta.InsertMode) || (Meta.EditMode))
                {
                    //aggiorno il codice del magazzino dei dettagli
                    object  idstore_selected = R["idstore"];
                    DataRow Curr             = DS.ddt_in.Rows[0];
                    Curr["idstore"] = idstore_selected;

                    foreach (DataRow Dett in DS.stock.Rows)
                    {
                        if (!Dett["idstore"].Equals(idstore_selected))
                        {
                            Dett["idstore"] = idstore_selected;
                        }
                    }
                    MetaData.SetDefault(DS.stock, "idstore", idstore_selected);
                }
            }
        }
示例#22
0
        public void MetaData_AfterRowSelect(DataTable T, DataRow R)
        {
            if (T == null)
            {
                return;
            }
            if (T.TableName == "intrastatcode" && Meta.DrawStateIsDone)
            {
                if (R != null && !Meta.IsEmpty)
                {
                    DataRow Curr = DS.invoicedetail.Rows[0];
                    HelpForm.SetComboBoxValue(cmbmeasure, R["idintrastatmeasure"]);
                    Curr["idintrastatmeasure"] = R["idintrastatmeasure"];
                }
            }
            if (T.TableName == "invoicekind")
            {
                if ((R == null) || (R["flag"] == DBNull.Value))
                {
                    grpRiga.Visible          = true;
                    grpRigaContratto.Visible = true;
                    return;
                }

                string AoV  = VeroTipoFatturaAV();
                string AVAR = (CfgFn.GetNoNullByte(R["flag"]) & 4) != 0 ? "S" : "N";
                if (AVAR == "S")
                {
                    grpInvMain.Visible = true;
                }
                else
                {
                    grpInvMain.Visible = false;
                }


                if (AoV == "A")
                {
                    grpRiga.Visible          = true;
                    grpRigaContratto.Visible = false;

                    txtEsercizioIva.Tag        = "expense_iva.ymov";
                    txtNumeroIva.Tag           = "expense_iva.nmov";
                    txtEsercizioImponibile.Tag = "expense_taxable.ymov";
                    txtNumImponibile.Tag       = "expense_taxable.nmov";

                    lblPercIndeduc.Visible = true;
                    txtPercIndeduc.Visible = true;
                    lblIvaIndedEUR.Visible = true;
                    txtImpDeducEUR.Visible = true;
                }

                if (AoV == "V")
                {
                    grpRiga.Visible          = false;
                    grpRigaContratto.Visible = true;

                    txtEsercizioIva.Tag        = "income_iva.ymov";
                    txtNumeroIva.Tag           = "income_iva.nmov";
                    txtEsercizioImponibile.Tag = "income_taxable.ymov";
                    txtNumImponibile.Tag       = "income_taxable.nmov";

                    lblPercIndeduc.Visible = false;
                    txtPercIndeduc.Visible = false;
                    lblIvaIndedEUR.Visible = false;
                    txtImpDeducEUR.Visible = false;
                }
                ImpostaControlliSiope(AoV);
            }
        }
示例#23
0
        private void btnDocumento_Click(object sender, EventArgs e)
        {
            int    esercizio = Convert.ToInt32(Meta.GetSys("esercizio"));
            string FilterIva = "(yinv<='" + esercizio.ToString() + "')";

            if (txtEsercDoc.Text != "")
            {
                int esercdocumento = CfgFn.GetNoNullInt32(txtEsercDoc.Text);
                try{
                    if (esercdocumento <= esercizio)
                    {
                        FilterIva = "(yinv='" + esercdocumento.ToString() + "')";
                    }
                    else
                    {
                        FilterIva = GetData.MergeFilters(FilterIva,
                                                         "(yinv='" + esercdocumento.ToString() + "')");
                    }
                }
                catch
                {
                }
            }
            int numdocumento = CfgFn.GetNoNullInt32(txtNumDoc.Text);

            if (txtNumDoc.Text != "")
            {
                FilterIva = GetData.MergeFilters(FilterIva,
                                                 "(ninv='" + numdocumento.ToString() + "')");
            }

            string filtertipodoc;

            if (cmbTipoFattura.SelectedIndex <= 0)
            {
                filtertipodoc = QHS.AppAnd(QHS.BitClear("flag", 0), QHS.BitClear("flag", 2));
            }
            else
            {
                filtertipodoc = "(idinvkind=" +
                                QueryCreator.quotedstrvalue(cmbTipoFattura.SelectedValue, true) + ")";
            }
            FilterIva = GetData.MergeFilters(FilterIva, filtertipodoc);

            FilterIva += "AND(residual= (taxabletotal + ivatotal) )AND(linkedimpos='0')and(linkedimpon='0')" +
                         "AND((active is null)OR(active='S'))AND(ycon is null)AND(flag_enable_split_payment='N')";


            MetaData Invoice = MetaData.GetMetaData(this, "invoiceresidual");

            Invoice.FilterLocked = true;
            Invoice.DS           = new DataSet();
            DataRow M = Invoice.SelectOne("default", FilterIva, null, null);

            if (M == null)
            {
                return;
            }
            HelpForm.SetComboBoxValue(cmbTipoFattura, M["idinvkind"]);
            txtEsercDoc.Text     = M["yinv"].ToString();
            txtNumDoc.Text       = M["ninv"].ToString();
            txtFornitore.Text    = M["registry"].ToString();
            txtDescrFattura.Text = M["description"].ToString();

            DS.invoicedetail.Clear();
            DetailsToUpdate.Clear();
            DS.invoice.Clear();

            string filterinvoice = QHS.AppAnd(QHS.CmpEq("idinvkind", M["idinvkind"]),
                                              QHS.CmpEq("yinv", M["yinv"]), QHS.CmpEq("ninv", M["ninv"]));

            DataAccess.RUN_SELECT_INTO_TABLE(Conn, DS.invoice, null, filterinvoice, null, false);
            SetComboCausaleFattura();
            AggiornaGridDettagliFattura();
        }
示例#24
0
        private void riempiOggetti(DataRow listRow)
        {
            new_idlist                    = listRow["idlist"];
            txNewListino.Text             = listRow["intcode"].ToString();
            txtNewDescrizioneListino.Text = listRow["description"].ToString();
            txtNewCoeffConversione.Text   = listRow["unitsforpackage"].ToString();

            if (txtNewDescrizione.Text != "")
            {
                if (MessageBox.Show("Aggiorno il campo descrizione in base al listino selezionato?",
                                    "Conferma", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    txtNewDescrizione.Text = listRow["description"].ToString();
                }
            }
            else
            {
                txtNewDescrizione.Text = listRow["description"].ToString();
            }

            object    idlistclasssel  = listRow["idlistclass"];
            string    filterListClass = QHS.CmpEq("idlistclass", idlistclasssel);
            DataTable ListClass       = Conn.RUN_SELECT("listclass", "*", null, filterListClass, null, true);

            if ((ListClass != null) && (ListClass.Rows.Count > 0) &&
                (ListClass.Rows[0]["idinv"] != DBNull.Value ||
                 ListClass.Rows[0]["assetkind"] != DBNull.Value ||
                 ListClass.Rows[0]["va3type"] != DBNull.Value))
            {
                new_idinv     = ListClass.Rows[0]["idinv"];
                new_assetkind = ListClass.Rows[0]["assetkind"];

                object flagva3 = Conn.DO_READ_VALUE("config", QHS.CmpEq("ayear", Meta.GetSys("esercizio")), "flagva3");
                if ((flagva3 == DBNull.Value) || (flagva3 == null))
                {
                    flagva3 = "N";
                }

                if (rOldDettaglio != null)
                {
                    string filterManKind = QHS.CmpEq("idmankind", rOldDettaglio["idmankind"]);
                    object linkToInvoice = Conn.DO_READ_VALUE("mandatekind", filterManKind, "linktoinvoice");
                    if (linkToInvoice == null)
                    {
                        linkToInvoice = DBNull.Value;
                    }

                    if ((linkToInvoice.ToString() != "N") && (flagva3.ToString() != "N"))
                    {
                        new_va3type = ListClass.Rows[0]["va3type"];
                    }
                }
            }

            HelpForm.SetComboBoxValue(cmbNewUnitaMisuraCS, listRow["idunit"]);
            HelpForm.SetComboBoxValue(cmbNewUnitaMisuraAcquisto, listRow["idpackage"]);

            // Legge la causale EP associata alla classificazione merceologica del listino, e la scrive nella causale EP del dettaglio ordine.
            object idaccmotive = Conn.DO_READ_VALUE("listclass", QHS.CmpEq("idlistclass", listRow["idlistclass"]),
                                                    "idaccmotive");

            if (idaccmotive != DBNull.Value)
            {
                DataTable Accmotive = Conn.RUN_SELECT("accmotive", "*", null, QHS.CmpEq("idaccmotive", idaccmotive),
                                                      null, false);
                if (Accmotive.Rows.Count > 0)
                {
                    DataRow RAccMotive = Accmotive.Rows[0];
                    txtCodiceCausale.Text      = RAccMotive["codemotive"].ToString();
                    txtDescrizioneCausale.Text = RAccMotive["title"].ToString();
                    expensekind     = RAccMotive["expensekind"];
                    new_idaccmotive = idaccmotive;
                    //ImpostaNaturadiSpesa(RAccMotive);
                }
                else
                {
                    txtCodiceCausale.Text      = "";
                    txtDescrizioneCausale.Text = "";
                    new_idaccmotive            = DBNull.Value;
                }
            }
            else
            {
                txtCodiceCausale.Text      = "";
                txtDescrizioneCausale.Text = "";
                new_idaccmotive            = DBNull.Value;
            }
        }
示例#25
0
        private void btnSelect_Click(object sender, EventArgs e)
        {
            MetaDettaglio = Disp.Get("mandatedetailgroupview");
            MetaDettaglio.FilterLocked = true;
            MetaDettaglio.DS           = new DataSet();

            string filter = QHS.AppAnd(QHS.MCmp(rContratto, new string[] { "idmankind", "yman", "nman" })
                                       , QHS.IsNull("stop"));

            int count = Conn.RUN_SELECT_COUNT("mandatedetailgroupview", filter, true);

            if (count == 0)
            {
                MessageBox.Show(this, "Nel contratto selezionato non esistono dettagli da annullare", "Avviso",
                                MessageBoxButtons.OK);
                return;
            }

            DataRow rDett = MetaDettaglio.SelectOne("dettaglio", filter, null, null);

            if (rDett == null)
            {
                MessageBox.Show(this, "Non è stata selezionata alcuna riga", "Avviso",
                                MessageBoxButtons.OK);
                return;
            }

            // Valorizzazione degli oggetti:

            HelpForm.SetComboBoxValue(cmbOldTipoIva, rDett["idivakind"]);
            DataRow[] IvaKind = tOldIvaKind.Select(QHC.CmpEq("idivakind", rDett["idivakind"]));
            if (IvaKind.Length > 0)
            {
                DataRow rIvaKind  = IvaKind[0];
                double  perc      = CfgFn.GetNoNullDouble(rIvaKind["rate"]);
                double  percIndet = CfgFn.GetNoNullDouble(rIvaKind["unabatabilitypercentage"]);

                txtOldAliquota.Text  = HelpForm.StringValue(perc, "x.y.fixed.4..%.100");
                txtOldPercIndet.Text = HelpForm.StringValue(percIndet, "x.y.fixed.4..%.100");
            }

            if (rDett["idlist"] != DBNull.Value)
            {
                string intcode = Conn.DO_READ_VALUE("list", QHC.CmpEq("idlist", rDett["idlist"]), "intcode").ToString();
                txtOldListino.Text = intcode;

                string list = Conn.DO_READ_VALUE("list", QHC.CmpEq("idlist", rDett["idlist"]), "description")
                              .ToString();
                txtOldDescrizioneListino.Text = list;

                HelpForm.SetComboBoxValue(cmbOldUnitaMisuraAcquisto, rDett["idpackage"]);

                int CoeffConversione = CfgFn.GetNoNullInt32(rDett["unitsforpackage"]);
                txtOldCoeffConversione.Text = CoeffConversione.ToString("n");

                HelpForm.SetComboBoxValue(cmbOldUnitaMisuraCS, rDett["idunit"]);
            }

            double quantitaconfezioni = CfgFn.GetNoNullDouble(rDett["npackage"]);

            txtOldQuantitaConfezioni.Text = quantitaconfezioni.ToString("n");

            double quantita = CfgFn.GetNoNullDouble(rDett["number"]);

            txtOldQuantita.Text = quantita.ToString("n");

            double importoUnitario = CfgFn.GetNoNullDouble(rDett["taxable"]);

            txtOldImportoUnitario.Text = importoUnitario.ToString();

            double sconto = CfgFn.GetNoNullDouble(rDett["discount"]);

            txtOldSconto.Text = sconto.ToString("p");

            double imponibileValuta = CfgFn.RoundValuta((importoUnitario * quantitaconfezioni * (1 - sconto)));

            txtOldImponibileValuta.Text = imponibileValuta.ToString();

            double ivaEuro = CfgFn.GetNoNullDouble(rDett["tax"]);

            txtOldIvaEuro.Text = ivaEuro.ToString("c");

            double ivaIndetraibileEuro = CfgFn.GetNoNullDouble(rDett["unabatable"]);

            txtOldIvaIndetraibileEuro.Text = ivaIndetraibileEuro.ToString("c");

            decimal imponibileEuro = CfgFn.GetNoNullDecimal(rDett["taxable_euro"]);

            txtOldImponibileEuro.Text = imponibileEuro.ToString("c");


            chkOldPromiscuo.Checked = (rDett["flagmixed"].ToString().ToUpper() == "S");

            int flagActivity = CfgFn.GetNoNullInt32(rDett["flagactivity"]);

            rdoOldAttivita1.Checked = (flagActivity == 1);
            rdoOldAttivita2.Checked = (flagActivity == 2);
            rdoOldAttivita3.Checked = (flagActivity == 3);
            rdoOldAttivita4.Checked = (flagActivity == 4);

            txtOldDescrizione.Text = rDett["detaildescription"].ToString();
            txtOldIdGroup.Text     = rDett["idgroup"].ToString();
            btnCopy.Enabled        = true;
            rOldDettaglio          = rDett;
            btnOK.Enabled          = true;

            idinv       = rOldDettaglio["idinv"];
            idlist      = rOldDettaglio["idlist"];
            idlocation  = rOldDettaglio["idlocation"];
            assetkind   = rOldDettaglio["assetkind"];
            va3type     = rOldDettaglio["va3type"];
            idaccmotive = rOldDettaglio["idaccmotive"];
            expensekind = rOldDettaglio["expensekind"];
        }
示例#26
0
 void SetDefaultField()
 {
     //Imposta il realcolumn di defaut ove presente uno uguale al columnname
     HelpForm.SetComboBoxValue(comboCol, comboColName.SelectedValue.ToString());
 }
示例#27
0
        public FrmSelectDetailsFromStock(MetaData Meta, string filtersql, DataSet DS)
        {
            InitializeComponent();
            this.Meta      = Meta;
            this.Conn      = Meta.Conn;
            this.Disp      = Meta.Dispatcher;
            this.filtersql = filtersql;
            this.DS        = DS;

            QHC = new CQueryHelper();
            QHS = Meta.Conn.GetQueryHelper();

            // Magazzino
            DataTable store = Conn.CreateTableByName("store", "*", false);

            D = new DataSet();
            D.Tables.Add(store);
            Conn.RUN_SELECT_INTO_TABLE(store, "description", filtersql, null, true);
            cmbMagazzino.DataSource    = store;
            cmbMagazzino.ValueMember   = "idstore";
            cmbMagazzino.DisplayMember = "description";
            HelpForm.SetComboBoxValue(cmbMagazzino, store.Rows[0]["idstore"]);
            cmbMagazzino.Enabled = false;

            // Responsabile
            DataTable manager = Conn.CreateTableByName("manager", "*", false);

            D.Tables.Add(manager);
            GetData.MarkToAddBlankRow(manager);
            GetData.Add_Blank_Row(manager);
            Conn.RUN_SELECT_INTO_TABLE(manager, "title", null, null, true);
            cmbResponsabile.DataSource    = manager;
            cmbResponsabile.ValueMember   = "idman";
            cmbResponsabile.DisplayMember = "title";

            Conn.DeleteAllUnselectable(manager);

            MetaSorting = Disp.Get("sorting");

            FormInit();
            DD                 = new DataSet("a");
            Sorting1           = Conn.CreateTableByName("sorting", "*");
            Sorting1.TableName = "sorting1";
            Sorting2           = Conn.CreateTableByName("sorting", "*");
            Sorting2.TableName = "sorting2";
            Sorting3           = Conn.CreateTableByName("sorting", "*");
            Sorting3.TableName = "sorting3";
            DD.Tables.Add(Sorting1);
            DD.Tables.Add(Sorting2);
            DD.Tables.Add(Sorting3);
            DD.EnforceConstraints = false;

            DataAccess.SetTableForReading(Sorting1, "sorting");
            DataAccess.SetTableForReading(Sorting2, "sorting");
            DataAccess.SetTableForReading(Sorting3, "sorting");

            string    filter    = "(ayear=" + QueryCreator.quotedstrvalue(Meta.GetSys("esercizio"), true) + ")";
            DataTable tExpSetup = Meta.Conn.RUN_SELECT("config", "*", null,
                                                       filter, null, null, true);

            if ((tExpSetup != null) && (tExpSetup.Rows.Count > 0))
            {
                DataRow R          = tExpSetup.Rows[0];
                string  idsorkind1 = R["idsortingkind1"].ToString();
                string  idsorkind2 = R["idsortingkind2"].ToString();
                string  idsorkind3 = R["idsortingkind3"].ToString();
                SetGBoxClass(1, idsorkind1);
                SetGBoxClass(2, idsorkind2);
                SetGBoxClass(3, idsorkind3);

                if (idsorkind3 == "")
                {
                    grpAnalitico.Size = new System.Drawing.Size(366, 200);
                }
                if (idsorkind2 + idsorkind3 == "")
                {
                    grpAnalitico.Size = new System.Drawing.Size(366, 100);
                }
                if (idsorkind1 + idsorkind2 + idsorkind3 == "")
                {
                    grpAnalitico.Visible = false;
                }
                if (idsorkind1 != "")
                {
                    CSM1 = new Class_SelectionManager(Meta, txtCodice1, txtDenom1, R["idsortingkind1"]);
                }
                if (idsorkind2 != "")
                {
                    CSM2 = new Class_SelectionManager(Meta, txtCodice2, txtDenom2, R["idsortingkind2"]);
                }
                if (idsorkind3 != "")
                {
                    CSM3 = new Class_SelectionManager(Meta, txtCodice3, txtDenom3, R["idsortingkind3"]);
                }
            }
        }