Search in sources :

Example 6 with Borderlayout

use of org.adempiere.webui.component.Borderlayout in project adempiere by adempiere.

the class WCollect method zkInit.

/**
	 * Instance Window and fill fields
	 * @return void
	 */
private void zkInit() {
    //		
    mainPanel = new Panel();
    Borderlayout mainLayout = new Borderlayout();
    layout = GridFactory.newGridLayout();
    eastlayout = GridFactory.newGridLayout();
    //	Panels
    centerPanel = new Panel();
    Panel eastPanel = new Panel();
    mainPanel.appendChild(mainLayout);
    mainLayout.setHeight("100%");
    mainLayout.setWidth("100%");
    //
    north = new North();
    north.setStyle("border: none; ");
    mainLayout.appendChild(north);
    north.appendChild(eastPanel);
    eastPanel.appendChild(eastlayout);
    eastlayout.setWidth("100%");
    eastlayout.setHeight("100%");
    rows = eastlayout.newRows();
    row = rows.newRow();
    row.appendChild(new Space());
    Label fsLabel = new Label(Msg.translate(p_ctx, "PayAmt") + ":");
    fsLabel.setStyle(FONT_SIZE + FONT_BOLD);
    fPayAmt = new Label();
    //		fPayAmt.setText(getPrePayAmt().toString());
    row.appendChild(fsLabel.rightAlign());
    row.appendChild(fPayAmt.rightAlign());
    fPayAmt.setStyle(FONT_SIZE);
    row = rows.newRow();
    row.appendChild(new Space());
    //	Add Payment Amount
    Label lOpenAmt = new Label(Msg.translate(p_ctx, "OpenAmt") + ":");
    lOpenAmt.setStyle(FONT_SIZE + FONT_BOLD);
    row.appendChild(lOpenAmt.rightAlign());
    fOpenAmt = new Label();
    fOpenAmt.setStyle(FONT_SIZE);
    row.appendChild(fOpenAmt.rightAlign());
    fReturnAmt = new Label();
    lReturnAmt = new Label(Msg.translate(p_ctx, "AmountReturned") + ":");
    lReturnAmt.setStyle(FONT_SIZE + FONT_BOLD);
    fReturnAmt.setStyle(FONT_SIZE);
    row = rows.newRow();
    row.appendChild(new Space());
    fReturnAmt = new Label();
    lReturnAmt = new Label(Msg.translate(p_ctx, "AmountReturned") + ":");
    lReturnAmt.setStyle(FONT_SIZE + FONT_BOLD);
    fReturnAmt.setStyle(FONT_SIZE);
    row.appendChild(lReturnAmt.rightAlign());
    row.appendChild(fReturnAmt.rightAlign());
    fReturnAmt.addEventListener("onFocus", this);
    row = rows.newRow();
    row.appendChild(new Space());
    fsPaidAmtLabel = new Label(Msg.translate(p_ctx, "PaidAmt") + ":");
    fsPaidAmtLabel.setStyle(FONT_SIZE + FONT_BOLD);
    fPaidAmt = new Label();
    row.appendChild(fsPaidAmtLabel.rightAlign());
    row.appendChild(fPaidAmt.rightAlign());
    fPaidAmt.setStyle(FONT_SIZE);
    // Button Plus
    bPlus = createButtonAction("Plus", KeyStroke.getKeyStroke(KeyEvent.VK_F3, Event.F3));
    row = rows.newRow();
    row.appendChild(new Space());
    row.appendChild(new Space());
    row.appendChild(bPlus);
    confirm = new ConfirmPanel(true);
    confirm.addActionListener(this);
    confirm.getOKButton().setWidth("55px");
    confirm.getOKButton().setHeight("55px");
    confirm.getButton(ConfirmPanel.A_CANCEL).setWidth("55px");
    confirm.getButton(ConfirmPanel.A_CANCEL).setHeight("55px");
    row.appendChild(confirm);
    row.setHeight("60px");
    Center center = new Center();
    center.setStyle("border: none; overflow-y:auto;overflow-x:hidden;");
    mainLayout.appendChild(center);
    center.appendChild(centerPanel);
    centerPanel.appendChild(layout);
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setStyle("overflow:auto;");
    rows = layout.newRows();
    row = rows.newRow();
    row.setWidth("100%");
    // Completed Standard Order: only prepayment possible 
    if (posPanel.getTotalLines().compareTo(Env.ZERO) == 1 && posPanel.isCompleted() && posPanel.isStandardOrder()) {
    //fIsPrePayOrder.setEnabled(false);
    //			fIsCreditOrder.setEnabled(false);
    //fIsPrePayOrder.setSelected(true);
    } else // Not completed Order 
    if (posPanel.getTotalLines().compareTo(Env.ZERO) == 1 && !posPanel.isCompleted()) {
        if (posPanel.isStandardOrder()) /*|| pos.isWarehouseOrder()*/
        {
        // Standard Order or Warehouse Order: no Credit Order, no prepayment
        //fIsPrePayOrder.setEnabled(false);
        //fIsPrePayOrder.setSelected(false);
        //				fIsCreditOrder.setEnabled(false);
        //				fIsCreditOrder.setSelected(false);
        } else {
        //fIsPrePayOrder.setEnabled(true);
        //				fIsCreditOrder.setEnabled(true);
        }
    } else {
    //fIsPrePayOrder.setEnabled(false);
    //			fIsCreditOrder.setEnabled(false);
    //			if(posPanel.isCompleted() &&
    //				posPanel.getM_Order().isInvoiced()  &&
    //				posPanel.getOpenAmt().compareTo(Env.ZERO)==1) {
    //				fIsCreditOrder.setSelected(true);
    //			}
    }
}
Also used : Space(org.zkoss.zul.Space) Panel(org.adempiere.webui.component.Panel) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Center(org.zkoss.zkex.zul.Center) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Label(org.adempiere.webui.component.Label) North(org.zkoss.zkex.zul.North) Borderlayout(org.adempiere.webui.component.Borderlayout)

