C_Charge_Trl Translation for the Charge

http://sourceforge.net/tracker/?func=detail&atid=879335&aid=2771474&group_id=176962
This commit is contained in:
vpj-cd 2009-04-18 22:13:34 +00:00
parent 35d756e764
commit a7cd793ea3
4 changed files with 156 additions and 4 deletions

View File

@ -33,7 +33,7 @@ FROM M_InOutLine iol
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID) LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID) LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID)
LEFT OUTER JOIN C_OrderLine ol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID) LEFT OUTER JOIN C_OrderLine ol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID)
LEFT OUTER JOIN C_Charge c ON (iol.C_Charge_ID=c.C_Charge_ID) LEFT OUTER JOIN C_Charge_Trl c ON (iol.C_Charge_ID=c.C_Charge_ID)
UNION UNION
SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy, iol.Updated, iol.UpdatedBy, SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy, iol.Updated, iol.UpdatedBy,
uom.AD_Language, uom.AD_Language,

View File

@ -33,7 +33,7 @@ FROM M_InOutLine iol
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID) LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID) LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID)
LEFT OUTER JOIN C_OrderLine ol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID) LEFT OUTER JOIN C_OrderLine ol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID)
LEFT OUTER JOIN C_Charge c ON (iol.C_Charge_ID=c.C_Charge_ID) LEFT OUTER JOIN C_Charge_Trl c ON (iol.C_Charge_ID=c.C_Charge_ID)
UNION UNION
SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy, iol.Updated, iol.UpdatedBy, SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy, iol.Updated, iol.UpdatedBy,
uom.AD_Language, uom.AD_Language,

View File

