journalTrans.parmAccountType(str2enum(accType,c4));
|
switch(journalTrans.parmAccountType())
|
{
|
case LedgerJournalACType::Ledger:
|
accEntryPattern =
[strFmt("%1-%2-%3-%4-%5",c5,c6,c7,c8,c9),c5];
|
if(c6)
|
{
|
accEntryPattern +=
"Division";
|
accEntryPattern += c6;
|
dimcount++;
|
}
|
if(c7)
|
{
|
accEntryPattern +=
"Region";
|
accEntryPattern += c7;
|
dimcount++;
|
}
|
if(c8)
|
{
|
accEntryPattern +=
"Branch";
|
accEntryPattern += c8;
|
dimcount++;
|
}
|
if(c9)
|
{
|
accEntryPattern +=
"Department";
|
accEntryPattern += c9;
|
dimcount++;
|
}
|
if(c43)
|
{
|
accEntryPattern +=
"Employee";
|
accEntryPattern += c43;
|
dimcount++;
|
}
|
if(c44)
|
{
|
accEntryPattern +=
"Customer";
|
accEntryPattern += c44;
|
dimcount++;
|
}
|
accEntryPattern =
conIns(accEntryPattern,3,dimcount);
|
journalTrans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(accEntryPattern));
|
public void createJournalLines_Second()
{
#define.INR("INR")
GOD_IntegrationPostingProfile integrationPostingProfile;
container dimensionValues;
int i;
DimensionDisplayValue membership;
NumberSeq numberSeq;
NumberSeq numSeqVoucher;
GOD_CashAccountMapping CashAccountMapping;
DimensionDynamicAccount ledgerdimension;
DimensionDefault dimensionDefaultnew;
//
DimensionDefault dimensionDefault;
LedgerDimensionAccount ledgerDimensionAccount;
int dimcount =0;
container accEntryPattern;
//
;
hasError =false;
integrationPostingProfile = this.getIntegrationPostingProfile();
LedgerjournalTrans.clear();
numberSeq = NumberSeq::newGetVoucherFromId((ledgerjournalname.NumberSequenceTable));
ledgerJournalTrans.Voucher = numberSeq.voucher();
LedgerjournalTrans.Company = curext();
ledgerJournalTrans.modifiedField(fieldNum(LedgerJournalTrans, Company));
ledgerJournalTrans.JournalNum = LedgerjournalTable.JournalNum;
LedgerJournaltrans.initFromLedgerJournalTable_LT(ledgerJournalTable);
if(tpmsPJStagingDB.CurrencyCode && Currency::exist(tpmsPJStagingDB.CurrencyCode))
{
ledgerJournalTrans.CurrencyCode = tpmsPJStagingDB.CurrencyCode;
ledgerJournalTrans.ExchRate = Currency::exchRate(LedgerjournalTrans.CurrencyCode);
}
else
{
errorLog += "@IMT238";
hasError = true;
}
ledgerJournalTrans.PaymReference = tpmsPJStagingDB.Paymentreference;
ledgerJournalTrans.Prepayment = tpmsPJStagingDB.Prepayment;
ledgerJournalTrans.modifiedField(fieldNum(LedgerJournalTrans, Prepayment));
//Modified by 21929 on 27/5/2016 to fetch item groups from integration parameters for
//prepayment journals
if(tpmsPJStagingDB.Prepayment == NoYes::No)
{
ledgerJournalTrans.TaxGroup = integrationPostingProfile.SalesTaxGroup;
ledgerJournalTrans.TaxItemGroup = integrationPostingProfile.SalesTaxMainGroup;
}
else
{
ledgerJournalTrans.TaxGroup = integrationParameter.SalesTaxMainGroup;
ledgerJournalTrans.TaxItemGroup = integrationParameter.SalesTaxGroup;
}
ledgerJournalTrans.AmountCurCredit = tpmsPJStagingDB.AmountCurCredit;
ledgerJournalTrans.TransDate = tpmsPJStagingDB.TransDate;
ledgerJournalTrans.DocumentNum = tpmsPJStagingDB.DocumentNum;
ledgerJournalTrans.DocumentDate = tpmsPJStagingDB.TransDate;
ledgerJournalTrans.AccountType = LedgerJournalACType::Ledger;
ledgerJournalTrans.modifiedField(fieldNum(LedgerJournalTrans,AccountType));
if(tpmsPJStagingDB.CashPayment == NoYes::Yes)
{
CashAccountMapping = GOD_CashAccountMapping::find(tpmsPJStagingDB.Vertical,tpmsPJStagingDB.Location);
}
// ledgerJournalTrans.LedgerDimension = this.getLedgerDimensionWithFD(CashAccountMapping.MainAccountIddebitset2);
// if(tpmsPJStagingDB.CustAccount)
/*{
if(CustTable::exist(tpmsPJStagingDB.CustAccount))
{
ledgerJournalTrans.LedgerDimension = DimensionStorage::getDynamicAccount(tpmsPJStagingDB.CustAccount, LedgerJournalACType::cust);
ledgerJournalTrans.modifiedField(fieldNum(LedgerJournalTrans, LedgerDimension));
}
else
{
hasError = true;
errorLog += strFmt("@IMT270", tpmsPJStagingDB.CustAccount);
}
}
ledgerJournalTrans.LedgerDimension = DimensionStorage::getDynamicAccount(tpmsPJStagingDB.CustAccount, LedgerJournalACType::cust);
ledgerJournalTrans.modifiedField(fieldNum(LedgerJournalTrans, LedgerDimension));
else
{
hasError = true;
errorLog += "@IMT136";
}*/
accEntryPattern = [strFmt("%1-%2",CashAccountMapping.MainAccountIddebitset2,tpmsPJStagingDB.Vertical),CashAccountMapping.MainAccountIddebitset2];
if(tpmsPJStagingDB.Vertical)
{
accEntryPattern += "Verticals";
accEntryPattern += tpmsPJStagingDB.Vertical;
dimcount++;
}
accEntryPattern = conIns(accEntryPattern,3,dimcount);
ledgerDimension = AxdDimensionUtil::getLedgerAccountId(accEntryPattern);
//ledgerDimension = AxdDimensionUtil::getMultiTypeAccountId(enumNum(LedgerJournalACType),LedgerJournalACType::Ledger,[CashAccountMapping.MainAccountIddebitset2,CashAccountMapping.MainAccountIddebitset2]);
dimensionDefaultnew = this.findDefaultDimension( tpmsPJStagingDB.Vertical,tpmsPJStagingDB.Location,tpmsPJStagingDB.Event);
ledgerJournalTrans.LedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension(ledgerDimension,str2int64(tpmsPJStagingDB.Vertical));//,DimensionDefault);
//DimensionStorage::getDefaultAccountForMainAccountNum(CashAccountMapping.MainAccountIddebitset2);//, LedgerJournalACType::Ledger);
ledgerJournalTrans.modifiedField(fieldNum(LedgerJournalTrans, LedgerDimension));
//dimensionValues = GOD_getFinancialDimensionsByRecId(CustTable::find(tpmsPJStagingDB.CustAccount).DefaultDimension);
//dimensionValues = GOD_getFinancialDimensionsByRecId(MainAccount::findByMainAccountId(CashAccountMapping.MainAccountIddebitset2).RecId);
//dimensionValues = GOD_getFinancialDimensionsByRecId(5637164306);
for(i=1; i<=conLen(dimensionValues); i+=2)
{
if(conPeek(dimensionValues,i) == #Membership)
{
membership = conPeek(dimensionValues,i+1);
break;
}
}
//LedgerjournalTrans.defaultdimension = ledgerJournalTable.DefaultDimension;
LedgerjournalTrans.defaultdimension = this.DimensionDefault(membership);
LedgerjournalTrans.OffsetDefaultDimension = this.DimensionDefault(membership);
ledgerJournalTable.DefaultDimension = this.DimensionDefault(membership);
ledgerJournalTrans.PostingProfile = custLedgerAccount.PostingProfile;
ledgerJournalTrans.OffsetAccountType = this.getOffsetAccountType();
ledgerJournalTrans.OffsetLedgerDimension = this.CreateLedgerDimensionsforcashsecond(ledgerjournalname.OffsetLedgerDimension,LedgerjournalTrans.defaultdimension);
if(!ledgerJournalTrans.OffsetLedgerDimension)
{
errorLog += "@IMT272";
}
if(CustPaymModeTable::find(tpmsPJStagingDB.PaymMode) || !tpmsPJStagingDB.PaymMode)
{
LedgerjournalTrans.PaymMode = tpmsPJStagingDB.PaymMode;
}
else
{
LedgerjournalTrans.PaymMode = "";
errorLog += "@IMT253";
}
Numseqvoucher = null;
}
No comments:
Post a Comment