E
E
ElizabethP2020-07-12 10:15:29
1C
ElizabethP, 2020-07-12 10:15:29

How to calculate the average cost in processing 1C?

5f0ab85b6aeff745932827.png
There is such a problem, now I am implementing the first report and the question arose of how to calculate the average cost in order to write the correct amount in the expense column, I was told that this should be done in the processing of the transaction, but I still don’t understand how to implement it syntactically what to pull out and where to put. I will be very glad for your help. This is how my processing looks like now

Процедура ОбработкаПроведения(Отказ, Режим)
  
  //{{__КОНСТРУКТОР_ДВИЖЕНИЙ_РЕГИСТРОВ
  // Данный фрагмент построен конструктором.
  // При повторном использовании конструктора, внесенные вручную изменения будут утеряны!!!

  // регистр ОстаткиТоваров Расход
  Движения.ОстаткиТоваров.Записывать = Истина;
  Для Каждого ТекСтрокаСведенияОПродаже Из СведенияОПродаже Цикл
    Движение = Движения.ОстаткиТоваров.Добавить();
    Движение.ВидДвижения = ВидДвиженияНакопления.Расход;
    Движение.Период = Дата;
    Движение.Товар = ТекСтрокаСведенияОПродаже.Номенклатура;
    Движение.Количество = ТекСтрокаСведенияОПродаже.Количество;
    Движение.Сумма = ТекСтрокаСведенияОПродаже.Сумма;
    
  КонецЦикла;

  //}}__КОНСТРУКТОР_ДВИЖЕНИЙ_РЕГИСТРОВ
КонецПроцедуры

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kinash, 2020-07-12
@Dementor

I was told that this should be done in the processing of the holding

What does suggested mean? This is an explicit requirement for your task in the second paragraph! If you do not implement write-off at the average cost at the time of write-off, you simply will not make a decision.
but I still don’t understand how to implement it syntactically, what to pull out from where and where to put it

Syntax is the rules for formatting code so that the compiler does not throw errors and does exactly what it is asked to do. You need to think "logically"!
The answer is in the very first paragraph of the task - you are required to record the arrival of a particular product in quantitative and total terms. At the time of posting an expense for a specific product, you must have a balance in quantity and cost (purchase cost). You can make a check at once so that you cannot sell more goods than are available. So you got that for a particular product you have X quantity and Y cost in stock, then the weighted average price will be equal to Y / X. The resulting price is multiplied by the amount to be written off and you get the cost price required for writing off. Movements on income to the accumulation register with a plus, movements on expenses with a minus. The report on the movement is done in an elementary way - take the register of the remaining goods and literally click Next-Next. And for the profit report, you need to add a profit register,

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question