20055 выборка по константам
This commit is contained in:
parent
48daeb5e44
commit
db25739970
|
@ -1167,3 +1167,32 @@
|
||||||
t."DocumentDate" IS NULL OR t."DocumentDate" BETWEEN _bdate AND _edate
|
t."DocumentDate" IS NULL OR t."DocumentDate" BETWEEN _bdate AND _edate
|
||||||
) and t."DocType" in ('UniversalDocument') ;
|
) and t."DocType" in ('UniversalDocument') ;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Выборка из учетной политики
|
||||||
|
|
||||||
|
??? note "Запрос"
|
||||||
|
|
||||||
|
Основной запрос:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
do $newQ$
|
||||||
|
declare _str text;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
$newQ$;
|
||||||
|
```
|
||||||
|
|
||||||
|
Итоговая выборка:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
insert into "tmp_finresult"( "DocCode" , "DocType" , "DocForm" , "AnyColumnA" , "AnyColumnB" , "AnyColumnC", "AnyColumnD", "AnyColumnE", "AnyColumnF", "orgId", "AnyColumnG", "AnyColumnH"
|
||||||
|
)
|
||||||
|
|
||||||
|
select p."VCode", 'Base.AccountingPolitics', 'RulesForDocumentStatusJournalForm' , f."Name", m."Determination", m."ValueText", m."ValueConst", to_char(p."WDate",'DD.MM.YYYY'), p."WUser", p."COrg",
|
||||||
|
to_char(p."BeginDate",'DD.MM.YYYY'), to_char(p."EndDate",'DD.MM.YYYY')
|
||||||
|
from acc."AccountingPolitics" p
|
||||||
|
join comdoc."SettingOfConstants" m on p."VCode" = m."PCode"
|
||||||
|
join comdoc."VFilials" f on p."COrg" = f."VCode"
|
||||||
|
where now()::date between coalesce(p."BeginDate",'19700101') and coalesce(p."EndDate",'20700101')
|
||||||
|
;
|
||||||
|
```
|
Loading…
Reference in New Issue