Subversion Repository Public Repository

TransPort_Tracking

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.transtracking.controller;

import com.bestray.transporttracking.DataSourceObject;
import com.bestray.transtracking.dao.impl.CodeDaoImpl;
import com.bestray.transtracking.dto.PaymentVoucherSearchDTO;
import com.bestray.transtracking.service.CodeService;
import com.bestray.transtracking.service.OilChangeService;
import com.bestray.transtracking.service.PartyService;
import com.bestray.transtracking.service.PaymentVoucherService;
import com.bestray.transtracking.service.ReceiptVoucherService;
import com.bestray.transtracking.service.impl.CodeServiceImpl;
import com.bestray.transtracking.service.impl.PartyServiceImpl;
import com.bestray.transtracking.service.impl.PaymentVoucherServiceImpl;
import com.bestray.transtracking.service.impl.ReceipVoucherServiceImpl;
import com.bestray.trastrack.domain.Code;
import com.bestray.trastrack.domain.Employee;
import com.bestray.trastrack.domain.Party;
import com.bestray.trastrack.domain.PaymentVoucher;
import com.bestray.trastrack.domain.ReceiptVoucher;
import com.bestray.trastrack.domain.ViewDomain;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Vector;

/**
 *
 * @author Bitu
 */
public class PaymentVoucherController {
    private CodeService codeService ;
    private CodeDaoImpl codeDao;
    private PaymentVoucherService paymentservice;
    private ReceiptVoucherService receiptservice;
    private PartyService partyservice;
    private OilChangeService oilservice;
    public static final String COLLECTION_CATAGORY = "COLLECTION_CATAGORY";
    private SimpleDateFormat sdf;
    
    public PaymentVoucherController(){
        paymentservice = new PaymentVoucherServiceImpl();
        codeService = new CodeServiceImpl();
        partyservice = new PartyServiceImpl();
        sdf = new SimpleDateFormat("dd/MM/yyyy");
        //receiptservice = new ReceipVoucherServiceImpl();
        
    }
    
     /*public Vector<Party> getPartyNameList() {
        Vector<Party> partys = new Vector<Party>();
        List<Party> partyList = paymentservice.getPartyNameList();
        for(Party party:partyList){
            partys.addElement(party);
            
        }
        return partys;
    }*/
     
      public Vector<Code> getCodeList() {
        Vector codes = new Vector();
        List<Code> codeList = codeService.getCodesByCodeTypeName(COLLECTION_CATAGORY);
        for(Code code:codeList){
            codes.addElement(code);
        }
        return codes;
    }
      public Vector<Employee> getEmployeeNameList() {
        Vector employees = new Vector();
        List<Employee> employeeList = paymentservice.getEmployeeNameList();
        for(Employee emp:employeeList){
            employees.addElement(emp);
        }
        return employees;
    }
      
     /* public PaymentVoucher getTotalPartyBalance(Long partyId){
         return paymentservice.getTotalPartyBalance(partyId);
     }*/
      
     /* public ReceiptVoucher getPartyBalanceTotal(Long partyId){
         return receiptservice.getTotalPartyBalance(partyId);
     }*/

    public ReceiptVoucher getReceiptInfo(Long partyId) {
        return receiptservice.getPartyPaymentDetails(partyId);
    }
    public boolean savePayment(PaymentVoucher payment){
        return paymentservice.collectPayment(payment);     
                
    }
    public Vector<Vector<String>> getSearchResults(PaymentVoucherSearchDTO search){
         List<PaymentVoucher> paymentcollectionlist = paymentservice.getSearchResult(search);
          Vector<Vector<String>> returnList = new Vector<Vector<String>>();
          codeDao = new CodeDaoImpl( DataSourceObject.getDataSourceObject());
           for(PaymentVoucher record:paymentcollectionlist){
              Code code = new Code();
              Vector<String> paymentcollection = new Vector<String>();
              paymentcollection.add(String.valueOf(record.getId()));
              //paymentcollection.add(String.valueOf(record.getVoucher_number()));
              paymentcollection.add(String.valueOf(sdf.format(record.getPayment_date())));
              paymentcollection.add(String.valueOf(record.getAmount_paid()));
              /*code=codeDao.getCodeById(record.getPayment_mode()!=null?record.getPayment_mode():0);
              if(code!=null){
                  paymentcollection.add(code.getName());
              }*/
              //clientcollection.add(record.getClient().getVehicleOwner().getOwnername());
              paymentcollection.add(record.getEmployee().getEmployee_Name());
              //paymentcollection.add(String.valueOf(record.getCurrent_balance()));
              //paymentcollection.add(String.valueOf(record.getDiposited_at()));
             
             // paymentcollection.add(String.valueOf(record.getRemaining_balance()));
              returnList.add(paymentcollection);
              }
               return returnList;
   }
    
     public PaymentVoucher getLastBalance(Long partyId){
         return paymentservice.getLastBalance(partyId);
     }
     public Party getAddress(Long partyId) {
        return partyservice.getPartyRegistrationDetails(partyId);
    }
     public ViewDomain getOilBalance(Long partyId){
         return paymentservice.getTotalOilBalance(partyId);
     }

    public ViewDomain getTotalPayment(Long partyId) {
        return paymentservice.getTotalPaymentBalance(partyId);
    }

    public ViewDomain getTotalExpense(Long partyId) {
         return paymentservice.getTotalExpenseBalance(partyId);
    }

    public PaymentVoucher getPaymentChangeById(Long id) {
        return paymentservice.getPaymentChangeById(id);
    }

    public void deletePaymentRecord(Long id) {
        paymentservice.delete(id);
    }

    public Vector<Party> getAllPartyNameList() {
        Vector partys = new Vector();
        List<Party> partyList = paymentservice.getAllPartyNameList();
        for(Party party:partyList){
            partys.addElement(party);
        }
        return partys;
    }

    public ViewDomain getPayment(Long partyId) {
        return paymentservice.getPayment(partyId);
    }

   

   
}

Commits for TransPort_Tracking/TransPortTracking/src/main/java/com/bestray/transtracking/controller/PaymentVoucherController.java

Diff revisions: vs.
Revision Author Commited Message
1 girijabapi picture girijabapi Sat 28 Jul, 2018 05:29:14 +0000