Example 7 with Borderlayout

use of org.adempiere.webui.component.Borderlayout in project adempiere by adempiere.

the class WPOSInfoProduct method setValuesFromProduct.

/**
	 * setValuesFromProduct
	 * @param productId
	 * @param imageId
     */
public void setValuesFromProduct(int productId, BigDecimal quantity, int imageId, int priceListId, int partnerId) {
    if (productId <= 0) {
        initialValue();
        return;
    }
    //	Refresh Values
    ProductInfo productInfo = new ProductInfo(productId, quantity, imageId, priceListId, partnerId);
    labelPriceName.setText(Msg.parseTranslation(ctx, "@PriceStd@ , @PriceList@ ") + posPanel.getCurSymbol());
    labelValue.setText(productInfo.value);
    labelPrice.setText(posPanel.getNumberFormat().format(productInfo.priceStd));
    labelPriceList.setText(posPanel.getNumberFormat().format(productInfo.priceList));
    labelName.setText(productInfo.name);
    labelUOMSymbol.setText(productInfo.uomSymbol);
    labelProductCategory.setText(productInfo.productCategoryName);
    labelProductTax.setText(productInfo.productTaxCategory);
    labelDescription.setText(productInfo.description);
    posPanel.updateProductPlaceholder(productInfo.name);
    if (productInfo.imageData != null) {
        North nt = new North();
        Borderlayout mainLayout = new Borderlayout();
        AImage img = null;
        byte[] data = productInfo.imageData;
        if (data != null && data.length > 0) {
            try {
                img = new AImage(null, data);
            } catch (Exception e) {
            }
        }
        Image bImg = new Image();
        bImg.setContent(img);
        bImg.setWidth("100%");
        bImg.setHeight("100px");
        nt.appendChild(bImg);
        buttonImage.setClass("z-button");
        mainLayout.appendChild(nt);
        mainLayout.setStyle("background-color: transparent");
        nt.setStyle("background-color: transparent");
        buttonImage.getChildren().clear();
        buttonImage.appendChild(mainLayout);
        buttonImage.invalidate();
        infoProductLayout.invalidate();
        labelLayout.invalidate();
        buttonPanel.invalidate();
    } else {
        buttonImage.getChildren().clear();
        buttonImage.invalidate();
    }
}
Also used : ProductInfo(org.adempiere.pos.service.ProductInfo) AImage(org.zkoss.image.AImage) North(org.zkoss.zkex.zul.North) Borderlayout(org.adempiere.webui.component.Borderlayout) AImage(org.zkoss.image.AImage) Image(org.zkoss.zul.Image)

Example 8 with Borderlayout

use of org.adempiere.webui.component.Borderlayout in project adempiere by adempiere.

the class WPOS method setMPOS.

//	dynInit
/**
	 * 	Set MPOS
	 *	@return true if found/set
	 */
