Table of Content
HAL Forum
procedure OutFormField (
string FormFieldName,string FieldValue)
Description:
Outputs a string value to a form field of a document that is being printed
Parameters:
FormFieldName The form field name, that will receive the specified value
FieldValue The value that will be assigned for specific form field
procedure PrintAT2WrofRows(record RcVc RepSpec,record AT2WrofVc AT2Wrofr)
BEGIN
  Integer i,rwcnt;
  row AT2WrofVc AT2Wrofrw;
  record AT2UnitVc AT2Unitr;
  record AT2AccBlock AT2AccRec;
  string 255 tstr;
  integer months,years;
  val t,t2;
  
  blockload(AT2AccRec);
  rwcnt = MatRowCnt(AT2Wrofr);
  for (i=0;i<rwcnt;i=i+1) begin
    MatRowGet(AT2Wrofr,i,AT2Wrofrw);
    AT2Unitr.InventoryNr = AT2Wrofrw.InventoryNr;
    if (ReadFirstMain(AT2Unitr,1,true)) then begin
    end;    
    OUTFORMFIELD("F_TRANSNR",i+1);          
    OUTFORMFIELD("F_FIXASSETCODE",AT2Wrofrw.InventoryNr);
    OUTFORMFIELD("F_FIXASSETNAME",AT2Wrofrw.Description);
    OUTFORMFIELD("F_SERIALNR",AT2Unitr.SerialNr);
    OUTFORMFIELD("F_COSTACCOUNT",AT2Wrofrw.Account);
    OUTFORMFIELD("F_OBJECT",AT2Wrofrw.Objects);
    OUTFORMFIELD("F_SALESPRICE",AT2Wrofrw.SalesVal);
    OUTFORMFIELD("F_INVENTORYNR",AT2Wrofrw.InventoryNr);
    OUTFORMFIELD("F_ANTAL",AT2Wrofrw.Qty);
    OUTFORMFIELD("F_ACUMULATEDDEPR",AT2Wrofrw.DprVal);
    OUTFORMFIELD("F_RESPONSIBLEPERSON",AT2Unitr.RespPerson);
    OUTFORMFIELD("F_PRODDATE",AT2Unitr.ProdDate);
    OUTFORMFIELD("F_PURCHASEDATE",AT2Unitr.PurchaseDate);//vg
    GetDepreciationPrc(AT2Unitr.Model1,t);
    years = 100 / t;
    months = 100 / t * 12;
    OUTFORMFIELD("F_DEPRPRC",t);
    if (FieldInForm("F_DEPRPRC2")) then begin
      GetDepreciationPrc(AT2Unitr.Model2,t);
      OUTFORMFIELD("F_DEPRPRC2",t);
    end;
    OUTFORMFIELD("F_PERIODMONTH",months);    
    OUTFORMFIELD("F_PERIODYEAR",years);
    
    if (FIELDINFORM("F_REVALUATEDVALUE")) then begin
      if (GetLastDprStartVal(0,AT2Wrofrw.InventoryNr,AT2Unitr.PurchVal,t,t2)) then begin 
      end;
      OUTFORMFIELD("F_REVALUATEDVALUE",t);
    end;
    if (FIELDINFORM("F_DEPARTMENT")) then begin
      GetAssetCurDepartment(AT2Wrofrw.InventoryNr,tstr);
      OUTFORMFIELD("F_DEPARTMENT",tstr);
    end;          
    if (FIELDINFORM("F_DEPRVAL")) then begin
      CalcDeprVal(AT2Unitr,AT2Wrofr,t);
      if (t != 0) then begin
        OUTFORMFIELD("F_DEPRVAL",t);
      end;
    end;          

    OUTFORMFIELD("F_STARTDEPCODE",AT2Unitr.DepCode);
    OUTFORMFIELD("F_STARTDEPNAME",AT2Unitr.DepName);
    OUTFORMFIELD("F_PURCHVAL",AT2Unitr.PurchVal);
    OUTFORMFIELD("F_COMMENT",AT2Unitr.Comment);
    EndFormRow;        
  end;  
  RETURN;
END;
Related topics:
««