Tax Invoice Report
click here to import xpo with ID values
----
public class ReportRun extends ObjectRun
{
CustInvoiceJour custInvoiceJour;
CustInvoiceTrans custInvoiceTrans;
TaxTrans taxTrans;
TaxData taxData;
SalesTable salesTable;
SalesLine salesLine;
SalesParmTable salesParmTable;
MarkupTrans markupTrans;
InventTrans inventTrans;
InventDim inventDim;
InventSerialId _InventSerialId;
ConfigTable configTable;
SalesId salesId;
TaxAmount bED;
TaxValue bEDTaxValue;
TaxAmount pEdCess;
TaxValue pEdCessTaxValue;
TaxAmount sECess;
TaxValue sECessTaxValue;
TaxAmount cSTorVAT;
TaxValue cSTorTaxValue;
MarkupValue mCharges;
real subTotal;
real sumofTotalAssessableValue;
real grandTotal;
real decOfGTotal;
real realOfGTotal;
real gGrandTotal;
real roundOff;
InventSerialId serial;
str ser;
Counter counter;
Counter counter1;
counter cnt;
real quantity;
//
InventSite inventSite;
Address address;
Addressing siteAddress;
ItemId itemid;
ConfigId config;
}
----
public void init()
{
;
try
{
if(element.args().parm())
{
this.query().dataSourceTable(tablenum(CustInvoiceJour)).addRange(fieldnum(CustInvoiceJour,SalesId)).value(element.args().parm());
salesId = element.args().parm();
this.query().userUpdate(false);
this.query().interactive(false);
super();
}
}
catch(exception::Error)
{
info("@GSY97");
}
// for SLNo
counter = 0;
cnt = 1;
}
----
public boolean fetch()
{
str s;
boolean ret;
ret = super();
// select sum(AssessableValue_IN) from salesLine
// where salesLine.SalesId == salesId;
//
// sumofTotalAssessableValue = salesLine.AssessableValue_IN;
select sum(AssessableValue_IN) from custInvoiceTrans
where custInvoiceTrans.SalesId == salesId;
sumofTotalAssessableValue = custInvoiceTrans.AssessableValue_IN;
select Value from markupTrans
join custInvoiceJour
where markupTrans.TransRecId == custInvoiceJour.RecId
&& markupTrans.TransTableId == custInvoiceJour.TableId
&& markupTrans.MarkupCode == "@SYS1655"
&& custInvoiceJour.SalesId == salesId;
MCharges = markupTrans.Value;
while select sum(TaxAmount) from taxTrans
group by TaxCode
join custInvoiceJour
where taxTrans.Voucher == custInvoiceJour.LedgerVoucher
&& taxTrans.TransDate == custInvoiceJour.InvoiceDate
&& custInvoiceJour.SalesId == salesId
{
if(taxTrans.TaxCode == "@GSY106")
{
bED = taxTrans.TaxAmount;
select taxData
where taxData.TaxCode == "@GSY106";
bEDTaxValue = taxData.TaxValue;
}
if(taxTrans.TaxCode == "@GSY107")
{
pEdCess = taxTrans.TaxAmount;
select taxData
where taxData.TaxCode == "@GSY107";
pEdCessTaxValue = taxData.TaxValue;
}
if(taxTrans.TaxCode == "@GSY108")
{
sECess = taxTrans.TaxAmount;
select taxData
where taxData.TaxCode == "@GSY108";
sECessTaxValue = taxData.TaxValue;
}
if(taxTrans.TaxCode == "@GSY81")
{
cSTorVAT = taxTrans.TaxAmount;
select taxData
where taxData.TaxCode == "@GSY81";
cSTorTaxValue = taxData.TaxValue;
}
else if(taxTrans.TaxCode == "@GSY109")
{
cSTorVAT = taxTrans.TaxAmount;
select taxData
where taxData.TaxCode == "@GSY109";
cSTorTaxValue = taxData.TaxValue;
}
}
subTotal = sumofTotalAssessableValue + (-bED) + (-pEdCess) + (-sECess);
grandTotal = subTotal + (-cSTorVAT) + mCharges;
decOfGTotal = (decround(frac(grandTotal), 2));
realOfGTotal = grandTotal - decOfGTotal;
if(decOfGTotal >= 0.50)
{
gGrandTotal = realOfGTotal + 1;
roundOff = gGrandTotal - grandTotal;
}
else
{
gGrandTotal = grandTotal - decOfGTotal;
roundOff = -decOfGTotal;
}
// select inventTrans
// join custInvoiceTrans
// where inventTrans.TransRefId == salesId
// join inventDim
// where inventDim.inventDimId == inventTrans.inventDimId;
//
// serial = inventDim.inventSerialId;
//
//while select inventTrans
// join custInvoiceTrans
// where inventTrans.TransRefId == salesId
// join inventDim
// where inventDim.inventDimId == inventTrans.inventDimId
// {
// // _InventSerialId = inventDim.inventSerialId;
// this.send(inventDim);
// }
element.execute(3);
element.execute(6);
//element.execute(4);
while select custInvoiceTrans
where custInvoiceTrans.SalesId == salesId
{
element.execute(4);
}
while select inventTrans
//join custInvoiceTrans where custinvoiceTrans.SalesId == salesId
where inventTrans.TransRefId == salesId
{
while select inventDim where inventDim.inventDimId == inventTrans.inventDimId
{
//this.send(inventDim);
itemid = inventTrans.ItemId;
element.execute(5);
}
}
while select configTable where configTable.ItemId == inventTrans.ItemId
&& configTable.ConfigId == inventDim.configId
{
// techDesc = configTable.TechnicalDescription;
//this.send(configTable);
element.execute(5);
}
//addres for site
// while select salesLine
// where salesLine.SalesId == salesId
// {
// itemid = salesLine.ItemId;
// element.execute(4);
// }
element.execute(1);
return ret;
}
----
For tax fields IN programable section
//BP Deviation documented
display real bED()
{
;
return -bED;
}
--
//BP Deviation documented
display real pEdCess()
{
;
return -pEdCess;
}
--
-----
//BP Deviation Documented
display Addressing siteAddr()
{
;
while select salesTable
where salesTable.SalesId == salesId
join inventSite where inventSite.SiteId == salesTable.InventSiteId
join address where address.Name == inventSite.SiteId
{
siteAddress = address.Address;
}
return siteAddress;
}
------
//BP Deviation Documented
display InvoiceId invoiceId()
{
;
select InvoiceId from custInvoiceJour
where custInvoiceJour.SalesId == salesId;
return custInvoiceJour.InvoiceId;
}
-----
This blog is for Dynamics AX (AXAPTA) Developers,this will help you for your development issues. This site contains some Microsoft Dynamics AX X++ Codes for use in your day to day use.
Subscribe to:
Post Comments (Atom)
Ledger Voucher creation Framework and x++ code to create ledger voucher
Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...
-
{ "Message" : "Please verify that the user is valid and set up correctly." } Sol: System Administration > Se...
-
Please click here to access Custom Workflow step by step process:
-
FormRun formRun = sender.formRun(); Object inventTrans_ds = formRun.dataSource(formDataSourceStr(InventMarking,InventTransO...
No comments:
Post a Comment
Give me the commetns and solutions