I have a PHP script to make calculations of a few linear meters, square meters, etc. The risk is that these calculations are taken from an excel spreadsheet and I have exchanged the values of the names of the cells by the $_post['']
that I have needed or the variables that I have needed, for example, I do not perform the calculations correctly, I leave my PHP script to see if you see any errors, I still leave the line of excell!
Here is my PHP script:
$metros_lineales = ((($_POST['cantidad_etiquetas']*($_POST['avance']+$_POST['separacion']+3))/$_POST['etiquetas_banda'])/ 1000+250)*1.1;
//calculo de los metros cuadrados.
$metros_cuadrados = ($metros_lineales*$_POST['banda_papel'])/1000;
//calculo costo del papel.
$costo_papel = $metros_cuadrados*$_POST['costo_papel'];
// calculo tiempo de tirada.
$tiempo_tirada = $metros_lineales/$_POST['velocidad_impresion'];
//calculo tiempo de tirada + preparacion.
$tiempo_tirada_mas_preparacion = $tiempo_tirada+90;
//Calculo coste tirada
$coste_tirada = ($tiempo_tirada*$_POST['precio_hora_maquina']);
//calculo del coste total.
$coste_total = $_POST['costo_papel']+$coste_tirada;
//calculo coste millar.
$coste_millar = ($coste_total/$_POST['cantidad_etiquetas'])*1000;
//calculo sin impresion
$sin_impresion = $coste_millar*$_POST['porcentaje_sinImpresion'];
//calculo grabados
$grabados = $_POST['cantidad_grabados']*$_POST['precio_grabados'];
//calculo coste millar mas gastos
$coste_millar_mas_gastos = ((($total_pedido+$_POST['cantidad_grabados']+$_POST['troquel']+$_POST['portes'])/$_POST['cantidad_etiquetas'])*1000);
//calculo estampacion
$estampacion = $total_gastos+$_POST['porcentaje_estampacion'];
//calculo total del pedido
$total_pedido = ($estampacion*$_POST['cantidad_etiquetas'])/1000;
//calculo beneficio bruto
$beneficio_bruto = $total_pedido-$_POST['costo_papel'];
excell line
square meters: (H28 * I28) / 1000
linear meters: (((A28 * (C28 + 3)) / D28) / 1000 + 250) * 1.1
That would be the excell formulas among many others, but in those two now you should see the errors that I have in my script.