public int write2datafile()
    {
        int return_val = 0;
        int paid_count  = Paid_MaSP.size();
        String file_date           = sDate_time;
        String[] time_info = file_date.split(" ");
        String[] file_info = time_info[0].split("/");
        String   file_dir = file_info[2] +"\\" + file_info[1];
        if(paid_count != 0)
        {
            try
            {
                // Create file 
                File Fdir = new File(file_dir);
                boolean  a = Fdir.mkdirs(); 
                if(a || Fdir.isDirectory())
                {
                    file_path   = file_dir +"\\" + file_info[0]+".thsv";
                    ComboBox_history.addItem(time_info[1] + "<>" +Consumer_name);
                    FileOutputStream fos = new FileOutputStream(file_path,true);
                    Writer out = new OutputStreamWriter(fos, "UTF8");
                    {
                        out.write("-->" +file_date + "<>" +Consumer_name + "\n" );
                        
                        for(int i = 0; i < paid_count; i++)
                        {
                            out.write("---" + Paid_MaSP.get(i) + "<>" + 
                                    Paid_TenSP.get(i) + "<>" + Paid_SoLuongSP.get(i) 
                                    + "<>" +Paid_TongGiaSP.get(i)
                                    + "<>" +Paid_GiaSSP.get(i)
                                    + "<>" +Paid_GiaLSP.get(i)+ "\n");
                            SauVan.update_distribution(Paid_MaSP.get(i));
                        }
                            
                        out.write("==>"+ Money_count_Items +"<>" + 
                                Money_total_bill  + "<>" +Money_custumer + "<>"
                                + Money_return + "\n");
                        out.write("==-"+ dno_cu + "\n");
                        out.close();
                    }
                }
            }
             
            catch (Exception e){//Catch exception if any
                    System.err.println("Error: " + e.getMessage());
            }
        }
        return return_val;
    }