public void ComboCustomize(IWebEasRepositoryBase repository, string column, string kodPolozky, Dictionary <string, string> requiredFields, ref PfeComboAttribute comboAttribute, HierarchyNode node) { // Nezobraziť DAP (pre iné organizácie) if (column.ToLower() == nameof(TypBiznisEntityTypView.TypNazov).ToLower() && !repository.GetNastavenieB("cfe", "PohladavkyDAP")) { if (!string.IsNullOrEmpty(comboAttribute.AdditionalWhereSql)) { comboAttribute.AdditionalWhereSql = "(" + comboAttribute.AdditionalWhereSql + ") AND "; } comboAttribute.AdditionalWhereSql += "C_Typ_Id NOT IN (129, 131, 132, 133, 134, 135, 136, 1001, 1002, 1004, 1005, 1006, 1007, 2001, 2002, 2004, 2005, 2006, 2007, 2010)"; } ; }
public void ComboCustomize(IWebEasRepositoryBase repository, string column, string kodPolozky, Dictionary <string, string> requiredFields, ref PfeComboAttribute comboAttribute, HierarchyNode node) { int dphRezim = (int)repository.GetNastavenieI("reg", "RezimDph"); if (dphRezim == 0) { comboAttribute.AdditionalWhereSql += $"{(string.IsNullOrEmpty(comboAttribute.AdditionalWhereSql) ? string.Empty : " AND ") }{nameof(C_Typ_Id)} != 6"; } }
public void ComboCustomize(IWebEasRepositoryBase repository, string column, string kodPolozky, Dictionary <string, string> requiredFields, ref PfeComboAttribute comboAttribute, HierarchyNode node) { comboAttribute.CustomSortSqlExp = nameof(Poradie); }
public void ComboCustomize(IWebEasRepositoryBase repository, string column, string kodPolozky, Dictionary <string, string> requiredFields, ref PfeComboAttribute comboAttribute, HierarchyNode node) { if (column.ToLower() == "StavNazov".ToLower() && (kodPolozky.StartsWith("crm-dod-")) || kodPolozky.StartsWith("crm-odb-")) { comboAttribute.AdditionalWhereSql = "C_StavEntity_Id IN (-2, -1, 1, 7, 8, 10, 14, 15)"; } else if (column.ToLower() == "StavNazov".ToLower() && (kodPolozky.StartsWith("fin-pok-") || kodPolozky.StartsWith("fin-bnk-") || kodPolozky.StartsWith("all-evi-intd") || kodPolozky.StartsWith("uct-evi-exd-"))) { comboAttribute.AdditionalWhereSql = "C_StavEntity_Id IN (1, 7, 10, 14, 15)"; } else if (column.ToLower() == "StavNazov".ToLower() && (kodPolozky.StartsWith("maj-"))) { comboAttribute.AdditionalWhereSql = "C_StavEntity_Id IN (1,22,23,24,25,26)"; } }
public void ComboCustomize(IWebEasRepositoryBase repository, string column, string kodPolozky, Dictionary <string, string> requiredFields, ref PfeComboAttribute comboAttribute, HierarchyNode node) { if (column.ToLower() == "idformatmeno" || column.ToLower() == "adresatpsidlo") { if (kodPolozky.StartsWith("crm-dod-")) // Dodávatelia { comboAttribute.AdditionalWhereSql = $"C_FakturaciaVztah_Id IN ({(int)FakturaciaVztahEnum.DOD}, {(int)FakturaciaVztahEnum.DOD_ODB})"; } else if (kodPolozky.StartsWith("crm-odb-")) // Odberatelia { comboAttribute.AdditionalWhereSql = $"C_FakturaciaVztah_Id IN ({(int)FakturaciaVztahEnum.ODB}, {(int)FakturaciaVztahEnum.DOD_ODB})"; } else if (kodPolozky.StartsWith("fin-pok-pdk") && column.ToLower() == "idformatmeno") // Pokladničné doklady { comboAttribute.Tpl = "{value};{AdresaTPSidlo};daň: {Danovnik};dod: {Dodavatel};odb: {Odberatel}"; var additionalFields = new[] { nameof(AdresaTPSidlo), nameof(Danovnik), nameof(Dodavatel), nameof(Odberatel) }; comboAttribute.AdditionalFields = comboAttribute.AdditionalFields != null?comboAttribute.AdditionalFields.Union(additionalFields).Distinct().ToArray() : additionalFields; } else if (kodPolozky.StartsWith("fin-pok-pdk") && column.ToLower() == "adresatpsidlo") // Pokladničné doklady { comboAttribute.Tpl = "{value};{IdFormatMeno};daň: {Danovnik};dod: {Dodavatel};odb: {Odberatel}"; var additionalFields = new[] { nameof(IdFormatMeno), nameof(Danovnik), nameof(Dodavatel), nameof(Odberatel) }; comboAttribute.AdditionalFields = comboAttribute.AdditionalFields != null?comboAttribute.AdditionalFields.Union(additionalFields).Distinct().ToArray() : additionalFields; } //Combo služba sa volá aj v špeciálnom prípade z dialógu P/Z. //Vtedy sa volá bez "!" a natvrdo sa má pridať filter na "Zákazník = 1" if (kodPolozky.Contains("fin-pok-pdk") && !kodPolozky.Contains("!")) { comboAttribute.AdditionalWhereSql += (!string.IsNullOrEmpty(comboAttribute.AdditionalWhereSql) ? " AND " : string.Empty) + nameof(Zakaznik) + " = 1"; } if (kodPolozky.StartsWith("all-prh-fa")) { byte typFakturacieId = requiredFields != null && requiredFields.ContainsKey("E_TypFakturacie_Id") ? byte.Parse(requiredFields["E_TypFakturacie_Id"]) : (byte)3; comboAttribute.AdditionalWhereSql += Helpers.GetTypFakturacieFilterSql(typFakturacieId); } } }
public void ComboCustomize(IWebEasRepositoryBase repository, string column, string kodPolozky, Dictionary <string, string> requiredFields, ref PfeComboAttribute comboAttribute, HierarchyNode node) { if (kodPolozky.StartsWith("fin-pok-pdk")) { comboAttribute.FilterByOrsPravo = true; } }
public void ComboCustomize(IWebEasRepositoryBase repository, string column, string kodPolozky, Dictionary <string, string> requiredFields, ref PfeComboAttribute comboAttribute, HierarchyNode node) { if (kodPolozky.StartsWith("crm") || kodPolozky.StartsWith("all-evi-intd")) { comboAttribute.FilterByOrsPravo = true; } else if (kodPolozky.StartsWith("maj-evi-maj")) { //comboAttribute.AdditionalWhereSql = "ISNULL(@DatumDokladu, GetDate()) BETWEEN PlatnostOd AND ISNULL(PlatnostDo, '2100-01-01')"; //Filtrovať "Platnosť od" je pri majetku problém, keďže majetok má často dátum roky dozadu - filter zjemníme nasledovne comboAttribute.AdditionalWhereSql = "ISNULL(@DatumDokladu, GetDate()) <= ISNULL(PlatnostDo, '2100-01-01')"; } }
public void ComboCustomize(IWebEasRepositoryBase repository, string column, string kodPolozky, Dictionary <string, string> requiredFields, ref PfeComboAttribute comboAttribute, HierarchyNode node) { //if (kodPolozky.Equals("fin-bnk-ban") || kodPolozky.Equals("fin-bnk-ppp")) if (kodPolozky.Equals("fin-bnk-ban")) //Prevodné príkazy majú zobraziť všetky bank. účty { comboAttribute.FilterByOrsPravo = true; } if (kodPolozky.Equals("fin-bnk-ppp")) { comboAttribute.AdditionalWhereSql += $" AND C_Mena_Id = {(int)MenaEnum.EUR}"; } }