@ -795,3 +795,80 @@ SELECT it.AD_Client_ID, it.AD_Org_ID, it.IsActive, it.Created, it.CreatedBy, it.
null,null,null,null,null null,null,null,null,null
FROM C_InvoiceTax it FROM C_InvoiceTax it
INNER JOIN C_Tax_Trl t ON (it.C_Tax_ID=t.C_Tax_ID); INNER JOIN C_Tax_Trl t ON (it.C_Tax_ID=t.C_Tax_ID);
DROP VIEW M_INOUT_LINE_VT;
CREATE OR REPLACE VIEW M_INOUT_LINE_VT
(AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY,
UPDATED, UPDATEDBY, AD_LANGUAGE, M_INOUT_ID, M_INOUTLINE_ID,
LINE, M_PRODUCT_ID, MOVEMENTQTY, QTYENTERED, UOMSYMBOL,
QTYORDERED, QTYDELIVERED, QTYBACKORDERED, NAME, DESCRIPTION,
DOCUMENTNOTE, UPC, SKU, PRODUCTVALUE, M_LOCATOR_ID,
M_WAREHOUSE_ID, X, Y, Z, M_ATTRIBUTESETINSTANCE_ID,
M_ATTRIBUTESET_ID, SERNO, LOT, M_LOT_ID, GUARANTEEDATE,
PRODUCTDESCRIPTION, IMAGEURL, C_CAMPAIGN_ID, C_PROJECT_ID, C_ACTIVITY_ID,
C_PROJECTPHASE_ID, C_PROJECTTASK_ID)
AS
SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy, iol.Updated, iol.UpdatedBy,
uom.AD_Language,
iol.M_InOut_ID, iol.M_InOutLine_ID,
iol.Line, p.M_Product_ID,
CASE WHEN iol.MovementQty<>0 OR iol.M_Product_ID IS NOT NULL THEN iol.MovementQty END AS MovementQty,
CASE WHEN iol.QtyEntered<>0 OR iol.M_Product_ID IS NOT NULL THEN iol.QtyEntered END AS QtyEntered,
CASE WHEN iol.MovementQty<>0 OR iol.M_Product_ID IS NOT NULL THEN uom.UOMSymbol END AS UOMSymbol,
ol.QtyOrdered, ol.QtyDelivered,
CASE WHEN iol.MovementQty<>0 OR iol.M_Product_ID IS NOT NULL THEN ol.QtyOrdered-ol.QtyDelivered END AS QtyBackOrdered,
COALESCE(COALESCE(pt.Name,p.Name)||productAttribute(iol.M_AttributeSetInstance_ID), c.Name, iol.Description) AS Name, -- main line
CASE WHEN COALESCE(pt.Name,p.Name,c.Name) IS NOT NULL THEN iol.Description END AS Description, -- second line
COALESCE(pt.DocumentNote, p.DocumentNote) AS DocumentNote, -- third line
p.UPC, p.SKU, p.Value AS ProductValue,
iol.M_Locator_ID, l.M_Warehouse_ID, l.X, l.Y, l.Z,
iol.M_AttributeSetInstance_ID, asi.M_AttributeSet_ID, asi.SerNo, asi.Lot, asi.M_Lot_ID,asi.GuaranteeDate,
pt.Description AS ProductDescription, p.ImageURL,
iol.C_Campaign_ID, iol.C_Project_ID, iol.C_Activity_ID, iol.C_ProjectPhase_ID, iol.C_ProjectTask_ID
FROM M_InOutLine iol
INNER JOIN C_UOM_Trl uom ON (iol.C_UOM_ID=uom.C_UOM_ID)
LEFT OUTER JOIN M_Product p ON (iol.M_Product_ID=p.M_Product_ID)
LEFT OUTER JOIN M_Product_Trl pt ON (iol.M_Product_ID=pt.M_Product_ID AND uom.AD_Language=pt.AD_Language)
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID)
LEFT OUTER JOIN C_OrderLine ol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID)
LEFT OUTER JOIN C_Charge_Trl c ON (iol.C_Charge_ID=c.C_Charge_ID)
UNION
SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy, iol.Updated, iol.UpdatedBy,
uom.AD_Language,
iol.M_InOut_ID, iol.M_InOutLine_ID,
iol.Line+(bl.Line/100) AS Line, p.M_Product_ID,
--iol.MovementQty*b.BOMQty AS QtyInvoiced,
CASE WHEN bl.IsQtyPercentage = 'N' THEN iol.MovementQty*bl.QtyBOM ELSE iol.MovementQty*(bl.QtyBatch / 100) END AS QtyInvoiced,
--iol.QtyEntered*b.BOMQty AS QtyEntered,
CASE WHEN bl.IsQtyPercentage = 'N' THEN iol.QtyEntered*bl.QtyBOM ELSE iol.QtyEntered*(bl.QtyBatch / 100) END AS QtyEntered,
uom.UOMSymbol,
null, null, null,
COALESCE (pt.Name, p.Name) AS Name, -- main line
b.Description, -- second line
COALESCE (pt.DocumentNote, p.DocumentNote) AS DocumentNote, -- third line
p.UPC, p.SKU, p.Value AS ProductValue,
iol.M_Locator_ID, l.M_Warehouse_ID, l.X, l.Y, l.Z,
iol.M_AttributeSetInstance_ID, asi.M_AttributeSet_ID, asi.SerNo, asi.Lot, asi.M_Lot_ID,asi.GuaranteeDate,
pt.Description AS ProductDescription, p.ImageURL,
iol.C_Campaign_ID, iol.C_Project_ID, iol.C_Activity_ID, iol.C_ProjectPhase_ID, iol.C_ProjectTask_ID
/*FROM M_Product_BOM b -- BOM lines
INNER JOIN M_InOutLine iol ON (b.M_Product_ID=iol.M_Product_ID)
INNER JOIN M_Product bp ON (bp.M_Product_ID=iol.M_Product_ID -- BOM Product
AND bp.IsBOM='Y' AND bp.IsVerified='Y' AND bp.IsPickListPrintDetails='Y')
INNER JOIN M_Product p ON (b.M_ProductBOM_ID=p.M_Product_ID) -- BOM line product
INNER JOIN C_UOM_Trl uom ON (p.C_UOM_ID=uom.C_UOM_ID)
INNER JOIN M_Product_Trl pt ON (iol.M_Product_ID=pt.M_Product_ID AND uom.AD_Language=pt.AD_Language)
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID);*/
FROM PP_Product_BOM b -- BOM lines
INNER JOIN M_InOutLine iol ON (b.M_Product_ID=iol.M_Product_ID)
INNER JOIN M_Product bp ON (bp.M_Product_ID=iol.M_Product_ID -- BOM Product
AND bp.IsBOM='Y' AND bp.IsVerified='Y' AND bp.IsPickListPrintDetails='Y')
INNER JOIN PP_Product_BOMLine bl ON (bl.PP_Product_BOM_ID=b.PP_Product_BOM_ID)
INNER JOIN M_Product p ON (bl.M_Product_ID=p.M_Product_ID) -- BOM line product
INNER JOIN C_UOM_Trl uom ON (p.C_UOM_ID=uom.C_UOM_ID)
INNER JOIN M_Product_Trl pt ON (bl.M_Product_ID=pt.M_Product_ID AND uom.AD_Language=pt.AD_Language)
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID);

View File

@ -397,7 +397,7 @@ UPDATE AD_Table_Trl SET IsTranslated='N' WHERE AD_Table_ID=53187
-- Apr 17, 2009 3:40:34 PM ECT -- Apr 17, 2009 3:40:34 PM ECT
-- Translation Charge Table Implementation -- Translation Charge Table Implementation
CREATE TABLE C_Charge_Trl (AD_Client_ID NUMERIC(10) NOT NULL, AD_Language VARCHAR(6) NOT NULL, AD_Org_ID NUMERIC(10) NOT NULL, C_Charge_ID NUMERIC(10) NOT NULL, Created TIMESTAMP DEFAULT NOW() NOT NULL, CreatedBy NUMERIC(10) NOT NULL, Description VARCHAR(255) , IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL, IsTranslated CHAR(1) CHECK (IsTranslated IN ('Y','N')) NOT NULL, Name VARCHAR(60) NOT NULL, Updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOW() NOT NULL, UpdatedBy NUMERIC(10) NOT NULL, CONSTRAINT C_Charge_Trl_Key PRIMARY KEY (AD_Language, C_Charge_ID)) CREATE TABLE C_Charge_Trl (AD_Client_ID NUMERIC(10) NOT NULL, AD_Language VARCHAR(6) NOT NULL, AD_Org_ID NUMERIC(10) NOT NULL, C_Charge_ID NUMERIC(10) NOT NULL, Created TIMESTAMP DEFAULT NOW() NOT NULL, CreatedBy NUMERIC(10) NOT NULL, Description VARCHAR(255) , IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL, IsTranslated CHAR(1) CHECK (IsTranslated IN ('Y','N')) NOT NULL, Name VARCHAR(60) NOT NULL, Updated TIMESTAMP DEFAULT NOW() NOT NULL, UpdatedBy NUMERIC(10) NOT NULL, CONSTRAINT C_Charge_Trl_Key PRIMARY KEY (AD_Language, C_Charge_ID))
; ;
-- Apr 17, 2009 3:44:32 PM ECT -- Apr 17, 2009 3:44:32 PM ECT
@ -798,3 +798,78 @@ SELECT it.AD_Client_ID, it.AD_Org_ID, it.IsActive, it.Created, it.CreatedBy, it.
FROM C_InvoiceTax it FROM C_InvoiceTax it
INNER JOIN C_Tax_Trl t ON (it.C_Tax_ID=t.C_Tax_ID); INNER JOIN C_Tax_Trl t ON (it.C_Tax_ID=t.C_Tax_ID);
DROP VIEW M_INOUT_HEADER_VT;
CREATE OR REPLACE VIEW M_INOUT_LINE_VT
(AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY,
UPDATED, UPDATEDBY, AD_LANGUAGE, M_INOUT_ID, M_INOUTLINE_ID,
LINE, M_PRODUCT_ID, MOVEMENTQTY, QTYENTERED, UOMSYMBOL,
QTYORDERED, QTYDELIVERED, QTYBACKORDERED, NAME, DESCRIPTION,
DOCUMENTNOTE, UPC, SKU, PRODUCTVALUE, M_LOCATOR_ID,
M_WAREHOUSE_ID, X, Y, Z, M_ATTRIBUTESETINSTANCE_ID,
M_ATTRIBUTESET_ID, SERNO, LOT, M_LOT_ID, GUARANTEEDATE,
PRODUCTDESCRIPTION, IMAGEURL, C_CAMPAIGN_ID, C_PROJECT_ID, C_ACTIVITY_ID,
C_PROJECTPHASE_ID, C_PROJECTTASK_ID)
AS
SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy, iol.Updated, iol.UpdatedBy,
uom.AD_Language,
iol.M_InOut_ID, iol.M_InOutLine_ID,
iol.Line, p.M_Product_ID,
CASE WHEN iol.MovementQty<>0 OR iol.M_Product_ID IS NOT NULL THEN iol.MovementQty END AS MovementQty,
CASE WHEN iol.QtyEntered<>0 OR iol.M_Product_ID IS NOT NULL THEN iol.QtyEntered END AS QtyEntered,
CASE WHEN iol.MovementQty<>0 OR iol.M_Product_ID IS NOT NULL THEN uom.UOMSymbol END AS UOMSymbol,
ol.QtyOrdered, ol.QtyDelivered,
CASE WHEN iol.MovementQty<>0 OR iol.M_Product_ID IS NOT NULL THEN ol.QtyOrdered-ol.QtyDelivered END AS QtyBackOrdered,
COALESCE(COALESCE(pt.Name,p.Name)||productAttribute(iol.M_AttributeSetInstance_ID), c.Name, iol.Description) AS Name, -- main line
CASE WHEN COALESCE(pt.Name,p.Name,c.Name) IS NOT NULL THEN iol.Description END AS Description, -- second line
COALESCE(pt.DocumentNote, p.DocumentNote) AS DocumentNote, -- third line
p.UPC, p.SKU, p.Value AS ProductValue,
iol.M_Locator_ID, l.M_Warehouse_ID, l.X, l.Y, l.Z,
iol.M_AttributeSetInstance_ID, asi.M_AttributeSet_ID, asi.SerNo, asi.Lot, asi.M_Lot_ID,asi.GuaranteeDate,
pt.Description AS ProductDescription, p.ImageURL,
iol.C_Campaign_ID, iol.C_Project_ID, iol.C_Activity_ID, iol.C_ProjectPhase_ID, iol.C_ProjectTask_ID
FROM M_InOutLine iol
INNER JOIN C_UOM_Trl uom ON (iol.C_UOM_ID=uom.C_UOM_ID)
LEFT OUTER JOIN M_Product p ON (iol.M_Product_ID=p.M_Product_ID)
LEFT OUTER JOIN M_Product_Trl pt ON (iol.M_Product_ID=pt.M_Product_ID AND uom.AD_Language=pt.AD_Language)
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID)
LEFT OUTER JOIN C_OrderLine ol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID)
LEFT OUTER JOIN C_Charge_Trl c ON (iol.C_Charge_ID=c.C_Charge_ID)
UNION
SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy, iol.Updated, iol.UpdatedBy,
uom.AD_Language,
iol.M_InOut_ID, iol.M_InOutLine_ID,
iol.Line+(bl.Line/100) AS Line, p.M_Product_ID,
--iol.MovementQty*b.BOMQty AS QtyInvoiced,
CASE WHEN bl.IsQtyPercentage = 'N' THEN iol.MovementQty*bl.QtyBOM ELSE iol.MovementQty*(bl.QtyBatch / 100) END AS QtyInvoiced,
--iol.QtyEntered*b.BOMQty AS QtyEntered,
CASE WHEN bl.IsQtyPercentage = 'N' THEN iol.QtyEntered*bl.QtyBOM ELSE iol.QtyEntered*(bl.QtyBatch / 100) END AS QtyEntered,
uom.UOMSymbol,
null, null, null,
COALESCE (pt.Name, p.Name) AS Name, -- main line
b.Description, -- second line
COALESCE (pt.DocumentNote, p.DocumentNote) AS DocumentNote, -- third line
p.UPC, p.SKU, p.Value AS ProductValue,
iol.M_Locator_ID, l.M_Warehouse_ID, l.X, l.Y, l.Z,
iol.M_AttributeSetInstance_ID, asi.M_AttributeSet_ID, asi.SerNo, asi.Lot, asi.M_Lot_ID,asi.GuaranteeDate,
pt.Description AS ProductDescription, p.ImageURL,
iol.C_Campaign_ID, iol.C_Project_ID, iol.C_Activity_ID, iol.C_ProjectPhase_ID, iol.C_ProjectTask_ID
/*FROM M_Product_BOM b -- BOM lines
INNER JOIN M_InOutLine iol ON (b.M_Product_ID=iol.M_Product_ID)
INNER JOIN M_Product bp ON (bp.M_Product_ID=iol.M_Product_ID -- BOM Product
AND bp.IsBOM='Y' AND bp.IsVerified='Y' AND bp.IsPickListPrintDetails='Y')
INNER JOIN M_Product p ON (b.M_ProductBOM_ID=p.M_Product_ID) -- BOM line product
INNER JOIN C_UOM_Trl uom ON (p.C_UOM_ID=uom.C_UOM_ID)
INNER JOIN M_Product_Trl pt ON (iol.M_Product_ID=pt.M_Product_ID AND uom.AD_Language=pt.AD_Language)
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID);*/
FROM PP_Product_BOM b -- BOM lines
INNER JOIN M_InOutLine iol ON (b.M_Product_ID=iol.M_Product_ID)
INNER JOIN M_Product bp ON (bp.M_Product_ID=iol.M_Product_ID -- BOM Product
AND bp.IsBOM='Y' AND bp.IsVerified='Y' AND bp.IsPickListPrintDetails='Y')
INNER JOIN PP_Product_BOMLine bl ON (bl.PP_Product_BOM_ID=b.PP_Product_BOM_ID)
INNER JOIN M_Product p ON (bl.M_Product_ID=p.M_Product_ID) -- BOM line product
INNER JOIN C_UOM_Trl uom ON (p.C_UOM_ID=uom.C_UOM_ID)
INNER JOIN M_Product_Trl pt ON (bl.M_Product_ID=pt.M_Product_ID AND uom.AD_Language=pt.AD_Language)
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID);