Hi All,
I have to upload rate against hsn code for one of our client. I didn’t get any standard entity in dixf. I want to upload it using x++ code but not able to understand table architecture which seems complex. Can anybody help me to come out from this issue. Any help would be appreciated.
Hi Kranthi,
thanks for your reply.
I already checked above three tables. what I understand that we can insert Hsn code, Sac code, Transaction Date From, Transaction Date to and value. this all values are inserting in TaxRuntimeLookupCondition and TaxRuntimeLookupMeasureResultDetail table. But how can we identify that the record which we are inserting that inserting against correct taxtype like CGST, SGST. I am not able to find reference for taxtype in TaxRuntimeLookupCondition table. there are no column which suggest this record inserted agains CGST or SGST.
please suggest.
awaiting for your valuable suggestion.
hi akshay,
have you found the solution, if yes then please mail me on my id foreverfriends75@gmail.com
I want to calculate the gst percentage on customize form.
Hi,
sorry for late revert. actually i wa
static void CGSTRateUpload(Args _args)
{
TaxRuntimeLookupCondition taxRuntimeLookupCondition,taxRuntimeLookupConditionSort;
TaxRuntimeLookupMeasureResult taxRuntimeLookupMeasureResult;
TaxRuntimeLookupMeasureResultDetail taxRuntimeLookupMeasureResultDetail;
int rowinserted, rowfailed;
ERComponentLookupConditionDimValue consumState,hsnCode,sacCode,partyGstReg,TaxDirection;
TaxRuntimeTaxMeasureValue Value;
FromDate TransactionDateFrom;
ToDate TransactionDateTo;
Dialog dialog;
DialogField dialogField;
SysExcelApplication application;
SysExcelWorkbooks workbooks;
SysExcelWorkbook workbook;
SysExcelWorksheets worksheets;
SysExcelWorksheet worksheet;
SysExcelCells cells;
COMVariantType type;
int row = 1;
Name name;
FileName filename;
;
dialog = new dialog("Dialog");
dialogField = dialog.addField(extendedTypeStr(FilenameOpen));
dialog.run();
if (dialog.closedOk())
{
filename = dialogField.value();
application = SysExcelApplication::construct();
workbooks = application.workbooks();
try
{
workbooks.open(filename);
}
catch (Exception::Error)
{
throw error("File cannot be opened.");
}
workbook = workbooks.item(1);
worksheets = workbook.worksheets();
worksheet = worksheets.itemFromNum(1);
cells = worksheet.cells();
try
{
do
{
row++;
ttsBegin;
taxRuntimeLookupCondition.clear();
consumState = cells.item(row,1).value().bStr();
hsnCode = cells.item(row,2).value().bStr();
sacCode = cells.item(row,3).value().bStr();
TransactionDateFrom = cells.item(row,4).value().date();
TransactionDateTo = cells.item(row,5).value().date();
partyGstReg = cells.item(row,6).value().bStr();
// TaxDirection = cells.item(row,7).value().bStr();
Value = cells.item(row,7).value().double();
if(!hsnCode)
{
hsnCode = strltrim(num2str(cells.item(row,2).value().double(),20,0,0,0));
if(hsnCode == "0")
{
hsnCode = "";
}
}
if(!sacCode)
{
sacCode = strltrim(num2str(cells.item(row,3).value().double(),20,0,0,0));
if(sacCode == "0")
{
sacCode = "";
}
}
if(!partyGstReg)
{
partyGstReg = strltrim(num2str(cells.item(row,6).value().double(),20,0,0,0));
if(partyGstReg == "0")
{
partyGstReg = "";
}
}
select maxof(SortNumber) from taxRuntimeLookupConditionSort where taxRuntimeLookupConditionSort.LookupVersion == 5637145338
&& taxRuntimeLookupConditionSort.Ledger == 5637154330;
/* select firstOnly1 taxRuntimeLookupConditionSort order by taxRuntimeLookupConditionSort.RecId desc
where taxRuntimeLookupConditionSort.Ledger == 5637154330
&& taxRuntimeLookupConditionSort.LookupVersion == 5637145338;*/
ttsBegin;
taxRuntimeLookupCondition.initValue();
taxRuntimeLookupCondition.DimValue1 = consumState;
taxRuntimeLookupCondition.DimValue2 = hsnCode;
taxRuntimeLookupCondition.DimValue3 = sacCode;
taxRuntimeLookupCondition.DateRangeFrom1 = TransactionDateFrom;
taxRuntimeLookupCondition.DateRangeTo1 = TransactionDateTo;
taxRuntimeLookupCondition.DimValue4 = partyGstReg;
// taxRuntimeLookupCondition.DimValue5 = TaxDirection;
taxRuntimeLookupCondition.LookupVersion = 5637145338; // CGST RecId
taxRuntimeLookupCondition.Ledger = 5637154330; // Current Company
if(taxRuntimeLookupConditionSort.SortNumber == 0)
{
taxRuntimeLookupCondition.SortNumber = 36;
}
else
{
taxRuntimeLookupCondition.SortNumber = taxRuntimeLookupConditionSort.SortNumber + 1;
}
//taxRuntimeLookupCondition.validateWrite();
taxRuntimeLookupCondition.insert();
/* update_recordset taxRuntimeLookupConditionSort
setting SortNumber = taxRuntimeLookupConditionSort.SortNumber - 1
where taxRuntimeLookupConditionSort.SortNumber > taxRuntimeLookupCondition.SortNumber
&& taxRuntimeLookupConditionSort.LookupVersion == 5637145338;//taxRuntimeLookupCondition.LookupVersion;*/
taxRuntimeLookupMeasureResult.LookupCondition = taxRuntimeLookupCondition.RecId;
taxRuntimeLookupMeasureResult.OwnerRecId = 5637145343;
taxRuntimeLookupMeasureResult.OwnerTableId = 104845;
taxRuntimeLookupMeasureResult.insert();
TaxRuntimeLookupMeasureResultDetail.LookupMeasureResult = taxRuntimeLookupMeasureResult.RecId;
TaxRuntimeLookupMeasureResultDetail.Measure = 5637145328; // Current Active GST
TaxRuntimeLookupMeasureResultDetail.Value = Value;
TaxRuntimeLookupMeasureResultDetail.insert();
ttsCommit;
rowinserted++;
//warning (strFmt("Row : %1 item : %2 Code: %3 Updated ", row, cells.item(row, 1).value().bStr(),cells.item(row, 2).value().bStr() ));
type = cells.item(row+1, 1).value().variantType();
ttsCommit;
}
while (type != COMVariantType::VT_EMPTY);
}
catch (Exception::Error)
{
ttsAbort;
throw error(strFmt("Exception orrcured in line %1",row));
}
application.quit();
info(strFmt("Total Row Failed: %1", rowfailed));
info(strFmt("Total Row Inserted: %1", rowinserted));
}
}
s logout from site so that i didn’t get notification. might be you already get solution if not check below code.