txSurcharge.setValue(((txSalesPrice.getValue() - txCostPrice.getValue()) / txCostPrice.getValue()) * 100);
}
}
protected void initRow() {
JbsGrid grdMain = new JbsGrid(6);
grdMain.setInsets(new Insets(5, 5));
/*
grdMain.setColumnWidth(1, new JbsExtent(40));
grdMain.setColumnWidth(3, new JbsExtent(40));
grdMain.setColumnWidth(5, new JbsExtent(40));
*/
int controlWidth = 60;
for (int i=1; i<=6; i++)
grdMain.setColumnWidth(i, new JbsExtent(controlWidth));
grdMain.add(new Label(JbsL10N.getString("ArticlePrice.standard")));
GridLayoutData ldStandard = new GridLayoutData();
ldStandard.setColumnSpan(5);
cbStandard.setLayoutData(ldStandard);
grdMain.add(cbStandard);
grdMain.add(new Label(JbsL10N.getString("ArticlePrice.name")));
GridLayoutData ldName = new GridLayoutData();
ldName.setColumnSpan(5);
txName.setLayoutData(ldName);
grdMain.add(txName);
grdMain.add(new Label(JbsL10N.getString("ArticlePrice.costPrice")));
txCostPrice.setWidth(new JbsExtent(controlWidth));
txCostPrice.addActionListener(new ActionListener() {
private static final long serialVersionUID = 1L;
public void actionPerformed(ActionEvent arg0) {
calcSalesPrice();
}
});
grdMain.add(txCostPrice);
grdMain.add(new Label(JbsL10N.getString("ArticlePrice.surcharge")));
txSurcharge.setWidth(new JbsExtent(controlWidth));
txSurcharge.addActionListener(new ActionListener() {
private static final long serialVersionUID = 1L;
public void actionPerformed(ActionEvent arg0) {
calcSalesPrice();
}
});
grdMain.add(txSurcharge);
grdMain.add(new Label(JbsL10N.getString("ArticlePrice.salesPrice")));
txSalesPrice.setWidth(new JbsExtent(controlWidth));
txSalesPrice.addActionListener(new ActionListener() {
private static final long serialVersionUID = 1L;
public void actionPerformed(ActionEvent arg0) {
calcSurcharge();
}
});
grdMain.add(txSalesPrice);
grdMain.add(new Label(JbsL10N.getString("ArticlePrice.vat")));
selVAT.setWidth(new JbsExtent(controlWidth));
selVAT.setLayoutData(ldName);
grdMain.add(selVAT);
grdMain.add(new Label(JbsL10N.getString("ArticlePrice.packingAmount")));
txPackingAmount.setWidth(new JbsExtent(controlWidth));
txPackingAmount.setLayoutData(ldName);
grdMain.add(txPackingAmount);
GridLayoutData ldDate = new GridLayoutData();
ldDate.setColumnSpan(2);
grdMain.add(new Label(JbsL10N.getString("ArticlePrice.availableFrom")));
txAvailableFrom.setLayoutData(ldDate);
grdMain.add(txAvailableFrom);
grdMain.add(new Label(JbsL10N.getString("ArticlePrice.availableTo")));
txAvailableTo.setLayoutData(ldDate);
grdMain.add(txAvailableTo);
this.add(grdMain);
/*