hg merge release-1.0c (merge release1 into release2)
This commit is contained in:
commit
9cecab37f3
|
@ -1639,6 +1639,7 @@ from c_acctprocessor
|
||||||
where not exists (select 1 from ad_schedule where
|
where not exists (select 1 from ad_schedule where
|
||||||
coalesce(c_acctprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
coalesce(c_acctprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
||||||
coalesce(c_acctprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
coalesce(c_acctprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
||||||
|
and ad_schedule.scheduletype='F'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
@ -1653,6 +1654,7 @@ from ad_alertprocessor
|
||||||
where not exists (select 1 from ad_schedule where
|
where not exists (select 1 from ad_schedule where
|
||||||
coalesce(ad_alertprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
coalesce(ad_alertprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
||||||
coalesce(ad_alertprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
coalesce(ad_alertprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
||||||
|
and ad_schedule.scheduletype='F'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
@ -1667,6 +1669,7 @@ from r_requestprocessor
|
||||||
where not exists (select 1 from ad_schedule where
|
where not exists (select 1 from ad_schedule where
|
||||||
coalesce(r_requestprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
coalesce(r_requestprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
||||||
coalesce(r_requestprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
coalesce(r_requestprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
||||||
|
and ad_schedule.scheduletype='F'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
@ -1681,6 +1684,7 @@ from ad_workflowprocessor
|
||||||
where not exists (select 1 from ad_schedule where
|
where not exists (select 1 from ad_schedule where
|
||||||
coalesce(ad_workflowprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
coalesce(ad_workflowprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
||||||
coalesce(ad_workflowprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
coalesce(ad_workflowprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
||||||
|
and ad_schedule.scheduletype='F'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
|
@ -1639,6 +1639,7 @@ from c_acctprocessor
|
||||||
where not exists (select 1 from ad_schedule where
|
where not exists (select 1 from ad_schedule where
|
||||||
coalesce(c_acctprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
coalesce(c_acctprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
||||||
coalesce(c_acctprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
coalesce(c_acctprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
||||||
|
and ad_schedule.scheduletype='F'
|
||||||
)
|
)
|
||||||
) as x
|
) as x
|
||||||
;
|
;
|
||||||
|
@ -1653,6 +1654,7 @@ from ad_alertprocessor
|
||||||
where not exists (select 1 from ad_schedule where
|
where not exists (select 1 from ad_schedule where
|
||||||
coalesce(ad_alertprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
coalesce(ad_alertprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
||||||
coalesce(ad_alertprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
coalesce(ad_alertprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
||||||
|
and ad_schedule.scheduletype='F'
|
||||||
)
|
)
|
||||||
) as x
|
) as x
|
||||||
;
|
;
|
||||||
|
@ -1667,6 +1669,7 @@ from r_requestprocessor
|
||||||
where not exists (select 1 from ad_schedule where
|
where not exists (select 1 from ad_schedule where
|
||||||
coalesce(r_requestprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
coalesce(r_requestprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
||||||
coalesce(r_requestprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
coalesce(r_requestprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
||||||
|
and ad_schedule.scheduletype='F'
|
||||||
)
|
)
|
||||||
) as x
|
) as x
|
||||||
;
|
;
|
||||||
|
@ -1681,6 +1684,7 @@ from ad_workflowprocessor
|
||||||
where not exists (select 1 from ad_schedule where
|
where not exists (select 1 from ad_schedule where
|
||||||
coalesce(ad_workflowprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
coalesce(ad_workflowprocessor.frequencytype,' ') =coalesce(ad_schedule.frequencytype,' ') and
|
||||||
coalesce(ad_workflowprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
coalesce(ad_workflowprocessor.frequency,-1) =coalesce(ad_schedule.frequency,-1)
|
||||||
|
and ad_schedule.scheduletype='F'
|
||||||
)
|
)
|
||||||
) as x
|
) as x
|
||||||
;
|
;
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
SET SQLBLANKLINES ON
|
||||||
|
SET DEFINE OFF
|
||||||
|
|
||||||
|
-- Feb 11, 2014 5:56:46 PM COT
|
||||||
|
-- IDEMPIERE-1724 Field C_Charge_ID in table C_OrderLine has wrong dynamic Validation
|
||||||
|
UPDATE AD_Column SET AD_Val_Rule_ID=52030,Updated=TO_DATE('2014-02-11 17:56:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3050
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('201402111757_IDEMPIERE-1724.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
SET SQLBLANKLINES ON
|
||||||
|
SET DEFINE OFF
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:34:30 AM COT
|
||||||
|
-- IDEMPIERE-1755 when copy a user some field should reset
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:34:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200458
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:35:12 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:35:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200405
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:35:19 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:35:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200408
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:35:23 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:35:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200407
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:35:46 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:35:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200406
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:35:55 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:35:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200456
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:03 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:36:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200404
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:14 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:36:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200409
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:31 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:36:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=417
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:38 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:36:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=61756
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:43 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:36:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200457
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:51 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2014-02-15 11:36:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=52066
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('201402151138_IDEMPIERE-1755.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
-- Feb 11, 2014 5:56:46 PM COT
|
||||||
|
-- IDEMPIERE-1724 Field C_Charge_ID in table C_OrderLine has wrong dynamic Validation
|
||||||
|
UPDATE AD_Column SET AD_Val_Rule_ID=52030,Updated=TO_TIMESTAMP('2014-02-11 17:56:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3050
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('201402111757_IDEMPIERE-1724.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
-- Feb 15, 2014 11:34:30 AM COT
|
||||||
|
-- IDEMPIERE-1755 when copy a user some field should reset
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:34:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200458
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:35:12 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:35:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200405
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:35:19 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:35:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200408
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:35:23 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:35:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200407
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:35:46 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:35:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200406
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:35:55 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:35:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200456
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:03 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:36:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200404
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:14 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:36:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200409
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:31 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:36:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=417
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:38 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:36:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=61756
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:43 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:36:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200457
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Feb 15, 2014 11:36:51 AM COT
|
||||||
|
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2014-02-15 11:36:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=52066
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('201402151138_IDEMPIERE-1755.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class CalloutRMA extends CalloutEngine {
|
||||||
invoice.getDateInvoiced(), invoice.getDateInvoiced(),
|
invoice.getDateInvoiced(), invoice.getDateInvoiced(),
|
||||||
AD_Org_ID, rma.getShipment().getM_Warehouse_ID(),
|
AD_Org_ID, rma.getShipment().getM_Warehouse_ID(),
|
||||||
invoice.getC_BPartner_Location_ID(), // should be bill to
|
invoice.getC_BPartner_Location_ID(), // should be bill to
|
||||||
invoice.getC_BPartner_Location_ID(), rma.isSOTrx());
|
invoice.getC_BPartner_Location_ID(), rma.isSOTrx(), null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -168,7 +168,7 @@ public class CalloutRMA extends CalloutEngine {
|
||||||
order.getDateOrdered(), order.getDateOrdered(),
|
order.getDateOrdered(), order.getDateOrdered(),
|
||||||
AD_Org_ID, order.getM_Warehouse_ID(),
|
AD_Org_ID, order.getM_Warehouse_ID(),
|
||||||
order.getC_BPartner_Location_ID(), // should be bill to
|
order.getC_BPartner_Location_ID(), // should be bill to
|
||||||
order.getC_BPartner_Location_ID(), rma.isSOTrx());
|
order.getC_BPartner_Location_ID(), rma.isSOTrx(), null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return "No Invoice/Order found the Shipment/Receipt associated";
|
return "No Invoice/Order found the Shipment/Receipt associated";
|
||||||
|
|
|
@ -477,7 +477,7 @@ public class CalloutInvoice extends CalloutEngine
|
||||||
//
|
//
|
||||||
int C_Tax_ID = Tax.get(ctx, M_Product_ID, C_Charge_ID, billDate, shipDate,
|
int C_Tax_ID = Tax.get(ctx, M_Product_ID, C_Charge_ID, billDate, shipDate,
|
||||||
AD_Org_ID, M_Warehouse_ID, billC_BPartner_Location_ID, shipC_BPartner_Location_ID,
|
AD_Org_ID, M_Warehouse_ID, billC_BPartner_Location_ID, shipC_BPartner_Location_ID,
|
||||||
Env.getContext(ctx, WindowNo, "IsSOTrx").equals("Y"));
|
Env.getContext(ctx, WindowNo, "IsSOTrx").equals("Y"), null);
|
||||||
if (log.isLoggable(Level.INFO)) log.info("Tax ID=" + C_Tax_ID);
|
if (log.isLoggable(Level.INFO)) log.info("Tax ID=" + C_Tax_ID);
|
||||||
//
|
//
|
||||||
if (C_Tax_ID == 0)
|
if (C_Tax_ID == 0)
|
||||||
|
|
|
@ -323,7 +323,7 @@ public class CalloutInvoiceBatch extends CalloutEngine
|
||||||
//
|
//
|
||||||
int C_Tax_ID = Tax.get(ctx, 0, C_Charge_ID, billDate, shipDate,
|
int C_Tax_ID = Tax.get(ctx, 0, C_Charge_ID, billDate, shipDate,
|
||||||
AD_Org_ID, M_Warehouse_ID, C_BPartner_Location_ID, C_BPartner_Location_ID,
|
AD_Org_ID, M_Warehouse_ID, C_BPartner_Location_ID, C_BPartner_Location_ID,
|
||||||
Env.getContext(ctx, WindowNo, "IsSOTrx").equals("Y"));
|
Env.getContext(ctx, WindowNo, "IsSOTrx").equals("Y"), null);
|
||||||
if (log.isLoggable(Level.INFO)) log.info("Tax ID=" + C_Tax_ID);
|
if (log.isLoggable(Level.INFO)) log.info("Tax ID=" + C_Tax_ID);
|
||||||
//
|
//
|
||||||
if (C_Tax_ID == 0)
|
if (C_Tax_ID == 0)
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ public class CalloutOrder extends CalloutEngine
|
||||||
//
|
//
|
||||||
int C_Tax_ID = Tax.get (ctx, M_Product_ID, C_Charge_ID, billDate, shipDate,
|
int C_Tax_ID = Tax.get (ctx, M_Product_ID, C_Charge_ID, billDate, shipDate,
|
||||||
AD_Org_ID, M_Warehouse_ID, billC_BPartner_Location_ID, shipC_BPartner_Location_ID,
|
AD_Org_ID, M_Warehouse_ID, billC_BPartner_Location_ID, shipC_BPartner_Location_ID,
|
||||||
"Y".equals(Env.getContext(ctx, WindowNo, "IsSOTrx")));
|
"Y".equals(Env.getContext(ctx, WindowNo, "IsSOTrx")), null);
|
||||||
if (log.isLoggable(Level.INFO)) log.info("Tax ID=" + C_Tax_ID);
|
if (log.isLoggable(Level.INFO)) log.info("Tax ID=" + C_Tax_ID);
|
||||||
//
|
//
|
||||||
if (C_Tax_ID == 0)
|
if (C_Tax_ID == 0)
|
||||||
|
|
|
@ -437,7 +437,7 @@ public class MInvoiceLine extends X_C_InvoiceLine
|
||||||
int C_Tax_ID = Tax.get(getCtx(), getM_Product_ID(), getC_Charge_ID() , m_DateInvoiced, m_DateInvoiced,
|
int C_Tax_ID = Tax.get(getCtx(), getM_Product_ID(), getC_Charge_ID() , m_DateInvoiced, m_DateInvoiced,
|
||||||
getAD_Org_ID(), M_Warehouse_ID,
|
getAD_Org_ID(), M_Warehouse_ID,
|
||||||
m_C_BPartner_Location_ID, // should be bill to
|
m_C_BPartner_Location_ID, // should be bill to
|
||||||
m_C_BPartner_Location_ID, m_IsSOTrx);
|
m_C_BPartner_Location_ID, m_IsSOTrx, get_TrxName());
|
||||||
if (C_Tax_ID == 0)
|
if (C_Tax_ID == 0)
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "No Tax found");
|
log.log(Level.SEVERE, "No Tax found");
|
||||||
|
|
|
@ -341,7 +341,7 @@ public class MOrderLine extends X_C_OrderLine
|
||||||
int ii = Tax.get(getCtx(), getM_Product_ID(), getC_Charge_ID(), getDateOrdered(), getDateOrdered(),
|
int ii = Tax.get(getCtx(), getM_Product_ID(), getC_Charge_ID(), getDateOrdered(), getDateOrdered(),
|
||||||
getAD_Org_ID(), getM_Warehouse_ID(),
|
getAD_Org_ID(), getM_Warehouse_ID(),
|
||||||
getC_BPartner_Location_ID(), // should be bill to
|
getC_BPartner_Location_ID(), // should be bill to
|
||||||
getC_BPartner_Location_ID(), m_IsSOTrx);
|
getC_BPartner_Location_ID(), m_IsSOTrx, get_TrxName());
|
||||||
if (ii == 0)
|
if (ii == 0)
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "No Tax found");
|
log.log(Level.SEVERE, "No Tax found");
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class MRMALine extends X_M_RMALine
|
||||||
taxId = Tax.get(getCtx(), getM_Product_ID(), getC_Charge_ID(), invoice.getDateInvoiced(), invoice.getDateInvoiced(),
|
taxId = Tax.get(getCtx(), getM_Product_ID(), getC_Charge_ID(), invoice.getDateInvoiced(), invoice.getDateInvoiced(),
|
||||||
getAD_Org_ID(), getParent().getShipment().getM_Warehouse_ID(),
|
getAD_Org_ID(), getParent().getShipment().getM_Warehouse_ID(),
|
||||||
invoice.getC_BPartner_Location_ID(), // should be bill to
|
invoice.getC_BPartner_Location_ID(), // should be bill to
|
||||||
invoice.getC_BPartner_Location_ID(), getParent().isSOTrx());
|
invoice.getC_BPartner_Location_ID(), getParent().isSOTrx(), get_TrxName());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -173,7 +173,7 @@ public class MRMALine extends X_M_RMALine
|
||||||
taxId = Tax.get(getCtx(), getM_Product_ID(), getC_Charge_ID(), order.getDateOrdered(), order.getDateOrdered(),
|
taxId = Tax.get(getCtx(), getM_Product_ID(), getC_Charge_ID(), order.getDateOrdered(), order.getDateOrdered(),
|
||||||
getAD_Org_ID(), order.getM_Warehouse_ID(),
|
getAD_Org_ID(), order.getM_Warehouse_ID(),
|
||||||
order.getC_BPartner_Location_ID(), // should be bill to
|
order.getC_BPartner_Location_ID(), // should be bill to
|
||||||
order.getC_BPartner_Location_ID(), getParent().isSOTrx());
|
order.getC_BPartner_Location_ID(), getParent().isSOTrx(), get_TrxName());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw new IllegalStateException("No Invoice/Order found the Shipment/Receipt associated");
|
throw new IllegalStateException("No Invoice/Order found the Shipment/Receipt associated");
|
||||||
|
|
|
@ -47,6 +47,30 @@ public class Tax
|
||||||
static private CLogger log = CLogger.getCLogger (Tax.class);
|
static private CLogger log = CLogger.getCLogger (Tax.class);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param M_Product_ID
|
||||||
|
* @param C_Charge_ID
|
||||||
|
* @param billDate
|
||||||
|
* @param shipDate
|
||||||
|
* @param AD_Org_ID
|
||||||
|
* @param M_Warehouse_ID
|
||||||
|
* @param billC_BPartner_Location_ID
|
||||||
|
* @param shipC_BPartner_Location_ID
|
||||||
|
* @param IsSOTrx
|
||||||
|
* @deprecated
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int get (Properties ctx, int M_Product_ID, int C_Charge_ID,
|
||||||
|
Timestamp billDate, Timestamp shipDate,
|
||||||
|
int AD_Org_ID, int M_Warehouse_ID,
|
||||||
|
int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID,
|
||||||
|
boolean IsSOTrx) {
|
||||||
|
return get(ctx, M_Product_ID, C_Charge_ID, billDate, shipDate, AD_Org_ID, M_Warehouse_ID, billC_BPartner_Location_ID, shipC_BPartner_Location_ID, IsSOTrx, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Get Tax ID - converts parameters to call Get Tax.
|
* Get Tax ID - converts parameters to call Get Tax.
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -76,18 +100,41 @@ public class Tax
|
||||||
Timestamp billDate, Timestamp shipDate,
|
Timestamp billDate, Timestamp shipDate,
|
||||||
int AD_Org_ID, int M_Warehouse_ID,
|
int AD_Org_ID, int M_Warehouse_ID,
|
||||||
int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID,
|
int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID,
|
||||||
boolean IsSOTrx)
|
boolean IsSOTrx, String trxName)
|
||||||
{
|
{
|
||||||
if (M_Product_ID != 0)
|
if (M_Product_ID != 0)
|
||||||
return getProduct (ctx, M_Product_ID, billDate, shipDate, AD_Org_ID, M_Warehouse_ID,
|
return getProduct (ctx, M_Product_ID, billDate, shipDate, AD_Org_ID, M_Warehouse_ID,
|
||||||
billC_BPartner_Location_ID, shipC_BPartner_Location_ID, IsSOTrx);
|
billC_BPartner_Location_ID, shipC_BPartner_Location_ID, IsSOTrx, trxName);
|
||||||
else if (C_Charge_ID != 0)
|
else if (C_Charge_ID != 0)
|
||||||
return getCharge (ctx, C_Charge_ID, billDate, shipDate, AD_Org_ID, M_Warehouse_ID,
|
return getCharge (ctx, C_Charge_ID, billDate, shipDate, AD_Org_ID, M_Warehouse_ID,
|
||||||
billC_BPartner_Location_ID, shipC_BPartner_Location_ID, IsSOTrx);
|
billC_BPartner_Location_ID, shipC_BPartner_Location_ID, IsSOTrx, trxName);
|
||||||
else
|
else
|
||||||
return getExemptTax (ctx, AD_Org_ID);
|
return getExemptTax (ctx, AD_Org_ID, trxName);
|
||||||
} // get
|
} // get
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param C_Charge_ID
|
||||||
|
* @param billDate
|
||||||
|
* @param shipDate
|
||||||
|
* @param AD_Org_ID
|
||||||
|
* @param M_Warehouse_ID
|
||||||
|
* @param billC_BPartner_Location_ID
|
||||||
|
* @param shipC_BPartner_Location_ID
|
||||||
|
* @param IsSOTrx
|
||||||
|
* @return
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
public static int getCharge (Properties ctx, int C_Charge_ID,
|
||||||
|
Timestamp billDate, Timestamp shipDate,
|
||||||
|
int AD_Org_ID, int M_Warehouse_ID,
|
||||||
|
int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID,
|
||||||
|
boolean IsSOTrx) {
|
||||||
|
return getCharge(ctx, C_Charge_ID, billDate, shipDate, AD_Org_ID, M_Warehouse_ID, billC_BPartner_Location_ID, shipC_BPartner_Location_ID, IsSOTrx, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Tax ID - converts parameters to call Get Tax.
|
* Get Tax ID - converts parameters to call Get Tax.
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -118,7 +165,7 @@ public class Tax
|
||||||
Timestamp billDate, Timestamp shipDate,
|
Timestamp billDate, Timestamp shipDate,
|
||||||
int AD_Org_ID, int M_Warehouse_ID,
|
int AD_Org_ID, int M_Warehouse_ID,
|
||||||
int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID,
|
int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID,
|
||||||
boolean IsSOTrx)
|
boolean IsSOTrx, String trxName)
|
||||||
{
|
{
|
||||||
/* ship location from warehouse is plainly ignored below */
|
/* ship location from warehouse is plainly ignored below */
|
||||||
// if (M_Warehouse_ID <= 0)
|
// if (M_Warehouse_ID <= 0)
|
||||||
|
@ -152,7 +199,7 @@ public class Tax
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pstmt = DB.prepareStatement (sql, null);
|
pstmt = DB.prepareStatement (sql, trxName);
|
||||||
pstmt.setInt (1, M_Warehouse_ID);
|
pstmt.setInt (1, M_Warehouse_ID);
|
||||||
pstmt.setInt (2, C_Charge_ID);
|
pstmt.setInt (2, C_Charge_ID);
|
||||||
pstmt.setInt (3, AD_Org_ID);
|
pstmt.setInt (3, AD_Org_ID);
|
||||||
|
@ -182,7 +229,7 @@ public class Tax
|
||||||
}
|
}
|
||||||
else if ("Y".equals (IsTaxExempt))
|
else if ("Y".equals (IsTaxExempt))
|
||||||
{
|
{
|
||||||
return getExemptTax (ctx, AD_Org_ID);
|
return getExemptTax (ctx, AD_Org_ID, trxName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
|
@ -213,10 +260,32 @@ public class Tax
|
||||||
+ ", shipToC_Location_ID=" + shipToC_Location_ID);
|
+ ", shipToC_Location_ID=" + shipToC_Location_ID);
|
||||||
return get (ctx, C_TaxCategory_ID, IsSOTrx,
|
return get (ctx, C_TaxCategory_ID, IsSOTrx,
|
||||||
shipDate, shipFromC_Location_ID, shipToC_Location_ID,
|
shipDate, shipFromC_Location_ID, shipToC_Location_ID,
|
||||||
billDate, billFromC_Location_ID, billToC_Location_ID);
|
billDate, billFromC_Location_ID, billToC_Location_ID, trxName);
|
||||||
} // getCharge
|
} // getCharge
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param M_Product_ID
|
||||||
|
* @param billDate
|
||||||
|
* @param shipDate
|
||||||
|
* @param AD_Org_ID
|
||||||
|
* @param M_Warehouse_ID
|
||||||
|
* @param billC_BPartner_Location_ID
|
||||||
|
* @param shipC_BPartner_Location_ID
|
||||||
|
* @param IsSOTrx
|
||||||
|
* @return
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
public static int getProduct (Properties ctx, int M_Product_ID,
|
||||||
|
Timestamp billDate, Timestamp shipDate,
|
||||||
|
int AD_Org_ID, int M_Warehouse_ID,
|
||||||
|
int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID,
|
||||||
|
boolean IsSOTrx) {
|
||||||
|
return getProduct(ctx, M_Product_ID, billDate, shipDate, AD_Org_ID, M_Warehouse_ID, billC_BPartner_Location_ID, shipC_BPartner_Location_ID, IsSOTrx, null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Tax ID - converts parameters to call Get Tax.
|
* Get Tax ID - converts parameters to call Get Tax.
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -246,7 +315,7 @@ public class Tax
|
||||||
Timestamp billDate, Timestamp shipDate,
|
Timestamp billDate, Timestamp shipDate,
|
||||||
int AD_Org_ID, int M_Warehouse_ID,
|
int AD_Org_ID, int M_Warehouse_ID,
|
||||||
int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID,
|
int billC_BPartner_Location_ID, int shipC_BPartner_Location_ID,
|
||||||
boolean IsSOTrx)
|
boolean IsSOTrx, String trxName)
|
||||||
{
|
{
|
||||||
String variable = "";
|
String variable = "";
|
||||||
int C_TaxCategory_ID = 0;
|
int C_TaxCategory_ID = 0;
|
||||||
|
@ -273,7 +342,7 @@ public class Tax
|
||||||
+ " AND o.AD_Org_ID=?"
|
+ " AND o.AD_Org_ID=?"
|
||||||
+ " AND il.C_BPartner_Location_ID=?"
|
+ " AND il.C_BPartner_Location_ID=?"
|
||||||
+ " AND sl.C_BPartner_Location_ID=?";
|
+ " AND sl.C_BPartner_Location_ID=?";
|
||||||
pstmt = DB.prepareStatement(sql, null);
|
pstmt = DB.prepareStatement(sql, trxName);
|
||||||
pstmt.setInt(1, M_Warehouse_ID);
|
pstmt.setInt(1, M_Warehouse_ID);
|
||||||
pstmt.setInt(2, M_Product_ID);
|
pstmt.setInt(2, M_Product_ID);
|
||||||
pstmt.setInt(3, AD_Org_ID);
|
pstmt.setInt(3, AD_Org_ID);
|
||||||
|
@ -298,7 +367,7 @@ public class Tax
|
||||||
if (found && "Y".equals(IsTaxExempt))
|
if (found && "Y".equals(IsTaxExempt))
|
||||||
{
|
{
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("getProduct - Business Partner is Tax exempt");
|
if (log.isLoggable(Level.FINE)) log.fine("getProduct - Business Partner is Tax exempt");
|
||||||
return getExemptTax(ctx, AD_Org_ID);
|
return getExemptTax(ctx, AD_Org_ID, trxName);
|
||||||
}
|
}
|
||||||
else if (found)
|
else if (found)
|
||||||
{
|
{
|
||||||
|
@ -318,7 +387,7 @@ public class Tax
|
||||||
+ ", shipToC_Location_ID=" + shipToC_Location_ID);
|
+ ", shipToC_Location_ID=" + shipToC_Location_ID);
|
||||||
return get(ctx, C_TaxCategory_ID, IsSOTrx,
|
return get(ctx, C_TaxCategory_ID, IsSOTrx,
|
||||||
shipDate, shipFromC_Location_ID, shipToC_Location_ID,
|
shipDate, shipFromC_Location_ID, shipToC_Location_ID,
|
||||||
billDate, billFromC_Location_ID, billToC_Location_ID);
|
billDate, billFromC_Location_ID, billToC_Location_ID, trxName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------
|
// ----------------------------------------------------------------
|
||||||
|
@ -328,7 +397,7 @@ public class Tax
|
||||||
// M_Product_ID -> C_TaxCategory_ID
|
// M_Product_ID -> C_TaxCategory_ID
|
||||||
variable = "M_Product_ID";
|
variable = "M_Product_ID";
|
||||||
sql = "SELECT C_TaxCategory_ID FROM M_Product WHERE M_Product_ID=?";
|
sql = "SELECT C_TaxCategory_ID FROM M_Product WHERE M_Product_ID=?";
|
||||||
C_TaxCategory_ID = DB.getSQLValueEx(null, sql, M_Product_ID);
|
C_TaxCategory_ID = DB.getSQLValueEx(trxName, sql, M_Product_ID);
|
||||||
found = C_TaxCategory_ID != -1;
|
found = C_TaxCategory_ID != -1;
|
||||||
if (C_TaxCategory_ID <= 0)
|
if (C_TaxCategory_ID <= 0)
|
||||||
{
|
{
|
||||||
|
@ -339,7 +408,7 @@ public class Tax
|
||||||
// AD_Org_ID -> billFromC_Location_ID
|
// AD_Org_ID -> billFromC_Location_ID
|
||||||
variable = "AD_Org_ID";
|
variable = "AD_Org_ID";
|
||||||
sql = "SELECT C_Location_ID FROM AD_OrgInfo WHERE AD_Org_ID=?";
|
sql = "SELECT C_Location_ID FROM AD_OrgInfo WHERE AD_Org_ID=?";
|
||||||
billFromC_Location_ID = DB.getSQLValueEx(null, sql, AD_Org_ID);
|
billFromC_Location_ID = DB.getSQLValueEx(trxName, sql, AD_Org_ID);
|
||||||
found = billFromC_Location_ID != -1;
|
found = billFromC_Location_ID != -1;
|
||||||
if (billFromC_Location_ID <= 0)
|
if (billFromC_Location_ID <= 0)
|
||||||
{
|
{
|
||||||
|
@ -352,7 +421,7 @@ public class Tax
|
||||||
+ " FROM C_BPartner_Location l"
|
+ " FROM C_BPartner_Location l"
|
||||||
+ " INNER JOIN C_BPartner b ON (l.C_BPartner_ID=b.C_BPartner_ID) "
|
+ " INNER JOIN C_BPartner b ON (l.C_BPartner_ID=b.C_BPartner_ID) "
|
||||||
+ " WHERE C_BPartner_Location_ID=?";
|
+ " WHERE C_BPartner_Location_ID=?";
|
||||||
pstmt = DB.prepareStatement(sql, null);
|
pstmt = DB.prepareStatement(sql, trxName);
|
||||||
pstmt.setInt(1, billC_BPartner_Location_ID);
|
pstmt.setInt(1, billC_BPartner_Location_ID);
|
||||||
rs = pstmt.executeQuery();
|
rs = pstmt.executeQuery();
|
||||||
found = false;
|
found = false;
|
||||||
|
@ -370,7 +439,7 @@ public class Tax
|
||||||
throw new TaxCriteriaNotFoundException(variable, billC_BPartner_Location_ID);
|
throw new TaxCriteriaNotFoundException(variable, billC_BPartner_Location_ID);
|
||||||
}
|
}
|
||||||
if ("Y".equals(IsTaxExempt))
|
if ("Y".equals(IsTaxExempt))
|
||||||
return getExemptTax(ctx, AD_Org_ID);
|
return getExemptTax(ctx, AD_Org_ID, trxName);
|
||||||
|
|
||||||
// Reverse for PO
|
// Reverse for PO
|
||||||
if (!IsSOTrx)
|
if (!IsSOTrx)
|
||||||
|
@ -389,7 +458,7 @@ public class Tax
|
||||||
// M_Warehouse_ID -> shipFromC_Location_ID
|
// M_Warehouse_ID -> shipFromC_Location_ID
|
||||||
variable = "M_Warehouse_ID";
|
variable = "M_Warehouse_ID";
|
||||||
sql = "SELECT C_Location_ID FROM M_Warehouse WHERE M_Warehouse_ID=?";
|
sql = "SELECT C_Location_ID FROM M_Warehouse WHERE M_Warehouse_ID=?";
|
||||||
shipFromC_Location_ID = DB.getSQLValueEx(null, sql, M_Warehouse_ID);
|
shipFromC_Location_ID = DB.getSQLValueEx(trxName, sql, M_Warehouse_ID);
|
||||||
found = shipFromC_Location_ID != -1;
|
found = shipFromC_Location_ID != -1;
|
||||||
if (shipFromC_Location_ID <= 0)
|
if (shipFromC_Location_ID <= 0)
|
||||||
{
|
{
|
||||||
|
@ -399,7 +468,7 @@ public class Tax
|
||||||
// shipC_BPartner_Location_ID -> shipToC_Location_ID
|
// shipC_BPartner_Location_ID -> shipToC_Location_ID
|
||||||
variable = "C_BPartner_Location_ID";
|
variable = "C_BPartner_Location_ID";
|
||||||
sql = "SELECT C_Location_ID FROM C_BPartner_Location WHERE C_BPartner_Location_ID=?";
|
sql = "SELECT C_Location_ID FROM C_BPartner_Location WHERE C_BPartner_Location_ID=?";
|
||||||
shipToC_Location_ID = DB.getSQLValueEx(null, sql, shipC_BPartner_Location_ID);
|
shipToC_Location_ID = DB.getSQLValueEx(trxName, sql, shipC_BPartner_Location_ID);
|
||||||
found = shipToC_Location_ID != -1;
|
found = shipToC_Location_ID != -1;
|
||||||
if (shipToC_Location_ID <= 0)
|
if (shipToC_Location_ID <= 0)
|
||||||
{
|
{
|
||||||
|
@ -428,24 +497,25 @@ public class Tax
|
||||||
|
|
||||||
return get (ctx, C_TaxCategory_ID, IsSOTrx,
|
return get (ctx, C_TaxCategory_ID, IsSOTrx,
|
||||||
shipDate, shipFromC_Location_ID, shipToC_Location_ID,
|
shipDate, shipFromC_Location_ID, shipToC_Location_ID,
|
||||||
billDate, billFromC_Location_ID, billToC_Location_ID);
|
billDate, billFromC_Location_ID, billToC_Location_ID, trxName);
|
||||||
} // getProduct
|
} // getProduct
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Exempt Tax Code
|
* Get Exempt Tax Code
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
* @param AD_Org_ID org to find client
|
* @param AD_Org_ID org to find client
|
||||||
|
* @param trxName Transaction
|
||||||
* @return C_Tax_ID
|
* @return C_Tax_ID
|
||||||
* @throws TaxNoExemptFoundException if no tax exempt found
|
* @throws TaxNoExemptFoundException if no tax exempt found
|
||||||
*/
|
*/
|
||||||
private static int getExemptTax (Properties ctx, int AD_Org_ID)
|
private static int getExemptTax (Properties ctx, int AD_Org_ID, String trxName)
|
||||||
{
|
{
|
||||||
final String sql = "SELECT t.C_Tax_ID "
|
final String sql = "SELECT t.C_Tax_ID "
|
||||||
+ "FROM C_Tax t"
|
+ "FROM C_Tax t"
|
||||||
+ " INNER JOIN AD_Org o ON (t.AD_Client_ID=o.AD_Client_ID) "
|
+ " INNER JOIN AD_Org o ON (t.AD_Client_ID=o.AD_Client_ID) "
|
||||||
+ "WHERE t.IsTaxExempt='Y' AND o.AD_Org_ID=? "
|
+ "WHERE t.IsTaxExempt='Y' AND o.AD_Org_ID=? "
|
||||||
+ "ORDER BY t.Rate DESC";
|
+ "ORDER BY t.Rate DESC";
|
||||||
int C_Tax_ID = DB.getSQLValueEx(null, sql, AD_Org_ID);
|
int C_Tax_ID = DB.getSQLValueEx(trxName, sql, AD_Org_ID);
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("getExemptTax - TaxExempt=Y - C_Tax_ID=" + C_Tax_ID);
|
if (log.isLoggable(Level.FINE)) log.fine("getExemptTax - TaxExempt=Y - C_Tax_ID=" + C_Tax_ID);
|
||||||
if (C_Tax_ID <= 0)
|
if (C_Tax_ID <= 0)
|
||||||
{
|
{
|
||||||
|
@ -469,13 +539,14 @@ public class Tax
|
||||||
* @param billDate invoice date
|
* @param billDate invoice date
|
||||||
* @param billFromC_Location_ID invoice from
|
* @param billFromC_Location_ID invoice from
|
||||||
* @param billToC_Location_ID invoice to
|
* @param billToC_Location_ID invoice to
|
||||||
|
* @param trxName Transaction
|
||||||
* @return C_Tax_ID
|
* @return C_Tax_ID
|
||||||
* @throws TaxNotFoundException if no tax found for given criteria
|
* @throws TaxNotFoundException if no tax found for given criteria
|
||||||
*/
|
*/
|
||||||
protected static int get (Properties ctx,
|
protected static int get (Properties ctx,
|
||||||
int C_TaxCategory_ID, boolean IsSOTrx,
|
int C_TaxCategory_ID, boolean IsSOTrx,
|
||||||
Timestamp shipDate, int shipFromC_Location_ID, int shipToC_Location_ID,
|
Timestamp shipDate, int shipFromC_Location_ID, int shipToC_Location_ID,
|
||||||
Timestamp billDate, int billFromC_Location_ID, int billToC_Location_ID)
|
Timestamp billDate, int billFromC_Location_ID, int billToC_Location_ID, String trxName)
|
||||||
{
|
{
|
||||||
// C_TaxCategory contains CommodityCode
|
// C_TaxCategory contains CommodityCode
|
||||||
|
|
||||||
|
@ -490,8 +561,8 @@ public class Tax
|
||||||
}
|
}
|
||||||
|
|
||||||
MTax[] taxes = MTax.getAll (ctx);
|
MTax[] taxes = MTax.getAll (ctx);
|
||||||
MLocation lFrom = new MLocation (ctx, billFromC_Location_ID, null);
|
MLocation lFrom = new MLocation (ctx, billFromC_Location_ID, trxName);
|
||||||
MLocation lTo = new MLocation (ctx, billToC_Location_ID, null);
|
MLocation lTo = new MLocation (ctx, billToC_Location_ID, trxName);
|
||||||
if (log.isLoggable(Level.FINER)){
|
if (log.isLoggable(Level.FINER)){
|
||||||
log.finer("From=" + lFrom);
|
log.finer("From=" + lFrom);
|
||||||
log.finer("To=" + lTo);
|
log.finer("To=" + lTo);
|
||||||
|
|
|
@ -1498,7 +1498,12 @@ public class Login
|
||||||
sql.append(" AND r.IsMasterRole='N'");
|
sql.append(" AND r.IsMasterRole='N'");
|
||||||
sql.append(" AND u.IsActive='Y' AND EXISTS (SELECT * FROM AD_Client c WHERE u.AD_Client_ID=c.AD_Client_ID AND c.IsActive='Y')");
|
sql.append(" AND u.IsActive='Y' AND EXISTS (SELECT * FROM AD_Client c WHERE u.AD_Client_ID=c.AD_Client_ID AND c.IsActive='Y')");
|
||||||
// don't show roles without org access
|
// don't show roles without org access
|
||||||
sql.append(" AND (r.isaccessallorgs='Y' OR EXISTS (SELECT 1 FROM AD_Role_OrgAccess ro WHERE ro.AD_Role_ID=r.AD_Role_ID AND ro.IsActive='Y'))");
|
sql.append(" AND (");
|
||||||
|
sql.append(" (r.isaccessallorgs='Y' OR EXISTS (SELECT 1 FROM AD_Role_OrgAccess ro WHERE ro.AD_Role_ID=r.AD_Role_ID AND ro.IsActive='Y'))");
|
||||||
|
// show roll with isuseuserorgaccess = "Y" when Exist org in AD_User_Orgaccess
|
||||||
|
sql.append(" OR ");
|
||||||
|
sql.append(" (r.isuseuserorgaccess='Y' AND EXISTS (SELECT 1 FROM AD_User_Orgaccess uo WHERE uo.AD_User_ID=u.AD_User_ID AND uo.IsActive='Y')) ");
|
||||||
|
sql.append(")");
|
||||||
sql.append(" ORDER BY r.Name");
|
sql.append(" ORDER BY r.Name");
|
||||||
|
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
|
Loading…
Reference in New Issue