= $año.'-01-01') AND ($inicio < $año.'-02-01') ) { $mesI='01'; } if ( ($fin >= $año.'-01-01') AND ($fin < $año.'-02-01') ) { $mesF='01'; } if ( ($inicio >= $año.'-02-01') AND ($inicio < $año.'-03-01') ) { $mesI='02'; } if ( ($fin >= $año.'-02-01') AND ($fin < $año.'-03-01') ) { $mesF='02'; } if ( ($inicio >= $año.'-03-01') AND ($inicio < $año.'-04-01') ) { $mesI='03'; } if ( ($fin >= $año.'-03-01') AND ($fin < $año.'-04-01') ) { $mesF='03'; } if ( ($inicio >= $año.'-04-01') AND ($inicio < $año.'-05-01') ) { $mesI='04'; } if ( ($fin >= $año.'-04-01') AND ($fin < $año.'-05-01') ) { $mesF='04'; } if ( ($inicio >= $año.'-05-01') AND ($inicio < $año.'-06-01') ) { $mesI='05'; } if ( ($fin >= $año.'-05-01') AND ($fin < $año.'-06-01') ) { $mesF='05'; } if ( ($inicio >= $año.'-06-01') AND ($inicio < $año.'-07-01') ) { $mesI='06'; } if ( ($fin >= $año.'-06-01') AND ($fin < $año.'-07-01') ) { $mesF='06'; } if ( ($inicio >= $año.'-07-01') AND ($inicio < $año.'-08-01') ) { $mesI='07'; } if ( ($fin >= $año.'-07-01') AND ($fin < $año.'-08-01') ) { $mesF='07'; } if ( ($inicio >= $año.'-08-01') AND ($inicio < $año.'-09-01') ) { $mesI='08'; } if ( ($fin >= $año.'-08-01') AND ($fin < $año.'-09-01') ) { $mesF='08'; } if ( ($inicio >= $año.'-09-01') AND ($inicio < $año.'-10-01') ) { $mesI='09'; } if ( ($fin >= $año.'-09-01') AND ($fin < $año.'-10-01') ) { $mesF='09'; } if ( ($inicio >= $año.'-10-01') AND ($inicio < $año.'-11-01') ) { $mesI='10'; } if ( ($fin >= $año.'-10-01') AND ($fin < $año.'-11-01') ) { $mesF='10'; } if ( ($inicio >= $año.'-11-01') AND ($inicio < $año.'-12-01') ) { $mesI='11'; } if ( ($fin >= $año.'-11-01') AND ($fin < $año.'-12-01') ) { $mesF='11'; } if ( ($inicio >= $año.'-12-01') AND ($inicio < $año.'-12-31') ) { $mesI='12'; } if ( ($fin >= $año.'-12-01') AND ($fin < $año.'-12-31') ) { $mesF='12'; } // DIAS // conteo de dias $I01= $año.'-'.$mesI.'-01'; if ($inicio == $I01 ) {$diaI=1;} $F01= $año.'-'.$mesF.'-01'; if ($fin == $F01 ) {$diaF=1;} $I02= $año.'-'.$mesI.'-02'; if ($inicio == $I02 ) {$diaI=2;} $F02= $año.'-'.$mesF.'-02'; if ($fin == $F02 ) {$diaF=2;} $I03= $año.'-'.$mesI.'-03'; if ($inicio == $I03 ) {$diaI=3;} $F03= $año.'-'.$mesF.'-03'; if ($fin == $F03 ) {$diaF=3;} $I04= $año.'-'.$mesI.'-04'; if ($inicio == $I04 ) {$diaI=4;} $F04= $año.'-'.$mesF.'-04'; if ($fin == $F04 ) {$diaF=4;} $I05= $año.'-'.$mesI.'-05'; if ($inicio == $I05 ) {$diaI=5;} $F05= $año.'-'.$mesF.'-05'; if ($fin == $F05 ) {$diaF=5;} $I06= $año.'-'.$mesI.'-06'; if ($inicio == $I06 ) {$diaI=6;} $F06= $año.'-'.$mesF.'-06'; if ($fin == $F06 ) {$diaF=6;} $I07= $año.'-'.$mesI.'-07'; if ($inicio == $I07 ) {$diaI=7;} $F07= $año.'-'.$mesF.'-07'; if ($fin == $F07 ) {$diaF=7;} $I08= $año.'-'.$mesI.'-08'; if ($inicio == $I08 ) {$diaI=8;} $F08= $año.'-'.$mesF.'-08'; if ($fin == $F08 ) {$diaF=8;} $I09= $año.'-'.$mesI.'-09'; if ($inicio == $I09 ) {$diaI=9;} $F09= $año.'-'.$mesF.'-09'; if ($fin == $F09 ) {$diaF=9;} $I10= $año.'-'.$mesI.'-10'; if ($inicio == $I10 ) {$diaI=10;} $F10= $año.'-'.$mesF.'-10'; if ($fin == $F10 ) {$diaF=10;} $I11= $año.'-'.$mesI.'-11'; if ($inicio == $I11 ) {$diaI=11;} $F11= $año.'-'.$mesF.'-11'; if ($fin == $F11 ) {$diaF=11;} $I12= $año.'-'.$mesI.'-12'; if ($inicio == $I12 ) {$diaI=12;} $F12= $año.'-'.$mesF.'-12'; if ($fin == $F12 ) {$diaF=12;} $I13= $año.'-'.$mesI.'-13'; if ($inicio == $I13 ) {$diaI=13;} $F13= $año.'-'.$mesF.'-13'; if ($fin == $F13 ) {$diaF=13;} $I14= $año.'-'.$mesI.'-14'; if ($inicio == $I14 ) {$diaI=14;} $F14= $año.'-'.$mesF.'-14'; if ($fin == $F14 ) {$diaF=14;} $I15= $año.'-'.$mesI.'-15'; if ($inicio == $I15 ) {$diaI=15;} $F15= $año.'-'.$mesF.'-15'; if ($fin == $F15 ) {$diaF=15;} $I16= $año.'-'.$mesI.'-16'; if ($inicio == $I16 ) {$diaI=16;} $F16= $año.'-'.$mesF.'-16'; if ($fin == $F16 ) {$diaF=16;} $I17= $año.'-'.$mesI.'-17'; if ($inicio == $I17 ) {$diaI=17;} $F17= $año.'-'.$mesF.'-17'; if ($fin == $F17 ) {$diaF=17;} $I18= $año.'-'.$mesI.'-18'; if ($inicio == $I18 ) {$diaI=18;} $F18= $año.'-'.$mesF.'-18'; if ($fin == $F18 ) {$diaF=18;} $I19= $año.'-'.$mesI.'-19'; if ($inicio == $I19 ) {$diaI=19;} $F19= $año.'-'.$mesF.'-19'; if ($fin == $F19 ) {$diaF=19;} $I20= $año.'-'.$mesI.'-20'; if ($inicio == $I20 ) {$diaI=20;} $F20= $año.'-'.$mesF.'-20'; if ($fin == $F20 ) {$diaF=20;} $I21= $año.'-'.$mesI.'-21'; if ($inicio == $I21 ) {$diaI=21;} $F21= $año.'-'.$mesF.'-21'; if ($fin == $F21 ) {$diaF=21;} $I22= $año.'-'.$mesI.'-22'; if ($inicio == $I22 ) {$diaI=22;} $F22= $año.'-'.$mesF.'-22'; if ($fin == $F22 ) {$diaF=22;} $I23= $año.'-'.$mesI.'-23'; if ($inicio == $I23 ) {$diaI=23;} $F23= $año.'-'.$mesF.'-23' ; if ($fin == $F23 ) {$diaF=23;} $I24= $año.'-'.$mesI.'-24'; if ($inicio == $I24 ) {$diaI=24;} $F24= $año.'-'.$mesF.'-24'; if ($fin == $F24 ) {$diaF=24;} $I25= $año.'-'.$mesI.'-25'; if ($inicio == $I25 ) {$diaI=25;} $F25= $año.'-'.$mesF.'-25'; if ($fin == $F25 ) {$diaF=25;} $I26= $año.'-'.$mesI.'-26'; if ($inicio == $I26 ) {$diaI=26;} $F26= $año.'-'.$mesF.'-26'; if ($fin == $F26 ) {$diaF=26;} $I27= $año.'-'.$mesI.'-27'; if ($inicio == $I27 ) {$diaI=27;} $F27= $año.'-'.$mesF.'-27'; if ($fin == $F27 ) {$diaF=27;} $I28= $año.'-'.$mesI.'-28'; if ($inicio == $I28 ) {$diaI=28;} $F28= $año.'-'.$mesF.'-28'; if ($fin == $F28 ) {$diaF=28;} $I29= $año.'-'.$mesI.'-29'; if ($inicio == $I29 ) {$diaI=29;} $F29= $año.'-'.$mesF.'-29'; if ($fin == $F29 ) {$diaF=29;} $I30= $año.'-'.$mesI.'-30'; if ($inicio == $I30 ) {$diaI=30;} $F30= $año.'-'.$mesF.'-30'; if ($fin == $F30 ) {$diaF=30;} $I31= $año.'-'.$mesI.'-31'; if ($inicio == $I31 ) {$diaI=31;} $F31= $año.'-'.$mesF.'-31'; if ($fin == $F31 ) {$diaF=31;} // calculo de dias if (($mesI == $mesF)){ $valor= $diaF - $diaI; } else { $diferencia= $mesF - $mesI-1; if ( ($mesI='01') OR ($mesI='03') OR ($mesI='05') OR ($mesI='07') OR ($mesI='08') OR ($mesI='10') OR ($mesI='12') ) { $inicioFINAL= 31 - $diaI; while ($diferencia>0) { $inicioFINAL=$inicioFINAL+30; $diferencia--; if ($diferencia>0) {$inicioFINAL=$inicioFINAL+31; $diferencia--;} } $dias= $diaF + $inicioFINAL; } else { $inicioFINAL= 30 - $diaI; while ($diferencia>0) { $inicioFINAL=$inicioFINAL+31; $diferencia--; if ($diferencia>0) {$inicioFINAL=$inicioFINAL+30; $diferencia--;} } $dias= $diaF + $inicioFINAL; } // fin esle } // fin else return $dias; } // fin funcion conteodias ?> ($w+1)) { $g= $gente[$w+1].$gente[$w+2].$gente[$w+3]; $w=$w+4; //$g= '105'; } // fin while */ // *** CALCULOS PARA FP *** if ($registro[AR4Lista8]=='Precio Fijo') { // *** numero de proyectos $FPF++; // Campo Total Hrs PF Plan $PlanPF = $duracion; // se obtienen las hrs PF planificadas $CountPFP= $CountPFP + $PlanPF; // conteo ... // Campo Total Hrs PF Real $proyecto=$registro[AR4Codigo]; // N OPC $Huno= mysql_query("SELECT * FROM 701AR5 WHERE AR5Enlace4= ' ".$proyecto." '"); while($unos = mysql_fetch_assoc($Huno)) {; foreach($unos as $huno) { $hini = $huno[AR5Hora1]; $hfin = $huno[AR5Hora2]; if ($hini < '08:00:00') {$hini = '08:00:00';} if ($hfin > '17:00:00') {$hfin = '17:00:00';} $uno = $uno + ($hfin - $hini); } } // horas segun calculos $dos = $duracion; $RealPF = min($uno,$dos); // se obtienen las hrs PF reales (AL QUERY FINAL) ** minimo entre ambos valores $real=$RealPF; $CountPFR= $CountPFR + $RealPF; // conteo... // *** ingresos // horas plan ---- $duracion // rata $tie= mysql_query("SELECT LPRMonto3 FROM 701LPR WHERE LPRCodigo='".$linea."'"); $ties = mysql_fetch_row($tie); foreach ($ties as $rataP) {} // horas plan * rata $IngP = $duracion * $rataP; // se obtiene el ingreso planificado del OPC $IngresosPFP= $IngresosPFP + $IngP; // ingresos Real $IngR= $IngP; $rataR= $rataP; $IngresosPFR = $IngresosPFR + $IngR; // se obtiene el ingreso cobrado del OPC // *** costos directos // Plan (Costos Directos) $horasPLAN=$duracion; // N horas planificadas $monto= mysql_query("SELECT LPRMonto7 FROM 701LPR WHERE LPRCodigo='".$linea."'"); $unosD = mysql_fetch_row($monto); foreach($unosD as $costoLIN) {} // costo promedio de la linea /* $Huno2= mysql_query("SELECT * FROM 700AGE WHERE AGECodigo='".$g."'"); $unos2 = mysql_fetch_assoc($Huno2); $banda = $unos2[AGELinea7]; $H1= mysql_query("SELECT * FROM 701BAN"); $uban = mysql_fetch_assoc($H1); if ($banda= 'A') {$cosban= $uban[BANMonto1];} if ($banda= 'B') {$cosban= $uban[BANMonto2];} if ($banda= 'C') {$cosban= $uban[BANMonto3];} if ($banda= 'D') {$cosban= $uban[BANMonto4];} $horasREAL = $real; // N horas reales $cosdirR = $horasREAL * $cosban; // (AL QUERY FINAL) $costoLIN = $cosdirR; */ $cosdirP = $horasPLAN * $costoLIN; // (AL QUERY FINAL) $CostosPFP = $CostosPFP + $cosdirP; // Real (Costos Directos) $horasREAL = $real; // N horas reales $cosdirR = $horasREAL * $costoLIN; // (AL QUERY FINAL) $CostosPFR = $CostosPFR + $cosdirR; } // *** CALCULOS PARA TM ***** if ($registro[AR4Lista8]=='Tiempo y Material') { // numero de proyectos $TM++; // Campo Total Hrs TM Plan $PlanTM = $duracion; // se obtienen las hrs TM planificadas (AL QUERY FINAL) $CountTMP= $CountTMP + $PlanTM; // Campo Total Hrs TM Real // horas segun Tabla Tiempos $proyecto=$registro[AR4Codigo]; // N OPC //$tiempos="SELECT SUM(AR5Monto1) FROM 701AR5,701AR4 WHERE AR4Codigo= ' " .$proyecto." ' AND AR5Enlace4= ' ".$proyecto." ' "; $Huno= mysql_query("SELECT * FROM 701AR5 WHERE AR5Enlace4= ' ".$proyecto." '"); while($unos = mysql_fetch_assoc($Huno)) {; foreach($unos as $huno) { $hini = $huno[AR5Hora1]; $hfin = $huno[AR5Hora2]; if ($hini < '08:00:00') {$hini = '08:00:00';} if ($hfin > '17:00:00') {$hfin = '17:00:00';} $uno = $uno + ($hfin - $hini); } } // horas segun calculos $dos = $duracion; // ya calculado en Campo Total Hrs TM Plan $realTM = min($uno,$dos); // (AL QUERY FINAL) ** minimo entre ambos valores $CountTMR= $CountTMR + $realTM; // *** ingresos // horas plan ---- $duracion // rata $tie= mysql_query("SELECT LPRMonto3 FROM 701LPR WHERE LPRCodigo='".$linea."'"); $ties = mysql_fetch_row($tie); foreach ($ties as $rataP) {} // horas plan * rata $IngP = $duracion * $rataP; // se obtiene el ingreso planificado del OPC $IngresosTMP= $IngresosTMP + $IngP; // ingresos Real // horas real // horas segun Tabla Tiempos $proyecto=$registro[AR4Codigo]; // N OPC $Huno= mysql_query("SELECT * FROM 701AR5 WHERE AR5Enlace4= ' ".$proyecto." '"); while($unos = mysql_fetch_assoc($Huno)) {; foreach($unos as $huno) { $hini = $huno[AR5Hora1]; $hfin = $huno[AR5Hora2]; if ($hini < '08:00:00') {$hini = '08:00:00';} if ($hfin > '17:00:00') {$hfin = '17:00:00';} $uno = $uno + ($hfin - $hini); } } // horas segun calculos $dos = $duracion; $real = min($uno,$dos); //** minimo entre ambos valores $rataR= $rataP; // hora real * rata $IngR = $real * $rataR; // se obtiene el ingreso cobrado del OPC (AL QUERY FINAL) $IngresosTMR= $IngresosTMR + $IngR; // *** costos directos // Plan (Costos Directos) $horasPLAN=$duracion; // N horas planificadas $monto= mysql_query("SELECT LPRMonto7 FROM 701LPR WHERE LPRCodigo='".$linea."'"); $unosD = mysql_fetch_row($monto); foreach($unosD as $costoLIN) {} // costo promedio de la linea /* $Huno2= mysql_query("SELECT * FROM 700AGE WHERE AGECodigo='".$g."'"); $unos2 = mysql_fetch_assoc($Huno2); $banda = $unos2[AGELinea7]; $H1= mysql_query("SELECT * FROM 701BAN"); $uban = mysql_fetch_assoc($H1); if ($banda= 'A') {$cosban= $uban[BANMonto1];} if ($banda= 'B') {$cosban= $uban[BANMonto2];} if ($banda= 'C') {$cosban= $uban[BANMonto3];} if ($banda= 'D') {$cosban= $uban[BANMonto4];} $horasREAL = $real; // N horas reales $cosdirR = $horasREAL * $cosban; // (AL QUERY FINAL) $costoLIN = $cosdirR; */ $cosdirP = $horasPLAN * $costoLIN; // (AL QUERY FINAL) $CostosTMP = $CostosTMP + $cosdirP; // Real (Costos Directos) $horasREAL = $real; // N horas reales $cosdirR = $horasREAL * $costoLIN; // (AL QUERY FINAL) $CostosTMR = $CostosTMR + $cosdirR; } // *** CALCULOS PARA OTROS *** if ($registro[AR4Lista8]=='Otros') { // numero de proyectos $OT++; // Campo Total Hrs PF Plan $PlanPF = $duracion; // se obtienen las hrs PF planificadas $CountOP= $CountOP + $PlanPF; // conteo ... // Campo Total Hrs PF Real $proyecto=$registro[AR4Codigo]; // N OPC $Huno= mysql_query("SELECT * FROM 701AR5 WHERE AR5Enlace4= ' ".$proyecto." '"); while($unos = mysql_fetch_assoc($Huno)) {; foreach($unos as $huno) { $hini = $huno[AR5Hora1]; $hfin = $huno[AR5Hora2]; if ($hini < '08:00:00') {$hini = '08:00:00';} if ($hfin > '17:00:00') {$hfin = '17:00:00';} $uno = $uno + ($hfin - $hini); } } // horas segun calculos $dos = $duracion; $RealPF = min($uno,$dos); // se obtienen las hrs PF reales (AL QUERY FINAL) ** minimo entre ambos valores $CountOR= $CountOR + $RealPF; // conteo... // *** ingresos // horas plan ---- $duracion // rata $tie= mysql_query("SELECT LPRMonto3 FROM 701LPR WHERE LPRCodigo='".$linea."'"); $ties = mysql_fetch_row($tie); foreach ($ties as $rataP) {} // horas plan * rata $IngP = $duracion * $rataP; // se obtiene el ingreso planificado del OPC $IngresosOP= $IngresosOP + $IngP; // ingresos Real $IngR= $IngP; $rataR= $rataP; $IngresosOR = $IngresosOR + $IngR; // se obtiene el ingreso cobrado del OPC // *** costos directos // Plan (Costos Directos) $horasPLAN=$duracion; // N horas planificadas $monto= mysql_query("SELECT LPRMonto7 FROM 701LPR WHERE LPRCodigo='".$linea."'"); $unosD = mysql_fetch_row($monto); foreach($unosD as $costoLIN) {} // costo promedio de la linea /* $Huno2= mysql_query("SELECT * FROM 700AGE WHERE AGECodigo='".$g."'"); $unos2 = mysql_fetch_assoc($Huno2); $banda = $unos2[AGELinea7]; $H1= mysql_query("SELECT * FROM 701BAN"); $uban = mysql_fetch_assoc($H1); if ($banda= 'A') {$cosban= $uban[BANMonto1];} if ($banda= 'B') {$cosban= $uban[BANMonto2];} if ($banda= 'C') {$cosban= $uban[BANMonto3];} if ($banda= 'D') {$cosban= $uban[BANMonto4];} $horasREAL = $real; // N horas reales $cosdirR = $horasREAL * $cosban; // (AL QUERY FINAL) $costoLIN = $cosdirR; */ $cosdirP = $horasPLAN * $costoLIN; // (AL QUERY FINAL) $CostosOP = $CostosOP + $cosdirP; // Real (Costos Directos) $horasREAL = $real; // N horas reales $cosdirR = $horasREAL * $costoLIN; // (AL QUERY FINAL) $CostosOR = $CostosOR + $cosdirR; } // ** BLOQUE GM // FP Plan $GMPFP = $IngresosPFP - $CostosPFP; $gm1a = ( ($GMPFP * 100) / $IngresosPFP ); // % $gm1b = ceil($gm1a); $gmPFP = $gm1b." %"; // FP Real $GMPFR = $IngresosPFR - $CostosPFR; $gm2a = ( ($GMPFR * 100) / $IngresosPFR ); // % $gm2b = ceil($gm2a); $gmPFR = $gm2b." %"; // TM Plan $GMTMP = $IngresosTMP - $CostosTMP; $gm5a = ( ($GMTMP * 100) / $IngresosTMP ); // % $gm6b = ceil($gm5a); $gmTMP = $gm6b." %"; // TM Real $GMTMR = $IngresosTMR - $CostosTMR; $gm7a = ( ($GMTMR * 100) / $IngresosTMR ); // % $gm8b = ceil($gm7a); $gmTMR = $gm8b." %"; // O Plan $GMOP = $IngresosOP - $CostosOP; $gm3a = ( ($GMOP * 100) / $IngresosOP ); // % $gm3b = ceil($gm3a); $gmOP = $gm3b." %"; // O Real $GMOR = $IngresosOR - $CostosOR; $gm4a = ( ($GMOR * 100) / $IngresosOR ); // % $gm4b = ceil($gm4a); $gmOR = $gm4b." %"; // fte // ******** ACOMODAR EL AÑO *************** // FTE if ( ($inicio > $año.'-01-01') AND ($inicio < $año.'-02-01') ) { $fteENE= $fteENE + $fte; } if ( ($inicio > $año.'-02-01') AND ($inicio < $año.'-03-01') ) { $fteFEB= $fteFEB + $fte; } if ( ($inicio > $año.'-03-01') AND ($inicio < $año.'-04-01') ) { $fteMAR= $fteMAR + $fte; } if ( ($inicio > $año.'-04-01') AND ($inicio < $año.'-05-01') ) { $fteABR= $fteABR + $fte; } if ( ($inicio > $año.'-05-01') AND ($inicio < $año.'-06-01') ) { $fteMAY= $fteMAY + $fte; } if ( ($inicio > $año.'-06-01') AND ($inicio < $año.'-07-01') ) { $fteJUN= $fteJUN + $fte; } if ( ($inicio > $año.'-07-01') AND ($inicio < $año.'-08-01') ) { $fteJUL= $fteJUL + $fte; } if ( ($inicio > $año.'-08-01') AND ($inicio < $año.'-09-01') ) { $fteAGO= $fteAGO + $fte; } if ( ($inicio > $año.'-09-01') AND ($inicio < $año.'-10-01') ) { $fteSEP= $fteSEP + $fte; } if ( ($inicio > $año.'-10-01') AND ($inicio < $año.'-11-01') ) { $fteOCT= $fteOCT + $fte; } if ( ($inicio > $año.'-11-01') AND ($inicio < $año.'-12-01') ) { $fteNOV= $fteNOV + $fte; } if ( ($inicio > $año.'-12-01') AND ($inicio < $año.'-12-31') ) { $fteDIC= $fteDIC + $fte; } } // while // GERENTE - MESES // gerente $G= mysql_query("SELECT AGENombre FROM 701LPR,700AGE WHERE LPREnlaceA=AGECodigo AND LPRCodigo='".$linea."'"); $P = mysql_fetch_row($G); foreach($P as $GP) {} // primer cuadro if ($mes == '01') { $Mes1='Enero';$sem='I';} if ($mes == '02') { $Mes1='Febrero';$sem='I';} if ($mes == '03') { $Mes1='Marzo';$sem='I';} if ($mes == '04') { $Mes1='Abril';$sem='II';} if ($mes == '05') { $Mes1='Mayo';$sem='II';} if ($mes == '06') { $Mes1='Junio';$sem='II';} if ($mes == '07') { $Mes1='Julio';$sem='III';} if ($mes == '08') { $Mes1='Agosto';$sem='III';} if ($mes == '09') { $Mes1='Septiembre';$sem='III';} if ($mes == '10') { $Mes1='Octubre';$sem='IV';} if ($mes == '11') { $Mes1='Noviembre';$sem='IV';} if ($mes == '12') { $Mes1='Diciembre';$sem='IV';} if ($sem=='I') {$Mes1='Marzo';$Mes2='Febrero';$Mes3='Enero';$fte3= $fteENE;$fte2=$fteFEB;$fte1= $fteMAR;} if ($sem=='II') {$Mes1='Junio';$Mes2='Mayo';$Mes3='Abril';$fte3= $fteABR;$fte2=$fteMAY;$fte1= $fteJUN;} if ($sem=='III') {$Mes1='Septiembre';$Mes2='Agosto';$Mes3='Julio';$fte3= $fteJUL;$fte2=$fteAGO;$fte1= $fteSEP;} if ($sem=='IV') {$Mes1='Diciembre';$Mes2='Noviembre';$Mes3='Octubre';$fte3= $fteOCT;$fte2=$fteNOV;$fte1= $fteDIC;} $h3= $WorkingHours * $fte3; $h2= $WorkingHours * $fte2; $h1= $WorkingHours * $fte1; $TotHP= $h3 + $h2 + $h1; // ** TOTALES DE PROYECTOS // cantidad de proyectos $Total = $FPF+$TM+$OT; // totales Hr Plan $TotalHP = $CountPFP + $CountTMP + $CountOP; // totales Hr Real $TotalHR = $CountPFR + $CountTMR + $CountOR; // TNS Plan $TNSP = $TotHP - $TotalHP; // TNS Real $TNSR = $TotHP - $TotalHR; // TNS Plan (%) $tns1 = ( ($TNSP * 100) / $TotHP ); // % $tnsP = ceil($tns1); $tnsPlan = $tnsP." %"; // TNS Real (%) $tns2 = ( ($TNSR * 100) / $TotHP ); // % $tnsR = ceil($tns2); $tnsReal = $tnsR." %"; // total Ingresos $TotalIngresosP = $IngresosPFP + $IngresosTMP + $IngresosOP; $TotalIngresosR = $IngresosPFR + $IngresosTMR + $IngresosOR; // total egresos $TotalCostosP = $CostosPFP + $CostosTMP + $CostosOP; $TotalCostosR = $CostosPFR + $CostosTMR + $CostosOR; // total GM $TotalGMP = $TotalIngresosP - $TotalCostosP; $TotalGMR = $TotalIngresosR - $TotalCostosR; // total GM % $gm20 = ( ($TotalGMP * 100) / $TotalIngresosP ); // % $gm30 = ceil($gm20); $TotalgmP = $gm30." %"; $gm40 = ( ($TotalGMR * 100) / $TotalIngresosR ); // % $gm50 = ceil($gm40); $TotalgmR = $gm50." %"; // ** BLOQUE DE CALCULOS FINALES // Fixed Cost Absorbed $Aporte= $costoFL; // TNS en $ $TNVP = $TNSP * $AC; $TNVR = $TNSR * $AC; // Margen Neto $NETP = $TotalGMP - $Aporte - $TNVP; $NETR = $TotalGMR - $Aporte - $TNVR; // Margen Neto (%) $gm400 = ( ($NETP * 100) / $TotalIngresosP ); // % $gm500 = ceil($gm400); $NetP = $gm500." %"; $gm600 = ( ($NETR * 100) / $TotalIngresosR ); // % $gm700 = ceil($gm600); $NetR = $gm700." %"; echo "WK :".$WorkingHours."
"; echo "sem :".$sem."
"; echo "fte3 :".$fte3."
"; echo "fte2 :".$fte2."
"; echo "fte1 :".$fte1."
"; echo "h3 :".$h3."
"; echo "h2 :".$h2."
"; echo "h1 :".$h1."
"; echo "TotalHP :".$TotHP."
"; echo "************" ."
"; ?>
Para ver el reporte detallado de la Linea de Producción, siga el siguiente enlace: "?>Production Data
xxxxxxxxx
Seleccione la Linea de Producción a visualizar :
xxxxxxxxx
Production Line:
Lider:
 
Quarter:

Fixes Costo Year (U$$O)

Allocated

Quarterly

Fixed Cost(U$$O)

 

 

 

 

 

 

 

Informacion de produccion
Total Prod. Hours
Working Hours
 
 
Persons
Hours
Persons
Hours
Persons
Hours
 
Productive Hours
Average Rate (U$$O)
Average Cost (U$$O)

 

Quarterv Production Summarv
FP
TM
O
Total
TNS
Plan
Actual
Plan
Actual
Plan
Actual
Plan
Actual
Plan
Actual
Total Nº OPC
Hours Sold

Income (U$$O)

Direct Cost (U$$O)

Gross Margin (U$$O)

(%)

 

Fixed Cost Absorved (U$$O)

TNS(U$$O)

 
 
Net Margin (U$$O)