Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.



...

Раскрыть

...

title

...

Список всех контрагентов
select "Name", "Inn", "PartnersGrpID", "Enabled", "PhoneNumber", "ExtCode" from "dcPartners"
Наименование, инн, группа, вкл/выкл, номер телефона, внешний код.


Раскрыть
title Информация по контрагенту по ИНН
select "PartnersGrpID", "Enabled", "PhoneNumber", "ExtCode", " IsSeparateRests" from "dcPartners" where "Inn" = :"Inn"

Группа, вкл/выкл, номер телефона, внешний код, тип системы расчетов(балансовая, ограничения), балансы на доступных кошельках, кредитные ограничения на кошельках.


Раскрыть
titleИнформация по кошелькам

...

select "dcPartners"."PartnerID", "dcAmounts"."Name" as "AmountName", "dcAmounts"."AmountID" as "AmountID",
        "sysCreditTypes"."Name" as "CreditName",
        "dcCreditRestrictions"."Credit", "dcCreditRestrictions"."Period", "dcCreditRestrictions"."Price",
        "dcCreditRestrictions"."AutoMigration", "GetCreditRest"."Rest" from "dcPartners"
        left join "dcCreditRestrictions" on "dcCreditRestrictions"."PartnerID" = "dcPartners"."PartnerID"
        left join "dcAmounts" on "dcAmounts"."AmountID" = "dcCreditRestrictions"."AmountID"
        left join "sysCreditTypes" on "sysCreditTypes"."CreditTypeID" = "dcCreditRestrictions"."CreditTypeID"
        left join "GetCreditRest"("dcCreditRestrictions"."PartnerID", "dcCreditRestrictions"."AmountID") on 1=1
        where "dcPartners"."PartnerID" = :"PartnerID"; 


Раскрыть
titleСписок карт по ИНН контрагента
select "Name", "Code", "Enabled", "ExpireDate", "ExtCode", "CarNumber", "CarModel", "PhoneNumber", "Rem" from "dcCards"
where "PartnerID" = (select "PartnerID" from "dcPartners" where "Inn" = :"Inn")

Наименование карты, номер карты, вкл/выкл, использовать до, внешний код, номер ТС, модель ТС, номер телефона, отметки.


Раскрыть
title Информация по карте по номеру карты
select "Name", "Enabled", "ExpireDate", "ExtCode", "CarNumber", "CarModel", "PhoneNumber"  from "dcCards" where "Code" = : "Code"

Наименование карты, вкл/выкл, использовать до, внешний код, номер ТС, модель ТС, номер телефона, балансы на доступных кошельках, кредитные ограничения на кошельках


Раскрыть
titleКредиты на кошельках для карты
select "dcCards"."CardID", "dcAmounts"."AmountID", "dcAmounts"."Name" as "AmountName", "sysLimitTypes"."Name" as "LimitName",
            "dcLimitRestrictions"."Limit", "dcLimitRestrictions"."Period", "dcLimitRestrictions"."StartPeriod",
            "GetCreditRest_byCard"."Rest" as "Rest"
            from "dcCards"
            left join "dcLimitRestrictions" on "dcLimitRestrictions"."CardID" = "dcCards"."CardID"
            left join "dcAmounts" on "dcAmounts"."AmountID" = "dcLimitRestrictions"."AmountID"
            left join "sysLimitTypes" on "sysLimitTypes"."LimitTypeID" = "dcLimitRestrictions"."LimitTypeID"
            left join "GetCreditRest_byCard"("dcLimitRestrictions"."CardID", "dcLimitRestrictions"."AmountID") on 1=1
            where "dcCards"."CardID" = :"CardID"


Раскрыть
titleЛимиты по карте
select "dcCards"."CardID", "dcAmounts"."AmountID", "dcAmounts"."Name" as "AmountName", "sysLimitTypes"."Name" as "LimitName",
        "dcLimitRestrictions"."Limit", "dcLimitRestrictions"."Period", "dcLimitRestrictions"."StartPeriod",
        case when "GetLimitRest"."Rest" < 0 then "GetCreditRest"."Rest"
         else case when "GetCreditRest"."Rest" > "GetLimitRest"."Rest" then "GetLimitRest"."Rest"
        else "GetCreditRest"."Rest" end end as "Rest"
        from "dcCards"
        left join "dcLimitRestrictions" on "dcLimitRestrictions"."CardID" = "dcCards"."CardID"
        left join "dcAmounts" on "dcAmounts"."AmountID" = "dcLimitRestrictions"."AmountID"
        left join "sysLimitTypes" on "sysLimitTypes"."LimitTypeID" = "dcLimitRestrictions"."LimitTypeID"
        left join "GetLimitRest"("dcLimitRestrictions"."CardID", "dcLimitRestrictions"."AmountID") on 1=1
        left join "GetCreditRest"("dcCards"."PartnerID", "dcLimitRestrictions"."AmountID") on 1=1
        where "dcCards"."CardID" = :"CardID";

