SKKN Giải pháp ứng dụng hệ thống tài khoản kế toán trên điện thoại di động

pdf 13 trang vanhoa 3801
Bạn đang xem tài liệu "SKKN Giải pháp ứng dụng hệ thống tài khoản kế toán trên điện thoại di động", để tải tài liệu gốc về máy bạn click vào nút DOWNLOAD ở trên

Tài liệu đính kèm:

  • pdfskkn_giai_phap_ung_dung_he_thong_tai_khoan_ke_toan_tren_dien.pdf

Nội dung tóm tắt: SKKN Giải pháp ứng dụng hệ thống tài khoản kế toán trên điện thoại di động

  1. TRƯỜNG CĐ KT-KT KIÊN GIANG CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM KHOA CÔNG NGHỆ THÔNG TIN ĐỘC LẬP - TỰ DO - HẠNH PHÚC GIẢI PHÁP ỨNG DỤNG HỆ THỐNG TÀI KHOẢN KẾ TOÁN TRÊN ĐIỆN THOẠI DI ĐỘNG I. Báo cáo tóm tắt nội dung sáng kiến Tên đề tài: Ứng dụng hệ thống tài khoản kế toán trên điện thoại di động Ứng dụng là giải pháp hoàn toàn mới, được viết ra và đưa lên “google play” giúp sinh viên có thể tra cứu thông tin tài khoản kế toán thuận tiện nhanh chóng và chính xác theo Thông tư số 200/2014/TT-BTC ngày 22 tháng 12 năm 2014, Bộ Tài Chính đã ký ban hành chế độ kế toán doanh nghiệp mới. Sáng kiến áp dụng ở một vài bộ phận trong đơn vị II. Nội dung 2.1 Dẫn nhập Sinh viên học và có áp dụng được vào trong công việc mà sinh viên sẽ làm khi ra trường ? Trong quá trình dạy và nghiên cứu nâng cao trình độ khai thác các kiến thức mới cũng như tiếp cận những công nghệ phục vụ cho việc giảng dạy được thực tế với môi trường làm việc sau khi sinh viên ra trường thì một trong những điều khá phổ biến trong cuộc sống hàng ngày của chúng ta là những ứng dụng trên hệ điều hành của những thiết bị điện thoại mà chúng ta sử dụng hàng ngày. Khai thác và sử dụng đòi hỏi phải có những phương pháp. Trong đó việc viết một ứng dụng hệ thống tài khoản kế toán và cài đặt như thế nào trên điện thoại di động là điều cần thiết đối với sinh viên chuyên ngành cũng như giúp it cho sinh viên kinh tế Xuất phát từ nhu cầu thực tế trên tôi đã nghiên cứu và viết phần mềm “ứng dụng tài khoản kế toán trên điện thoại di động” 2.2 Những khó khăn Hiện nay việc ứng dụng những công nghệ mới là những vấn đề khó đối với sinh viên. Bên cạnh đó giáo viên cũng lơ là trong công việc nghiên cứu công nghệ mới, thực tế để áp dụng giảng dạy cho sinh viên nên dẫn đến sinh viên khó tiếp cận được những công việc cũng như những kiến thức mới và hữu ít khi ra trường. 2.3 Giải pháp khắc phục khó khăn a. Mục tiêu chương trình: Tạo ra và đưa lên “google play” một chương trình danh mục hệ thống tài khoản kế toán doanh nghiệp được ban hành theo thông tư 200 - cập nhật mới nhất áp dụng cho năm 2015, áp dụng đối với các doanh nghiệp thuộc mọi lĩnh vực, mọi thành phần kinh tế. Các doanh nghiệp vừa và nhỏ đang thực hiện kế toán theo chế độ kế toán áp dụng cho doanh nghiệp vừa và nhỏ được vận dụng quy định của Thông tư này Trang 1
  2. b. Các giải pháp giúp sinh viên có thể tra cứu thông tin tài khoản kế toán thuận tiện nhanh chóng và chính xác: Trang chủ Tra cứu thông tin tài sản Tra cứu thông tin tài nợ phải trả Tra cứu thông tin vốn chủ sở hữu Trang 2
  3. Tra cứu thông tin doanh thu Tra cứu thông tin chi phí sản xuất kinh doanh Tra cứu thông tin thu nhập khác Tra cứu thông tin chi phí khác Trang 3
  4. Tra cứu thông tin xác định kết quả kinh doanh c. Cài đặt ứng dụng Bước 1: Trang 4
  5. Bước 2: d. Một số Code chương trình Class: activity_main.xml <TextView android:id="@+id/textViewLoai" android:layout_width="match_parent" android:layout_height="50dp" android:background="@color/text_color8" android:gravity="center" android:text="HỆ THỐNG TÀI KHOẢN KẾ TOÁN" Trang 5
  6. android:textColor="#ffffff" android:textSize="16sp" android:textStyle="bold" /> Class: Database package model; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import controller.*; Trang 6
  7. import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class Database extends SQLiteOpenHelper { private static String DB_PATH = "/data/data/nguyenquankhanh.hethongtaikhoanketoan/databases/"; private static String DB_NAME = "hethongtaikhoanketoan.sqlite"; private static final int DB_VERSION = 1; private SQLiteDatabase sqliteDatabase; private final Context context; public Database(Context context) { super(context, DB_NAME, null, DB_VERSION); this.context = context; } public void openDatabase() throws SQLException { String Path = DB_PATH + DB_NAME; sqliteDatabase = SQLiteDatabase.openDatabase(Path, null, SQLiteDatabase.OPEN_READONLY); } public synchronized void closeDatabase() { if (sqliteDatabase != null) sqliteDatabase.close(); super.close(); } private boolean checkDatabase() { SQLiteDatabase checkDB = null; try { String Path = DB_PATH + DB_NAME; checkDB = SQLiteDatabase.openDatabase(Path, null, SQLiteDatabase.OPEN_READONLY); } catch (SQLException e) { } if (checkDB != null) checkDB.close(); return checkDB != null ? true : false; } private void copyDatabase() throws IOException { // doc database InputStream input = this.context.getAssets().open(DB_NAME); Trang 7
  8. String outFileName = DB_PATH + DB_NAME;// // ghi database OutputStream output = new FileOutputStream(outFileName); byte[] buffer = new byte[1024]; int length; while ((length = input.read(buffer)) > 0) { output.write(buffer, 0, length); } output.flush(); output.close(); input.close(); } public void createDatabase() throws IOException { boolean dbExist = checkDatabase(); if (dbExist) { } else { this.getReadableDatabase(); try { copyDatabase(); } catch (IOException e) { throw new Error("Error copy database"); } } } // lay danh sach loai public ArrayList dsLoai() { ArrayList ds = new ArrayList (); SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor = db.rawQuery("select * from loai", null); if (cursor.moveToFirst()) { do { Loai l = new Loai(); l.setMaLoai(Integer.parseInt(cursor.getString(0))); l.setTenLoai(cursor.getString(1)); ds.add(l); } while (cursor.moveToNext()); } cursor.close(); db.close(); return ds; } // lay danh sach tai khoan theo ma tra ve loai public Loai dsTaiKhoan(int ma) { SQLiteDatabase db = this.getReadableDatabase(); Loai loaiTK = new Loai(); //troi oi luu y can thay cau lenh query!!! Cursor cursor = db.rawQuery( Trang 8
  9. "select l.*,tk.* from loai as l join taikhoan as tk on l.maloai = tk.loai" + " where l.maloai = " + ma + " order by tk.stt;", null); if (cursor.moveToFirst()) { int m = 0; do { int maLoai = Integer.parseInt(cursor.getString(0)); String tenLoai = cursor.getString(1); int stt = Integer.parseInt(cursor.getString(2)); int soHieu = Integer.parseInt(cursor.getString(3)); String tenTaiKhoan = cursor.getString(4); int cap = Integer.parseInt(cursor.getString(5)); int loai = Integer.parseInt(cursor.getString(6)); // chi khoi tao 1 lan doi tuong loai if (maLoai != m) { loaiTK = new Loai(maLoai, tenLoai); m = maLoai; } // add tai khoan vao loai luu tru trong arraylist if (soHieu != 0) { TaiKhoan tk = new TaiKhoan(stt, soHieu, tenTaiKhoan, cap, loai); loaiTK.getDsTaiKhoan().add(tk); } } while (cursor.moveToNext()); } cursor.close(); db.close(); return loaiTK; } // lay danh sach tai khoan theo ma tra ve arraylist tai khoan public ArrayList dsTaiKhoan1(int ma) { ArrayList ds = new ArrayList (); SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor = db.rawQuery( "select l.*,tk.* from loai as l join taikhoan as tk on l.maloai = tk.loai" + "where l.maloai = " + ma + "order by tk.stt;", null); if (cursor.moveToFirst()) { do { int stt = Integer.parseInt(cursor.getString(2)); int soHieu = Integer.parseInt(cursor.getString(3)); String tenTaiKhoan = cursor.getString(4); int cap = Integer.parseInt(cursor.getString(5)); int loai = Integer.parseInt(cursor.getString(6)); TaiKhoan tk = new TaiKhoan(stt, soHieu, tenTaiKhoan, cap, loai); ds.add(tk); } while (cursor.moveToNext()); } cursor.close(); Trang 9
  10. db.close(); return ds; } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // TODO Auto-generated method stub } } Class: MainActivity.java package controller; import java.io.IOException; import java.util.ArrayList; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdView; import model.*; import nguyenquankhanh.hethongtaikhoanketoan.R; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import android.widget.AdapterView.OnItemClickListener; public class MainActivity extends Activity { AdView adView; ListView lvLoai; ArrayAdapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Trang 10
  11. setContentView(R.layout.activity_main); adView = (AdView) findViewById(R.id.adView); AdRequest adRequest = new AdRequest.Builder().build(); adView.loadAd(adRequest); Database dao = new Database(this); try { dao.createDatabase(); } catch (IOException e) { e.printStackTrace(); } // lay database ArrayList dsLoai = dao.dsLoai(); lvLoai = (ListView) findViewById(R.id.listViewLoai); // chi lay ra ten loai add vao arraylist string ArrayList dsTenLoai = new ArrayList (); for (Loai loai : dsLoai) if (!dsTenLoai.contains(loai)) dsTenLoai.add(loai.getTenLoai()); // su dung listview co san (simple_list_item_1) de hien thi adapter = new ArrayAdapter (this, android.R.layout.simple_list_item_1, dsTenLoai); lvLoai.setAdapter(adapter); // xu ly click len tung loai tai khoan lvLoai.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { int itemPosition = position; View viewItem = lvLoai.getChildAt(itemPosition); TextView textView = (TextView) viewItem; String itemValue = (String) textView.getText(); Intent myIntent = new Intent(MainActivity.this, TaiKhoanActivity.class); // hang dau tien = 0 int mLoai = (itemPosition + 1); if (mLoai == 9) { alert(); } else { myIntent.putExtra("maLoai", String.valueOf(mLoai)); myIntent.putExtra("tenLoai", itemValue); Trang 11
  12. startActivity(myIntent); } } }); } public AlertDialog.Builder alert() { AlertDialog.Builder aDialog = new AlertDialog.Builder(this); aDialog.setTitle("NAUKE"); aDialog.setMessage("nguyennauke@gmail.com"); aDialog.setPositiveButton("Trở Về", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); aDialog.create().show(); return aDialog; } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, 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(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } Trang 12
  13. 2.4 Kết quả thực hiện Sau khi cài đặt xong sẽ có giao diện tương tác làm việc như đã nêu trên điện thoại. 2.5 Kết luận Trên đây là một sáng kiến dễ áp dụng. Với lòng yêu nghề và xem việc giáo dục sinh viên là mối quan tâm hàng đầu, tôi nghĩ sáng kiến này cũng giúp cho chúng ta phần nào tìm ra một giải pháp hợp lý trong tiếp cận với việc ứng dụng hệ thống tài khoản kế toán trên điện thoại di động Tôi không khẳng định rằng với phương pháp nêu trên hoàn toàn hay hoặc hợp lý. Nhưng với phương pháp này, bản thân tôi nhận thấy rằng giải pháp tôi nêu trên thực sự mang lại nhiều lợi ích cho các sinh viên. Đây không phải là một ý tưởng mới, nhưng không phải bất kỳ ai cũng áp dụng thuận lợi và hiệu quả. Điều này còn tùy thuộc vào cách áp dụng cũng như khả năng của từng người. Qua đây, tôi rất mong nhận được nhiều ý kiến đóng góp, các ý tưởng từ các đồng nghiệp, từ hội đồng khoa học để tôi tiếp tục hoàn thiện. Xin chân thành cảm ơn. Trang 13