Skip to content

Commit

Permalink
[FIX] Nueva clase para mostrar movimientosArticuloSerie
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-teruel committed Feb 15, 2015
1 parent a68a52f commit 9f73459
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 68 deletions.
3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions StockControl.iml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
android:name=".Recepciones"
android:label="@string/title_activity_recepciones" >
</activity>
<activity
android:name=".MovArticuloSerieDetail"
android:label="@string/title_activity_mov_articulo_serie_detail" >
</activity>
</application>

</manifest>
66 changes: 7 additions & 59 deletions app/src/main/java/es/incaser/apps/stockcontrol/DbAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,13 @@ public Cursor getSumMovArticuloSerie(String codigoEmpresa, String tipoMovimiento
return cur;
}

public Cursor getMovArticuloSerieByDoc(String codigoEmpresa, String tipoMovimiento, String serie, String documento) {
String where ="CodigoEmpresa=? AND OrigenDocumento=? AND SerieDocumento=? AND Documento=?";
Cursor cur = db.query("MovimientoArticuloSerie", new String[]{"*"}, where,
new String[]{codigoEmpresa, TipoMovimiento.origenMov(tipoMovimiento), serie, documento}, "", "", "");
return cur;
}

public void updateUnidadesMovStock(String codigoEmpresa, String tipoMovimiento, String serie, String documento) {
String sql = "UPDATE MovimientoStock SET Unidades = (SELECT COUNT(id) " +
"FROM MovimientoArticuloSerie " +
Expand Down Expand Up @@ -461,65 +468,6 @@ public Cursor getBusqueda(String tabla, String campoBusqueda, String campoRetorn

//*******************************************************************************////

public Cursor getMaquina(String id) {
return db.query("Maquinas", new String[]{"*"}, "id=?", new String[]{id}, "", "", "");
}

public Cursor getRecaudacion(String codigoEmpresa, String codigoEstablecimiento, String codigoMaquina) {
return db.query("INC_LineasRecaudacion", new String[]{"*"}, "CodigoEmpresa=? AND INC_CodigoEstablecimiento=? AND INC_CodigoMaquina=?",
new String[]{codigoEmpresa, codigoEstablecimiento, codigoMaquina}, "", "", "");
}

public Cursor getCabeceraRecaudacion(String codigoEmpresa, String codigoEstablecimiento) {
return db.query("INC_CabeceraRecaudacion", new String[]{"*"}, "CodigoEmpresa=? AND INC_CodigoEstablecimiento=?",
new String[]{codigoEmpresa, codigoEstablecimiento}, "", "", "");
}


public Cursor getPrestamosEstablecimiento(String codigoEmpresa, String codigoEstablecimiento) {
return db.query("Prestamos", new String[]{"*"}, "CodigoEmpresa=? AND INC_CodigoEstablecimiento=?",
new String[]{codigoEmpresa, codigoEstablecimiento}, "", "", "");
}

public Cursor getPrestamo(String codigoPrestamo) {
return db.query("Prestamos", new String[]{"*"}, "INC_CodigoPrestamo=?",
new String[]{codigoPrestamo}, "", "", "");
}

public Map<String, String> getDicRelLineasCabecerax() {
Map<String, String> dicRelLineasCabecera = new HashMap<String, String>();
dicRelLineasCabecera.put("INC_ImporteRecaudacion", "INC_TotalRecaudacion");
dicRelLineasCabecera.put("INC_ImporteRetencion", "INC_TotalRetencion");
dicRelLineasCabecera.put("INC_ImporteNeto", "INC_TotalNeto");
dicRelLineasCabecera.put("INC_ImporteEstablecimiento", "INC_TotalEstablecimiento");

return dicRelLineasCabecera;
}

public Cursor getTotalesRecaudacion(String empresa, String establecimiento, String fecha) {
// Map<String, String> dicRelLineasCabecera = getDicRelLineasCabecera();
// String[] campos = dicRelLineasCabecera.keySet().toString().replace("[","").replace("]","").split(",");
String[] campos = new String[]{
"SUM(INC_ImporteRecaudacion) AS INC_TotalRecaudacion",
"SUM(INC_ImporteRetencion) AS INC_TotalRetencion",
"SUM(INC_ImporteNeto) AS INC_TotalNeto",
"SUM(INC_ImporteEstablecimiento) AS INC_TotalEstablecimiento",
"SUM(INC_ImporteNeto + INC_ImporteRetencion) AS INC_TotalNetoMasRetencion",
"SUM(INC_RecuperaCargaEmpresa) AS INC_TotalRecuperaCarga",
"0 AS INC_TotalRecuperaPrestamo",
"0 AS INC_TotalSaldo",
"0 AS INC_MaquinasInstaladas",
"COUNT() AS INC_MaquinasRecaudadas",
"0 AS INC_StatusAlbaran",
"0 AS INC_Porcentaje",
};

String where = "Printable=1 AND CodigoEmpresa=? AND INC_CodigoEstablecimiento=? AND INC_FechaRecaudacion=?";
String groupBy = "CodigoEmpresa, INC_CodigoEstablecimiento, INC_FechaRecaudacion";
String[] whereArgs = new String[]{empresa, establecimiento, fecha};
return db.query("INC_LineasRecaudacion", campos, where, whereArgs, groupBy, "", "");
}

public Cursor getCursor(String query) {
return db.rawQuery(query, new String[]{});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package es.incaser.apps.stockcontrol;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;


public class MovArticuloSerieDetail extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mov_articulo_serie_detail);
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_mov_articulo_serie_detail, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}

return super.onOptionsItemSelected(item);
}
}
12 changes: 12 additions & 0 deletions app/src/main/res/layout/activity_mov_articulo_serie_detail.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="es.incaser.apps.stockcontrol.MovArticuloSerieDetail">

<TextView android:text="@string/hello_world" android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</RelativeLayout>
7 changes: 7 additions & 0 deletions app/src/main/res/menu/menu_mov_articulo_serie_detail.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="es.incaser.apps.stockcontrol.MovArticuloSerieDetail">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="never" />
</menu>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
<string name="action_db_rebuild">Regenerar bd</string>
<string name="action_soft_sync">Soft sync</string>
<string name="title_activity_recepciones">Recepciones</string>
<string name="title_activity_mov_articulo_serie_detail">Detalle movimiento</string>

</resources>

0 comments on commit 9f73459

Please sign in to comment.