V
V
Vladik1802021-09-06 21:18:20
1C
Vladik180, 2021-09-06 21:18:20

1s how to specify the period in the request from the accumulation register?

Запрос.Текст = 
    "ВЫБРАТЬ РАЗРЕШЕННЫЕ
    |	КассаОстаткиОстатки.СуммаОстаток КАК СуммаОстаток,
    |	КассаОстатки.Период КАК Период
    |ИЗ
    |	РегистрНакопления.КассаОстатки.Остатки ( &НачалоПериода,  &КонецПериода) КАК КассаОстаткиОстатки,
    |	РегистрНакопления.КассаОстатки КАК КассаОстатки
    |ГДЕ
    |	КассаОстаткиОстатки.Сотрудник = &Сотрудник
    |	И КассаОстаткиОстатки.ТипПлатежа = ЗНАЧЕНИЕ(ПЕРЕЧИСЛЕНИе.ТипПлатежа.Наличные)"
    ;

  
  Запрос.УстановитьПараметр("Сотрудник", ПараметрыСеанса.ТекущийСотрудник);
  Запрос.УстановитьПараметр("НачалоПериода",  Период.ДатаНачала);
  Запрос.УстановитьПараметр("КонецПериода", КонецДня(Период.ДатаОкончания));


tell me how to set the period between. i.e. I need the sum, for example, between 3 and 4, and with such a request it shows from 1 to 4. what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kinash, 2021-09-15
@Dementor

1) You need to use a virtual turnover table and specify the period of interest in the parameters. Almost like in the question with the remainder, but you have an end date in the selection conditions section - you are lucky that there was a reduction to a boolean value and you got the result.
2) The use of a resource called "SumRemainder" in the turnover register is bad style and confuses the query reader. If you have receipts and expenses, then you need to write them in just "Amount". And if you want (why?) to store the calculated balances by day, then you do not need an accumulation register - but a register of information.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question