GDDate graceDays = new GDDate(parcel.getDate());
graceDays.addDays(Integer.valueOf(system.getProperty("gracedays")));
if ( today.afterOrEquals(new GDDate(parcel.getDate())) ) {
if ( today.beforeOrEquals(graceDays) && today.afterOrEquals(new GDDate(parcel.getDate())) ){
totalText.setText(new Money(parcel.getValueBeforeParcelDateExpiration()).getFormatedValue());
}
else
{
totalText.setText(new Money(parcel.getValueAfterParcelDateExpiration()).getFormatedValue());
}
}
else
{
totalText.setText(new Money(parcel.getValueBeforeParcelDateExpiration()).getFormatedValue());
}
// if ( today.after(new GDDate(parcel.getDate())) && today.after(graceDays)) {
// totalText.setText(new Money(parcel.getValueAfterParcelDateExpiration()).getFormatedValue());
// }else {
// totalText.setText(new Money(parcel.getValueBeforeParcelDateExpiration()).getFormatedValue());
// }
totalText.setEditable(false);
Link bankingBilletLink = new Link(dialog, SWT.NONE);
bankingBilletLink.setText("<a>Gerar boleto</a>");
// bankingBilletLink.setText("");
bankingBilletLink.setBackground(dialog.getBackground());
bankingBilletLink.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event arg0) {
Money ticketAndMora = new Money(0.0);
GDDate today = new GDDate();
GDDate graceDays = new GDDate(parcel.getDate());
graceDays.addDays(Integer.valueOf(system.getProperty("gracedays")));
if ( today.after(new GDDate(parcel.getDate())) && today.after(graceDays)) {
ticketAndMora = new Money(new Money(ticketText.getText()).getFloatValue() + new Money(moraText.getText()).getFloatValue());
}
/*
* Se o ultimo argumento for true, vai abrir uma nova shell senao vai abrir em uma nova dentro da mainScreen*/
CreateReports.createBankingBilletReport(registration, parcel, ticketAndMora, new Money((discountText.getText().equals("") ? "0" : discountText.getText())), true);
}
});
GridData data = new GridData(GridData.FILL);
data.widthHint = 80;