|
Returns time variable that has been increased or reduced by a specified amount of minutes. |
|
Minutes |
The amount of minutes to be added/removed from the time variable |
TheTime |
The time variable after specified minutes have been added/removed |
|
global
procedure CalcProdTime(record RecVc Recr,val qty,var val dayqty,var time timeqty)
begin
LongInt durmin;
Time durtime;
val numprod;
val qtytogo;
val prodmins;
qtytogo = qty;
if (qtytogo<0) then begin
qtytogo = 0;
end;
numprod = Recr.NumProd;
if (numprod==0) then begin
numprod = 1;
end;
dayqty = Recr.FixedAssembDays;
if (qtytogo==0) then begin dayqty = 0; end;
dayqty = dayqty + ((Recr.QtyAssemblyDays * qtytogo) / numprod);
durmin = TimeToMinutes(Recr.SetUpTime);
if (qtytogo==0) then begin durmin = 0; end;
prodmins = Recr.HrsToProd * 60.00;
if (Recr.MinsToProd>=0) then begin
prodmins = prodmins + Recr.MinsToProd;
end;
if (Recr.SecsToProd>=0) then begin
prodmins = prodmins + Recr.SecsToProd/60.00;
end;
durmin = durmin + (qtytogo * prodmins) / numprod;
dayqty = dayqty + MinutesToTime(durmin,durtime);
timeqty = durtime;
return;
end;
««