include('includes/configure.php'); $textoConsulta ="SELECT round(products_tax) products_tax, " . "round(sum(products_quantity*products_price_cost),2) precioSinIva, " . //"round(sum(products_quantity*(products_price_cost/(1+products_tax/100))*products_tax/100),2) iva ". "round(sum(products_quantity*(products_price_cost*products_tax/100)),2) iva ". "FROM orders_products op join orders o on op.orders_id = o.orders_id ". "where o.shipdate between '".$_POST['fechaEntregaIni']."' and '".$_POST['fechaEntregaFin']."' ". //"and o.orders_id=13871 ". "group by 1 "; /* $textoConsulta ="SELECT round(products_tax) products_tax, " . "round(sum(op.products_quantity*((op.products_price*(1+products_tax/100))/(1+valor/100))),2) precioFinal, " . "round(sum(op.products_quantity*(op.products_price*(1+products_tax/100))/(1+valor/100)/(1+products_tax/100)),2) precioSinIva, " . "round(sum((op.products_quantity*(op.products_price*(1+products_tax/100))/(1+valor/100)/(1+products_tax/100))*products_tax/100),2) iva ". "FROM orders_products op join orders o on op.orders_id = o.orders_id ". "join products p on p.products_id = op.products_id ". "join tipoBeneficio tb on tb.idTipo = p.products_TipoBeneficio ". "where o.shipdate between '".$_POST['fechaEntregaIni']."' and '".$_POST['fechaEntregaFin']."' ". //"and o.orders_id=13871 ". "group by 1 "; */ //echo $textoConsulta; //$status_query = tep_db_query($textoConsulta); $texto_query1 = "SELECT tramo_date shipdate,count(*) pedidos " . "FROM ps_orders o join ps_cart d on (d.id_cart=o.id_cart) " . "where tramo_date between '".$_POST['fechaEntregaIni']."' and '".$_POST['fechaEntregaFin']."' " . "and o.current_state in (2,3,4) ". //Estados Cancelado y Pago Virtual "group by 1"; $status_query1 = tep_db_query($texto_query1); //echo $texto_query1; ?>