Раскрыть
titleОперации(заправки) по всем картам контрагента по ИНН
select "rgAmountRests"."Quantity",
        "rgAmountRests"."Amount",
        "rgAmountRests"."Price",
        "rgAmountRests"."Date",
        "rgAmountRests"."AZSCode",
        "dcCards"."Name"
        from "dcPartners"
        left join "rgAmountRests" on "rgAmountRests"."PartnerID" = "dcPartners"."PartnerID"
        left join "dcCards" on "rgAmountRests"."CardID" = "dcCards"."CardID"
        left join "dcAmounts" on "dcAmounts"."AmountID" = "rgAmountRests"."AmountID"
        where  "dcPartners"."PartnerID" = :"PartnerID" AND "rgAmountRests"."DocTypeID" = 3 order by "rgAmountRests"."Date" desc;

Литраж, сумма, цена, дата, азс, наименование карты


Раскрыть
titleОперации(заправки) по карте по коду карты
select "rgAmountRests"."Quantity",
        "rgAmountRests"."Amount",
        "rgAmountRests"."Price",
        "rgAmountRests"."Date",
        "rgAmountRests"."AZSCode",
        "dcCards"."Name"
        from "dcCards"
        left join "rgAmountRests" on "rgAmountRests"."CardID" = "dcCards"."CardID"
        left join "dcAmounts" on "dcAmounts"."AmountID" = "rgAmountRests"."AmountID"
        where  "dcCards"."Code" = :"Code" AND "rgAmountRests"."DocTypeID" = 3 order by "rgAmountRests"."Date" desc;

Литраж, сумма, цена, дата, азс. 


Раскрыть
titleЗапрос на изменение информации карты
update "dcCards"set "Name" = :"Name",
"Enabled" = :"Enabled",
"ExpireDate" = :"ExpireDate",
"Rem" = :"Rem",
"AllowInOffline" = :"AllowInOffline",
"PIN" = :"PIN",
"ExtCode" = :"ExtCode",
"PhoneNumber" = :"PhoneNumber",
"CarNumber" = :"CarNumber",
"CarModel" = :"CarModel",
"Email" = :"Email"
where "Code"  = :"Code"


Раскрыть
titleИзменение цены топлива.
update "dcFuels" set "Price" = :price where "FuelID" = :fuleId


Раскрыть
titleТолько создание карты. В тригере создаются лимиты по все кошелькам
insert into "dcCards" (""PartnerID",
    "Name",
    "Code",
    "Enabled",
    "ExpireDate",
    "Rem",
    "AllowInOffline",
    "TransactionID",
    PIN,
    "ExtCode",
    "PhoneNumber",
    "CarNumber",
    "CarModel",
    "Email")
valuee (...)


Раскрыть
titleИзменение лимита по карте
update "dcLimitRestrictions" set "LimitTypeID" = ?, "Limit" = ?, "Period" = ?, "StartPeriod" = ? where ("CardID" = ?) and ("AmountID" = ?)


Раскрыть
titleЛимиты по карте
select "dcCards"."CardID", "dcAmounts"."AmountID", "dcAmounts"."Name" as "AmountName", "sysLimitTypes"."Name" as "LimitName",
        "dcLimitRestrictions"."Limit", "dcLimitRestrictions"."Period", "dcLimitRestrictions"."StartPeriod",
        case when "GetLimitRest"."Rest" < 0 then "GetCreditRest"."Rest"
         else case when "GetCreditRest"."Rest" > "GetLimitRest"."Rest" then "GetLimitRest"."Rest"
        else "GetCreditRest"."Rest" end end as "Rest"
        from "dcCards"
        left join "dcLimitRestrictions" on "dcLimitRestrictions"."CardID" = "dcCards"."CardID"
        left join "dcAmounts" on "dcAmounts"."AmountID" = "dcLimitRestrictions"."AmountID"
        left join "sysLimitTypes" on "sysLimitTypes"."LimitTypeID" = "dcLimitRestrictions"."LimitTypeID"
        left join "GetLimitRest"("dcLimitRestrictions"."CardID", "dcLimitRestrictions"."AmountID") on 1=1
        left join "GetCreditRest"("dcCards"."PartnerID", "dcLimitRestrictions"."AmountID") on 1=1
        where "dcCards"."CardID" = ид карты;


Раскрыть
titleСоздание контрагента
insert into "dcPartners" (   "Name",
    "Rem",
    "WithNDS",
    "Inn",
    "PartnersGrpID",
    "DiscountSchemaID",
    "Enabled",
    "ExtCode",
    "PhoneNumber")
values (...)


Раскрыть
titleПолучение кредитов по контагенту
select "dcPartners"."PartnerID", "dcAmounts"."Name" as "AmountName",
        "sysCreditTypes"."Name" as "CreditName",
        "dcCreditRestrictions"."Credit", "dcCreditRestrictions"."Period", "dcCreditRestrictions"."Price",
        "dcCreditRestrictions"."AutoMigration", "GetCreditRest"."Rest" from "dcPartners"
        left join "dcCreditRestrictions" on "dcCreditRestrictions"."PartnerID" = "dcPartners"."PartnerID"
        left join "dcAmounts" on "dcAmounts"."AmountID" = "dcCreditRestrictions"."AmountID"
        left join "sysCreditTypes" on "sysCreditTypes"."CreditTypeID" = "dcCreditRestrictions"."CreditTypeID"
        left join "GetCreditRest"("dcCreditRestrictions"."PartnerID", "dcCreditRestrictions"."AmountID") on 1=1
        where "dcPartners"."PartnerID" = ид контрагента