|
|
Строка 4: |
Строка 4: |
| | | |
| Вес по справочнику [изделий] | | Вес по справочнику [изделий] |
− |
| |
− | = Полный текст функции =
| |
− |
| |
− | type
| |
− | TQREvR11Wght = class(TQREvDbFunction)
| |
− | public
| |
− | function Calculate: TQREvResult; override;
| |
− | end;
| |
− |
| |
− | function TQREvR11Wght.Calculate: TQREvResult;
| |
− | var
| |
− | ProdCode: integer;
| |
− | Refl: string;
| |
− | begin
| |
− | ProdCode := 0;
| |
− | Refl := 'R11 ';
| |
− | Result.Kind := ResDouble;
| |
− | if (ArgList.Count > 0) then
| |
− | ProdCode := ConvQREvToInt(Argument(0));
| |
− | if (ArgList.Count > 1) and (Argument(1).Kind = ResString) then
| |
− | Refl := Argument(1).StrResult;
| |
− | if (GetWorkArea is TAdsTable) and
| |
− | (UpperCase(TAdsTable(GetWorkArea).Name) = UpperCase(TrimRight(Refl))) and
| |
− | (TAdsTable(GetWorkArea).FindField('WEIGHT') <> nil) and
| |
− | (TAdsTable(GetWorkArea).FindField('KOD') <> nil) and
| |
− | (TAdsTable(GetWorkArea).FindField('FREE_PRICE') <> nil) and
| |
− | (TAdsTable(GetWorkArea).FieldByName('KOD').AsInteger = ProdCode) then
| |
− | Result.dblResult := TAdsTable(GetWorkArea).FieldByName('WEIGHT').AsFloat
| |
− | else
| |
− | Result.DblResult := R11Wght(ProdCode, Refl);
| |
− | end;
| |
| | | |
| = ProdCost = | | = ProdCost = |
Версия 14:29, 5 сентября 2016
R11Wght - это функция, описанная в файле QrAddFn.pas
R11Wght( Code, [<Refl/"R11"] )
Вес по справочнику [изделий]
ProdCost
function R11Wght(ProdCode: integer; Refl: string = 'R11 '): double;
begin
Result := SeekRef(Refl, ProdCode, 'WEIGHT', 1, 0);
end;