TextField<String> sitravaux = (TextField<String>) ComponentManager.get().get("INFORMATION_PANEL_SITRAVAUX_ID");
NumberField montant = (NumberField) ComponentManager.get().get("INFORMATION_PANEL_MONTANT_ID");
List<NameValuePair> values = new ArrayList<NameValuePair>();
List<DeductionDto> listDeduction = deductionGrid.getStore().getModels();
DeductionDto deductionDto = null;
String deductions = "";
double amount = 0.0;
String information = "";
// Grid 1
NumberFormat numberFormat = NumberFormat.getFormat(NUMBER_FORMAT);
double canto = 0.0;
double badge = 0.0;
double grue = 0.0;
double lift = 0.0;
double benne = 0.0;
double nettoyage = 0.0;
double autres = 0.0; // khong co nhan
double prorata = 0.0;
double refacturations = 0.0;// khong co nhan
for (int j = 0; j < listDeduction.size(); j++) {
deductionDto = listDeduction.get(j);
/*
* deductions += DateTimeFormat.getFormat(Constants.DATE_FORMAT).format (deductionDto.getDate()) + Constants.SEPRATE +
* numberFormat.format(deductionDto.getCanto()) + Constants.SEPRATE + numberFormat.format(deductionDto.getBadge()) + Constants.SEPRATE +
* numberFormat.format(deductionDto.getGrue()) + Constants.SEPRATE + numberFormat.format(deductionDto.getLift()) + Constants.SEPRATE +
* numberFormat.format(deductionDto.getBenne()) + Constants.SEPRATE + numberFormat.format(deductionDto.getNettoyage()) + Constants.SEPRATE
* + numberFormat.format(deductionDto.getAutres()) + Constants.SEPRATE + numberFormat.format(deductionDto.getProrata()) +
* Constants.SEPRATE + numberFormat.format(deductionDto.getRefacturations()) + Constants.SEPRATE;
*/
deductions += append(deductionDto.getDate(), deductionDto.getCanto(), deductionDto.getBadge(), deductionDto.getGrue(),
deductionDto.getLift(), deductionDto.getBenne(), deductionDto.getNettoyage(), deductionDto.getAutres(),
deductionDto.getProrata(), deductionDto.getRefacturations());
canto += deductionDto.getCanto();
badge += deductionDto.getBadge();
grue += deductionDto.getGrue();
lift += deductionDto.getLift();
benne += deductionDto.getBenne();
nettoyage += deductionDto.getNettoyage();
autres += deductionDto.getAutres();
prorata += deductionDto.getProrata();
refacturations += deductionDto.getRefacturations();
}
canto = canto * ratioList[0];
badge = badge * ratioList[1];
grue = grue * ratioList[2];
lift = lift * ratioList[3];
benne = benne * ratioList[4];
nettoyage = nettoyage * ratioList[5];
prorata = prorata * ratioList[6];
values.add(new NameValuePair(ConstantClient.DEDUCTIONDTO_ID_STR, deductions));
String paramPrestation = append(ratioList[0], ratioList[1], ratioList[2], ratioList[3], ratioList[4], ratioList[5], ratioList[6]);
values.add(new NameValuePair("paramPrestation", paramPrestation));
canto += deductionDto.getCanto();
badge += deductionDto.getBadge();
grue += deductionDto.getGrue();
lift += deductionDto.getLift();
benne += deductionDto.getBenne();
nettoyage += deductionDto.getNettoyage();
autres += deductionDto.getAutres();
prorata += deductionDto.getProrata();
information += chantier + Constants.SEPRATE + responsables + Constants.SEPRATE + societe;
values.add(new NameValuePair("information", information));
String generaleInformation = chantier + Constants.SEPRATE + lot.getValue() + Constants.SEPRATE + sitravaux.getValue() + Constants.SEPRATE