FR [2857197] - Make BP Tax Exempt application configurable

https://sourceforge.net/tracker/?func=detail&aid=2857197&group_id=176962&atid=879332
This commit is contained in:
Carlos Ruiz 2009-09-11 22:11:42 +00:00
parent c66f6924e2
commit 556d86d44c
6 changed files with 448 additions and 122 deletions

View File

@ -88,19 +88,6 @@ public interface I_C_BPartner
*/
public String getAD_Language();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name AD_OrgBP_ID */
public static final String COLUMNNAME_AD_OrgBP_ID = "AD_OrgBP_ID";
@ -114,6 +101,19 @@ public interface I_C_BPartner
*/
public String getAD_OrgBP_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name BPartner_Parent_ID */
public static final String COLUMNNAME_BPartner_Parent_ID = "BPartner_Parent_ID";
@ -127,6 +127,19 @@ public interface I_C_BPartner
*/
public int getBPartner_Parent_ID();
/** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
/** Set Business Partner .
* Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID);
/** Get Business Partner .
* Identifies a Business Partner
*/
public int getC_BPartner_ID();
/** Column name C_BP_Group_ID */
public static final String COLUMNNAME_C_BP_Group_ID = "C_BP_Group_ID";
@ -142,19 +155,6 @@ public interface I_C_BPartner
public I_C_BP_Group getC_BP_Group() throws RuntimeException;
/** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
/** Set Business Partner .
* Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID);
/** Get Business Partner .
* Identifies a Business Partner
*/
public int getC_BPartner_ID();
/** Column name C_Dunning_ID */
public static final String COLUMNNAME_C_Dunning_ID = "C_Dunning_ID";
@ -215,17 +215,6 @@ public interface I_C_BPartner
public I_C_PaymentTerm getC_PaymentTerm() throws RuntimeException;
/** Column name C_TaxGroup_ID */
public static final String COLUMNNAME_C_TaxGroup_ID = "C_TaxGroup_ID";
/** Set Tax Group */
public void setC_TaxGroup_ID (int C_TaxGroup_ID);
/** Get Tax Group */
public int getC_TaxGroup_ID();
public org.eevolution.model.I_C_TaxGroup getC_TaxGroup() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
@ -242,6 +231,17 @@ public interface I_C_BPartner
*/
public int getCreatedBy();
/** Column name C_TaxGroup_ID */
public static final String COLUMNNAME_C_TaxGroup_ID = "C_TaxGroup_ID";
/** Set Tax Group */
public void setC_TaxGroup_ID (int C_TaxGroup_ID);
/** Get Tax Group */
public int getC_TaxGroup_ID();
public org.eevolution.model.I_C_TaxGroup getC_TaxGroup() throws RuntimeException;
/** Column name DeliveryRule */
public static final String COLUMNNAME_DeliveryRule = "DeliveryRule";
@ -444,6 +444,19 @@ public interface I_C_BPartner
/** Get One time transaction */
public boolean isOneTime();
/** Column name IsPOTaxExempt */
public static final String COLUMNNAME_IsPOTaxExempt = "IsPOTaxExempt";
/** Set PO Tax exempt.
* Business partner is exempt from tax on purchases
*/
public void setIsPOTaxExempt (boolean IsPOTaxExempt);
/** Get PO Tax exempt.
* Business partner is exempt from tax on purchases
*/
public boolean isPOTaxExempt();
/** Column name IsProspect */
public static final String COLUMNNAME_IsProspect = "IsProspect";
@ -486,13 +499,13 @@ public interface I_C_BPartner
/** Column name IsTaxExempt */
public static final String COLUMNNAME_IsTaxExempt = "IsTaxExempt";
/** Set Tax exempt.
* Business partner is exempt from tax
/** Set SO Tax exempt.
* Business partner is exempt from tax on sales
*/
public void setIsTaxExempt (boolean IsTaxExempt);
/** Get Tax exempt.
* Business partner is exempt from tax
/** Get SO Tax exempt.
* Business partner is exempt from tax on sales
*/
public boolean isTaxExempt();
@ -803,6 +816,19 @@ public interface I_C_BPartner
*/
public BigDecimal getSO_CreditLimit();
/** Column name SOCreditStatus */
public static final String COLUMNNAME_SOCreditStatus = "SOCreditStatus";
/** Set Credit Status.
* Business Partner Credit Status
*/
public void setSOCreditStatus (String SOCreditStatus);
/** Get Credit Status.
* Business Partner Credit Status
*/
public String getSOCreditStatus();
/** Column name SO_CreditUsed */
public static final String COLUMNNAME_SO_CreditUsed = "SO_CreditUsed";
@ -829,19 +855,6 @@ public interface I_C_BPartner
*/
public String getSO_Description();
/** Column name SOCreditStatus */
public static final String COLUMNNAME_SOCreditStatus = "SOCreditStatus";
/** Set Credit Status.
* Business Partner Credit Status
*/
public void setSOCreditStatus (String SOCreditStatus);
/** Get Credit Status.
* Business Partner Credit Status
*/
public String getSOCreditStatus();
/** Column name TaxID */
public static final String COLUMNNAME_TaxID = "TaxID";

View File

@ -263,6 +263,7 @@ public class MBPartner extends X_C_BPartner
setIsEmployee (false);
setIsSalesRep (false);
setIsTaxExempt(false);
setIsPOTaxExempt(false);
setIsDiscountPrinted(false);
//
setSO_CreditLimit (Env.ZERO);

View File

@ -134,9 +134,11 @@ public class Tax
int billFromC_Location_ID = 0;
int billToC_Location_ID = 0;
String IsTaxExempt = null;
String IsSOTaxExempt = null;
String IsPOTaxExempt = null;
// Get all at once
String sql = "SELECT c.C_TaxCategory_ID, o.C_Location_ID, il.C_Location_ID, b.IsTaxExempt,"
String sql = "SELECT c.C_TaxCategory_ID, o.C_Location_ID, il.C_Location_ID, b.IsTaxExempt, b.IsPOTaxExempt,"
+ " w.C_Location_ID, sl.C_Location_ID "
+ "FROM C_Charge c, AD_OrgInfo o,"
+ " C_BPartner_Location il INNER JOIN C_BPartner b ON (il.C_BPartner_ID=b.C_BPartner_ID) "
@ -162,9 +164,11 @@ public class Tax
C_TaxCategory_ID = rs.getInt (1);
billFromC_Location_ID = rs.getInt (2);
billToC_Location_ID = rs.getInt (3);
IsTaxExempt = rs.getString (4);
shipFromC_Location_ID = rs.getInt (5);
shipToC_Location_ID = rs.getInt (6);
IsSOTaxExempt = rs.getString (4);
IsPOTaxExempt = rs.getString (5);
IsTaxExempt = IsSOTrx ? IsSOTaxExempt : IsPOTaxExempt;
shipFromC_Location_ID = rs.getInt (6);
shipToC_Location_ID = rs.getInt (7);
found = true;
}
DB.close(rs, pstmt);
@ -250,6 +254,8 @@ public class Tax
int billFromC_Location_ID = 0;
int billToC_Location_ID = 0;
String IsTaxExempt = null;
String IsSOTaxExempt = null;
String IsPOTaxExempt = null;
String sql = null;
PreparedStatement pstmt = null;
@ -257,7 +263,7 @@ public class Tax
try
{
// Get all at once
sql = "SELECT p.C_TaxCategory_ID, o.C_Location_ID, il.C_Location_ID, b.IsTaxExempt,"
sql = "SELECT p.C_TaxCategory_ID, o.C_Location_ID, il.C_Location_ID, b.IsTaxExempt, b.IsPOTaxExempt, "
+ " w.C_Location_ID, sl.C_Location_ID "
+ "FROM M_Product p, AD_OrgInfo o,"
+ " C_BPartner_Location il INNER JOIN C_BPartner b ON (il.C_BPartner_ID=b.C_BPartner_ID) "
@ -279,9 +285,11 @@ public class Tax
C_TaxCategory_ID = rs.getInt(1);
billFromC_Location_ID = rs.getInt(2);
billToC_Location_ID = rs.getInt(3);
IsTaxExempt = rs.getString(4);
shipFromC_Location_ID = rs.getInt(5);
shipToC_Location_ID = rs.getInt(6);
IsSOTaxExempt = rs.getString(4);
IsPOTaxExempt = rs.getString(5);
IsTaxExempt = IsSOTrx ? IsSOTaxExempt : IsPOTaxExempt;
shipFromC_Location_ID = rs.getInt(6);
shipToC_Location_ID = rs.getInt(7);
found = true;
}
DB.close(rs, pstmt);
@ -339,7 +347,7 @@ public class Tax
// billC_BPartner_Location_ID -> billToC_Location_ID
variable = "BillTo_ID";
sql = "SELECT l.C_Location_ID, b.IsTaxExempt "
sql = "SELECT l.C_Location_ID, b.IsTaxExempt, b.IsPOTaxExempt "
+ " FROM C_BPartner_Location l"
+ " INNER JOIN C_BPartner b ON (l.C_BPartner_ID=b.C_BPartner_ID) "
+ " WHERE C_BPartner_Location_ID=?";
@ -350,7 +358,9 @@ public class Tax
if (rs.next())
{
billToC_Location_ID = rs.getInt(1);
IsTaxExempt = rs.getString(2);
IsSOTaxExempt = rs.getString(2);
IsPOTaxExempt = rs.getString(3);
IsTaxExempt = IsSOTrx ? IsSOTaxExempt : IsPOTaxExempt;
found = true;
}
DB.close(rs, pstmt);

