merge revision 6275-6315 from branches/adempiere341
This commit is contained in:
parent
7de7553dac
commit
3824014613
|
@ -519,15 +519,9 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
"Notice : " + noOfNotice + ", Request : " + noOfRequest + ", Workflow Activities : " + noOfWorkflow);
|
"Notice : " + noOfNotice + ", Request : " + noOfRequest + ", Workflow Activities : " + noOfWorkflow);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showWindowInTabPanel(Window window)
|
/**
|
||||||
{
|
* @param event
|
||||||
Tabpanel tabPanel = new Tabpanel();
|
*/
|
||||||
window.setParent(tabPanel);
|
|
||||||
String title = window.getTitle();
|
|
||||||
window.setTitle(null);
|
|
||||||
windowContainer.addWindow(tabPanel, title, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onEvent(Event event)
|
public void onEvent(Event event)
|
||||||
{
|
{
|
||||||
Component comp = event.getTarget();
|
Component comp = event.getTarget();
|
||||||
|
@ -720,32 +714,16 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
|
|
||||||
if(menu.getAction().equals(MMenu.ACTION_Window))
|
if(menu.getAction().equals(MMenu.ACTION_Window))
|
||||||
{
|
{
|
||||||
ADWindow adWindow = new ADWindow(Env.getCtx(), menu.getAD_Window_ID());
|
openWindow(menu.getAD_Window_ID());
|
||||||
|
|
||||||
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
|
||||||
adWindow.createPart(tabPanel);
|
|
||||||
windowContainer.addWindow(tabPanel, adWindow.getTitle(), true);
|
|
||||||
}
|
}
|
||||||
else if(menu.getAction().equals(MMenu.ACTION_Process) ||
|
else if(menu.getAction().equals(MMenu.ACTION_Process) ||
|
||||||
menu.getAction().equals(MMenu.ACTION_Report))
|
menu.getAction().equals(MMenu.ACTION_Report))
|
||||||
{
|
{
|
||||||
ProcessDialog pd = new ProcessDialog (menu.getAD_Process_ID(), menu.isSOTrx());
|
openProcessDialog(menu.getAD_Process_ID(), menu.isSOTrx());
|
||||||
if (pd.isValid()) {
|
|
||||||
pd.setPage(page);
|
|
||||||
pd.setClosable(true);
|
|
||||||
pd.setWidth("500px");
|
|
||||||
pd.doHighlighted();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(menu.getAction().equals(MMenu.ACTION_Form))
|
else if(menu.getAction().equals(MMenu.ACTION_Form))
|
||||||
{
|
{
|
||||||
ADForm form = ADForm.openForm(menu.getAD_Form_ID());
|
openForm(menu.getAD_Form_ID());
|
||||||
|
|
||||||
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
|
||||||
form.setParent(tabPanel);
|
|
||||||
//do not show window title when open as tab
|
|
||||||
form.setTitle(null);
|
|
||||||
windowContainer.addWindow(tabPanel, form.getFormName(), true);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -753,17 +731,80 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param processId
|
||||||
|
* @param soTrx
|
||||||
|
* @return ProcessDialog
|
||||||
|
*/
|
||||||
|
public ProcessDialog openProcessDialog(int processId, boolean soTrx) {
|
||||||
|
ProcessDialog pd = new ProcessDialog (processId, soTrx);
|
||||||
|
if (pd.isValid()) {
|
||||||
|
pd.setPage(page);
|
||||||
|
pd.setClosable(true);
|
||||||
|
pd.setWidth("500px");
|
||||||
|
pd.doHighlighted();
|
||||||
|
}
|
||||||
|
return pd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param formId
|
||||||
|
* @return ADWindow
|
||||||
|
*/
|
||||||
|
public ADForm openForm(int formId) {
|
||||||
|
ADForm form = ADForm.openForm(formId);
|
||||||
|
|
||||||
|
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
||||||
|
form.setParent(tabPanel);
|
||||||
|
//do not show window title when open as tab
|
||||||
|
form.setTitle(null);
|
||||||
|
windowContainer.addWindow(tabPanel, form.getFormName(), true);
|
||||||
|
|
||||||
|
return form;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param windowId
|
||||||
|
* @return ADWindow
|
||||||
|
*/
|
||||||
|
public ADWindow openWindow(int windowId) {
|
||||||
|
ADWindow adWindow = new ADWindow(Env.getCtx(), windowId);
|
||||||
|
|
||||||
|
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
||||||
|
adWindow.createPart(tabPanel);
|
||||||
|
windowContainer.addWindow(tabPanel, adWindow.getTitle(), true);
|
||||||
|
|
||||||
|
return adWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param url
|
||||||
|
*/
|
||||||
public void showURL(String url, boolean closeable)
|
public void showURL(String url, boolean closeable)
|
||||||
{
|
{
|
||||||
showURL(url, url, closeable);
|
showURL(url, url, closeable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param title
|
||||||
|
* @param closeable
|
||||||
|
*/
|
||||||
public void showURL(String url, String title, boolean closeable)
|
public void showURL(String url, String title, boolean closeable)
|
||||||
{
|
{
|
||||||
Iframe iframe = new Iframe(url);
|
Iframe iframe = new Iframe(url);
|
||||||
addWin(iframe, title, closeable);
|
addWin(iframe, title, closeable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param webDoc
|
||||||
|
* @param title
|
||||||
|
* @param closeable
|
||||||
|
*/
|
||||||
public void showURL(WebDoc webDoc, String title, boolean closeable)
|
public void showURL(WebDoc webDoc, String title, boolean closeable)
|
||||||
{
|
{
|
||||||
Iframe iframe = new Iframe();
|
Iframe iframe = new Iframe();
|
||||||
|
@ -774,6 +815,12 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
addWin(iframe, title, closeable);
|
addWin(iframe, title, closeable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param fr
|
||||||
|
* @param title
|
||||||
|
* @param closeable
|
||||||
|
*/
|
||||||
private void addWin(Iframe fr, String title, boolean closeable)
|
private void addWin(Iframe fr, String title, boolean closeable)
|
||||||
{
|
{
|
||||||
fr.setWidth("100%");
|
fr.setWidth("100%");
|
||||||
|
@ -791,7 +838,10 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
windowContainer.addWindow(tabPanel, title, closeable);
|
windowContainer.addWindow(tabPanel, title, closeable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param AD_Window_ID
|
||||||
|
* @param query
|
||||||
|
*/
|
||||||
public void showZoomWindow(int AD_Window_ID, MQuery query)
|
public void showZoomWindow(int AD_Window_ID, MQuery query)
|
||||||
{
|
{
|
||||||
ADWindow wnd = new ADWindow(Env.getCtx(), AD_Window_ID, query);
|
ADWindow wnd = new ADWindow(Env.getCtx(), AD_Window_ID, query);
|
||||||
|
@ -801,12 +851,19 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
windowContainer.addWindow(tabPanel, wnd.getTitle(), true);
|
windowContainer.addWindow(tabPanel, wnd.getTitle(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param win
|
||||||
|
*/
|
||||||
public void showWindow(Window win)
|
public void showWindow(Window win)
|
||||||
{
|
{
|
||||||
String pos = win.getPosition();
|
String pos = win.getPosition();
|
||||||
this.showWindow(win, pos);
|
this.showWindow(win, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param win
|
||||||
|
* @param pos
|
||||||
|
*/
|
||||||
public void showWindow(Window win, String pos)
|
public void showWindow(Window win, String pos)
|
||||||
{
|
{
|
||||||
win.setPage(page);
|
win.setPage(page);
|
||||||
|
@ -819,31 +876,33 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
mode = objMode.toString();
|
mode = objMode.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("modal".equals(mode))
|
if (Window.MODE_MODAL.equals(mode))
|
||||||
{
|
{
|
||||||
showModal(win);
|
showModal(win);
|
||||||
}
|
}
|
||||||
else if ("popup".equals(mode))
|
else if (Window.MODE_POPUP.equals(mode))
|
||||||
{
|
{
|
||||||
showPopup(win, pos);
|
showPopup(win, pos);
|
||||||
}
|
}
|
||||||
else if ("overlapped".equals(mode))
|
else if (Window.MODE_OVERLAPPED.equals(mode))
|
||||||
{
|
{
|
||||||
showOverlapped(win, pos);
|
showOverlapped(win, pos);
|
||||||
}
|
}
|
||||||
else if ("embedded".equals(mode))
|
else if (Window.MODE_EMBEDDED.equals(mode))
|
||||||
{
|
{
|
||||||
showEmbedded(win, pos);
|
showEmbedded(win);
|
||||||
}
|
}
|
||||||
else if ("highlighted".equals(mode))
|
else if (Window.MODE_HIGHLIGHTED.equals(mode))
|
||||||
{
|
{
|
||||||
showHighlighted(win, pos);
|
showHighlighted(win, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
// win.setVisible(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showModal(Window win)
|
/**
|
||||||
|
*
|
||||||
|
* @param win
|
||||||
|
*/
|
||||||
|
private void showModal(Window win)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -856,7 +915,12 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showPopup(Window win, String position)
|
/**
|
||||||
|
*
|
||||||
|
* @param win
|
||||||
|
* @param position
|
||||||
|
*/
|
||||||
|
private void showPopup(Window win, String position)
|
||||||
{
|
{
|
||||||
if (position == null)
|
if (position == null)
|
||||||
win.setPosition("center");
|
win.setPosition("center");
|
||||||
|
@ -866,7 +930,12 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
win.doPopup();
|
win.doPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showOverlapped(Window win, String position)
|
/**
|
||||||
|
*
|
||||||
|
* @param win
|
||||||
|
* @param position
|
||||||
|
*/
|
||||||
|
private void showOverlapped(Window win, String position)
|
||||||
{
|
{
|
||||||
if (position == null)
|
if (position == null)
|
||||||
win.setPosition("center");
|
win.setPosition("center");
|
||||||
|
@ -876,7 +945,12 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
win.doOverlapped();
|
win.doOverlapped();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showHighlighted(Window win, String position)
|
/**
|
||||||
|
*
|
||||||
|
* @param win
|
||||||
|
* @param position
|
||||||
|
*/
|
||||||
|
private void showHighlighted(Window win, String position)
|
||||||
{
|
{
|
||||||
if (position == null)
|
if (position == null)
|
||||||
win.setPosition("center");
|
win.setPosition("center");
|
||||||
|
@ -886,36 +960,56 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
win.doHighlighted();
|
win.doHighlighted();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showEmbedded(Window win, String position)
|
/**
|
||||||
|
*
|
||||||
|
* @param window
|
||||||
|
*/
|
||||||
|
private void showEmbedded(Window window)
|
||||||
{
|
{
|
||||||
if (position == null)
|
Tabpanel tabPanel = new Tabpanel();
|
||||||
win.setPosition("center");
|
window.setParent(tabPanel);
|
||||||
else
|
String title = window.getTitle();
|
||||||
win.setPosition(position);
|
window.setTitle(null);
|
||||||
|
windowContainer.addWindow(tabPanel, title, true);
|
||||||
win.doEmbedded();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return clientInfo
|
||||||
|
*/
|
||||||
public ClientInfo getClientInfo() {
|
public ClientInfo getClientInfo() {
|
||||||
return clientInfo;
|
return clientInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param clientInfo
|
||||||
|
*/
|
||||||
public void setClientInfo(ClientInfo clientInfo) {
|
public void setClientInfo(ClientInfo clientInfo) {
|
||||||
this.clientInfo = clientInfo;
|
this.clientInfo = clientInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param win
|
||||||
|
*/
|
||||||
public int registerWindow(Object win) {
|
public int registerWindow(Object win) {
|
||||||
int retValue = windows.size();
|
int retValue = windows.size();
|
||||||
windows.add(win);
|
windows.add(win);
|
||||||
return retValue;
|
return retValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param WindowNo
|
||||||
|
*/
|
||||||
public void unregisterWindow(int WindowNo) {
|
public void unregisterWindow(int WindowNo) {
|
||||||
if (WindowNo < windows.size())
|
if (WindowNo < windows.size())
|
||||||
windows.set(WindowNo, null);
|
windows.set(WindowNo, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param WindowNo
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
public Object findWindow(int WindowNo) {
|
public Object findWindow(int WindowNo) {
|
||||||
if (WindowNo < windows.size())
|
if (WindowNo < windows.size())
|
||||||
return windows.get(WindowNo);
|
return windows.get(WindowNo);
|
||||||
|
@ -923,11 +1017,18 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close active tab
|
||||||
|
*/
|
||||||
public void removeWindow()
|
public void removeWindow()
|
||||||
{
|
{
|
||||||
windowContainer.removeWindow();
|
windowContainer.removeWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
*/
|
||||||
public void setPage(Page page) {
|
public void setPage(Page page) {
|
||||||
if (this.page != page) {
|
if (this.page != page) {
|
||||||
layout.setPage(page);
|
layout.setPage(page);
|
||||||
|
@ -935,6 +1036,10 @@ public class Desktop extends AbstractUIPart implements MenuListener, Serializabl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the root component
|
||||||
|
* @return Component
|
||||||
|
*/
|
||||||
public Component getComponent() {
|
public Component getComponent() {
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,98 @@
|
||||||
package org.adempiere.webui;
|
package org.adempiere.webui;
|
||||||
|
|
||||||
|
import org.adempiere.webui.apps.ProcessDialog;
|
||||||
import org.adempiere.webui.component.Window;
|
import org.adempiere.webui.component.Window;
|
||||||
|
import org.adempiere.webui.panel.ADForm;
|
||||||
|
import org.adempiere.webui.window.ADWindow;
|
||||||
import org.compiere.model.MQuery;
|
import org.compiere.model.MQuery;
|
||||||
import org.compiere.util.WebDoc;
|
import org.compiere.util.WebDoc;
|
||||||
|
|
||||||
public interface IDesktop {
|
public interface IDesktop {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return ClientInfo
|
||||||
|
*/
|
||||||
public ClientInfo getClientInfo();
|
public ClientInfo getClientInfo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param nodeId
|
||||||
|
*/
|
||||||
public void onMenuSelected(int nodeId);
|
public void onMenuSelected(int nodeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param window
|
||||||
|
* @return windowNo
|
||||||
|
*/
|
||||||
public int registerWindow(Object window);
|
public int registerWindow(Object window);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* close active window
|
||||||
|
*/
|
||||||
public void removeWindow();
|
public void removeWindow();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param closeable
|
||||||
|
*/
|
||||||
public void showURL(String url, boolean closeable);
|
public void showURL(String url, boolean closeable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param doc
|
||||||
|
* @param string
|
||||||
|
* @param closeable
|
||||||
|
*/
|
||||||
public void showURL(WebDoc doc, String string, boolean closeable);
|
public void showURL(WebDoc doc, String string, boolean closeable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param win
|
||||||
|
*/
|
||||||
public void showWindow(Window win);
|
public void showWindow(Window win);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param win
|
||||||
|
* @param position
|
||||||
|
*/
|
||||||
public void showWindow(Window win, String position);
|
public void showWindow(Window win, String position);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param window_ID
|
||||||
|
* @param query
|
||||||
|
*/
|
||||||
public void showZoomWindow(int window_ID, MQuery query);
|
public void showZoomWindow(int window_ID, MQuery query);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param windowNo
|
||||||
|
*/
|
||||||
public void unregisterWindow(int windowNo);
|
public void unregisterWindow(int windowNo);
|
||||||
|
|
||||||
public void showWindowInTabPanel(Window win); // Elaine 2008/07/30
|
/**
|
||||||
|
*
|
||||||
|
* @param processId
|
||||||
|
* @param soTrx
|
||||||
|
* @return ProcessDialog
|
||||||
|
*/
|
||||||
|
public ProcessDialog openProcessDialog(int processId, boolean soTrx);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param formId
|
||||||
|
* @return ADWindow
|
||||||
|
*/
|
||||||
|
public ADForm openForm(int formId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param windowId
|
||||||
|
* @return ADWindow
|
||||||
|
*/
|
||||||
|
public ADWindow openWindow(int windowId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,8 @@ public class WArchive implements EventListener
|
||||||
else // all Reports
|
else // all Reports
|
||||||
av.query(true, m_AD_Table_ID, 0);
|
av.query(true, m_AD_Table_ID, 0);
|
||||||
|
|
||||||
SessionManager.getAppDesktop().showWindowInTabPanel(form);
|
form.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
|
||||||
|
SessionManager.getAppDesktop().showWindow(form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
|
|
||||||
package org.adempiere.webui.apps;
|
package org.adempiere.webui.apps;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.InvalidClassException;
|
import java.io.InvalidClassException;
|
||||||
import java.io.NotSerializableException;
|
import java.io.NotSerializableException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
@ -26,6 +30,7 @@ import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import javax.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
|
@ -51,6 +56,13 @@ import org.zkoss.zk.ui.Component;
|
||||||
import org.zkoss.zk.ui.Execution;
|
import org.zkoss.zk.ui.Execution;
|
||||||
import org.zkoss.zk.ui.Executions;
|
import org.zkoss.zk.ui.Executions;
|
||||||
|
|
||||||
|
import com.lowagie.text.Document;
|
||||||
|
import com.lowagie.text.DocumentException;
|
||||||
|
import com.lowagie.text.pdf.PdfContentByte;
|
||||||
|
import com.lowagie.text.pdf.PdfImportedPage;
|
||||||
|
import com.lowagie.text.pdf.PdfReader;
|
||||||
|
import com.lowagie.text.pdf.PdfWriter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Windows Application Environment and utilities
|
* Windows Application Environment and utilities
|
||||||
*
|
*
|
||||||
|
@ -735,4 +747,36 @@ public final class AEnv
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param pdfList
|
||||||
|
* @param outFile
|
||||||
|
* @throws IOException
|
||||||
|
* @throws DocumentException
|
||||||
|
* @throws FileNotFoundException
|
||||||
|
*/
|
||||||
|
public static void mergePdf(List<File> pdfList, File outFile) throws IOException,
|
||||||
|
DocumentException, FileNotFoundException {
|
||||||
|
Document document = null;
|
||||||
|
PdfWriter copy = null;
|
||||||
|
for (File f : pdfList)
|
||||||
|
{
|
||||||
|
PdfReader reader = new PdfReader(f.getAbsolutePath());
|
||||||
|
if (document == null)
|
||||||
|
{
|
||||||
|
document = new Document(reader.getPageSizeWithRotation(1));
|
||||||
|
copy = PdfWriter.getInstance(document, new FileOutputStream(outFile));
|
||||||
|
document.open();
|
||||||
|
}
|
||||||
|
int pages = reader.getNumberOfPages();
|
||||||
|
PdfContentByte cb = copy.getDirectContent();
|
||||||
|
for (int i = 1; i <= pages; i++) {
|
||||||
|
document.newPage();
|
||||||
|
PdfImportedPage page = copy.getImportedPage(reader, i);
|
||||||
|
cb.addTemplate(page, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.close();
|
||||||
|
}
|
||||||
} // AEnv
|
} // AEnv
|
||||||
|
|
|
@ -252,13 +252,16 @@ public class ProcessModalDialog extends Window implements EventListener
|
||||||
m_autoStart = true;
|
m_autoStart = true;
|
||||||
}
|
}
|
||||||
if (m_autoStart) {
|
if (m_autoStart) {
|
||||||
|
this.getFirstChild().setVisible(false);
|
||||||
startProcess();
|
startProcess();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the process is a silent one
|
// Check if the process is a silent one
|
||||||
if(isValid() && m_ShowHelp != null && m_ShowHelp.equals("S"))
|
if(isValid() && m_ShowHelp != null && m_ShowHelp.equals("S"))
|
||||||
{
|
{
|
||||||
|
this.getFirstChild().setVisible(false);
|
||||||
startProcess();
|
startProcess();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -269,21 +272,23 @@ public class ProcessModalDialog extends Window implements EventListener
|
||||||
*/
|
*/
|
||||||
private void startProcess()
|
private void startProcess()
|
||||||
{
|
{
|
||||||
m_processRunnable = new ProcessRunnable(Executions.getCurrent().getDesktop());
|
|
||||||
m_pi.setPrintPreview(true);
|
m_pi.setPrintPreview(true);
|
||||||
|
|
||||||
if (m_ASyncProcess != null) {
|
if (m_ASyncProcess != null) {
|
||||||
m_ASyncProcess.lockUI(m_pi);
|
m_ASyncProcess.lockUI(m_pi);
|
||||||
|
} else {
|
||||||
|
Clients.showBusy(null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processRunnable = new ProcessRunnable(Executions.getCurrent().getDesktop());
|
||||||
//use echo, otherwise lock ui wouldn't work
|
//use echo, otherwise lock ui wouldn't work
|
||||||
Clients.response(new AuEcho(this, "runProcessBackground", null));
|
Clients.response(new AuEcho(this, "runASyncProcess", null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* internal use, don't call this directly
|
* internal use, don't call this directly
|
||||||
*/
|
*/
|
||||||
public void runProcessBackground() {
|
public void runASyncProcess() {
|
||||||
new Thread(m_processRunnable).start();
|
new Thread(m_processRunnable).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,6 +307,8 @@ public class ProcessModalDialog extends Window implements EventListener
|
||||||
} finally {
|
} finally {
|
||||||
if (m_ASyncProcess != null) {
|
if (m_ASyncProcess != null) {
|
||||||
m_ASyncProcess.unlockUI(m_pi);
|
m_ASyncProcess.unlockUI(m_pi);
|
||||||
|
} else {
|
||||||
|
Clients.showBusy(null, false);
|
||||||
}
|
}
|
||||||
//release full control of desktop
|
//release full control of desktop
|
||||||
Executions.deactivate(desktop);
|
Executions.deactivate(desktop);
|
||||||
|
|
|
@ -18,13 +18,13 @@ package org.adempiere.webui.apps.form;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.math.*;
|
import java.math.*;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
|
|
||||||
import org.adempiere.webui.LayoutUtils;
|
import org.adempiere.webui.LayoutUtils;
|
||||||
|
import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.component.ConfirmPanel;
|
import org.adempiere.webui.component.ConfirmPanel;
|
||||||
import org.adempiere.webui.component.DesktopTabpanel;
|
import org.adempiere.webui.component.DesktopTabpanel;
|
||||||
import org.adempiere.webui.component.Label;
|
import org.adempiere.webui.component.Label;
|
||||||
|
@ -68,12 +68,6 @@ import org.zkoss.zul.Div;
|
||||||
import org.zkoss.zul.Html;
|
import org.zkoss.zul.Html;
|
||||||
import org.zkoss.zul.Space;
|
import org.zkoss.zul.Space;
|
||||||
|
|
||||||
import com.lowagie.text.Document;
|
|
||||||
import com.lowagie.text.pdf.PdfContentByte;
|
|
||||||
import com.lowagie.text.pdf.PdfImportedPage;
|
|
||||||
import com.lowagie.text.pdf.PdfReader;
|
|
||||||
import com.lowagie.text.pdf.PdfWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manual Shipment Selection
|
* Manual Shipment Selection
|
||||||
*
|
*
|
||||||
|
@ -706,26 +700,7 @@ public class WInOutGen extends ADForm implements EventListener, ValueChangeListe
|
||||||
if (pdfList.size() > 1) {
|
if (pdfList.size() > 1) {
|
||||||
try {
|
try {
|
||||||
File outFile = File.createTempFile("WInOutGen", ".pdf");
|
File outFile = File.createTempFile("WInOutGen", ".pdf");
|
||||||
Document document = null;
|
AEnv.mergePdf(pdfList, outFile);
|
||||||
PdfWriter copy = null;
|
|
||||||
for (File f : pdfList)
|
|
||||||
{
|
|
||||||
PdfReader reader = new PdfReader(f.getAbsolutePath());
|
|
||||||
if (document == null)
|
|
||||||
{
|
|
||||||
document = new Document(reader.getPageSizeWithRotation(1));
|
|
||||||
copy = PdfWriter.getInstance(document, new FileOutputStream(outFile));
|
|
||||||
document.open();
|
|
||||||
}
|
|
||||||
int pages = reader.getNumberOfPages();
|
|
||||||
PdfContentByte cb = copy.getDirectContent();
|
|
||||||
for (int i = 1; i <= pages; i++) {
|
|
||||||
document.newPage();
|
|
||||||
PdfImportedPage page = copy.getImportedPage(reader, i);
|
|
||||||
cb.addTemplate(page, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
document.close();
|
|
||||||
|
|
||||||
Clients.showBusy(null, false);
|
Clients.showBusy(null, false);
|
||||||
Window win = new SimplePDFViewer(this.getFormName(), new FileInputStream(outFile));
|
Window win = new SimplePDFViewer(this.getFormName(), new FileInputStream(outFile));
|
||||||
|
@ -745,7 +720,6 @@ public class WInOutGen extends ADForm implements EventListener, ValueChangeListe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Lock User Interface.
|
* Lock User Interface.
|
||||||
* Called from the Worker before processing
|
* Called from the Worker before processing
|
||||||
|
|
|
@ -18,7 +18,6 @@ package org.adempiere.webui.apps.form;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
@ -29,6 +28,7 @@ import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.adempiere.webui.LayoutUtils;
|
import org.adempiere.webui.LayoutUtils;
|
||||||
|
import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.component.ConfirmPanel;
|
import org.adempiere.webui.component.ConfirmPanel;
|
||||||
import org.adempiere.webui.component.DesktopTabpanel;
|
import org.adempiere.webui.component.DesktopTabpanel;
|
||||||
import org.adempiere.webui.component.Label;
|
import org.adempiere.webui.component.Label;
|
||||||
|
@ -86,11 +86,6 @@ import org.zkoss.zul.Div;
|
||||||
import org.zkoss.zul.Html;
|
import org.zkoss.zul.Html;
|
||||||
import org.zkoss.zul.Space;
|
import org.zkoss.zul.Space;
|
||||||
|
|
||||||
import com.lowagie.text.Document;
|
|
||||||
import com.lowagie.text.pdf.PdfContentByte;
|
|
||||||
import com.lowagie.text.pdf.PdfImportedPage;
|
|
||||||
import com.lowagie.text.pdf.PdfReader;
|
|
||||||
import com.lowagie.text.pdf.PdfWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manual Invoice Selection
|
* Manual Invoice Selection
|
||||||
|
@ -705,26 +700,7 @@ public class WInvoiceGen extends ADForm
|
||||||
if (pdfList.size() > 1) {
|
if (pdfList.size() > 1) {
|
||||||
try {
|
try {
|
||||||
File outFile = File.createTempFile("WInvoiceGen", ".pdf");
|
File outFile = File.createTempFile("WInvoiceGen", ".pdf");
|
||||||
Document document = null;
|
AEnv.mergePdf(pdfList, outFile);
|
||||||
PdfWriter copy = null;
|
|
||||||
for (File f : pdfList)
|
|
||||||
{
|
|
||||||
PdfReader reader = new PdfReader(f.getAbsolutePath());
|
|
||||||
if (document == null)
|
|
||||||
{
|
|
||||||
document = new Document(reader.getPageSizeWithRotation(1));
|
|
||||||
copy = PdfWriter.getInstance(document, new FileOutputStream(outFile));
|
|
||||||
document.open();
|
|
||||||
}
|
|
||||||
int pages = reader.getNumberOfPages();
|
|
||||||
PdfContentByte cb = copy.getDirectContent();
|
|
||||||
for (int i = 1; i <= pages; i++) {
|
|
||||||
document.newPage();
|
|
||||||
PdfImportedPage page = copy.getImportedPage(reader, i);
|
|
||||||
cb.addTemplate(page, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
document.close();
|
|
||||||
|
|
||||||
Clients.showBusy(null, false);
|
Clients.showBusy(null, false);
|
||||||
Window win = new SimplePDFViewer(this.getFormName(), new FileInputStream(outFile));
|
Window win = new SimplePDFViewer(this.getFormName(), new FileInputStream(outFile));
|
||||||
|
|
|
@ -162,8 +162,8 @@ public class WMatch extends ADForm
|
||||||
private Label onlyProductLabel = new Label();
|
private Label onlyProductLabel = new Label();
|
||||||
private Label dateFromLabel = new Label();
|
private Label dateFromLabel = new Label();
|
||||||
private Label dateToLabel = new Label();
|
private Label dateToLabel = new Label();
|
||||||
private WDateEditor dateFrom = new WDateEditor("DateFrom", false, false, true, DisplayType.Date, "DateFrom");
|
private WDateEditor dateFrom = new WDateEditor("DateFrom", false, false, true, "DateFrom");
|
||||||
private WDateEditor dateTo = new WDateEditor("DateTo", false, false, true, DisplayType.Date, "DateTo");
|
private WDateEditor dateTo = new WDateEditor("DateTo", false, false, true, "DateTo");
|
||||||
private Button bSearch = new Button();
|
private Button bSearch = new Button();
|
||||||
private Panel southPanel = new Panel();
|
private Panel southPanel = new Panel();
|
||||||
private Grid southLayout = GridFactory.newGridLayout();
|
private Grid southLayout = GridFactory.newGridLayout();
|
||||||
|
|
|
@ -14,106 +14,71 @@
|
||||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/**
|
|
||||||
* 2007, Modified by Posterita Ltd.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.adempiere.webui.apps.form;
|
package org.adempiere.webui.apps.form;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.sql.*;
|
||||||
import java.sql.PreparedStatement;
|
import java.util.ArrayList;
|
||||||
import java.sql.ResultSet;
|
import java.util.List;
|
||||||
import java.sql.SQLException;
|
import java.util.logging.*;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
|
import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.component.Button;
|
import org.adempiere.webui.component.Button;
|
||||||
|
import org.adempiere.webui.component.ConfirmPanel;
|
||||||
|
import org.adempiere.webui.component.Grid;
|
||||||
|
import org.adempiere.webui.component.GridFactory;
|
||||||
import org.adempiere.webui.component.Label;
|
import org.adempiere.webui.component.Label;
|
||||||
import org.adempiere.webui.component.ListItem;
|
|
||||||
import org.adempiere.webui.component.Listbox;
|
import org.adempiere.webui.component.Listbox;
|
||||||
import org.adempiere.webui.component.Textbox;
|
import org.adempiere.webui.component.ListboxFactory;
|
||||||
import org.adempiere.webui.component.VerticalBox;
|
import org.adempiere.webui.component.Panel;
|
||||||
|
import org.adempiere.webui.component.Row;
|
||||||
|
import org.adempiere.webui.component.Rows;
|
||||||
|
import org.adempiere.webui.component.Window;
|
||||||
|
import org.adempiere.webui.editor.WNumberEditor;
|
||||||
import org.adempiere.webui.panel.ADForm;
|
import org.adempiere.webui.panel.ADForm;
|
||||||
import org.adempiere.webui.session.SessionManager;
|
import org.adempiere.webui.session.SessionManager;
|
||||||
import org.adempiere.webui.window.FDialog;
|
import org.adempiere.webui.window.FDialog;
|
||||||
import org.compiere.model.MLookupFactory;
|
import org.adempiere.webui.window.SimplePDFViewer;
|
||||||
import org.compiere.model.MLookupInfo;
|
import org.compiere.model.*;
|
||||||
import org.compiere.model.MPaySelectionCheck;
|
import org.compiere.print.*;
|
||||||
import org.compiere.model.MPaymentBatch;
|
import org.compiere.util.*;
|
||||||
import org.compiere.print.ReportCtl;
|
|
||||||
import org.compiere.print.ReportEngine;
|
|
||||||
import org.compiere.util.CLogger;
|
|
||||||
import org.compiere.util.DB;
|
|
||||||
import org.compiere.util.Env;
|
|
||||||
import org.compiere.util.Ini;
|
|
||||||
import org.compiere.util.KeyNamePair;
|
|
||||||
import org.compiere.util.Language;
|
|
||||||
import org.compiere.util.Msg;
|
|
||||||
import org.compiere.util.ValueNamePair;
|
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zk.ui.event.EventListener;
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zkex.zul.Borderlayout;
|
||||||
|
import org.zkoss.zkex.zul.Center;
|
||||||
|
import org.zkoss.zkex.zul.South;
|
||||||
import org.zkoss.zul.Filedownload;
|
import org.zkoss.zul.Filedownload;
|
||||||
import org.zkoss.zul.Hbox;
|
|
||||||
|
|
||||||
public class WPayPrint extends ADForm implements EventListener
|
/**
|
||||||
|
* Payment Print & Export
|
||||||
|
*
|
||||||
|
* @author Jorg Janke
|
||||||
|
* @version $Id: VPayPrint.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
|
||||||
|
*/
|
||||||
|
public class WPayPrint extends ADForm
|
||||||
|
implements EventListener
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
/** Used Bank Account */
|
* Initialize Panel
|
||||||
private int m_C_BankAccount_ID = -1;
|
*/
|
||||||
|
|
||||||
/** Payment Information */
|
|
||||||
private MPaySelectionCheck[] m_checks = null;
|
|
||||||
|
|
||||||
/** Payment Batch */
|
|
||||||
private MPaymentBatch m_batch = null;
|
|
||||||
|
|
||||||
/** Logger */
|
|
||||||
private static CLogger log = CLogger.getCLogger(WPayPrint.class);
|
|
||||||
|
|
||||||
// Static Variables
|
|
||||||
private Hbox centerPanel = new Hbox();
|
|
||||||
private Hbox southPanel = new Hbox();
|
|
||||||
|
|
||||||
private Button bPrint = new Button();
|
|
||||||
private Button bExport = new Button();
|
|
||||||
private Button bCancel = new Button();
|
|
||||||
private Button bProcess = new Button();//(Msg.getMsg(Env.getCtx(), "VPayPrintProcess"));
|
|
||||||
private Label lPaySelect = new Label();
|
|
||||||
private Listbox fPaySelect = new Listbox();
|
|
||||||
private Label lBank = new Label();
|
|
||||||
private Label fBank = new Label();
|
|
||||||
private Label lPaymentRule = new Label();
|
|
||||||
private Listbox fPaymentRule = new Listbox();
|
|
||||||
private Label lDocumentNo = new Label();
|
|
||||||
private Textbox fDocumentNo = new Textbox();
|
|
||||||
private Label lNoPayments = new Label();
|
|
||||||
private Label fNoPayments = new Label();
|
|
||||||
private Label lBalance = new Label();
|
|
||||||
private Textbox fBalance = new Textbox();
|
|
||||||
private Label lCurrency = new Label();
|
|
||||||
private Label fCurrency = new Label();
|
|
||||||
|
|
||||||
public WPayPrint()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void initForm()
|
protected void initForm()
|
||||||
{
|
{
|
||||||
log.info("");
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
jbInit();
|
zkInit();
|
||||||
dynInit();
|
dynInit();
|
||||||
|
Borderlayout contentLayout = new Borderlayout();
|
||||||
this.appendChild(centerPanel);
|
contentLayout.setWidth("100%");
|
||||||
this.appendChild(southPanel);
|
contentLayout.setHeight("100%");
|
||||||
|
this.appendChild(contentLayout);
|
||||||
fPaySelect.setSelectedIndex(0);
|
Center center = new Center();
|
||||||
loadPaySelectInfo();
|
contentLayout.appendChild(center);
|
||||||
|
center.appendChild(centerPanel);
|
||||||
|
South south = new South();
|
||||||
|
south.setStyle("border: none");
|
||||||
|
contentLayout.appendChild(south);
|
||||||
|
south.appendChild(southPanel);
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
@ -121,120 +86,104 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
}
|
}
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
|
/** Used Bank Account */
|
||||||
|
private int m_C_BankAccount_ID = -1;
|
||||||
|
|
||||||
|
/** Payment Information */
|
||||||
|
private MPaySelectionCheck[] m_checks = null;
|
||||||
|
/** Payment Batch */
|
||||||
|
private MPaymentBatch m_batch = null;
|
||||||
|
/** Logger */
|
||||||
|
private static CLogger log = CLogger.getCLogger(WPayPrint.class);
|
||||||
|
|
||||||
|
// Static Variables
|
||||||
|
private Panel centerPanel = new Panel();
|
||||||
|
private ConfirmPanel southPanel = new ConfirmPanel(true, false, false, false, false, false, false);
|
||||||
|
private Grid centerLayout = GridFactory.newGridLayout();
|
||||||
|
private Button bPrint = southPanel.createButton(ConfirmPanel.A_PRINT);
|
||||||
|
private Button bExport = southPanel.createButton(ConfirmPanel.A_EXPORT);
|
||||||
|
private Button bCancel = southPanel.getButton(ConfirmPanel.A_CANCEL);
|
||||||
|
private Button bProcess = southPanel.createButton(ConfirmPanel.A_PROCESS);
|
||||||
|
private Label lPaySelect = new Label();
|
||||||
|
private Listbox fPaySelect = ListboxFactory.newDropdownListbox();
|
||||||
|
private Label lBank = new Label();
|
||||||
|
private Label fBank = new Label();
|
||||||
|
private Label lPaymentRule = new Label();
|
||||||
|
private Listbox fPaymentRule = ListboxFactory.newDropdownListbox();
|
||||||
|
private Label lDocumentNo = new Label();
|
||||||
|
private WNumberEditor fDocumentNo = new WNumberEditor();
|
||||||
|
private Label lNoPayments = new Label();
|
||||||
|
private Label fNoPayments = new Label();
|
||||||
|
private Label lBalance = new Label();
|
||||||
|
private WNumberEditor fBalance = new WNumberEditor();
|
||||||
|
private Label lCurrency = new Label();
|
||||||
|
private Label fCurrency = new Label();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Static Init
|
* Static Init
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private void jbInit() throws Exception
|
private void zkInit() throws Exception
|
||||||
{
|
{
|
||||||
fPaySelect.setRows(1);
|
//
|
||||||
fPaySelect.setMold("select");
|
centerPanel.appendChild(centerLayout);
|
||||||
|
//
|
||||||
fPaymentRule.setRows(1);
|
bPrint.addActionListener(this);
|
||||||
fPaymentRule.setMold("select");
|
bExport.addActionListener(this);
|
||||||
|
bCancel.addActionListener(this);
|
||||||
bCancel.setImage("/images/Cancel24.png");
|
//
|
||||||
bPrint.setImage("/images/Print24.png");
|
|
||||||
bExport.setImage("/images/ExportX24.png");
|
|
||||||
|
|
||||||
bPrint.addEventListener(Events.ON_CLICK, this);
|
|
||||||
bExport.addEventListener(Events.ON_CLICK, this);
|
|
||||||
bCancel.addEventListener(Events.ON_CLICK, this);
|
|
||||||
|
|
||||||
bProcess.setLabel(Msg.getMsg(Env.getCtx(), "EFT"));
|
|
||||||
bProcess.setEnabled(false);
|
bProcess.setEnabled(false);
|
||||||
bProcess.addEventListener(Events.ON_CLICK, this);
|
bProcess.addActionListener(this);
|
||||||
|
//
|
||||||
|
lPaySelect.setText(Msg.translate(Env.getCtx(), "C_PaySelection_ID"));
|
||||||
|
fPaySelect.addActionListener(this);
|
||||||
|
//
|
||||||
|
lBank.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));
|
||||||
|
//
|
||||||
|
lPaymentRule.setText(Msg.translate(Env.getCtx(), "PaymentRule"));
|
||||||
|
fPaymentRule.addActionListener(this);
|
||||||
|
//
|
||||||
|
lDocumentNo.setText(Msg.translate(Env.getCtx(), "DocumentNo"));
|
||||||
|
fDocumentNo.getComponent().setIntegral(true);
|
||||||
|
lNoPayments.setText(Msg.getMsg(Env.getCtx(), "NoOfPayments"));
|
||||||
|
fNoPayments.setText("0");
|
||||||
|
lBalance.setText(Msg.translate(Env.getCtx(), "CurrentBalance"));
|
||||||
|
fBalance.setReadWrite(false);
|
||||||
|
fBalance.getComponent().setIntegral(false);
|
||||||
|
lCurrency.setText(Msg.translate(Env.getCtx(), "C_Currency_ID"));
|
||||||
|
//
|
||||||
|
southPanel.addButton(bExport);
|
||||||
|
southPanel.addButton(bPrint);
|
||||||
|
southPanel.addButton(bProcess);
|
||||||
|
//
|
||||||
|
Rows rows = centerLayout.newRows();
|
||||||
|
Row row = rows.newRow();
|
||||||
|
row.appendChild(lPaySelect.rightAlign());
|
||||||
|
row.appendChild(fPaySelect);
|
||||||
|
|
||||||
lPaySelect.setValue(Msg.translate(Env.getCtx(), "C_PaySelection_ID"));
|
row = rows.newRow();
|
||||||
fPaySelect.addEventListener(Events.ON_SELECT, this);
|
row.appendChild(lBank.rightAlign());
|
||||||
|
row.appendChild(fBank);
|
||||||
|
row.appendChild(lBalance.rightAlign());
|
||||||
|
row.appendChild(fBalance.getComponent());
|
||||||
|
|
||||||
lBank.setValue(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));
|
row = rows.newRow();
|
||||||
|
row.appendChild(lPaymentRule.rightAlign());
|
||||||
|
row.appendChild(fPaymentRule);
|
||||||
|
row.appendChild(lCurrency.rightAlign());
|
||||||
|
row.appendChild(fCurrency);
|
||||||
|
|
||||||
lPaymentRule.setValue(Msg.translate(Env.getCtx(), "PaymentRule"));
|
row = rows.newRow();
|
||||||
fPaymentRule.addEventListener(Events.ON_SELECT, this);
|
row.appendChild(lDocumentNo.rightAlign());
|
||||||
|
row.appendChild(fDocumentNo.getComponent());
|
||||||
|
row.appendChild(lNoPayments.rightAlign());
|
||||||
|
row.appendChild(fNoPayments);
|
||||||
|
|
||||||
lDocumentNo.setValue(Msg.translate(Env.getCtx(), "DocumentNo"));
|
} // VPayPrint
|
||||||
lNoPayments.setValue(Msg.getMsg(Env.getCtx(), "NoOfPayments"));
|
|
||||||
fNoPayments.setValue("0");
|
|
||||||
lBalance.setValue(Msg.translate(Env.getCtx(), "CurrentBalance"));
|
|
||||||
fBalance.setEnabled(false);
|
|
||||||
lCurrency.setValue(Msg.translate(Env.getCtx(), "C_Currency_ID"));
|
|
||||||
|
|
||||||
Hbox boxPaySelect = new Hbox();
|
|
||||||
|
|
||||||
fPaySelect.setWidth("100%");
|
|
||||||
|
|
||||||
boxPaySelect.setWidth("100%");
|
|
||||||
boxPaySelect.setWidths("40%, 60%");
|
|
||||||
boxPaySelect.appendChild(lPaySelect);
|
|
||||||
boxPaySelect.appendChild(fPaySelect);
|
|
||||||
|
|
||||||
Hbox boxBank = new Hbox();
|
|
||||||
boxBank.setWidth("100%");
|
|
||||||
boxBank.setWidths("40%, 60%");
|
|
||||||
boxBank.appendChild(lBank);
|
|
||||||
boxBank.appendChild(fBank);
|
|
||||||
|
|
||||||
Hbox boxPaymentRule = new Hbox();
|
|
||||||
boxPaymentRule.setWidth("100%");
|
|
||||||
boxPaymentRule.setWidths("40%, 60%");
|
|
||||||
boxPaymentRule.appendChild(lPaymentRule);
|
|
||||||
boxPaymentRule.appendChild(fPaymentRule);
|
|
||||||
|
|
||||||
Hbox boxDocNo = new Hbox();
|
|
||||||
boxDocNo.setWidth("100%");
|
|
||||||
boxDocNo.setWidths("40%, 60%");
|
|
||||||
boxDocNo.appendChild(lDocumentNo);
|
|
||||||
boxDocNo.appendChild(fDocumentNo);
|
|
||||||
|
|
||||||
Hbox boxNoPayments = new Hbox();
|
|
||||||
boxNoPayments.setWidth("100%");
|
|
||||||
boxNoPayments.setWidths("50%, 50%");
|
|
||||||
boxNoPayments.appendChild(lNoPayments);
|
|
||||||
boxNoPayments.appendChild(fNoPayments);
|
|
||||||
|
|
||||||
Hbox boxBalance = new Hbox();
|
|
||||||
boxBalance.setWidth("100%");
|
|
||||||
boxBalance.setWidths("50%, 50%");
|
|
||||||
boxBalance.appendChild(lBalance);
|
|
||||||
boxBalance.appendChild(fBalance);
|
|
||||||
|
|
||||||
Hbox boxCurrency = new Hbox();
|
|
||||||
boxCurrency.setWidth("100%");
|
|
||||||
boxCurrency.setWidths("50%, 50%");
|
|
||||||
boxCurrency.appendChild(lCurrency);
|
|
||||||
boxCurrency.appendChild(fCurrency);
|
|
||||||
|
|
||||||
centerPanel.setWidth("100%");
|
|
||||||
centerPanel.setWidths("65%, 35%");
|
|
||||||
|
|
||||||
VerticalBox vBox1 = new VerticalBox();
|
|
||||||
vBox1.setWidth("100%");
|
|
||||||
vBox1.appendChild(boxPaySelect);
|
|
||||||
vBox1.appendChild(boxBank);
|
|
||||||
vBox1.appendChild(boxPaymentRule);
|
|
||||||
vBox1.appendChild(boxDocNo);
|
|
||||||
|
|
||||||
VerticalBox vBox2 = new VerticalBox();
|
|
||||||
vBox2.setWidth("100%");
|
|
||||||
vBox2.appendChild(new Label(""));
|
|
||||||
vBox2.appendChild(boxBalance);
|
|
||||||
vBox2.appendChild(boxCurrency);
|
|
||||||
vBox2.appendChild(boxNoPayments);
|
|
||||||
|
|
||||||
centerPanel.appendChild(vBox1);
|
|
||||||
centerPanel.appendChild(vBox2);
|
|
||||||
|
|
||||||
southPanel.appendChild(bCancel);
|
|
||||||
southPanel.appendChild(bExport);
|
|
||||||
southPanel.appendChild(bPrint);
|
|
||||||
southPanel.appendChild(bProcess);
|
|
||||||
} // WPayPrint
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamic Init
|
* Dynamic Init
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private void dynInit()
|
private void dynInit()
|
||||||
{
|
{
|
||||||
log.config("");
|
log.config("");
|
||||||
|
@ -244,17 +193,16 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
String sql = "SELECT C_PaySelection_ID, Name || ' - ' || TotalAmt FROM C_PaySelection "
|
String sql = "SELECT C_PaySelection_ID, Name || ' - ' || TotalAmt FROM C_PaySelection "
|
||||||
+ "WHERE AD_Client_ID=? AND Processed='Y' AND IsActive='Y'"
|
+ "WHERE AD_Client_ID=? AND Processed='Y' AND IsActive='Y'"
|
||||||
+ "ORDER BY PayDate DESC";
|
+ "ORDER BY PayDate DESC";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
||||||
pstmt.setInt(1, AD_Client_ID);
|
pstmt.setInt(1, AD_Client_ID);
|
||||||
ResultSet rs = pstmt.executeQuery();
|
ResultSet rs = pstmt.executeQuery();
|
||||||
|
//
|
||||||
while (rs.next())
|
while (rs.next())
|
||||||
{
|
{
|
||||||
KeyNamePair pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
|
KeyNamePair pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
|
||||||
fPaySelect.appendItem(pp.getName(), pp);
|
fPaySelect.addItem(pp);
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
pstmt.close();
|
pstmt.close();
|
||||||
|
@ -263,11 +211,23 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, sql, e);
|
log.log(Level.SEVERE, sql, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fPaySelect.getItemCount() == 0)
|
if (fPaySelect.getItemCount() == 0)
|
||||||
FDialog.info(m_WindowNo, this, "VPayPrintNoRecords");
|
FDialog.info(m_WindowNo, this, "VPayPrintNoRecords");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fPaySelect.setSelectedIndex(0);
|
||||||
|
loadPaySelectInfo();
|
||||||
|
}
|
||||||
} // dynInit
|
} // dynInit
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispose
|
||||||
|
*/
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
SessionManager.getAppDesktop().removeWindow();
|
||||||
|
} // dispose
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Payment Selection
|
* Set Payment Selection
|
||||||
* @param C_PaySelection_ID id
|
* @param C_PaySelection_ID id
|
||||||
|
@ -279,16 +239,11 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
//
|
//
|
||||||
for (int i = 0; i < fPaySelect.getItemCount(); i++)
|
for (int i = 0; i < fPaySelect.getItemCount(); i++)
|
||||||
{
|
{
|
||||||
ListItem listitem = fPaySelect.getItemAtIndex(i);
|
KeyNamePair pp = fPaySelect.getItemAtIndex(i).toKeyNamePair();
|
||||||
|
|
||||||
KeyNamePair pp = null;
|
|
||||||
|
|
||||||
if (listitem != null)
|
|
||||||
pp = (KeyNamePair)listitem.getValue();
|
|
||||||
|
|
||||||
if (pp.getKey() == C_PaySelection_ID)
|
if (pp.getKey() == C_PaySelection_ID)
|
||||||
{
|
{
|
||||||
fPaySelect.setSelectedIndex(i);
|
fPaySelect.setSelectedIndex(i);
|
||||||
|
loadPaySelectInfo();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,15 +254,16 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
* Action Listener
|
* Action Listener
|
||||||
* @param e event
|
* @param e event
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public void onEvent(Event e)
|
public void onEvent(Event e)
|
||||||
{
|
{
|
||||||
|
// log.config( "VPayPrint.actionPerformed" + e.toString());
|
||||||
if (e.getTarget() == fPaySelect)
|
if (e.getTarget() == fPaySelect)
|
||||||
loadPaySelectInfo();
|
loadPaySelectInfo();
|
||||||
else if (e.getTarget() == fPaymentRule)
|
else if (e.getTarget() == fPaymentRule)
|
||||||
loadPaymentRuleInfo();
|
loadPaymentRuleInfo();
|
||||||
|
//
|
||||||
else if (e.getTarget() == bCancel)
|
else if (e.getTarget() == bCancel)
|
||||||
SessionManager.getAppDesktop().removeWindow();
|
dispose();
|
||||||
else if (e.getTarget() == bExport)
|
else if (e.getTarget() == bExport)
|
||||||
cmd_export();
|
cmd_export();
|
||||||
else if (e.getTarget() == bProcess)
|
else if (e.getTarget() == bProcess)
|
||||||
|
@ -319,7 +275,6 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
/**
|
/**
|
||||||
* PaySelect changed - load Bank
|
* PaySelect changed - load Bank
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private void loadPaySelectInfo()
|
private void loadPaySelectInfo()
|
||||||
{
|
{
|
||||||
log.info( "VPayPrint.loadPaySelectInfo");
|
log.info( "VPayPrint.loadPaySelectInfo");
|
||||||
|
@ -327,15 +282,7 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// load Banks from PaySelectLine
|
// load Banks from PaySelectLine
|
||||||
|
int C_PaySelection_ID = fPaySelect.getSelectedItem().toKeyNamePair().getKey();
|
||||||
ListItem listitem = fPaySelect.getSelectedItem();
|
|
||||||
|
|
||||||
KeyNamePair key = null;
|
|
||||||
|
|
||||||
if (listitem != null)
|
|
||||||
key = (KeyNamePair)listitem.getValue();
|
|
||||||
|
|
||||||
int C_PaySelection_ID = key.getKey();
|
|
||||||
m_C_BankAccount_ID = -1;
|
m_C_BankAccount_ID = -1;
|
||||||
String sql = "SELECT ps.C_BankAccount_ID, b.Name || ' ' || ba.AccountNo," // 1..2
|
String sql = "SELECT ps.C_BankAccount_ID, b.Name || ' ' || ba.AccountNo," // 1..2
|
||||||
+ " c.ISO_Code, CurrentBalance " // 3..4
|
+ " c.ISO_Code, CurrentBalance " // 3..4
|
||||||
|
@ -344,26 +291,24 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
+ " INNER JOIN C_Bank b ON (ba.C_Bank_ID=b.C_Bank_ID)"
|
+ " INNER JOIN C_Bank b ON (ba.C_Bank_ID=b.C_Bank_ID)"
|
||||||
+ " INNER JOIN C_Currency c ON (ba.C_Currency_ID=c.C_Currency_ID) "
|
+ " INNER JOIN C_Currency c ON (ba.C_Currency_ID=c.C_Currency_ID) "
|
||||||
+ "WHERE ps.C_PaySelection_ID=? AND ps.Processed='Y' AND ba.IsActive='Y'";
|
+ "WHERE ps.C_PaySelection_ID=? AND ps.Processed='Y' AND ba.IsActive='Y'";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
||||||
pstmt.setInt(1, C_PaySelection_ID);
|
pstmt.setInt(1, C_PaySelection_ID);
|
||||||
ResultSet rs = pstmt.executeQuery();
|
ResultSet rs = pstmt.executeQuery();
|
||||||
|
|
||||||
if (rs.next())
|
if (rs.next())
|
||||||
{
|
{
|
||||||
m_C_BankAccount_ID = rs.getInt(1);
|
m_C_BankAccount_ID = rs.getInt(1);
|
||||||
fBank.setValue(rs.getString(2));
|
fBank.setText(rs.getString(2));
|
||||||
fCurrency.setValue(rs.getString(3));
|
fCurrency.setText(rs.getString(3));
|
||||||
fBalance.setValue(rs.getBigDecimal(4).toString());
|
fBalance.setValue(rs.getBigDecimal(4));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_C_BankAccount_ID = -1;
|
m_C_BankAccount_ID = -1;
|
||||||
fBank.setValue("");
|
fBank.setText("");
|
||||||
fCurrency.setValue("");
|
fCurrency.setText("");
|
||||||
fBalance.setValue("0");
|
fBalance.setValue(Env.ZERO);
|
||||||
log.log(Level.SEVERE, "No active BankAccount for C_PaySelection_ID=" + C_PaySelection_ID);
|
log.log(Level.SEVERE, "No active BankAccount for C_PaySelection_ID=" + C_PaySelection_ID);
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
|
@ -373,7 +318,6 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, sql, e);
|
log.log(Level.SEVERE, sql, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPaymentRule();
|
loadPaymentRule();
|
||||||
} // loadPaySelectInfo
|
} // loadPaySelectInfo
|
||||||
|
|
||||||
|
@ -383,23 +327,12 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
private void loadPaymentRule()
|
private void loadPaymentRule()
|
||||||
{
|
{
|
||||||
log.info("");
|
log.info("");
|
||||||
|
|
||||||
if (m_C_BankAccount_ID == -1)
|
if (m_C_BankAccount_ID == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// load PaymentRule for Bank
|
// load PaymentRule for Bank
|
||||||
|
int C_PaySelection_ID = fPaySelect.getSelectedItem().toKeyNamePair().getKey();
|
||||||
ListItem listitem = fPaySelect.getSelectedItem();
|
fPaymentRule.removeAllItems();
|
||||||
|
|
||||||
KeyNamePair kp = null;
|
|
||||||
|
|
||||||
if (listitem != null)
|
|
||||||
kp = (KeyNamePair)listitem.getValue();
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
|
|
||||||
int C_PaySelection_ID = kp.getKey();
|
|
||||||
fPaymentRule.getChildren().clear();
|
|
||||||
int AD_Reference_ID = 195; // MLookupInfo.getAD_Reference_ID("All_Payment Rule");
|
int AD_Reference_ID = 195; // MLookupInfo.getAD_Reference_ID("All_Payment Rule");
|
||||||
Language language = Language.getLanguage(Env.getAD_Language(Env.getCtx()));
|
Language language = Language.getLanguage(Env.getAD_Language(Env.getCtx()));
|
||||||
MLookupInfo info = MLookupFactory.getLookup_List(language, AD_Reference_ID);
|
MLookupInfo info = MLookupFactory.getLookup_List(language, AD_Reference_ID);
|
||||||
|
@ -407,17 +340,16 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
+ " AND " + info.KeyColumn
|
+ " AND " + info.KeyColumn
|
||||||
+ " IN (SELECT PaymentRule FROM C_PaySelectionCheck WHERE C_PaySelection_ID=?) "
|
+ " IN (SELECT PaymentRule FROM C_PaySelectionCheck WHERE C_PaySelection_ID=?) "
|
||||||
+ info.Query.substring(info.Query.indexOf(" ORDER BY"));
|
+ info.Query.substring(info.Query.indexOf(" ORDER BY"));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
||||||
pstmt.setInt(1, C_PaySelection_ID);
|
pstmt.setInt(1, C_PaySelection_ID);
|
||||||
ResultSet rs = pstmt.executeQuery();
|
ResultSet rs = pstmt.executeQuery();
|
||||||
|
//
|
||||||
while (rs.next())
|
while (rs.next())
|
||||||
{
|
{
|
||||||
ValueNamePair pp = new ValueNamePair(rs.getString(2), rs.getString(3));
|
ValueNamePair pp = new ValueNamePair(rs.getString(2), rs.getString(3));
|
||||||
fPaymentRule.appendItem(pp.getName(), pp);
|
fPaymentRule.addItem(pp);
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
pstmt.close();
|
pstmt.close();
|
||||||
|
@ -426,12 +358,10 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, sql, e);
|
log.log(Level.SEVERE, sql, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fPaymentRule.getItemCount() == 0)
|
if (fPaymentRule.getItemCount() == 0)
|
||||||
log.config("PaySel=" + C_PaySelection_ID + ", BAcct=" + m_C_BankAccount_ID + " - " + sql);
|
log.config("PaySel=" + C_PaySelection_ID + ", BAcct=" + m_C_BankAccount_ID + " - " + sql);
|
||||||
|
else
|
||||||
fPaymentRule.setSelectedIndex(0);
|
fPaymentRule.setSelectedIndex(0);
|
||||||
|
|
||||||
loadPaymentRuleInfo();
|
loadPaymentRuleInfo();
|
||||||
} // loadPaymentRule
|
} // loadPaymentRule
|
||||||
|
|
||||||
|
@ -439,33 +369,17 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
* PaymentRule changed - load DocumentNo, NoPayments,
|
* PaymentRule changed - load DocumentNo, NoPayments,
|
||||||
* enable/disable EFT, Print
|
* enable/disable EFT, Print
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private void loadPaymentRuleInfo()
|
private void loadPaymentRuleInfo()
|
||||||
{
|
{
|
||||||
ListItem listitem = fPaymentRule.getSelectedItem();
|
ValueNamePair pp = fPaymentRule.getSelectedItem().toValueNamePair();
|
||||||
|
|
||||||
ValueNamePair pp = null;
|
|
||||||
|
|
||||||
if (listitem != null)
|
|
||||||
pp = (ValueNamePair)listitem.getValue();
|
|
||||||
|
|
||||||
if (pp == null)
|
if (pp == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String PaymentRule = pp.getValue();
|
String PaymentRule = pp.getValue();
|
||||||
|
|
||||||
log.info("PaymentRule=" + PaymentRule);
|
log.info("PaymentRule=" + PaymentRule);
|
||||||
fNoPayments.setValue(" ");
|
fNoPayments.setText(" ");
|
||||||
|
|
||||||
listitem = fPaySelect.getSelectedItem();
|
|
||||||
|
|
||||||
KeyNamePair kp = null;
|
|
||||||
|
|
||||||
if (listitem != null)
|
|
||||||
kp = (KeyNamePair)listitem.getValue();
|
|
||||||
|
|
||||||
int C_PaySelection_ID = kp.getKey();
|
|
||||||
|
|
||||||
|
int C_PaySelection_ID = fPaySelect.getSelectedItem().toKeyNamePair().getKey();
|
||||||
String sql = "SELECT COUNT(*) "
|
String sql = "SELECT COUNT(*) "
|
||||||
+ "FROM C_PaySelectionCheck "
|
+ "FROM C_PaySelectionCheck "
|
||||||
+ "WHERE C_PaySelection_ID=?";
|
+ "WHERE C_PaySelection_ID=?";
|
||||||
|
@ -474,10 +388,9 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
||||||
pstmt.setInt(1, C_PaySelection_ID);
|
pstmt.setInt(1, C_PaySelection_ID);
|
||||||
ResultSet rs = pstmt.executeQuery();
|
ResultSet rs = pstmt.executeQuery();
|
||||||
|
//
|
||||||
if (rs.next())
|
if (rs.next())
|
||||||
fNoPayments.setValue(String.valueOf(rs.getInt(1)));
|
fNoPayments.setText(String.valueOf(rs.getInt(1)));
|
||||||
|
|
||||||
rs.close();
|
rs.close();
|
||||||
pstmt.close();
|
pstmt.close();
|
||||||
}
|
}
|
||||||
|
@ -485,23 +398,21 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, sql, e);
|
log.log(Level.SEVERE, sql, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
bProcess.setEnabled(PaymentRule.equals("T"));
|
bProcess.setEnabled(PaymentRule.equals("T"));
|
||||||
|
|
||||||
// DocumentNo
|
// DocumentNo
|
||||||
sql = "SELECT CurrentNext "
|
sql = "SELECT CurrentNext "
|
||||||
+ "FROM C_BankAccountDoc "
|
+ "FROM C_BankAccountDoc "
|
||||||
+ "WHERE C_BankAccount_ID=? AND PaymentRule=? AND IsActive='Y'";
|
+ "WHERE C_BankAccount_ID=? AND PaymentRule=? AND IsActive='Y'";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
||||||
pstmt.setInt(1, m_C_BankAccount_ID);
|
pstmt.setInt(1, m_C_BankAccount_ID);
|
||||||
pstmt.setString(2, PaymentRule);
|
pstmt.setString(2, PaymentRule);
|
||||||
ResultSet rs = pstmt.executeQuery();
|
ResultSet rs = pstmt.executeQuery();
|
||||||
|
//
|
||||||
if (rs.next())
|
if (rs.next())
|
||||||
fDocumentNo.setValue(new Integer(rs.getInt(1)).toString());
|
fDocumentNo.setValue(new Integer(rs.getInt(1)));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "VPayPrint.loadPaymentRuleInfo - No active BankAccountDoc for C_BankAccount_ID="
|
log.log(Level.SEVERE, "VPayPrint.loadPaymentRuleInfo - No active BankAccountDoc for C_BankAccount_ID="
|
||||||
|
@ -517,51 +428,25 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
}
|
}
|
||||||
} // loadPaymentRuleInfo
|
} // loadPaymentRuleInfo
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Export payments to file
|
* Export payments to file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private void cmd_export()
|
private void cmd_export()
|
||||||
{
|
{
|
||||||
ListItem listitem = fPaymentRule.getSelectedItem();
|
String PaymentRule = fPaymentRule.getSelectedItem().toValueNamePair().getValue();
|
||||||
|
|
||||||
ValueNamePair vp = null;
|
|
||||||
|
|
||||||
if (listitem != null)
|
|
||||||
vp = (ValueNamePair)listitem.getValue();
|
|
||||||
|
|
||||||
String PaymentRule = null;
|
|
||||||
|
|
||||||
if (vp != null)
|
|
||||||
PaymentRule = vp.getValue();
|
|
||||||
|
|
||||||
log.info(PaymentRule);
|
log.info(PaymentRule);
|
||||||
|
|
||||||
if (!getChecks(PaymentRule))
|
if (!getChecks(PaymentRule))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
File file = null;
|
|
||||||
FileInputStream fstream = null;
|
|
||||||
int no = -1;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
file = File.createTempFile("temp", "txt");
|
// Get File Info
|
||||||
no = MPaySelectionCheck.exportToFile(m_checks, file);
|
File tempFile = File.createTempFile("paymentExport", ".txt");
|
||||||
fstream = new FileInputStream(file);
|
|
||||||
}
|
|
||||||
catch (IOException e1)
|
|
||||||
{
|
|
||||||
e1.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Filedownload.save(fstream, "", file.getAbsolutePath());
|
|
||||||
|
|
||||||
// Create File
|
// Create File
|
||||||
|
MPaySelectionCheck.exportToFile(m_checks, tempFile);
|
||||||
FDialog.info(m_WindowNo, this, "Saved",
|
Filedownload.save(new FileInputStream(tempFile), "plain/text", "paymentExport.txt");
|
||||||
file.getAbsolutePath() + "\n"
|
|
||||||
+ Msg.getMsg(Env.getCtx(), "NoOfLines") + "=" + no);
|
|
||||||
|
|
||||||
if (FDialog.ask(m_WindowNo, this, "VPayPrintSuccess?"))
|
if (FDialog.ask(m_WindowNo, this, "VPayPrintSuccess?"))
|
||||||
{
|
{
|
||||||
|
@ -569,67 +454,72 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
MPaySelectionCheck.confirmPrint (m_checks, m_batch);
|
MPaySelectionCheck.confirmPrint (m_checks, m_batch);
|
||||||
// document No not updated
|
// document No not updated
|
||||||
}
|
}
|
||||||
|
dispose();
|
||||||
SessionManager.getAppDesktop().removeWindow();
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
} // cmd_export
|
} // cmd_export
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create EFT payment
|
* Create EFT payment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private void cmd_EFT()
|
private void cmd_EFT()
|
||||||
{
|
{
|
||||||
ListItem listitem = fPaymentRule.getSelectedItem();
|
String PaymentRule = fPaymentRule.getSelectedItem().toValueNamePair().getValue();
|
||||||
|
|
||||||
ValueNamePair vp = null;
|
|
||||||
|
|
||||||
if (listitem != null)
|
|
||||||
vp = (ValueNamePair)listitem.getValue();
|
|
||||||
|
|
||||||
String PaymentRule = vp.getValue();
|
|
||||||
log.info(PaymentRule);
|
log.info(PaymentRule);
|
||||||
|
|
||||||
if (!getChecks(PaymentRule))
|
if (!getChecks(PaymentRule))
|
||||||
return;
|
return;
|
||||||
|
dispose();
|
||||||
SessionManager.getAppDesktop().removeWindow();
|
|
||||||
} // cmd_EFT
|
} // cmd_EFT
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print Checks and/or Remittance
|
* Print Checks and/or Remittance
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private void cmd_print()
|
private void cmd_print()
|
||||||
{
|
{
|
||||||
ListItem listitem = fPaymentRule.getSelectedItem();
|
String PaymentRule = fPaymentRule.getSelectedItem().toValueNamePair().getValue();
|
||||||
|
|
||||||
ValueNamePair vp = null;
|
|
||||||
|
|
||||||
if (listitem != null)
|
|
||||||
vp = (ValueNamePair)listitem.getValue();
|
|
||||||
|
|
||||||
String PaymentRule = vp.getValue();
|
|
||||||
log.info(PaymentRule);
|
log.info(PaymentRule);
|
||||||
|
|
||||||
if (!getChecks(PaymentRule))
|
if (!getChecks(PaymentRule))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
boolean somethingPrinted = false;
|
|
||||||
boolean directPrint = !Ini.isPropertyBool(Ini.P_PRINTPREVIEW);
|
|
||||||
|
|
||||||
// for all checks
|
// for all checks
|
||||||
|
List<File> pdfList = new ArrayList<File>();
|
||||||
for (int i = 0; i < m_checks.length; i++)
|
for (int i = 0; i < m_checks.length; i++)
|
||||||
{
|
{
|
||||||
MPaySelectionCheck check = m_checks[i];
|
MPaySelectionCheck check = m_checks[i];
|
||||||
// ReportCtrl will check BankAccountDoc for PrintFormat
|
// ReportCtrl will check BankAccountDoc for PrintFormat
|
||||||
boolean ok = ReportCtl.startDocumentPrint(ReportEngine.CHECK, check.get_ID(), null, m_WindowNo, directPrint);
|
ReportEngine re = ReportEngine.get(Env.getCtx(), ReportEngine.CHECK, check.get_ID());
|
||||||
if (!somethingPrinted && ok)
|
try
|
||||||
somethingPrinted = true;
|
{
|
||||||
|
File file = File.createTempFile("WPayPrint", null);
|
||||||
|
re.getPDF(file);
|
||||||
|
pdfList.add(file);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Confirm Print and Update BankAccountDoc
|
SimplePDFViewer chequeViewer = null;
|
||||||
if (somethingPrinted && FDialog.ask(m_WindowNo, this, "VPayPrintSuccess?"))
|
try
|
||||||
{
|
{
|
||||||
|
File outFile = File.createTempFile("WPayPrint", null);
|
||||||
|
AEnv.mergePdf(pdfList, outFile);
|
||||||
|
chequeViewer = new SimplePDFViewer(this.getFormName(), new FileInputStream(outFile));
|
||||||
|
chequeViewer.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
|
||||||
|
chequeViewer.setWidth("100%");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update BankAccountDoc
|
||||||
int lastDocumentNo = MPaySelectionCheck.confirmPrint (m_checks, m_batch);
|
int lastDocumentNo = MPaySelectionCheck.confirmPrint (m_checks, m_batch);
|
||||||
if (lastDocumentNo != 0)
|
if (lastDocumentNo != 0)
|
||||||
{
|
{
|
||||||
|
@ -639,26 +529,57 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
.append(" AND PaymentRule='").append(PaymentRule).append("'");
|
.append(" AND PaymentRule='").append(PaymentRule).append("'");
|
||||||
DB.executeUpdate(sb.toString(), null);
|
DB.executeUpdate(sb.toString(), null);
|
||||||
}
|
}
|
||||||
} // confirm
|
|
||||||
|
|
||||||
|
SimplePDFViewer remitViewer = null;
|
||||||
if (FDialog.ask(m_WindowNo, this, "VPayPrintPrintRemittance"))
|
if (FDialog.ask(m_WindowNo, this, "VPayPrintPrintRemittance"))
|
||||||
{
|
{
|
||||||
|
pdfList = new ArrayList<File>();
|
||||||
for (int i = 0; i < m_checks.length; i++)
|
for (int i = 0; i < m_checks.length; i++)
|
||||||
{
|
{
|
||||||
MPaySelectionCheck check = m_checks[i];
|
MPaySelectionCheck check = m_checks[i];
|
||||||
ReportCtl.startDocumentPrint(ReportEngine.REMITTANCE, check.get_ID(), null, m_WindowNo, directPrint);
|
ReportEngine re = ReportEngine.get(Env.getCtx(), ReportEngine.REMITTANCE, check.get_ID());
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File file = File.createTempFile("WPayPrint", null);
|
||||||
|
re.getPDF(file);
|
||||||
|
pdfList.add(file);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File outFile = File.createTempFile("WPayPrint", null);
|
||||||
|
AEnv.mergePdf(pdfList, outFile);
|
||||||
|
String name = Msg.translate(Env.getCtx(), "Remittance");
|
||||||
|
remitViewer = new SimplePDFViewer(this.getFormName() + " - " + name, new FileInputStream(outFile));
|
||||||
|
remitViewer.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
|
||||||
|
remitViewer.setWidth("100%");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
} // remittance
|
} // remittance
|
||||||
|
|
||||||
SessionManager.getAppDesktop().removeWindow();
|
dispose();
|
||||||
|
|
||||||
|
if (chequeViewer != null)
|
||||||
|
SessionManager.getAppDesktop().showWindow(chequeViewer);
|
||||||
|
|
||||||
|
if (remitViewer != null)
|
||||||
|
SessionManager.getAppDesktop().showWindow(remitViewer);
|
||||||
} // cmd_print
|
} // cmd_print
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Get Checks
|
* Get Checks
|
||||||
* @param PaymentRule Payment Rule
|
* @param PaymentRule Payment Rule
|
||||||
* @return true if payments were created
|
* @return true if payments were created
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private boolean getChecks(String PaymentRule)
|
private boolean getChecks(String PaymentRule)
|
||||||
{
|
{
|
||||||
// do we have values
|
// do we have values
|
||||||
|
@ -667,28 +588,19 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
{
|
{
|
||||||
FDialog.error(m_WindowNo, this, "VPayPrintNoRecords",
|
FDialog.error(m_WindowNo, this, "VPayPrintNoRecords",
|
||||||
"(" + Msg.translate(Env.getCtx(), "C_PaySelectionLine_ID") + "=0)");
|
"(" + Msg.translate(Env.getCtx(), "C_PaySelectionLine_ID") + "=0)");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get data
|
// get data
|
||||||
|
int C_PaySelection_ID = fPaySelect.getSelectedItem().toKeyNamePair().getKey();
|
||||||
ListItem listitem = fPaySelect.getSelectedItem();
|
int startDocumentNo = ((Number)fDocumentNo.getValue()).intValue();
|
||||||
|
|
||||||
KeyNamePair kp = null;
|
|
||||||
|
|
||||||
if (listitem != null)
|
|
||||||
kp = (KeyNamePair)listitem.getValue();
|
|
||||||
|
|
||||||
int C_PaySelection_ID = kp.getKey();
|
|
||||||
|
|
||||||
int startDocumentNo = new Integer(fDocumentNo.getValue());
|
|
||||||
|
|
||||||
log.config("C_PaySelection_ID=" + C_PaySelection_ID + ", PaymentRule=" + PaymentRule + ", DocumentNo=" + startDocumentNo);
|
log.config("C_PaySelection_ID=" + C_PaySelection_ID + ", PaymentRule=" + PaymentRule + ", DocumentNo=" + startDocumentNo);
|
||||||
|
//
|
||||||
// get Selections
|
// get Slecetions
|
||||||
m_checks = MPaySelectionCheck.get(C_PaySelection_ID, PaymentRule, startDocumentNo, null);
|
m_checks = MPaySelectionCheck.get(C_PaySelection_ID, PaymentRule, startDocumentNo, null);
|
||||||
|
|
||||||
|
//
|
||||||
if (m_checks == null || m_checks.length == 0)
|
if (m_checks == null || m_checks.length == 0)
|
||||||
{
|
{
|
||||||
FDialog.error(m_WindowNo, this, "VPayPrintNoRecords",
|
FDialog.error(m_WindowNo, this, "VPayPrintNoRecords",
|
||||||
|
@ -696,7 +608,7 @@ public class WPayPrint extends ADForm implements EventListener
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_batch = MPaymentBatch.getForPaySelection (Env.getCtx(), C_PaySelection_ID, null);
|
m_batch = MPaymentBatch.getForPaySelection (Env.getCtx(), C_PaySelection_ID, null);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // getChecks
|
} // getChecks
|
||||||
}
|
|
||||||
|
} // PayPrint
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -101,7 +101,7 @@ public class WPayment extends Window
|
||||||
m_mTab = mTab;
|
m_mTab = mTab;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bDateField = new WDateEditor("DateAcct", false, false, true, DisplayType.Date, "DateAcct");
|
bDateField = new WDateEditor("DateAcct", false, false, true, "DateAcct");
|
||||||
zkInit();
|
zkInit();
|
||||||
m_initOK = dynInit(button); // Null Pointer if order/invoice not saved yet
|
m_initOK = dynInit(button); // Null Pointer if order/invoice not saved yet
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,8 +184,8 @@ public class WTrxMaterial extends ADForm
|
||||||
MLookup mtypeLookup = MLookupFactory.get (ctx, m_WindowNo, 0, 3666, DisplayType.List);
|
MLookup mtypeLookup = MLookupFactory.get (ctx, m_WindowNo, 0, 3666, DisplayType.List);
|
||||||
mtypeField = new WTableDirEditor("MovementType", false, false, true, mtypeLookup);
|
mtypeField = new WTableDirEditor("MovementType", false, false, true, mtypeLookup);
|
||||||
// Dates
|
// Dates
|
||||||
dateFField = new WDateEditor("DateFrom", false, false, true, DisplayType.Date, Msg.getMsg(Env.getCtx(), "DateFrom"));
|
dateFField = new WDateEditor("DateFrom", false, false, true, Msg.getMsg(Env.getCtx(), "DateFrom"));
|
||||||
dateTField = new WDateEditor("DateTo", false, false, true, DisplayType.Date, Msg.getMsg(Env.getCtx(), "DateTo"));
|
dateTField = new WDateEditor("DateTo", false, false, true, Msg.getMsg(Env.getCtx(), "DateTo"));
|
||||||
//
|
//
|
||||||
confirmPanel.addActionListener(this);
|
confirmPanel.addActionListener(this);
|
||||||
statusBar.setStatusLine("");
|
statusBar.setStatusLine("");
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class WPerformanceDetail extends Window
|
||||||
WBarGraph barPanel = new WBarGraph(goal);
|
WBarGraph barPanel = new WBarGraph(goal);
|
||||||
appendChild(barPanel);
|
appendChild(barPanel);
|
||||||
|
|
||||||
SessionManager.getAppDesktop().showWindowInTabPanel(this);
|
this.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
|
||||||
|
SessionManager.getAppDesktop().showWindow(this);
|
||||||
} // PerformanceDetail
|
} // PerformanceDetail
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,14 @@
|
||||||
|
|
||||||
package org.adempiere.webui.component;
|
package org.adempiere.webui.component;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
|
||||||
import org.zkoss.zul.Bandpopup;
|
import org.adempiere.webui.apps.AEnv;
|
||||||
import org.zkoss.zul.Button;
|
import org.zkoss.zul.Decimalbox;
|
||||||
import org.zkoss.zul.Hbox;
|
import org.zkoss.zul.Hbox;
|
||||||
|
import org.zkoss.zul.Popup;
|
||||||
import org.zkoss.zul.Vbox;
|
import org.zkoss.zul.Vbox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +33,7 @@ import org.zkoss.zul.Vbox;
|
||||||
* @date Mar 11, 2007
|
* @date Mar 11, 2007
|
||||||
* @version $Revision: 0.10 $
|
* @version $Revision: 0.10 $
|
||||||
*/
|
*/
|
||||||
public class NumberBox extends Bandbox
|
public class NumberBox extends Panel
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -41,6 +43,9 @@ public class NumberBox extends Bandbox
|
||||||
|
|
||||||
NumberFormat format = null;
|
NumberFormat format = null;
|
||||||
|
|
||||||
|
private Decimalbox decimalBox = null;
|
||||||
|
private Button btn;
|
||||||
|
|
||||||
public NumberBox(boolean integral)
|
public NumberBox(boolean integral)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
@ -50,10 +55,25 @@ public class NumberBox extends Bandbox
|
||||||
|
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
this.setImage("/images/Calculator16.png");
|
decimalBox = new Decimalbox();
|
||||||
|
if (integral)
|
||||||
|
decimalBox.setScale(0);
|
||||||
|
|
||||||
|
btn = new Button();
|
||||||
|
btn.setImage("/images/Calculator16.png");
|
||||||
this.setAction("onKeyPress : return calc.validate('" +
|
this.setAction("onKeyPress : return calc.validate('" +
|
||||||
this.getId() + "'," + integral + ", event);");
|
decimalBox.getId() + "'," + integral + ", event);");
|
||||||
this.appendChild(getBandPopup());
|
|
||||||
|
Popup popup = getCalculatorPopup();
|
||||||
|
btn.setHeight("22px");
|
||||||
|
btn.setWidth("26px");
|
||||||
|
btn.setPopup(popup);
|
||||||
|
appendChild(decimalBox);
|
||||||
|
appendChild(btn);
|
||||||
|
appendChild(popup);
|
||||||
|
|
||||||
|
String style = AEnv.isFirefox2() ? "display: inline" : "display: inline-block";
|
||||||
|
this.setStyle(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFormat(NumberFormat format)
|
public void setFormat(NumberFormat format)
|
||||||
|
@ -61,31 +81,36 @@ public class NumberBox extends Bandbox
|
||||||
this.format = format;
|
this.format = format;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValue(Number value)
|
public void setValue(Object value)
|
||||||
{
|
{
|
||||||
if (format != null)
|
if (value == null)
|
||||||
{
|
decimalBox.setValue(null);
|
||||||
super.setValue(format.format(value));
|
else if (value instanceof BigDecimal)
|
||||||
}
|
decimalBox.setValue((BigDecimal) value);
|
||||||
|
else if (value instanceof Number)
|
||||||
|
decimalBox.setValue(new BigDecimal(((Number)value).doubleValue()));
|
||||||
else
|
else
|
||||||
{
|
decimalBox.setValue(new BigDecimal(value.toString()));
|
||||||
super.setValue(value.toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRawValue(Object value)
|
public BigDecimal getValue()
|
||||||
{
|
{
|
||||||
super.setRawValue(value);
|
return decimalBox.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getText()
|
public String getText()
|
||||||
{
|
{
|
||||||
return super.getText();
|
BigDecimal value = decimalBox.getValue();
|
||||||
|
if (value == null) return null;
|
||||||
|
|
||||||
|
if (format != null)
|
||||||
|
return format.format(value);
|
||||||
|
else
|
||||||
|
return value.toPlainString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValue(String value)
|
public void setValue(String value)
|
||||||
{
|
{
|
||||||
String formattedValue = "";
|
|
||||||
Number numberValue = null;
|
Number numberValue = null;
|
||||||
|
|
||||||
if (format != null)
|
if (format != null)
|
||||||
|
@ -93,38 +118,27 @@ public class NumberBox extends Bandbox
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
numberValue = format.parse(value);
|
numberValue = format.parse(value);
|
||||||
formattedValue = format.format(numberValue);
|
setValue(numberValue);
|
||||||
}
|
}
|
||||||
catch (ParseException e)
|
catch (ParseException e)
|
||||||
{
|
{
|
||||||
formattedValue = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
formattedValue = value;
|
decimalBox.setValue(new BigDecimal(value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.setValue(formattedValue);
|
private Popup getCalculatorPopup()
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
public void setReadonly(boolean readonly)
|
|
||||||
{
|
{
|
||||||
// Due to bug in bandbox - once set readonly, setting to not readonly
|
Popup popup = new Popup();
|
||||||
// does not work
|
|
||||||
super.setDisabled(readonly);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private Bandpopup getBandPopup()
|
|
||||||
{
|
|
||||||
Bandpopup bandPopup = new Bandpopup();
|
|
||||||
|
|
||||||
Vbox vbox = new Vbox();
|
Vbox vbox = new Vbox();
|
||||||
|
|
||||||
txtCalc = new Textbox();
|
txtCalc = new Textbox();
|
||||||
txtCalc.setAction("onKeyPress : return calc.validate('" +
|
txtCalc.setAction("onKeyPress : return calc.validate('" +
|
||||||
this.getId() + "!real','" + txtCalc.getId()
|
decimalBox.getId() + "','" + txtCalc.getId()
|
||||||
+ "'," + integral + ", event);");
|
+ "'," + integral + ", event);");
|
||||||
txtCalc.setMaxlength(250);
|
txtCalc.setMaxlength(250);
|
||||||
txtCalc.setCols(30);
|
txtCalc.setCols(30);
|
||||||
|
@ -252,7 +266,7 @@ public class NumberBox extends Bandbox
|
||||||
Button btnEqual = new Button();
|
Button btnEqual = new Button();
|
||||||
btnEqual.setWidth("30px");
|
btnEqual.setWidth("30px");
|
||||||
btnEqual.setLabel("=");
|
btnEqual.setLabel("=");
|
||||||
btnEqual.setAction("onClick : calc.evaluate('" + this.getId() + "!real','"
|
btnEqual.setAction("onClick : calc.evaluate('" + decimalBox.getId() + "','"
|
||||||
+ txtCalcId + "')");
|
+ txtCalcId + "')");
|
||||||
|
|
||||||
Button btnAdd = new Button();
|
Button btnAdd = new Button();
|
||||||
|
@ -271,7 +285,30 @@ public class NumberBox extends Bandbox
|
||||||
vbox.appendChild(row3);
|
vbox.appendChild(row3);
|
||||||
vbox.appendChild(row4);
|
vbox.appendChild(row4);
|
||||||
|
|
||||||
bandPopup.appendChild(vbox);
|
popup.appendChild(vbox);
|
||||||
return bandPopup;
|
return popup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isIntegral() {
|
||||||
|
return integral;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntegral(boolean integral) {
|
||||||
|
this.integral = integral;
|
||||||
|
if (integral)
|
||||||
|
decimalBox.setScale(0);
|
||||||
|
else
|
||||||
|
decimalBox.setScale(Decimalbox.AUTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnabled(boolean enabled)
|
||||||
|
{
|
||||||
|
decimalBox.setReadonly(!enabled);
|
||||||
|
btn.setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEnabled()
|
||||||
|
{
|
||||||
|
return decimalBox.isReadonly();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,8 +287,7 @@ public class WListItemRenderer implements ListitemRenderer, EventListener, Listi
|
||||||
numberbox.setFormat(format);
|
numberbox.setFormat(format);
|
||||||
numberbox.setValue((BigDecimal)field);
|
numberbox.setValue((BigDecimal)field);
|
||||||
numberbox.setWidth("100px");
|
numberbox.setWidth("100px");
|
||||||
numberbox.setButtonVisible(true);
|
numberbox.setEnabled(true);
|
||||||
numberbox.setReadonly(false);
|
|
||||||
numberbox.setStyle("text-align:right; "
|
numberbox.setStyle("text-align:right; "
|
||||||
+ listcell.getStyle());
|
+ listcell.getStyle());
|
||||||
numberbox.addEventListener(Events.ON_CHANGE, this);
|
numberbox.addEventListener(Events.ON_CHANGE, this);
|
||||||
|
@ -578,7 +577,7 @@ public class WListItemRenderer implements ListitemRenderer, EventListener, Listi
|
||||||
}
|
}
|
||||||
else if (source instanceof NumberBox)
|
else if (source instanceof NumberBox)
|
||||||
{
|
{
|
||||||
value = new BigDecimal(((NumberBox)source).getValue());
|
value = ((NumberBox)source).getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(value != null)
|
if(value != null)
|
||||||
|
|
|
@ -35,6 +35,10 @@ public class Window extends org.zkoss.zul.Window
|
||||||
|
|
||||||
public static final String MODE_EMBEDDED = "embedded";
|
public static final String MODE_EMBEDDED = "embedded";
|
||||||
|
|
||||||
|
public static final String MODE_HIGHLIGHTED = "highlighted";
|
||||||
|
|
||||||
|
public static final String MODE_KEY = "mode";
|
||||||
|
|
||||||
public Window()
|
public Window()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
|
|
@ -46,6 +46,10 @@ public class WDateEditor extends WEditor
|
||||||
|
|
||||||
private Timestamp oldValue = new Timestamp(0);
|
private Timestamp oldValue = new Timestamp(0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param gridField
|
||||||
|
*/
|
||||||
public WDateEditor(GridField gridField)
|
public WDateEditor(GridField gridField)
|
||||||
{
|
{
|
||||||
super(new Datebox(), gridField);
|
super(new Datebox(), gridField);
|
||||||
|
@ -83,16 +87,14 @@ public class WDateEditor extends WEditor
|
||||||
* @param mandatory
|
* @param mandatory
|
||||||
* @param readonly
|
* @param readonly
|
||||||
* @param updateable
|
* @param updateable
|
||||||
* @param displayType
|
* @param title
|
||||||
* @param label
|
|
||||||
*/
|
*/
|
||||||
public WDateEditor(String columnName, boolean mandatory, boolean readonly, boolean updateable,
|
public WDateEditor(String columnName, boolean mandatory, boolean readonly, boolean updateable,
|
||||||
int displayType, String label) {
|
String title)
|
||||||
//TODO: support for displayType
|
{
|
||||||
super(new Datebox(), columnName, label, null, mandatory, readonly, updateable);
|
super(new Datebox(), columnName, title, null, mandatory, readonly, updateable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onEvent(Event event)
|
public void onEvent(Event event)
|
||||||
{
|
{
|
||||||
Date date = getComponent().getValue();
|
Date date = getComponent().getValue();
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class WNumberEditor extends WEditor
|
||||||
|
|
||||||
public static final int MAX_DISPLAY_LENGTH = 20;
|
public static final int MAX_DISPLAY_LENGTH = 20;
|
||||||
|
|
||||||
private String oldValue;
|
private BigDecimal oldValue;
|
||||||
|
|
||||||
private boolean mandatory = false;
|
private boolean mandatory = false;
|
||||||
|
|
||||||
|
@ -95,11 +95,8 @@ public class WNumberEditor extends WEditor
|
||||||
{
|
{
|
||||||
if (gridField != null)
|
if (gridField != null)
|
||||||
{
|
{
|
||||||
getComponent().setMaxlength(gridField.getFieldLength());
|
|
||||||
getComponent().setTooltiptext(gridField.getDescription());
|
getComponent().setTooltiptext(gridField.getDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
getComponent().setCols(MAX_DISPLAY_LENGTH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,14 +105,8 @@ public class WNumberEditor extends WEditor
|
||||||
*/
|
*/
|
||||||
public void onEvent(Event event)
|
public void onEvent(Event event)
|
||||||
{
|
{
|
||||||
String newValue = getComponent().getValue();
|
BigDecimal newValue = getComponent().getValue();
|
||||||
BigDecimal oldNumber = null;
|
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||||
if (oldValue != null && oldValue.trim().length() > 0)
|
|
||||||
oldNumber = new BigDecimal(oldValue);
|
|
||||||
BigDecimal newNumber = null;
|
|
||||||
if (newValue != null && newValue.trim().length() > 0)
|
|
||||||
newNumber = new BigDecimal(newValue);
|
|
||||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldNumber, newNumber);
|
|
||||||
super.fireValueChange(changeEvent);
|
super.fireValueChange(changeEvent);
|
||||||
oldValue = newValue;
|
oldValue = newValue;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +129,7 @@ public class WNumberEditor extends WEditor
|
||||||
@Override
|
@Override
|
||||||
public String getDisplay()
|
public String getDisplay()
|
||||||
{
|
{
|
||||||
return getComponent().getValue();
|
return getComponent().getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -162,14 +153,7 @@ public class WNumberEditor extends WEditor
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Object value)
|
public void setValue(Object value)
|
||||||
{
|
{
|
||||||
if (value != null)
|
getComponent().setValue(value);
|
||||||
{
|
|
||||||
getComponent().setValue(value.toString());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
getComponent().setValue("0");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -331,7 +331,7 @@ ContextMenuListener, IZoomableEditor
|
||||||
@Override
|
@Override
|
||||||
public void dynamicDisplay()
|
public void dynamicDisplay()
|
||||||
{
|
{
|
||||||
if (isReadWrite() && (!lookup.isValidated() || !lookup.isLoaded()))
|
if (isReadWrite() && (lookup != null) && (!lookup.isValidated() || !lookup.isLoaded()))
|
||||||
this.actionRefresh();
|
this.actionRefresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,174 @@
|
||||||
|
/******************************************************************************
|
||||||
|
* Copyright (C) 2008 Low Heng Sin *
|
||||||
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
* by the Free Software Foundation. This program is distributed in the hope *
|
||||||
|
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||||
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
|
* See the GNU General Public License for more details. *
|
||||||
|
* You should have received a copy of the GNU General Public License along *
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
package org.adempiere.webui.editor;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.adempiere.webui.event.ValueChangeEvent;
|
||||||
|
import org.compiere.model.GridField;
|
||||||
|
import org.compiere.util.CLogger;
|
||||||
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zk.ui.event.Events;
|
||||||
|
import org.zkoss.zul.Timebox;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Low Heng Sin
|
||||||
|
*/
|
||||||
|
public class WTimeEditor extends WEditor
|
||||||
|
{
|
||||||
|
private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE};
|
||||||
|
private static final CLogger logger;
|
||||||
|
|
||||||
|
static
|
||||||
|
{
|
||||||
|
logger = CLogger.getCLogger(WDateEditor.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Timestamp oldValue = new Timestamp(0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param gridField
|
||||||
|
*/
|
||||||
|
public WTimeEditor(GridField gridField)
|
||||||
|
{
|
||||||
|
super(new Timebox(), gridField);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param columnName
|
||||||
|
* @param mandatory
|
||||||
|
* @param readonly
|
||||||
|
* @param updateable
|
||||||
|
* @param title
|
||||||
|
*/
|
||||||
|
public WTimeEditor(String columnName, boolean mandatory, boolean readonly, boolean updateable,
|
||||||
|
String title)
|
||||||
|
{
|
||||||
|
super(new Timebox(), columnName, title, null, mandatory, readonly, updateable);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for use if a grid field is unavailable
|
||||||
|
*
|
||||||
|
* @param label
|
||||||
|
* column name (not displayed)
|
||||||
|
* @param description
|
||||||
|
* description of component
|
||||||
|
* @param mandatory
|
||||||
|
* whether a selection must be made
|
||||||
|
* @param readonly
|
||||||
|
* whether or not the editor is read only
|
||||||
|
* @param updateable
|
||||||
|
* whether the editor contents can be changed
|
||||||
|
*/
|
||||||
|
public WTimeEditor (String label, String description, boolean mandatory, boolean readonly, boolean updateable)
|
||||||
|
{
|
||||||
|
super(new Timebox(), label, description, mandatory, readonly, updateable);
|
||||||
|
setColumnName("Time");
|
||||||
|
}
|
||||||
|
|
||||||
|
public WTimeEditor()
|
||||||
|
{
|
||||||
|
this("Time", "Time", false, false, true);
|
||||||
|
} // VDate
|
||||||
|
|
||||||
|
public void onEvent(Event event)
|
||||||
|
{
|
||||||
|
Date date = getComponent().getValue();
|
||||||
|
Timestamp newValue = null;
|
||||||
|
|
||||||
|
if (date != null)
|
||||||
|
{
|
||||||
|
newValue = new Timestamp(date.getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||||
|
super.fireValueChange(changeEvent);
|
||||||
|
oldValue = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplay()
|
||||||
|
{
|
||||||
|
// Elaine 2008/07/29
|
||||||
|
return getComponent().getText();
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getValue()
|
||||||
|
{
|
||||||
|
// Elaine 2008/07/25
|
||||||
|
if(getComponent().getValue() == null) return null;
|
||||||
|
return new Timestamp(getComponent().getValue().getTime());
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isMandatory()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMandatory(boolean mandatory)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setValue(Object value)
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
oldValue = null;
|
||||||
|
getComponent().setValue(null);
|
||||||
|
}
|
||||||
|
else if (value instanceof Timestamp)
|
||||||
|
{
|
||||||
|
getComponent().setValue((Timestamp)value);
|
||||||
|
oldValue = (Timestamp)value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logger.log(Level.SEVERE, "New field value is not of type timestamp");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Timebox getComponent() {
|
||||||
|
return (Timebox) component;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isReadWrite() {
|
||||||
|
return !getComponent().isReadonly();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setReadWrite(boolean readWrite) {
|
||||||
|
getComponent().setReadonly(!readWrite);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getEvents()
|
||||||
|
{
|
||||||
|
return LISTENER_EVENTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -105,6 +105,9 @@ public class WebEditorFactory
|
||||||
/** Date */
|
/** Date */
|
||||||
else if (DisplayType.isDate(displayType))
|
else if (DisplayType.isDate(displayType))
|
||||||
{
|
{
|
||||||
|
if (displayType == DisplayType.Time)
|
||||||
|
editor = new WTimeEditor(gridField);
|
||||||
|
else
|
||||||
editor = new WDateEditor(gridField);
|
editor = new WDateEditor(gridField);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -952,11 +952,10 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
||||||
if (dialog.isValid()) {
|
if (dialog.isValid()) {
|
||||||
dialog.setPosition("center");
|
dialog.setPosition("center");
|
||||||
try {
|
try {
|
||||||
|
dialog.setPage(this.getComponent().getPage());
|
||||||
dialog.doModal();
|
dialog.doModal();
|
||||||
}
|
}
|
||||||
catch (InterruptedException e) {
|
catch (InterruptedException e) {
|
||||||
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1337,22 +1336,16 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
||||||
if (m_uiLocked) return;
|
if (m_uiLocked) return;
|
||||||
|
|
||||||
m_uiLocked = true;
|
m_uiLocked = true;
|
||||||
boolean notPrint = pi != null
|
|
||||||
&& pi.getAD_Process_ID() != curTab.getAD_Process_ID()
|
|
||||||
&& pi.isReportingProcess() == false;
|
|
||||||
//
|
|
||||||
// Process Result
|
|
||||||
if (notPrint) // refresh if not print
|
|
||||||
{
|
|
||||||
if (Executions.getCurrent() != null)
|
if (Executions.getCurrent() != null)
|
||||||
Clients.showBusy("Processing...", true);
|
Clients.showBusy(null, true);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
//get full control of desktop
|
//get full control of desktop
|
||||||
Executions.activate(getComponent().getDesktop());
|
Executions.activate(getComponent().getDesktop());
|
||||||
try {
|
try {
|
||||||
Clients.showBusy("Processing...", true);
|
Clients.showBusy(null, true);
|
||||||
} catch(Error ex){
|
} catch(Error ex){
|
||||||
throw ex;
|
throw ex;
|
||||||
} finally{
|
} finally{
|
||||||
|
@ -1364,7 +1357,6 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void unlockUI(ProcessInfo pi) {
|
public void unlockUI(ProcessInfo pi) {
|
||||||
if (!m_uiLocked) return;
|
if (!m_uiLocked) return;
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class SessionContextListener implements ExecutionInit,
|
||||||
if (parent == null)
|
if (parent == null)
|
||||||
{
|
{
|
||||||
exec.removeAttribute(SESSION_CTX);
|
exec.removeAttribute(SESSION_CTX);
|
||||||
ServerContext.dispose();
|
// ServerContext.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -239,7 +239,7 @@ public class WAssignmentDialog extends Window implements EventListener
|
||||||
confirmPanel.getButton("Cancel").setVisible(readWrite);
|
confirmPanel.getButton("Cancel").setVisible(readWrite);
|
||||||
fResource.setEnabled(readWrite);
|
fResource.setEnabled(readWrite);
|
||||||
fDateFrom.setReadonly(!readWrite);
|
fDateFrom.setReadonly(!readWrite);
|
||||||
fQty.setReadonly(!readWrite);
|
fQty.setEnabled(readWrite);
|
||||||
|
|
||||||
m_setting = false;
|
m_setting = false;
|
||||||
} // dynInit
|
} // dynInit
|
||||||
|
@ -265,7 +265,7 @@ public class WAssignmentDialog extends Window implements EventListener
|
||||||
Calendar date = new GregorianCalendar();
|
Calendar date = new GregorianCalendar();
|
||||||
getDateAndTimeFrom(date);
|
getDateAndTimeFrom(date);
|
||||||
Timestamp assignDateFrom = new Timestamp(date.getTimeInMillis());
|
Timestamp assignDateFrom = new Timestamp(date.getTimeInMillis());
|
||||||
BigDecimal qty = new BigDecimal(fQty.getValue());
|
BigDecimal qty = fQty.getValue();
|
||||||
KeyNamePair uom = (KeyNamePair)m_lookup.get(fResource.getSelectedItem());
|
KeyNamePair uom = (KeyNamePair)m_lookup.get(fResource.getSelectedItem());
|
||||||
int minutes = MUOMConversion.convertToMinutes(Env.getCtx(), uom.getKey(), qty);
|
int minutes = MUOMConversion.convertToMinutes(Env.getCtx(), uom.getKey(), qty);
|
||||||
Timestamp assignDateTo = TimeUtil.addMinutess(assignDateFrom, minutes);
|
Timestamp assignDateTo = TimeUtil.addMinutess(assignDateFrom, minutes);
|
||||||
|
@ -339,8 +339,8 @@ public class WAssignmentDialog extends Window implements EventListener
|
||||||
Timestamp assignDateFrom = new Timestamp(date.getTimeInMillis());
|
Timestamp assignDateFrom = new Timestamp(date.getTimeInMillis());
|
||||||
if (assignDateFrom != null)
|
if (assignDateFrom != null)
|
||||||
m_mAssignment.setAssignDateFrom (assignDateFrom);
|
m_mAssignment.setAssignDateFrom (assignDateFrom);
|
||||||
if (fQty.getValue() != null && fQty.getValue().trim().length() > 0) {
|
if (fQty.getValue() != null) {
|
||||||
BigDecimal qty = new BigDecimal(fQty.getValue());
|
BigDecimal qty = fQty.getValue();
|
||||||
m_mAssignment.setQty(qty);
|
m_mAssignment.setQty(qty);
|
||||||
}
|
}
|
||||||
m_mAssignment.setName((String)fName.getValue());
|
m_mAssignment.setName((String)fName.getValue());
|
||||||
|
|
|
@ -486,7 +486,7 @@ public class WPAttributeDialog extends Window implements EventListener
|
||||||
editor.setValue(Env.ZERO);
|
editor.setValue(Env.ZERO);
|
||||||
row.appendChild(editor);
|
row.appendChild(editor);
|
||||||
if (readOnly)
|
if (readOnly)
|
||||||
editor.setReadonly(true);
|
editor.setEnabled(false);
|
||||||
else
|
else
|
||||||
m_editors.add (editor);
|
m_editors.add (editor);
|
||||||
}
|
}
|
||||||
|
@ -773,7 +773,7 @@ public class WPAttributeDialog extends Window implements EventListener
|
||||||
else if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributes[i].getAttributeValueType()))
|
else if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributes[i].getAttributeValueType()))
|
||||||
{
|
{
|
||||||
NumberBox editor = (NumberBox)m_editors.get(i);
|
NumberBox editor = (NumberBox)m_editors.get(i);
|
||||||
BigDecimal value = new BigDecimal(editor.getValue());
|
BigDecimal value = editor.getValue();
|
||||||
log.fine(attributes[i].getName() + "=" + value);
|
log.fine(attributes[i].getName() + "=" + value);
|
||||||
if (attributes[i].isMandatory() && value == null)
|
if (attributes[i].isMandatory() && value == null)
|
||||||
mandatory += " - " + attributes[i].getName();
|
mandatory += " - " + attributes[i].getName();
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class ZkReportViewerProvider implements ReportViewerProvider {
|
||||||
viewer.setClosable(true);
|
viewer.setClosable(true);
|
||||||
viewer.setWidth("95%");
|
viewer.setWidth("95%");
|
||||||
|
|
||||||
SessionManager.getAppDesktop().showWindowInTabPanel(viewer);
|
viewer.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
|
||||||
// AEnv.showWindow(viewer);
|
SessionManager.getAppDesktop().showWindow(viewer);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue