Table of Content
HAL Forum
function string NEXTSERNR (
string RegisterName,date NrSerDate,integer OldSerNr,boolean,string TargetComment)
Description:
Returns next logical serial number for specified register. Extra features can be used when RecordBegin/EndRecord has number series block defined via SerialNoBlock
Parameters:
RegisterName  
NrSerDate  
OldSerNr  
 
TargetComment  
updating procedure CreateJob(string cucode,Date td,string restype,LongInt NrOfJob,LongInt NrOfDays)
begin
  record JobVc Jobr;
  record HotelBlock Hotelb;
  LongInt cnt;
  
  BlockLoad(Hotelb);
  RecordNew(Jobr);
  Jobr.TransDate = td;
  Jobr.Type = restype;      
  JobPasteType(Jobr,"");
  Jobr.NrOfDays = NrOfDays;
  Jobr.EndDate = AddDay(Jobr.TransDate,Jobr.NrOfDays);
  Jobr.CUCode = cucode;      
  PasteCUCodeToJob(Jobr,-1);
  Jobr.ResStatus = Hotelb.AllotmentSt;      
  cnt = 1;

  while (cnt<=NrOfJob) begin
    Jobr.SerNr = NextSerNr("JobVc",Jobr.TransDate,-1,false,"");
    if (Jobr.SerNr>0) then begin
      JobSumup(Jobr);
      if (RecordStore(Jobr,false)) then begin 
      end;
    end;
    cnt = cnt + 1;
  end;
  return;
end;
Related topics:
««