View File

@ -41,11 +41,13 @@ public class X_C_BPartner extends PO implements I_C_BPartner, I_Persistent
super (ctx, C_BPartner_ID, trxName);
/** if (C_BPartner_ID == 0)
{
setC_BP_Group_ID (0);
setC_BPartner_ID (0);
setC_BP_Group_ID (0);
setIsCustomer (false);
setIsEmployee (false);
setIsOneTime (false);
setIsPOTaxExempt (false);
// N
setIsProspect (false);
setIsSalesRep (false);
setIsSummary (false);
@ -186,6 +188,29 @@ public class X_C_BPartner extends PO implements I_C_BPartner, I_Persistent
return ii.intValue();
}
/** Set Business Partner .
@param C_BPartner_ID
Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID)
{
if (C_BPartner_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID));
}
/** Get Business Partner .
@return Identifies a Business Partner
*/
public int getC_BPartner_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_C_BP_Group getC_BP_Group() throws RuntimeException
{
return (I_C_BP_Group)MTable.get(getCtx(), I_C_BP_Group.Table_Name)
@ -214,29 +239,6 @@ public class X_C_BPartner extends PO implements I_C_BPartner, I_Persistent
return ii.intValue();
}
/** Set Business Partner .
@param C_BPartner_ID
Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID)
{
if (C_BPartner_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID));
}
/** Get Business Partner .
@return Identifies a Business Partner
*/
public int getC_BPartner_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_C_Dunning getC_Dunning() throws RuntimeException
{
return (I_C_Dunning)MTable.get(getCtx(), I_C_Dunning.Table_Name)
@ -714,6 +716,30 @@ public class X_C_BPartner extends PO implements I_C_BPartner, I_Persistent
return false;
}
/** Set PO Tax exempt.
@param IsPOTaxExempt
Business partner is exempt from tax on purchases
*/
public void setIsPOTaxExempt (boolean IsPOTaxExempt)
{
set_Value (COLUMNNAME_IsPOTaxExempt, Boolean.valueOf(IsPOTaxExempt));
}
/** Get PO Tax exempt.
@return Business partner is exempt from tax on purchases
*/
public boolean isPOTaxExempt ()
{
Object oo = get_Value(COLUMNNAME_IsPOTaxExempt);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Prospect.
@param IsProspect
Indicates this is a Prospect
@ -786,17 +812,17 @@ public class X_C_BPartner extends PO implements I_C_BPartner, I_Persistent
return false;
}
/** Set Tax exempt.
/** Set SO Tax exempt.
@param IsTaxExempt
Business partner is exempt from tax
Business partner is exempt from tax on sales
*/
public void setIsTaxExempt (boolean IsTaxExempt)
{
set_Value (COLUMNNAME_IsTaxExempt, Boolean.valueOf(IsTaxExempt));
}
/** Get Tax exempt.
@return Business partner is exempt from tax
/** Get SO Tax exempt.
@return Business partner is exempt from tax on sales
*/
public boolean isTaxExempt ()
{
@ -1344,6 +1370,36 @@ public class X_C_BPartner extends PO implements I_C_BPartner, I_Persistent
return bd;
}
/** SOCreditStatus AD_Reference_ID=289 */
public static final int SOCREDITSTATUS_AD_Reference_ID=289;
/** Credit Stop = S */
public static final String SOCREDITSTATUS_CreditStop = "S";
/** Credit Hold = H */
public static final String SOCREDITSTATUS_CreditHold = "H";
/** Credit Watch = W */
public static final String SOCREDITSTATUS_CreditWatch = "W";
/** No Credit Check = X */
public static final String SOCREDITSTATUS_NoCreditCheck = "X";
/** Credit OK = O */
public static final String SOCREDITSTATUS_CreditOK = "O";
/** Set Credit Status.
@param SOCreditStatus
Business Partner Credit Status
*/
public void setSOCreditStatus (String SOCreditStatus)
{
set_Value (COLUMNNAME_SOCreditStatus, SOCreditStatus);
}
/** Get Credit Status.
@return Business Partner Credit Status
*/
public String getSOCreditStatus ()
{
return (String)get_Value(COLUMNNAME_SOCreditStatus);
}
/** Set Credit Used.
@param SO_CreditUsed
Current open balance
@ -1381,36 +1437,6 @@ public class X_C_BPartner extends PO implements I_C_BPartner, I_Persistent
return (String)get_Value(COLUMNNAME_SO_Description);
}
/** SOCreditStatus AD_Reference_ID=289 */
public static final int SOCREDITSTATUS_AD_Reference_ID=289;
/** Credit Stop = S */
public static final String SOCREDITSTATUS_CreditStop = "S";
/** Credit Hold = H */
public static final String SOCREDITSTATUS_CreditHold = "H";
/** Credit Watch = W */
public static final String SOCREDITSTATUS_CreditWatch = "W";
/** No Credit Check = X */
public static final String SOCREDITSTATUS_NoCreditCheck = "X";
/** Credit OK = O */
public static final String SOCREDITSTATUS_CreditOK = "O";
/** Set Credit Status.
@param SOCreditStatus
Business Partner Credit Status
*/
public void setSOCreditStatus (String SOCreditStatus)
{
set_Value (COLUMNNAME_SOCreditStatus, SOCreditStatus);
}
/** Get Credit Status.
@return Business Partner Credit Status
*/
public String getSOCreditStatus ()
{
return (String)get_Value(COLUMNNAME_SOCreditStatus);
}
/** Set Tax ID.
@param TaxID
Tax Identification

View File

@ -0,0 +1,138 @@
-- Sep 11, 2009 4:52:30 PM COT
-- FR2857197-Make BP Tax Exempt application configurable
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53926,0,'IsPOTaxExempt',TO_DATE('2009-09-11 16:52:29','YYYY-MM-DD HH24:MI:SS'),100,'Business partner is exempt from tax on purchases','D','If a business partner is exempt from tax on purchases, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.','Y','PO Tax exempt','PO Tax exempt',TO_DATE('2009-09-11 16:52:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Sep 11, 2009 4:52:30 PM COT
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53926 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Element SET Description='Business partner is exempt from tax on sales', Help='If a business partner is exempt from tax on sales, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.', Name='SO Tax exempt', PrintName='SO Tax exempt',Updated=TO_DATE('2009-09-11 16:52:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=930
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=930
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Column SET ColumnName='IsTaxExempt', Name='SO Tax exempt', Description='Business partner is exempt from tax on sales', Help='If a business partner is exempt from tax on sales, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.' WHERE AD_Element_ID=930
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Process_Para SET ColumnName='IsTaxExempt', Name='SO Tax exempt', Description='Business partner is exempt from tax on sales', Help='If a business partner is exempt from tax on sales, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.', AD_Element_ID=930 WHERE UPPER(ColumnName)='ISTAXEXEMPT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Process_Para SET ColumnName='IsTaxExempt', Name='SO Tax exempt', Description='Business partner is exempt from tax on sales', Help='If a business partner is exempt from tax on sales, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.' WHERE AD_Element_ID=930 AND IsCentrallyMaintained='Y'
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Field SET Name='SO Tax exempt', Description='Business partner is exempt from tax on sales', Help='If a business partner is exempt from tax on sales, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=930) AND IsCentrallyMaintained='Y'
;
-- Sep 11, 2009 4:52:56 PM COT
UPDATE AD_PrintFormatItem pi SET PrintName='SO Tax exempt', Name='SO Tax exempt' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=930)
;
-- Sep 11, 2009 4:53:40 PM COT
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,58381,53926,0,20,291,'IsPOTaxExempt',TO_DATE('2009-09-11 16:53:39','YYYY-MM-DD HH24:MI:SS'),100,'N','Business partner is exempt from tax on purchases','D',1,'If a business partner is exempt from tax on purchases, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.','Y','Y','N','N','N','N','N','Y','N','N','Y','N','Y','PO Tax exempt',TO_DATE('2009-09-11 16:53:39','YYYY-MM-DD HH24:MI:SS'),100,1)
;
-- Sep 11, 2009 4:53:40 PM COT
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58381 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Sep 11, 2009 4:53:44 PM COT
ALTER TABLE C_BPartner ADD IsPOTaxExempt CHAR(1) DEFAULT 'N' CHECK (IsPOTaxExempt IN ('Y','N')) NOT NULL
;
-- Sep 11, 2009 4:55:29 PM COT
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,58381,57981,0,220,TO_DATE('2009-09-11 16:55:28','YYYY-MM-DD HH24:MI:SS'),100,'Business partner is exempt from tax on purchases',1,'D','If a business partner is exempt from tax on purchases, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.','Y','Y','Y','N','N','N','N','Y','PO Tax exempt',330,TO_DATE('2009-09-11 16:55:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Sep 11, 2009 4:55:29 PM COT
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57981 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
;
-- Sep 11, 2009 4:55:36 PM COT
UPDATE AD_Field SET IsSameLine='N',Updated=TO_DATE('2009-09-11 16:55:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2160
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=57981
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=54555
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=2132
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=2149
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=2144
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=2162
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=3955
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=2124
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=2164
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=2139
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=9620
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=2148
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=2128
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=2127
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=2146
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=2154
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=2153
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=2135
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=57533
;
update c_bpartner set ispotaxexempt = istaxexempt where ispotaxexempt <> istaxexempt and istaxexempt is not null;

View File

@ -0,0 +1,138 @@
-- Sep 11, 2009 4:52:30 PM COT
-- FR2857197-Make BP Tax Exempt application configurable
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53926,0,'IsPOTaxExempt',TO_TIMESTAMP('2009-09-11 16:52:29','YYYY-MM-DD HH24:MI:SS'),100,'Business partner is exempt from tax on purchases','D','If a business partner is exempt from tax on purchases, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.','Y','PO Tax exempt','PO Tax exempt',TO_TIMESTAMP('2009-09-11 16:52:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Sep 11, 2009 4:52:30 PM COT
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53926 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Element SET Description='Business partner is exempt from tax on sales', Help='If a business partner is exempt from tax on sales, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.', Name='SO Tax exempt', PrintName='SO Tax exempt',Updated=TO_TIMESTAMP('2009-09-11 16:52:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=930
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=930
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Column SET ColumnName='IsTaxExempt', Name='SO Tax exempt', Description='Business partner is exempt from tax on sales', Help='If a business partner is exempt from tax on sales, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.' WHERE AD_Element_ID=930
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Process_Para SET ColumnName='IsTaxExempt', Name='SO Tax exempt', Description='Business partner is exempt from tax on sales', Help='If a business partner is exempt from tax on sales, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.', AD_Element_ID=930 WHERE UPPER(ColumnName)='ISTAXEXEMPT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Process_Para SET ColumnName='IsTaxExempt', Name='SO Tax exempt', Description='Business partner is exempt from tax on sales', Help='If a business partner is exempt from tax on sales, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.' WHERE AD_Element_ID=930 AND IsCentrallyMaintained='Y'
;
-- Sep 11, 2009 4:52:53 PM COT
UPDATE AD_Field SET Name='SO Tax exempt', Description='Business partner is exempt from tax on sales', Help='If a business partner is exempt from tax on sales, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=930) AND IsCentrallyMaintained='Y'
;
-- Sep 11, 2009 4:52:56 PM COT
UPDATE AD_PrintFormatItem SET PrintName='SO Tax exempt', Name='SO Tax exempt' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=930)
;
-- Sep 11, 2009 4:53:40 PM COT
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) VALUES (0,58381,53926,0,20,291,'IsPOTaxExempt',TO_TIMESTAMP('2009-09-11 16:53:39','YYYY-MM-DD HH24:MI:SS'),100,'N','Business partner is exempt from tax on purchases','D',1,'If a business partner is exempt from tax on purchases, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.','Y','Y','N','N','N','N','N','Y','N','N','Y','N','Y','PO Tax exempt',TO_TIMESTAMP('2009-09-11 16:53:39','YYYY-MM-DD HH24:MI:SS'),100,1)
;
-- Sep 11, 2009 4:53:40 PM COT
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58381 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Sep 11, 2009 4:53:44 PM COT
ALTER TABLE C_BPartner ADD COLUMN IsPOTaxExempt CHAR(1) DEFAULT 'N' CHECK (IsPOTaxExempt IN ('Y','N')) NOT NULL
;
-- Sep 11, 2009 4:55:29 PM COT
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,58381,57981,0,220,TO_TIMESTAMP('2009-09-11 16:55:28','YYYY-MM-DD HH24:MI:SS'),100,'Business partner is exempt from tax on purchases',1,'D','If a business partner is exempt from tax on purchases, the exempt tax rate is used. For this, you need to set up a tax rate with a 0% rate and indicate that this is your tax exempt rate. This is required for tax reporting, so that you can track tax exempt transactions.','Y','Y','Y','N','N','N','N','Y','PO Tax exempt',330,TO_TIMESTAMP('2009-09-11 16:55:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Sep 11, 2009 4:55:29 PM COT
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=57981 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
;
-- Sep 11, 2009 4:55:36 PM COT
UPDATE AD_Field SET IsSameLine='N',Updated=TO_TIMESTAMP('2009-09-11 16:55:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2160
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=57981
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=54555
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=2132
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=2149
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=2144
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=2162
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=3955
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=2124
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=2164
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=2139
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=9620
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=2148
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=2128
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=2127
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=2146
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=2154
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=2153
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=2135
;
-- Sep 11, 2009 4:55:58 PM COT
UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=57533
;
update c_bpartner set ispotaxexempt = istaxexempt where ispotaxexempt <> istaxexempt and istaxexempt is not null;