Автор: SerG_GRS [Владивосток] (212.91.204.---)
Дата: давно
А в такой, млин. Далее проследить и реструкторизовать логику работы для бухгалтера:
GetNextNo(NoSeriesCode : Code[10];SeriesDate : Date;ModifySeries : Boolean) : Code[20]
IF SeriesDate = 0D THEN
SeriesDate := WORKDATE;
IF ModifySeries OR (LastNoSeriesLine."Series Code" = '') THEN BEGIN
IF ModifySeries THEN
NoSeriesLine.LOCKTABLE(TRUE);
NoSeries.GET(NoSeriesCode);
SetNoSeriesLineFilter(NoSeriesLine,NoSeriesCode,SeriesDate);
IF NOT NoSeriesLine.FIND('-') THEN BEGIN
NoSeriesLine.SETRANGE("Starting Date");
IF NoSeriesLine.FIND('-') THEN
ERROR(
Text004,
NoSeriesCode,SeriesDate);
ERROR(
Text005,
NoSeriesCode);
END;
END ELSE
NoSeriesLine := LastNoSeriesLine;
IF NoSeries."Date Order" AND (SeriesDate < NoSeriesLine."Last Date Used") THEN
ERROR(
Text006,
NoSeries.Code,NoSeriesLine."Last Date Used");
NoSeriesLine."Last Date Used" := SeriesDate;
IF NoSeriesLine."Last No. Used" = '' THEN BEGIN
NoSeriesLine.TESTFIELD("Starting No.");
NoSeriesLine."Last No. Used" := NoSeriesLine."Starting No.";
END ELSE
IF NoSeriesLine."Increment-by No." <= 1 THEN
NoSeriesLine."Last No. Used" := INCSTR(NoSeriesLine."Last No. Used")
ELSE
IncrementNoText(NoSeriesLine."Last No. Used",NoSeriesLine."Increment-by No.");
IF (NoSeriesLine."Ending No." <> '') AND
(NoSeriesLine."Last No. Used" > NoSeriesLine."Ending No.")
THEN
ERROR(
Text007,
NoSeriesLine."Ending No.",NoSeriesCode);
IF (NoSeriesLine."Ending No." <> '') AND
(NoSeriesLine."Warning No." <> '') AND
(NoSeriesLine."Last No. Used" >= NoSeriesLine."Warning No.") AND
(NoSeriesCode <> WarningNoSeriesCode) AND
(TryNoSeriesCode = '')
THEN BEGIN
WarningNoSeriesCode := NoSeriesCode;
MESSAGE(
Text007,
NoSeriesLine."Ending No.",NoSeriesCode);
END;
NoSeriesLine.VALIDATE(Open);
IF ModifySeries THEN
NoSeriesLine.MODIFY
ELSE
LastNoSeriesLine := NoSeriesLine;
EXIT(NoSeriesLine."Last No. Used");
* * * * * * * * * * * * * * * * * * * * * * *
кхе, кхе Starlet EP85 4WD МКПП
- - - - - - - - - - - - - - - - - - - - - - - - - -
- эх, настальгия:
Subaru Legacy 89' EJ-18 sedan
Toyota Sprinter Trueno GT-Z
| |