PUT FRO
Материал из Фабиус wiki
PUT_FRO_ - это программа из справочника R266
Сохранить FRO НОВАЯ ВЕРСИЯ
PUT_FRO_()
Текст
local reps, my, opdata_path, i local path, sql local connection local kinddoc, lvlnum, amnt, kshift, sum, krefl2, kanal2 my := DATE() path := GetPrm( 'PATH_REST', 'CASH_SHOP' ) if EMPTY( ATR( path ) ) return endif path := NICE_PATH( path ) if !DIRECTORYEXISTS( path ) return endif try ENADISCONTROLS( GETAREA(), false ) connection := CREATECONNECTION( path, 'adssys', "", 1, 'critical' ) DBGOTOP() while !EOF() kinddoc := DOCS2->KINDDOC lvlnum := DOCS2->LVLNUM amnt := DOCS2->AMNT amnt := STRTRAN( STR( amnt ), ',', '.' ) kshift := DOCS2->kshift sum := DOCS2->SUM sum := STRTRAN( STR( sum ), ',', '.' ) krefl2 := DOCS2->KREFL2 kanal2 := DOCS2->KANAL2 sql := [ INSERT INTO DOCP] + RET_F_EXT( my ) + [( KINDDOC, LVLNUM, AMNT, KSHIFT, "SUM", KREFL2, KANAL2 ) ; VALUES ( '] + kinddoc + [', '] + lvlnum + [', ] + amnt + [, '] + kshift + [', ] + sum + [, '] + krefl2 + [', ] + kanal2 + [ ) ] SIMPLESQL( sql, connection ) // ---->>>> DBSKIP() end DBGOTOP() finally FREEANDNIL( connection ) ENADISCONTROLS( GETAREA(), true ) end