IDEMPIERE-5132 Enable filling Purchase Order in Material Receipt (#1099)

This commit is contained in:
Carlos Ruiz 2022-01-03 08:04:55 +01:00 committed by GitHub
parent 75bc20b404
commit 7c116c2dd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 50 deletions

View File

@ -0,0 +1,19 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-5132 Enable filling Purchase Order in Material Receipt
-- Dec 29, 2021, 7:26:07 PM CET
UPDATE AD_Field SET DisplayLogic=NULL, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@C_Order_ID@!0', IsToolbarButton=NULL,Updated=TO_DATE('2021-12-29 19:26:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3490
;
-- Dec 30, 2021, 11:44:51 AM CET
UPDATE AD_Field SET IsReadOnly='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2021-12-30 11:44:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3490
;
-- Dec 30, 2021, 12:12:11 PM CET
UPDATE AD_Field SET DisplayLogic=NULL, IsReadOnly='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@C_OrderLine_ID@!0', IsToolbarButton=NULL,Updated=TO_DATE('2021-12-30 12:12:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3521
;
SELECT register_migration_script('202112291927_IDEMPIERE-5132.sql') FROM dual
;

View File

@ -0,0 +1,16 @@
-- IDEMPIERE-5132 Enable filling Purchase Order in Material Receipt
-- Dec 29, 2021, 7:26:07 PM CET
UPDATE AD_Field SET DisplayLogic=NULL, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@C_Order_ID@!0', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-12-29 19:26:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3490
;
-- Dec 30, 2021, 11:44:51 AM CET
UPDATE AD_Field SET IsReadOnly='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-12-30 11:44:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3490
;
-- Dec 30, 2021, 12:12:11 PM CET
UPDATE AD_Field SET DisplayLogic=NULL, IsReadOnly='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@C_OrderLine_ID@!0', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-12-30 12:12:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3521
;
SELECT register_migration_script('202112291927_IDEMPIERE-5132.sql') FROM dual
;

View File

@ -232,53 +232,12 @@ public class WCreateFromShipmentUI extends CreateFromShipment implements EventLi
if (m_actionActive)
return;
m_actionActive = true;
/*
// Order
if (e.getTarget().equals(orderField))
{
ListItem li = orderField.getSelectedItem();
int C_Order_ID = 0;
if (li != null && li.getValue() != null)
C_Order_ID = ((Integer) li.getValue()).intValue();
// set Invoice, RMA and Shipment to Null
rmaField.setSelectedIndex(-1);
//shipmentField.setSelectedIndex(-1);
loadOrder(C_Order_ID, true);
}
// Shipment
else if (e.getTarget().equals(invoiceField))
{
ListItem li = shipmentField.getSelectedItem();
int M_InOut_ID = 0;
if (li != null && li.getValue() != null)
M_InOut_ID = ((Integer) li.getValue()).intValue();
// set Order, RMA and Invoice to Null
orderField.setSelectedIndex(-1);
rmaField.setSelectedIndex(-1);
loadShipment(M_InOut_ID);
}
// RMA
else if (e.getTarget().equals(rmaField))
{
ListItem li = rmaField.getSelectedItem();
int M_RMA_ID = 0;
if (li != null && li.getValue() != null)
M_RMA_ID = ((Integer) li.getValue()).intValue();
// set Order and Invoice to Null
orderField.setSelectedIndex(-1);
//shipmentField.setSelectedIndex(-1);
loadRMA(M_RMA_ID);
}
m_actionActive = false;
*/
// Order
if (e.getTarget().equals(orderField))
{
KeyNamePair pp = orderField.getSelectedItem().toKeyNamePair();
if (pp == null || pp.getKey() == 0)
;
else
if (pp != null && pp.getKey() > 0)
{
int C_Order_ID = pp.getKey();
// set Invoice and Shipment to Null
@ -291,9 +250,7 @@ public class WCreateFromShipmentUI extends CreateFromShipment implements EventLi
else if (e.getTarget().equals(invoiceField))
{
KeyNamePair pp = invoiceField.getSelectedItem().toKeyNamePair();
if (pp == null || pp.getKey() == 0)
;
else
if (pp != null && pp.getKey() > 0)
{
int C_Invoice_ID = pp.getKey();
// set Order and Shipment to Null
@ -306,9 +263,7 @@ public class WCreateFromShipmentUI extends CreateFromShipment implements EventLi
else if (e.getTarget().equals(rmaField))
{
KeyNamePair pp = rmaField.getSelectedItem().toKeyNamePair();
if (pp == null || pp.getKey() == 0)
;
else
if (pp != null && pp.getKey() > 0)
{
int M_RMA_ID = pp.getKey();
// set Order and Shipment to Null
@ -460,7 +415,17 @@ public class WCreateFromShipmentUI extends CreateFromShipment implements EventLi
for(KeyNamePair knp : list)
orderField.addItem(knp);
orderField.setSelectedIndex(0);
int C_Order_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_Order_ID");
if (C_Order_ID > 0) {
orderField.setValue(Integer.valueOf(C_Order_ID));
if (orderField.getSelectedItem() != null) { // in case the order is not in the list, f.e. the BP was changed
KeyNamePair knpo = orderField.getSelectedItem().toKeyNamePair();
if (knpo != null && knpo.getKey() > 0)
loadOrder(knpo.getKey(), false, locatorField.getValue()!=null?((Integer)locatorField.getValue()).intValue():0);
}
} else {
orderField.setSelectedIndex(0);
}
orderField.addActionListener(this);
initBPDetails(C_BPartner_ID);