private void setMPOS() {
    int salesRep_ID = Env.getAD_User_ID(getCtx());
    setPOS(salesRep_ID);
    if (getM_POS() != null) {
        validLocator();
        return;
    }
    int orgId = Env.getAD_Org_ID(getCtx());
    poss = getPOSByOrganization(orgId);
    //	Select POS
    String msg = Msg.getMsg(ctx, "SelectPOS");
    selection = new Window();
    Panel mainPanel = new Panel();
    Panel panel = new Panel();
    selection.setTitle(msg);
    Borderlayout mainLayout = new Borderlayout();
    Grid layout = GridFactory.newGridLayout();
    selection.appendChild(panel);
    selection.setWidth("200px");
    selection.setHeight("140px");
    //	North
    Panel centerPanel = new Panel();
    mainPanel.appendChild(mainLayout);
    mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
    mainLayout.setHeight("100%");
    mainLayout.setWidth("100%");
    //
    Center center = new Center();
    center.setStyle("border: none");
    mainLayout.appendChild(center);
    center.appendChild(centerPanel);
    centerPanel.appendChild(layout);
    layout.setWidth("100%");
    layout.setHeight("100%");
    selection.appendChild(mainPanel);
    Rows rows = null;
    Row row = null;
    rows = layout.newRows();
    row = rows.newRow();
    for (MPOS pos : poss) {
        listTerminal.addItem(pos.getKeyNamePair());
    }
    okButton.addActionListener(this);
    cancelButton.addEventListener("onClick", this);
    okButton.setWidth("45px");
    okButton.setHeight("45px");
    cancelButton.setWidth("45px");
    cancelButton.setHeight("45px");
    listTerminal.setHeight("45px");
    listTerminal.setStyle("height:45px;" + WPOS.FONTSIZEMEDIUM);
    row.setSpans("2");
    row.appendChild(listTerminal);
    row.setHeight("45px");
    row = rows.newRow();
    confirm = new ConfirmPanel(true);
    confirm.addActionListener(this);
    confirm.getOKButton().setWidth("55px");
    confirm.getOKButton().setHeight("55px");
    confirm.getButton(ConfirmPanel.A_CANCEL).setWidth("55px");
    confirm.getButton(ConfirmPanel.A_CANCEL).setHeight("55px");
    row.appendChild(confirm);
    row.setHeight("55px");
    AEnv.showWindow(selection);
}
Also used : Window(org.adempiere.webui.component.Window) Panel(org.adempiere.webui.component.Panel) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) StatusBarPanel(org.adempiere.webui.panel.StatusBarPanel) Center(org.zkoss.zkex.zul.Center) MPOS(org.compiere.model.MPOS) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Grid(org.adempiere.webui.component.Grid) Borderlayout(org.adempiere.webui.component.Borderlayout) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 9 with Borderlayout

use of org.adempiere.webui.component.Borderlayout in project adempiere by adempiere.

the class WPOS method dynInit.

//	init
/**************************************************************************
	 * 	Dynamic Init.
	 * 	PosPanel has a GridBagLayout.
	 * 	The Sub Panels return their position
	 */
private boolean dynInit() {
    setMPOS();
    userPinListener = new WPOSUserPinListener(this);
    //Delay 5 seconds by default
    userPinTimer = new Timer((getPINEntryTimeout() + 5) * 1000);
    userPinTimer.addEventListener(Events.ON_TIMER, userPinListener);
    userPinListener.setTimer(userPinTimer);
    userPinTimer.setRunning(false);
    Borderlayout mainLayout = new Borderlayout();
    actionPanel = new WPOSActionPanel(this);
    documentPanel = new WPOSDocumentPanel(this);
    orderLinePanel = new WPOSOrderLinePanel(this);
    infoProductPanel = new WPOSInfoProduct(this);
    quantityPanel = new WPOSQuantityPanel(this);
    East east = new East();
    Center center = new Center();
    West westPanel = new West();
    South southPanel = new South();
    Borderlayout fullPanel = new Borderlayout();
    Borderlayout mediumPanel = new Borderlayout();
    statusBar.appendChild(userPinTimer);
    southPanel.appendChild(statusBar);
    center.setStyle("border: none; width:40%");
    center.appendChild(fullPanel);
    mainLayout.appendChild(center);
    center.setStyle("border: none; height:auto%;");
    fullPanel.setWidth("100%");
    fullPanel.setHeight("auto");
    fullPanel.setStyle("overflow:hidden;height:auto;");
    westPanel.appendChild(this.actionPanel);
    east.appendChild(documentPanel);
    this.actionPanel.appendChild(infoProductPanel.getPanel());
    if (IsShowLineControl())
        this.actionPanel.appendChild(quantityPanel.getPanel());
    this.actionPanel.appendChild(orderLinePanel);
    east.setSplittable(true);
    east.setStyle("border: none; min-width:44%; width:44%");
    fullPanel.appendChild(westPanel);
    Center centerPanel = new Center();
    fullPanel.appendChild(centerPanel);
    centerPanel.appendChild(mediumPanel);
    //	FR [ 44 ] Change Button location
    westPanel.setStyle("display:inline-block;border: none; width:100%; height:auto;float:left;overflow:hidden;");
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");
    mainLayout.appendChild(east);
    mainLayout.appendChild(southPanel);
    form.appendChild(mainLayout);
    //	Seek to last
    if (hasRecord()) {
        lastRecord();
    }
    refreshPanel();
    form.setHeight("100%");
    return true;
}
Also used : Center(org.zkoss.zkex.zul.Center) Timer(org.zkoss.zul.Timer) West(org.zkoss.zkex.zul.West) South(org.zkoss.zkex.zul.South) Borderlayout(org.adempiere.webui.component.Borderlayout) East(org.zkoss.zkex.zul.East)

Example 10 with Borderlayout

use of org.adempiere.webui.component.Borderlayout in project adempiere by adempiere.

the class WPOSKeyboard method init.

/**
	 * 	Initialize
	 * @param startText 
	 * @param POSKeyLayout_ID 
	 */
public void init(int POSKeyLayout_ID) {
    Panel panel = new Panel();
    appendChild(panel);
    //	Content
    Panel mainPanel = new Panel();
    Borderlayout mainLayout = new Borderlayout();
    Grid productLayout = GridFactory.newGridLayout();
    appendChild(panel);
    //	North
    Panel northPanel = new Panel();
    mainPanel.appendChild(mainLayout);
    mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
    mainLayout.setHeight("100%");
    mainLayout.setWidth("100%");
    Center center = new Center();
    //
    North north = new North();
    north.setStyle("border: none");
    mainLayout.appendChild(north);
    north.appendChild(northPanel);
    northPanel.appendChild(productLayout);
    productLayout.setWidth("100%");
    appendChild(mainPanel);
    Rows rows = null;
    Row row = null;
    rows = productLayout.newRows();
    row = rows.newRow();
    String txtCalcId = txtCalc.getId();
    row.appendChild(txtCalc);
    txtCalc.setName("number");
    txtCalc.setWidth("92%");
    WPOSKeyPanel keys = new WPOSKeyPanel(POSKeyLayout_ID, this, txtCalcId, keyBoardType);
    center = new Center();
    center.setStyle("border: none");
    keys.setWidth("100%");
    keys.setHeight("99%");
    center.appendChild(keys);
    mainLayout.appendChild(center);
    South south = new South();
    ConfirmPanel confirm = new ConfirmPanel(true, false, true, false, false, false, false);
    confirm.addActionListener(this);
    south.appendChild(confirm);
    mainLayout.appendChild(south);
}
Also used : ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Panel(org.adempiere.webui.component.Panel) Center(org.zkoss.zkex.zul.Center) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Grid(org.adempiere.webui.component.Grid) South(org.zkoss.zkex.zul.South) North(org.zkoss.zkex.zul.North) Borderlayout(org.adempiere.webui.component.Borderlayout) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Aggregations

Borderlayout (org.adempiere.webui.component.Borderlayout)11 Panel (org.adempiere.webui.component.Panel)8 Center (org.zkoss.zkex.zul.Center)7 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)5 Grid (org.adempiere.webui.component.Grid)5 Row (org.adempiere.webui.component.Row)5 Rows (org.adempiere.webui.component.Rows)5 South (org.zkoss.zkex.zul.South)5 Label (org.adempiere.webui.component.Label)4 North (org.zkoss.zkex.zul.North)4 Tab (org.adempiere.webui.component.Tab)2 Tabbox (org.adempiere.webui.component.Tabbox)2 StatusBarPanel (org.adempiere.webui.panel.StatusBarPanel)2 AImage (org.zkoss.image.AImage)2 Center (org.zkoss.zul.Center)2 Div (org.zkoss.zul.Div)2 Hbox (org.zkoss.zul.Hbox)2 Image (org.zkoss.zul.Image)2 North (org.zkoss.zul.North)2 Color (java.awt.Color)1