![]() |
#9 |
Member
|
Вот такая связь...
X++: server static LedgerAccount account( InventAccountType accountType, CustVendAC accountNum, CustVendGroupId accountGroup, TaxGroup taxGroup ) { Counter i = 0; Integer maxOutcome= enumcnt(TableGroupAll); InventPosting inventLedger; CustVendRel accountRelation; TaxGroup testTaxGroup; Integer taxQty; Counter taxI; InventPostingParameters inventPostingParameters = InventPostingParameters::find(); if (! accountGroup) accountGroup = InventPosting::accountGroup(accountType,accountNum); if (!taxGroup) taxI = 2; else taxI = inventPostingParameters.taxCodeRelationEnabled()? 1 : 2; while (taxI <= taxQty) { if (taxI == 1) testTaxGroup = taxGroup; else testTaxGroup = ''; while (i < maxOutcome) { if (inventPostingParameters.accountRelationEnabled(i)) { accountRelation= InventPosting::accountRelation(i,accountNum,accountGroup); select firstonly inventLedger index hint ItemIdx where inventLedger.InventAccountType == accountType && inventLedger.CustVendCode == i && inventLedger.CustVendRelation == accountRelation && inventLedger.ItemCode == TableGroupAll::All && inventLedger.ItemRelation == '' && inventLedger.TaxGroupId == testTaxGroup; if (inventLedger.LedgerAccountId) return inventLedger.LedgerAccountId; } i += 1; } taxI += 1; } return ''; }
__________________
С уважением, glibs® |
|