mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-13 22:35:16 +03:00
feat(meta-compile,meta-decompile): поддержка типа ChartOfAccounts (План счетов) (v1.37/v0.26)
Четвёртый тип раундтрипа (после Catalog/ExchangePlan/ПВХ). Корпус — 3 дампа 8.3.24.
Декомпилятор: снят гейт +ChartOfAccounts; тип-зависимые дефолты (checkUnique=true,
dataLockControlMode=Automatic, codeSeries=WholeChartOfAccounts, defaultPresentation=AsCode);
спец-свойства extDimensionTypes/maxExtDimensionCount/codeMask/autoOrderByCode/orderLength +
DataHistory-триплет; профиль StandardAttributes ПС; захват признаков учёта и предопределённых счетов.
Компилятор: Emit-ChartOfAccountsProperties переписан на общие хелперы в каноническом порядке
(был устаревший хардкод неверного порядка/дефолтов). Всегда эмитится платформенно-константный
блок StandardTabularSections/ExtDimensionTypes (обёртка Synonym пустой-lang «Виды субконто»,
вложенный ExtDimensionType→FillChecking=ShowError). StandardAttributes-профиль ПС условный
(Наименование/Код→ShowError, Родитель→FFV).
Общие фиксы:
- Новый контекст реквизита `account` (= catalog, но БЕЗ <Use> — реквизиты ПС не иерархичны как
справочник); ПВХ переведён с ошибочного отдельного case на общий с catalog.
- Признаки учёта (AccountingFlag/ExtDimensionAccountingFlag) — переиспользован Emit-Attribute с
параметром тега + контекст `account-flag` (= account, но без Indexing/FullTextSearch, тип по
умолчанию Boolean). Старые куцые Emit-AccountingFlag/Emit-ExtDimensionAccountingFlag удалены.
- ent:AccountType — FillValue реквизита Тип: Active/Passive/ActivePassive распознаются
в Normalize-ChoiceValue. CodeSeries allowlist +WholeChartOfAccounts.
Предопределённые счета — отдельная грамматика (Emit-PredefAccount/Build-PredefinedAccountXml +
PredefAccount-ToDsl): AccountType/OffBalance/Order(вербатим)/AccountingFlags(только TRUE, разворот
по def-порядку признаков плана)/ExtDimensionTypes(субконто {type,turnover?,flags?})/ChildItems.
Роундтрип 3/3 match, TOTAL 25596→0. Регресс 47/47 ps1+py, ps1↔py identical. 1С-cert ✓.
spec §7.2c, кейс chart-of-accounts.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# meta-compile v1.36 — Compile 1C metadata object from JSON
|
||||
# meta-compile v1.37 — Compile 1C metadata object from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
@@ -257,7 +257,7 @@ $script:validEnumValues = @{
|
||||
"FillChecking" = @("DontCheck","ShowError","ShowWarning")
|
||||
"Indexing" = @("DontIndex","Index","IndexWithAdditionalOrder")
|
||||
"SubordinationUse" = @("ToItems","ToFolders","ToFoldersAndItems")
|
||||
"CodeSeries" = @("WholeCatalog","WithinSubordination","WithinOwnerSubordination","WholeCharacteristicKind")
|
||||
"CodeSeries" = @("WholeCatalog","WithinSubordination","WithinOwnerSubordination","WholeCharacteristicKind","WholeChartOfAccounts")
|
||||
"ChoiceMode" = @("BothWays","QuickChoice","FromForm")
|
||||
"CreateOnInput" = @("Auto","Use","DontUse")
|
||||
"ChoiceHistoryOnInput" = @("Auto","DontUse")
|
||||
@@ -630,6 +630,8 @@ $script:fillEmptyRefWords = @('emptyref','пустаяссылка')
|
||||
$script:fillEnumValWords = @('enumvalue','значениеперечисления')
|
||||
$script:fillBoolTrue = @('true','истина','да')
|
||||
$script:fillBoolFalse = @('false','ложь','нет')
|
||||
# Значения платформенного перечисления ВидСчета (ent:AccountType) — FillValue стандартного реквизита Тип у Плана счетов.
|
||||
$script:accountTypeValues = @('Active','Passive','ActivePassive')
|
||||
# XxxRef (тип реквизита) → корень DTR-пути (для разворота короткой записи значения).
|
||||
$script:fillRefKindRoot = @{
|
||||
'catalogref'='Catalog'; 'documentref'='Document'; 'enumref'='Enum';
|
||||
@@ -1018,7 +1020,7 @@ $script:standardAttributesByType = @{
|
||||
"AccumulationRegister" = @("Active","LineNumber","Recorder","Period")
|
||||
"AccountingRegister" = @("Active","Period","Recorder","LineNumber","Account")
|
||||
"CalculationRegister" = @("Active","Recorder","LineNumber","RegistrationPeriod","CalculationType","ReversingEntry")
|
||||
"ChartOfAccounts" = @("PredefinedDataName","Predefined","Ref","DeletionMark","Description","Code","Parent","Order","Type","OffBalance")
|
||||
"ChartOfAccounts" = @("PredefinedDataName","Order","OffBalance","Type","Description","Code","Parent","Predefined","DeletionMark","Ref")
|
||||
"ChartOfCharacteristicTypes" = @("PredefinedDataName","Predefined","Ref","DeletionMark","Description","Code","Parent","ValueType")
|
||||
"ChartOfCalculationTypes" = @("PredefinedDataName","Predefined","Ref","DeletionMark","Description","Code","ActionPeriodIsBasic")
|
||||
"BusinessProcess" = @("Ref","DeletionMark","Date","Number","Started","Completed","HeadTask")
|
||||
@@ -1047,6 +1049,13 @@ $script:stdAttrProfile = @{
|
||||
"Description" = @{ FillChecking = "ShowError" }
|
||||
"Parent" = @{ FillFromFillingValue = "true" }
|
||||
}
|
||||
# ChartOfAccounts: Наименование/Код → FillChecking=ShowError (3/3), Родитель → FFV=true (3/3). Тип (АктивПассив)
|
||||
# и FillValue Родителя (self EmptyRef) кастомизируются пообъектно → захват override, не профиль.
|
||||
"ChartOfAccounts" = @{
|
||||
"Description" = @{ FillChecking = "ShowError" }
|
||||
"Code" = @{ FillChecking = "ShowError" }
|
||||
"Parent" = @{ FillFromFillingValue = "true" }
|
||||
}
|
||||
}
|
||||
|
||||
# $ov — hashtable переопределений (профиль + DSL) для полей: FillChecking, FillFromFillingValue,
|
||||
@@ -1107,7 +1116,7 @@ function Emit-StandardAttribute {
|
||||
# Прочие типы (не в множестве) → блок эмитится всегда (текущее поведение, пока их правило не выведено).
|
||||
# - stdAttrProfile[тип]: профиль материализованного блока (пусто = schema-дефолт), поверх — DSL-override.
|
||||
# Миграция типа = добавить его в stdAttrConditionalTypes + stdAttrProfile и переснять снэпшоты; КОД НЕ ТРОГАЕМ.
|
||||
$script:stdAttrConditionalTypes = @('Catalog', 'ExchangePlan', 'ChartOfCharacteristicTypes')
|
||||
$script:stdAttrConditionalTypes = @('Catalog', 'ExchangePlan', 'ChartOfCharacteristicTypes', 'ChartOfAccounts')
|
||||
function Emit-StandardAttributes {
|
||||
param([string]$indent, [string]$objectType)
|
||||
$attrs = $script:standardAttributesByType[$objectType]
|
||||
@@ -1321,6 +1330,7 @@ function Normalize-ChoiceValue {
|
||||
if ($s -match '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$') { return @{ XsiType='xs:dateTime'; Text=$s } }
|
||||
$ref = Normalize-FillRef $s
|
||||
if ($ref) { return @{ XsiType='xr:DesignTimeRef'; Text=$ref } }
|
||||
if ($script:accountTypeValues -contains $s) { return @{ XsiType='ent:AccountType'; Text=$s } }
|
||||
return @{ XsiType='xs:string'; Text=$s }
|
||||
}
|
||||
|
||||
@@ -1521,8 +1531,10 @@ function Emit-MinMaxValue {
|
||||
}
|
||||
|
||||
function Emit-Attribute {
|
||||
param([string]$indent, $parsed, [string]$context)
|
||||
# $context: "catalog", "document", "object", "processor", "tabular", "processor-tabular", "register"
|
||||
param([string]$indent, $parsed, [string]$context, [string]$elemTag = "Attribute")
|
||||
# $context: "catalog", "document", "object", "processor", "tabular", "processor-tabular", "register",
|
||||
# "account" (реквизит Плана счетов: как catalog, но без <Use>), "account-flag" (признак учёта ПС:
|
||||
# как account, но без <Indexing>/<FullTextSearch>, тип по умолчанию Boolean; $elemTag = AccountingFlag/ExtDimensionAccountingFlag)
|
||||
$attrName = $parsed.name
|
||||
$ctxReserved = $script:reservedByContext[$context]
|
||||
if ($ctxReserved) {
|
||||
@@ -1538,7 +1550,7 @@ function Emit-Attribute {
|
||||
Write-Warning "Attribute '$attrName' conflicts with a standard attribute name. This may cause errors when loading into 1C."
|
||||
}
|
||||
$uuid = New-Guid-String
|
||||
X "$indent<Attribute uuid=`"$uuid`">"
|
||||
X "$indent<$elemTag uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $parsed.name)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym
|
||||
@@ -1548,6 +1560,11 @@ function Emit-Attribute {
|
||||
$typeStr = $parsed.type
|
||||
if ($typeStr) {
|
||||
Emit-ValueType "$indent`t`t" $typeStr
|
||||
} elseif ($context -eq "account-flag") {
|
||||
# Признак учёта — по умолчанию Boolean.
|
||||
X "$indent`t`t<Type>"
|
||||
X "$indent`t`t`t<v8:Type>xs:boolean</v8:Type>"
|
||||
X "$indent`t`t</Type>"
|
||||
} else {
|
||||
# Default: unqualified string
|
||||
X "$indent`t`t<Type>"
|
||||
@@ -1607,14 +1624,17 @@ function Emit-Attribute {
|
||||
|
||||
# Indexing/FullTextSearch/DataHistory — not for non-stored objects (processor, processor-tabular)
|
||||
if ($context -notin @("processor", "processor-tabular")) {
|
||||
$indexing = "DontIndex"
|
||||
if ($parsed.flags -contains "index") { $indexing = "Index" }
|
||||
if ($parsed.flags -contains "indexadditional") { $indexing = "IndexWithAdditionalOrder" }
|
||||
if ($parsed.indexing) { $indexing = $parsed.indexing }
|
||||
X "$indent`t`t<Indexing>$indexing</Indexing>"
|
||||
# Признаки учёта ПС (account-flag) не имеют <Indexing>/<FullTextSearch>, но имеют <DataHistory>.
|
||||
if ($context -ne "account-flag") {
|
||||
$indexing = "DontIndex"
|
||||
if ($parsed.flags -contains "index") { $indexing = "Index" }
|
||||
if ($parsed.flags -contains "indexadditional") { $indexing = "IndexWithAdditionalOrder" }
|
||||
if ($parsed.indexing) { $indexing = $parsed.indexing }
|
||||
X "$indent`t`t<Indexing>$indexing</Indexing>"
|
||||
|
||||
$fts = if ($parsed.fullTextSearch) { $parsed.fullTextSearch } else { "Use" }
|
||||
X "$indent`t`t<FullTextSearch>$fts</FullTextSearch>"
|
||||
$fts = if ($parsed.fullTextSearch) { $parsed.fullTextSearch } else { "Use" }
|
||||
X "$indent`t`t<FullTextSearch>$fts</FullTextSearch>"
|
||||
}
|
||||
# DataHistory — not for Chart* types and non-InformationRegister register family
|
||||
if ($context -notin @("chart", "register-other")) {
|
||||
$dh = if ($parsed.dataHistory) { $parsed.dataHistory } else { "Use" }
|
||||
@@ -1623,7 +1643,7 @@ function Emit-Attribute {
|
||||
}
|
||||
|
||||
X "$indent`t</Properties>"
|
||||
X "$indent</Attribute>"
|
||||
X "$indent</$elemTag>"
|
||||
}
|
||||
|
||||
# <Picture> команды — структурный блок (зеркало form-compile). Дефолт LoadTransparent=true (конвенция
|
||||
@@ -2721,87 +2741,111 @@ function Emit-ChartOfAccountsProperties {
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
X "$i<Comment/>"
|
||||
X "$i<UseStandardCommands>true</UseStandardCommands>"
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
X "$i<UseStandardCommands>$useStdCmd</UseStandardCommands>"
|
||||
$inclHelp = if (Get-BoolProp "includeHelpInContents" $false) { "true" } else { "false" }
|
||||
X "$i<IncludeHelpInContents>$inclHelp</IncludeHelpInContents>"
|
||||
Emit-BasedOn $i $def.basedOn
|
||||
|
||||
# ExtDimensionTypes
|
||||
$extDimTypes = if ($def.extDimensionTypes) { "$($def.extDimensionTypes)" } else { "" }
|
||||
if ($extDimTypes) { X "$i<ExtDimensionTypes>$extDimTypes</ExtDimensionTypes>" }
|
||||
else { X "$i<ExtDimensionTypes/>" }
|
||||
# ExtDimensionTypes — ссылка на ПВХ видов субконто (прощающий ввод: ПланВидовХарактеристик.X → ChartOfCharacteristicTypes.X).
|
||||
$extDimTypes = ""
|
||||
if ($def.extDimensionTypes) {
|
||||
$extDimTypes = "$($def.extDimensionTypes)"
|
||||
if ($extDimTypes.Contains('.')) {
|
||||
$edtDot = $extDimTypes.IndexOf('.'); $edtPfx = $extDimTypes.Substring(0, $edtDot); $edtSfx = $extDimTypes.Substring($edtDot + 1)
|
||||
if ($script:objectTypeSynonyms.ContainsKey($edtPfx)) { $edtPfx = $script:objectTypeSynonyms[$edtPfx] }
|
||||
$extDimTypes = "$edtPfx.$edtSfx"
|
||||
}
|
||||
}
|
||||
if ($extDimTypes) { X "$i<ExtDimensionTypes>$(Esc-Xml $extDimTypes)</ExtDimensionTypes>" } else { X "$i<ExtDimensionTypes/>" }
|
||||
|
||||
$maxExtDim = if ($null -ne $def.maxExtDimensionCount) { "$($def.maxExtDimensionCount)" } else { "3" }
|
||||
X "$i<MaxExtDimensionCount>$maxExtDim</MaxExtDimensionCount>"
|
||||
|
||||
$codeMask = if ($def.codeMask) { "$($def.codeMask)" } else { "" }
|
||||
if ($codeMask) { X "$i<CodeMask>$codeMask</CodeMask>" } else { X "$i<CodeMask/>" }
|
||||
|
||||
$codeLength = if ($null -ne $def.codeLength) { "$($def.codeLength)" } else { "8" }
|
||||
$descriptionLength = if ($null -ne $def.descriptionLength) { "$($def.descriptionLength)" } else { "120" }
|
||||
$codeSeries = if ($def.codeSeries) { "$($def.codeSeries)" } else { "WholeChartOfAccounts" }
|
||||
$autoOrder = if ($def.autoOrderByCode -eq $false) { "false" } else { "true" }
|
||||
$orderLength = if ($null -ne $def.orderLength) { "$($def.orderLength)" } else { "5" }
|
||||
if ($def.codeMask) { X "$i<CodeMask>$(Esc-XmlText "$($def.codeMask)")</CodeMask>" } else { X "$i<CodeMask/>" }
|
||||
|
||||
$codeLength = if ($null -ne $def.codeLength) { "$($def.codeLength)" } else { "9" }
|
||||
$descriptionLength = if ($null -ne $def.descriptionLength) { "$($def.descriptionLength)" } else { "25" }
|
||||
X "$i<CodeLength>$codeLength</CodeLength>"
|
||||
X "$i<DescriptionLength>$descriptionLength</DescriptionLength>"
|
||||
X "$i<CodeSeries>$codeSeries</CodeSeries>"
|
||||
X "$i<CheckUnique>false</CheckUnique>"
|
||||
X "$i<DefaultPresentation>AsDescription</DefaultPresentation>"
|
||||
X "$i<AutoOrderByCode>$autoOrder</AutoOrderByCode>"
|
||||
X "$i<OrderLength>$orderLength</OrderLength>"
|
||||
|
||||
X "$i<EditType>InDialog</EditType>"
|
||||
X "$i<CodeSeries>$(Get-EnumProp 'CodeSeries' 'codeSeries' 'WholeChartOfAccounts')</CodeSeries>"
|
||||
$checkUnique = if ($def.checkUnique -eq $false) { "false" } else { "true" }
|
||||
X "$i<CheckUnique>$checkUnique</CheckUnique>"
|
||||
X "$i<DefaultPresentation>$(Get-EnumProp 'DefaultPresentation' 'defaultPresentation' 'AsCode')</DefaultPresentation>"
|
||||
|
||||
Emit-StandardAttributes $i "ChartOfAccounts"
|
||||
Emit-Characteristics $i $def.characteristics
|
||||
|
||||
# StandardTabularSections — ExtDimensionTypes
|
||||
# StandardTabularSections — ExtDimensionTypes (обёртка платформенно-константна: Synonym с пустым lang «Виды субконто»,
|
||||
# Comment/ToolTip/FillChecking; вложены 4 стандартных реквизита all-default). Кастомизация — не выведена (см. WORKFLOW).
|
||||
X "$i<StandardTabularSections>"
|
||||
X "$i`t<xr:StandardTabularSection name=`"ExtDimensionTypes`">"
|
||||
X "$i`t`t<xr:Synonym>"
|
||||
X "$i`t`t`t<v8:item>"
|
||||
X "$i`t`t`t`t<v8:lang/>"
|
||||
X "$i`t`t`t`t<v8:content>Виды субконто</v8:content>"
|
||||
X "$i`t`t`t</v8:item>"
|
||||
X "$i`t`t</xr:Synonym>"
|
||||
X "$i`t`t<xr:Comment/>"
|
||||
X "$i`t`t<xr:ToolTip/>"
|
||||
X "$i`t`t<xr:FillChecking>DontCheck</xr:FillChecking>"
|
||||
X "$i`t`t<xr:StandardAttributes>"
|
||||
foreach ($stAttr in @("TurnoversOnly","Predefined","ExtDimensionType","LineNumber")) {
|
||||
Emit-StandardAttribute "$i`t`t`t" $stAttr
|
||||
$stOv = if ($stAttr -eq "ExtDimensionType") { @{ FillChecking = "ShowError" } } else { $null }
|
||||
Emit-StandardAttribute "$i`t`t`t" $stAttr $stOv
|
||||
}
|
||||
X "$i`t`t</xr:StandardAttributes>"
|
||||
X "$i`t</xr:StandardTabularSection>"
|
||||
X "$i</StandardTabularSections>"
|
||||
|
||||
X "$i<Characteristics/>"
|
||||
X "$i<PredefinedDataUpdate>Auto</PredefinedDataUpdate>"
|
||||
X "$i<PredefinedDataUpdate>$(Get-EnumProp 'PredefinedDataUpdate' 'predefinedDataUpdate' 'Auto')</PredefinedDataUpdate>"
|
||||
X "$i<EditType>$(Get-EnumProp 'EditType' 'editType' 'InDialog')</EditType>"
|
||||
$quickChoice = if ($def.quickChoice -eq $true) { "true" } else { "false" }
|
||||
X "$i<QuickChoice>$quickChoice</QuickChoice>"
|
||||
X "$i<ChoiceMode>BothWays</ChoiceMode>"
|
||||
X "$i<InputByString>"
|
||||
X "$i`t<xr:Field>ChartOfAccounts.$objName.StandardAttribute.Description</xr:Field>"
|
||||
X "$i`t<xr:Field>ChartOfAccounts.$objName.StandardAttribute.Code</xr:Field>"
|
||||
X "$i</InputByString>"
|
||||
X "$i<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>"
|
||||
X "$i<ChoiceMode>$(Get-EnumProp 'ChoiceMode' 'choiceMode' 'BothWays')</ChoiceMode>"
|
||||
|
||||
# InputByString: override ЛИБО дефолт [Descr при D>0]+[Code при C>0] (prefix ChartOfAccounts).
|
||||
if (Test-DefKey 'inputByString') {
|
||||
$ibFields = @($def.inputByString | ForEach-Object { Expand-DataPath "$_" })
|
||||
} else {
|
||||
$ibFields = @()
|
||||
if ([int]$descriptionLength -gt 0) { $ibFields += "ChartOfAccounts.$objName.StandardAttribute.Description" }
|
||||
if ([int]$codeLength -gt 0) { $ibFields += "ChartOfAccounts.$objName.StandardAttribute.Code" }
|
||||
}
|
||||
Emit-FieldBlock $i "InputByString" $ibFields
|
||||
X "$i<SearchStringModeOnInputByString>$(Get-EnumProp 'SearchStringModeOnInputByString' 'searchStringModeOnInputByString' 'Begin')</SearchStringModeOnInputByString>"
|
||||
X "$i<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>"
|
||||
X "$i<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>"
|
||||
X "$i<DefaultObjectForm/>"
|
||||
X "$i<DefaultListForm/>"
|
||||
X "$i<DefaultChoiceForm/>"
|
||||
X "$i<AuxiliaryObjectForm/>"
|
||||
X "$i<AuxiliaryListForm/>"
|
||||
X "$i<AuxiliaryChoiceForm/>"
|
||||
X "$i<IncludeHelpInContents>false</IncludeHelpInContents>"
|
||||
X "$i<BasedOn/>"
|
||||
X "$i<DataLockFields/>"
|
||||
X "$i<CreateOnInput>$(Get-EnumProp 'CreateOnInput' 'createOnInput' 'DontUse')</CreateOnInput>"
|
||||
X "$i<ChoiceHistoryOnInput>$(Get-EnumProp 'ChoiceHistoryOnInput' 'choiceHistoryOnInput' 'Auto')</ChoiceHistoryOnInput>"
|
||||
Emit-FormRef $i "DefaultObjectForm" $def.defaultObjectForm
|
||||
Emit-FormRef $i "DefaultListForm" $def.defaultListForm
|
||||
Emit-FormRef $i "DefaultChoiceForm" $def.defaultChoiceForm
|
||||
Emit-FormRef $i "AuxiliaryObjectForm" $def.auxiliaryObjectForm
|
||||
Emit-FormRef $i "AuxiliaryListForm" $def.auxiliaryListForm
|
||||
Emit-FormRef $i "AuxiliaryChoiceForm" $def.auxiliaryChoiceForm
|
||||
|
||||
$dataLockControlMode = Get-EnumProp "DataLockControlMode" "dataLockControlMode" "Automatic"
|
||||
X "$i<DataLockControlMode>$dataLockControlMode</DataLockControlMode>"
|
||||
$autoOrder = if ($def.autoOrderByCode -eq $false) { "false" } else { "true" }
|
||||
X "$i<AutoOrderByCode>$autoOrder</AutoOrderByCode>"
|
||||
$orderLength = if ($null -ne $def.orderLength) { "$($def.orderLength)" } else { "9" }
|
||||
X "$i<OrderLength>$orderLength</OrderLength>"
|
||||
|
||||
$fullTextSearch = Get-EnumProp "FullTextSearch" "fullTextSearch" "Use"
|
||||
X "$i<FullTextSearch>$fullTextSearch</FullTextSearch>"
|
||||
$dlFields = if (Test-DefKey 'dataLockFields') { @($def.dataLockFields | ForEach-Object { Expand-DataPath "$_" }) } else { @() }
|
||||
Emit-FieldBlock $i "DataLockFields" $dlFields
|
||||
X "$i<DataLockControlMode>$(Get-EnumProp 'DataLockControlMode' 'dataLockControlMode' 'Automatic')</DataLockControlMode>"
|
||||
X "$i<FullTextSearch>$(Get-EnumProp 'FullTextSearch' 'fullTextSearch' 'Use')</FullTextSearch>"
|
||||
X "$i<DataHistory>$(Get-EnumProp 'DataHistory' 'dataHistory' 'DontUse')</DataHistory>"
|
||||
$updDH = if (Get-BoolProp "updateDataHistoryImmediatelyAfterWrite" $false) { "true" } else { "false" }
|
||||
X "$i<UpdateDataHistoryImmediatelyAfterWrite>$updDH</UpdateDataHistoryImmediatelyAfterWrite>"
|
||||
$execDH = if (Get-BoolProp "executeAfterWriteDataHistoryVersionProcessing" $false) { "true" } else { "false" }
|
||||
X "$i<ExecuteAfterWriteDataHistoryVersionProcessing>$execDH</ExecuteAfterWriteDataHistoryVersionProcessing>"
|
||||
|
||||
Emit-MLText $i "ObjectPresentation" $def.objectPresentation
|
||||
Emit-MLText $i "ExtendedObjectPresentation" $def.extendedObjectPresentation
|
||||
Emit-MLText $i "ListPresentation" $def.listPresentation
|
||||
Emit-MLText $i "ExtendedListPresentation" $def.extendedListPresentation
|
||||
Emit-MLText $i "Explanation" $def.explanation
|
||||
X "$i<CreateOnInput>DontUse</CreateOnInput>"
|
||||
X "$i<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>"
|
||||
X "$i<DataHistory>DontUse</DataHistory>"
|
||||
X "$i<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>"
|
||||
X "$i<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>"
|
||||
}
|
||||
|
||||
function Emit-AccountingRegisterProperties {
|
||||
@@ -3190,74 +3234,6 @@ function Emit-Column {
|
||||
X "$indent</Column>"
|
||||
}
|
||||
|
||||
function Emit-AccountingFlag {
|
||||
param([string]$indent, [string]$flagName)
|
||||
$uuid = New-Guid-String
|
||||
$flagSynonym = Split-CamelCase $flagName
|
||||
|
||||
X "$indent<AccountingFlag uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $flagName)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $flagSynonym
|
||||
X "$indent`t`t<Comment/>"
|
||||
X "$indent`t`t<Type>"
|
||||
X "$indent`t`t`t<v8:Type>xs:boolean</v8:Type>"
|
||||
X "$indent`t`t</Type>"
|
||||
X "$indent`t`t<PasswordMode>false</PasswordMode>"
|
||||
X "$indent`t`t<Format/>"
|
||||
X "$indent`t`t<EditFormat/>"
|
||||
X "$indent`t`t<ToolTip/>"
|
||||
X "$indent`t`t<MarkNegatives>false</MarkNegatives>"
|
||||
X "$indent`t`t<Mask/>"
|
||||
X "$indent`t`t<MultiLine>false</MultiLine>"
|
||||
X "$indent`t`t<ExtendedEdit>false</ExtendedEdit>"
|
||||
X "$indent`t`t<MinValue xsi:nil=`"true`"/>"
|
||||
X "$indent`t`t<MaxValue xsi:nil=`"true`"/>"
|
||||
X "$indent`t`t<FillChecking>DontCheck</FillChecking>"
|
||||
X "$indent`t`t<ChoiceParameterLinks/>"
|
||||
X "$indent`t`t<ChoiceParameters/>"
|
||||
X "$indent`t`t<QuickChoice>Auto</QuickChoice>"
|
||||
X "$indent`t`t<ChoiceForm/>"
|
||||
X "$indent`t`t<LinkByType/>"
|
||||
X "$indent`t`t<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>"
|
||||
X "$indent`t</Properties>"
|
||||
X "$indent</AccountingFlag>"
|
||||
}
|
||||
|
||||
function Emit-ExtDimensionAccountingFlag {
|
||||
param([string]$indent, [string]$flagName)
|
||||
$uuid = New-Guid-String
|
||||
$flagSynonym = Split-CamelCase $flagName
|
||||
|
||||
X "$indent<ExtDimensionAccountingFlag uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $flagName)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $flagSynonym
|
||||
X "$indent`t`t<Comment/>"
|
||||
X "$indent`t`t<Type>"
|
||||
X "$indent`t`t`t<v8:Type>xs:boolean</v8:Type>"
|
||||
X "$indent`t`t</Type>"
|
||||
X "$indent`t`t<PasswordMode>false</PasswordMode>"
|
||||
X "$indent`t`t<Format/>"
|
||||
X "$indent`t`t<EditFormat/>"
|
||||
X "$indent`t`t<ToolTip/>"
|
||||
X "$indent`t`t<MarkNegatives>false</MarkNegatives>"
|
||||
X "$indent`t`t<Mask/>"
|
||||
X "$indent`t`t<MultiLine>false</MultiLine>"
|
||||
X "$indent`t`t<ExtendedEdit>false</ExtendedEdit>"
|
||||
X "$indent`t`t<MinValue xsi:nil=`"true`"/>"
|
||||
X "$indent`t`t<MaxValue xsi:nil=`"true`"/>"
|
||||
X "$indent`t`t<FillChecking>DontCheck</FillChecking>"
|
||||
X "$indent`t`t<ChoiceParameterLinks/>"
|
||||
X "$indent`t`t<ChoiceParameters/>"
|
||||
X "$indent`t`t<QuickChoice>Auto</QuickChoice>"
|
||||
X "$indent`t`t<ChoiceForm/>"
|
||||
X "$indent`t`t<LinkByType/>"
|
||||
X "$indent`t`t<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>"
|
||||
X "$indent`t</Properties>"
|
||||
X "$indent</ExtDimensionAccountingFlag>"
|
||||
}
|
||||
|
||||
function Emit-URLTemplate {
|
||||
param([string]$indent, [string]$tmplName, $tmplDef)
|
||||
$uuid = New-Guid-String
|
||||
@@ -3526,12 +3502,13 @@ if ($objType -in $typesWithAttrTS) {
|
||||
}
|
||||
}
|
||||
|
||||
# ChartOfAccounts: AccountingFlags + ExtDimensionAccountingFlags
|
||||
# ChartOfAccounts: AccountingFlags + ExtDimensionAccountingFlags (признаки учёта — структурно как реквизит,
|
||||
# но без Indexing/FullTextSearch/Use; тип по умолчанию Boolean). Парсим как реквизиты.
|
||||
$acctFlags = @()
|
||||
$extDimFlags = @()
|
||||
if ($objType -eq "ChartOfAccounts") {
|
||||
if ($def.accountingFlags) { $acctFlags = @($def.accountingFlags) }
|
||||
if ($def.extDimensionAccountingFlags) { $extDimFlags = @($def.extDimensionAccountingFlags) }
|
||||
if ($def.accountingFlags) { foreach ($af in $def.accountingFlags) { $acctFlags += Parse-AttributeShorthand $af } }
|
||||
if ($def.extDimensionAccountingFlags) { foreach ($edf in $def.extDimensionAccountingFlags) { $extDimFlags += Parse-AttributeShorthand $edf } }
|
||||
}
|
||||
|
||||
# Task: AddressingAttributes
|
||||
@@ -3558,7 +3535,8 @@ if ($objType -in $typesWithAttrTS) {
|
||||
"Document" { "document" }
|
||||
{ $_ -in @("DataProcessor","Report") } { "processor" }
|
||||
"ChartOfCharacteristicTypes" { "catalog" } # реквизиты ПВХ структурно как у справочника (Use/FillFromFillingValue/DataHistory)
|
||||
{ $_ -in @("ChartOfAccounts","ChartOfCalculationTypes") } { "chart" }
|
||||
"ChartOfAccounts" { "account" } # как catalog, но БЕЗ <Use> (реквизиты ПС не иерархичны как справочник)
|
||||
"ChartOfCalculationTypes" { "chart" }
|
||||
default { "object" }
|
||||
}
|
||||
foreach ($a in $attrs) {
|
||||
@@ -3569,12 +3547,10 @@ if ($objType -in $typesWithAttrTS) {
|
||||
Emit-TabularSection "`t`t`t" $tsName $tsE.columns $objType $objName $tsE.synonym $tsE.tooltip $tsE.comment $tsE.lineNumber
|
||||
}
|
||||
foreach ($af in $acctFlags) {
|
||||
$afName = if ($af.name) { $af.name } else { "$af" }
|
||||
Emit-AccountingFlag "`t`t`t" $afName
|
||||
Emit-Attribute "`t`t`t" $af "account-flag" "AccountingFlag"
|
||||
}
|
||||
foreach ($edf in $extDimFlags) {
|
||||
$edfName = if ($edf.name) { $edf.name } else { "$edf" }
|
||||
Emit-ExtDimensionAccountingFlag "`t`t`t" $edfName
|
||||
Emit-Attribute "`t`t`t" $edf "account-flag" "ExtDimensionAccountingFlag"
|
||||
}
|
||||
foreach ($aa in $addrAttrs) {
|
||||
Emit-AddressingAttribute "`t`t`t" $aa
|
||||
@@ -3827,6 +3803,82 @@ function Build-PredefinedXml {
|
||||
return $sb.ToString()
|
||||
}
|
||||
|
||||
# --- Предопределённые СЧЕТА Плана счетов (отдельная грамматика: AccountType/OffBalance/Order/AccountingFlags/
|
||||
# ExtDimensionTypes/ChildItems). Флаги перечисляем по def-порядку списков признаков плана; в DSL — только TRUE. ---
|
||||
$script:predefAccGet = { param($o, [string[]]$keys) foreach ($k in $keys) { if ($o -is [System.Collections.IDictionary]) { if ($o.Contains($k)) { return $o[$k] } } elseif ($o.PSObject -and $o.PSObject.Properties[$k]) { return $o.$k } } return $null }
|
||||
function Emit-PredefAccountFlags {
|
||||
param($sb, [string]$indent, [string]$tag, [string]$refKind, [string]$objName, [string[]]$flagNames, $trueSet)
|
||||
if (-not $flagNames -or $flagNames.Count -eq 0) { [void]$sb.Append("$indent<$tag/>`n"); return }
|
||||
$set = @{}; if ($trueSet) { foreach ($t in @($trueSet)) { $set["$t"] = $true } }
|
||||
[void]$sb.Append("$indent<$tag>`n")
|
||||
foreach ($fn in $flagNames) {
|
||||
$v = if ($set.ContainsKey($fn)) { 'true' } else { 'false' }
|
||||
[void]$sb.Append("$indent`t<Flag ref=`"ChartOfAccounts.$objName.$refKind.$fn`">$v</Flag>`n")
|
||||
}
|
||||
[void]$sb.Append("$indent</$tag>`n")
|
||||
}
|
||||
function Emit-PredefAccount {
|
||||
param($sb, $val, [string]$indent, [string]$objName, [string[]]$acctFlagNames, [string[]]$extDimFlagNames)
|
||||
$gv = $script:predefAccGet
|
||||
$name = "$(& $gv $val @('name','имя'))"
|
||||
$codeV = & $gv $val @('code','код'); $code = if ($null -ne $codeV) { "$codeV" } else { '' }
|
||||
$hasDesc = ($val -is [System.Collections.IDictionary] -and ($val.Contains('description') -or $val.Contains('наименование'))) -or ($val.PSObject -and ($val.PSObject.Properties['description'] -or $val.PSObject.Properties['наименование']))
|
||||
$descV = & $gv $val @('description','наименование')
|
||||
$desc = if ($hasDesc) { "$descV" } else { Split-CamelCase $name }
|
||||
$acctType = "$(& $gv $val @('accountType','видСчета','вид'))"; if (-not $acctType) { $acctType = 'ActivePassive' }
|
||||
$offV = & $gv $val @('offBalance','забалансовый'); $off = if ($offV -eq $true) { 'true' } else { 'false' }
|
||||
$order = "$(& $gv $val @('order','порядок'))"
|
||||
$flags = & $gv $val @('flags','признаки')
|
||||
$subconto = & $gv $val @('subconto','extDimensionTypes','видыСубконто')
|
||||
$children = & $gv $val @('childItems','подчиненные')
|
||||
|
||||
[void]$sb.Append("$indent<Item id=`"$(New-Guid-String)`">`n")
|
||||
[void]$sb.Append("$indent`t<Name>$(Esc-XmlText $name)</Name>`n")
|
||||
if (-not $code) { [void]$sb.Append("$indent`t<Code/>`n") } else { [void]$sb.Append("$indent`t<Code>$(Esc-XmlText $code)</Code>`n") }
|
||||
if ($desc -eq '') { [void]$sb.Append("$indent`t<Description/>`n") } else { [void]$sb.Append("$indent`t<Description>$(Esc-XmlText $desc)</Description>`n") }
|
||||
[void]$sb.Append("$indent`t<AccountType>$acctType</AccountType>`n")
|
||||
[void]$sb.Append("$indent`t<OffBalance>$off</OffBalance>`n")
|
||||
[void]$sb.Append("$indent`t<Order>$(Esc-XmlText $order)</Order>`n")
|
||||
Emit-PredefAccountFlags $sb "$indent`t" 'AccountingFlags' 'AccountingFlag' $objName $acctFlagNames $flags
|
||||
# ExtDimensionTypes — субконто: пусто → self-close; иначе список <ExtDimensionType name="..."> с Turnover + признаками.
|
||||
$subArr = @(); if ($subconto) { $subArr = @($subconto) }
|
||||
if ($subArr.Count -eq 0) { [void]$sb.Append("$indent`t<ExtDimensionTypes/>`n") }
|
||||
else {
|
||||
[void]$sb.Append("$indent`t<ExtDimensionTypes>`n")
|
||||
foreach ($sc in $subArr) {
|
||||
$scType = "$(& $gv $sc @('type','тип'))"
|
||||
if ($scType.Contains('.')) {
|
||||
$scDot = $scType.IndexOf('.'); $scPfx = $scType.Substring(0, $scDot); $scSfx = $scType.Substring($scDot + 1)
|
||||
if ($script:objectTypeSynonyms.ContainsKey($scPfx)) { $scPfx = $script:objectTypeSynonyms[$scPfx] }
|
||||
$scType = "$scPfx.$scSfx"
|
||||
}
|
||||
$scTurnV = & $gv $sc @('turnover','оборотный'); $scTurn = if ($scTurnV -eq $true) { 'true' } else { 'false' }
|
||||
$scFlags = & $gv $sc @('flags','признаки')
|
||||
[void]$sb.Append("$indent`t`t<ExtDimensionType name=`"$(Esc-Xml $scType)`">`n")
|
||||
[void]$sb.Append("$indent`t`t`t<Turnover>$scTurn</Turnover>`n")
|
||||
Emit-PredefAccountFlags $sb "$indent`t`t`t" 'AccountingFlags' 'ExtDimensionAccountingFlag' $objName $extDimFlagNames $scFlags
|
||||
[void]$sb.Append("$indent`t`t</ExtDimensionType>`n")
|
||||
}
|
||||
[void]$sb.Append("$indent`t</ExtDimensionTypes>`n")
|
||||
}
|
||||
$childArr = @(); if ($children) { $childArr = @($children) }
|
||||
if ($childArr.Count -gt 0) {
|
||||
[void]$sb.Append("$indent`t<ChildItems>`n")
|
||||
foreach ($c in $childArr) { Emit-PredefAccount $sb $c "$indent`t`t" $objName $acctFlagNames $extDimFlagNames }
|
||||
[void]$sb.Append("$indent`t</ChildItems>`n")
|
||||
}
|
||||
[void]$sb.Append("$indent</Item>`n")
|
||||
}
|
||||
function Build-PredefinedAccountXml {
|
||||
param($items, [string]$objName, [string[]]$acctFlagNames, [string[]]$extDimFlagNames)
|
||||
$sb = New-Object System.Text.StringBuilder
|
||||
[void]$sb.Append("<?xml version=`"1.0`" encoding=`"UTF-8`"?>`n")
|
||||
[void]$sb.Append("<PredefinedData xmlns=`"http://v8.1c.ru/8.3/xcf/predef`" xmlns:v8=`"http://v8.1c.ru/8.1/data/core`" xmlns:xr=`"http://v8.1c.ru/8.3/xcf/readable`" xmlns:xs=`"http://www.w3.org/2001/XMLSchema`" xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`" xsi:type=`"ChartOfAccountsPredefinedItems`" version=`"$($script:formatVersion)`">`n")
|
||||
foreach ($it in $items) { Emit-PredefAccount $sb $it "`t" $objName $acctFlagNames $extDimFlagNames }
|
||||
[void]$sb.Append("</PredefinedData>`n")
|
||||
return $sb.ToString()
|
||||
}
|
||||
|
||||
$extDir = Join-Path $objSubDir "Ext"
|
||||
|
||||
if (-not (Test-Path $typeDir)) {
|
||||
@@ -3927,7 +3979,16 @@ if ($objType -eq "BusinessProcess") {
|
||||
|
||||
# Предопределённые элементы (Ext/Predefined.xml). Root-элемент — по типу. Пусто/нет ключа → файл не создаём.
|
||||
$predefRootByType = @{ 'Catalog' = 'CatalogPredefinedItems'; 'ChartOfCharacteristicTypes' = 'PlanOfCharacteristicKindPredefinedItems' }
|
||||
if ($predefRootByType.ContainsKey($objType) -and $def.predefined -and @($def.predefined).Count -gt 0) {
|
||||
if ($objType -eq 'ChartOfAccounts' -and $def.predefined -and @($def.predefined).Count -gt 0) {
|
||||
# Предопределённые СЧЕТА — отдельная грамматика (флаги разворачиваются по def-порядку признаков плана).
|
||||
Ensure-ExtDir
|
||||
$afNames = @(); if ($def.accountingFlags) { foreach ($af in $def.accountingFlags) { $afNames += (Parse-AttributeShorthand $af).name } }
|
||||
$edfNames = @(); if ($def.extDimensionAccountingFlags) { foreach ($edf in $def.extDimensionAccountingFlags) { $edfNames += (Parse-AttributeShorthand $edf).name } }
|
||||
$predefXml = Build-PredefinedAccountXml @($def.predefined) $objName $afNames $edfNames
|
||||
$predefPath = Join-Path $extDir "Predefined.xml"
|
||||
[System.IO.File]::WriteAllText($predefPath, $predefXml, $enc)
|
||||
$modulesCreated += $predefPath
|
||||
} elseif ($predefRootByType.ContainsKey($objType) -and $def.predefined -and @($def.predefined).Count -gt 0) {
|
||||
Ensure-ExtDir
|
||||
$catCodeType = if ($def.codeType) { "$($def.codeType)" } else { 'String' }
|
||||
$predefXml = Build-PredefinedXml @($def.predefined) $predefRootByType[$objType] $catCodeType
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# meta-compile v1.36 — Compile 1C metadata object from JSON
|
||||
# meta-compile v1.37 — Compile 1C metadata object from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import argparse
|
||||
@@ -374,7 +374,7 @@ valid_enum_values = {
|
||||
'FillChecking': ['DontCheck', 'ShowError', 'ShowWarning'],
|
||||
'Indexing': ['DontIndex', 'Index', 'IndexWithAdditionalOrder'],
|
||||
'SubordinationUse': ['ToItems', 'ToFolders', 'ToFoldersAndItems'],
|
||||
'CodeSeries': ['WholeCatalog', 'WithinSubordination', 'WithinOwnerSubordination', 'WholeCharacteristicKind'],
|
||||
'CodeSeries': ['WholeCatalog', 'WithinSubordination', 'WithinOwnerSubordination', 'WholeCharacteristicKind', 'WholeChartOfAccounts'],
|
||||
'ChoiceMode': ['BothWays', 'QuickChoice', 'FromForm'],
|
||||
'CreateOnInput': ['Auto', 'Use', 'DontUse'],
|
||||
'ChoiceHistoryOnInput': ['Auto', 'DontUse'],
|
||||
@@ -660,6 +660,8 @@ fill_empty_ref_words = ('emptyref', 'пустаяссылка')
|
||||
fill_enum_val_words = ('enumvalue', 'значениеперечисления')
|
||||
fill_bool_true = ('true', 'истина', 'да')
|
||||
fill_bool_false = ('false', 'ложь', 'нет')
|
||||
# Значения платформенного перечисления ВидСчета (ent:AccountType) — FillValue реквизита Тип у Плана счетов.
|
||||
ACCOUNT_TYPE_VALUES = ('Active', 'Passive', 'ActivePassive')
|
||||
# XxxRef (тип реквизита) → корень DTR-пути (для разворота короткой записи значения).
|
||||
fill_ref_kind_root = {
|
||||
'catalogref': 'Catalog', 'documentref': 'Document', 'enumref': 'Enum',
|
||||
@@ -1035,7 +1037,7 @@ standard_attributes_by_type = {
|
||||
'AccumulationRegister': ['Active', 'LineNumber', 'Recorder', 'Period'],
|
||||
'AccountingRegister': ['Active', 'Period', 'Recorder', 'LineNumber', 'Account'],
|
||||
'CalculationRegister': ['Active', 'Recorder', 'LineNumber', 'RegistrationPeriod', 'CalculationType', 'ReversingEntry'],
|
||||
'ChartOfAccounts': ['PredefinedDataName', 'Predefined', 'Ref', 'DeletionMark', 'Description', 'Code', 'Parent', 'Order', 'Type', 'OffBalance'],
|
||||
'ChartOfAccounts': ['PredefinedDataName', 'Order', 'OffBalance', 'Type', 'Description', 'Code', 'Parent', 'Predefined', 'DeletionMark', 'Ref'],
|
||||
'ChartOfCharacteristicTypes': ['PredefinedDataName', 'Predefined', 'Ref', 'DeletionMark', 'Description', 'Code', 'Parent', 'ValueType'],
|
||||
'ChartOfCalculationTypes': ['PredefinedDataName', 'Predefined', 'Ref', 'DeletionMark', 'Description', 'Code', 'ActionPeriodIsBasic'],
|
||||
'BusinessProcess': ['Ref', 'DeletionMark', 'Date', 'Number', 'Started', 'Completed', 'HeadTask'],
|
||||
@@ -1061,6 +1063,12 @@ std_attr_profile = {
|
||||
'Description': {'FillChecking': 'ShowError'},
|
||||
'Parent': {'FillFromFillingValue': 'true'},
|
||||
},
|
||||
# ChartOfAccounts: Наименование/Код → FillChecking=ShowError (3/3), Родитель → FFV=true (3/3).
|
||||
'ChartOfAccounts': {
|
||||
'Description': {'FillChecking': 'ShowError'},
|
||||
'Code': {'FillChecking': 'ShowError'},
|
||||
'Parent': {'FillFromFillingValue': 'true'},
|
||||
},
|
||||
}
|
||||
|
||||
# ov — dict переопределений (профиль + DSL): FillChecking, FillFromFillingValue, Synonym,
|
||||
@@ -1126,7 +1134,7 @@ def emit_standard_attribute(indent, attr_name, ov=None):
|
||||
# Единый эмиттер блока StandardAttributes — поведение правят ДАННЫЕ, не форк кода (см. коммент в .ps1).
|
||||
# std_attr_conditional_types: типы, где блок только при кастомизации (DSL-ключ standardAttributes).
|
||||
# Прочие типы → блок всегда (текущее поведение). Миграция типа = +строчка в оба справочника + снэпшоты.
|
||||
std_attr_conditional_types = {'Catalog', 'ExchangePlan', 'ChartOfCharacteristicTypes'}
|
||||
std_attr_conditional_types = {'Catalog', 'ExchangePlan', 'ChartOfCharacteristicTypes', 'ChartOfAccounts'}
|
||||
def emit_standard_attributes(indent, object_type):
|
||||
attrs = standard_attributes_by_type.get(object_type)
|
||||
if not attrs:
|
||||
@@ -1402,6 +1410,8 @@ def normalize_choice_value(value):
|
||||
ref = normalize_fill_ref(s)
|
||||
if ref:
|
||||
return ('xr:DesignTimeRef', ref)
|
||||
if s in ACCOUNT_TYPE_VALUES:
|
||||
return ('ent:AccountType', s)
|
||||
return ('xs:string', s)
|
||||
|
||||
def convert_from_ch_param_shorthand(s):
|
||||
@@ -1597,7 +1607,10 @@ def emit_min_max_value(indent, tag, val):
|
||||
t = 'xs:string' if isinstance(val, str) else 'xs:decimal'
|
||||
X(f'{indent}<{tag} xsi:type="{t}">{esc_xml(str(val))}</{tag}>')
|
||||
|
||||
def emit_attribute(indent, parsed, context):
|
||||
def emit_attribute(indent, parsed, context, elem_tag='Attribute'):
|
||||
# context: "catalog", "document", "object", "processor", "tabular", "processor-tabular", "register",
|
||||
# "account" (реквизит Плана счетов: как catalog, но без <Use>), "account-flag" (признак учёта ПС:
|
||||
# как account, но без <Indexing>/<FullTextSearch>, тип по умолчанию Boolean; elem_tag = AccountingFlag/ExtDimensionAccountingFlag)
|
||||
attr_name = parsed['name']
|
||||
ctx_reserved = RESERVED_BY_CONTEXT.get(context)
|
||||
if ctx_reserved is not None:
|
||||
@@ -1607,7 +1620,7 @@ def emit_attribute(indent, parsed, context):
|
||||
elif context not in ('tabular', 'processor-tabular') and (attr_name in RESERVED_ATTR_NAMES or attr_name in RESERVED_ATTR_NAMES_RU):
|
||||
print(f"WARNING: Attribute '{attr_name}' conflicts with a standard attribute name. This may cause errors when loading into 1C.", file=sys.stderr)
|
||||
uid = new_uuid()
|
||||
X(f'{indent}<Attribute uuid="{uid}">')
|
||||
X(f'{indent}<{elem_tag} uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(parsed["name"])}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym'])
|
||||
@@ -1618,6 +1631,10 @@ def emit_attribute(indent, parsed, context):
|
||||
type_str = parsed['type']
|
||||
if type_str:
|
||||
emit_value_type(f'{indent}\t\t', type_str)
|
||||
elif context == 'account-flag':
|
||||
X(f'{indent}\t\t<Type>')
|
||||
X(f'{indent}\t\t\t<v8:Type>xs:boolean</v8:Type>')
|
||||
X(f'{indent}\t\t</Type>')
|
||||
else:
|
||||
X(f'{indent}\t\t<Type>')
|
||||
X(f'{indent}\t\t\t<v8:Type>xs:string</v8:Type>')
|
||||
@@ -1663,20 +1680,22 @@ def emit_attribute(indent, parsed, context):
|
||||
if context == 'catalog':
|
||||
X(f'{indent}\t\t<Use>{parsed.get("use") or "ForItem"}</Use>')
|
||||
if context not in ('processor', 'processor-tabular'):
|
||||
indexing = 'DontIndex'
|
||||
if 'index' in parsed.get('flags', []):
|
||||
indexing = 'Index'
|
||||
if 'indexadditional' in parsed.get('flags', []):
|
||||
indexing = 'IndexWithAdditionalOrder'
|
||||
if parsed.get('indexing'):
|
||||
indexing = parsed['indexing']
|
||||
X(f'{indent}\t\t<Indexing>{indexing}</Indexing>')
|
||||
X(f'{indent}\t\t<FullTextSearch>{parsed.get("fullTextSearch") or "Use"}</FullTextSearch>')
|
||||
# Признаки учёта ПС (account-flag) не имеют <Indexing>/<FullTextSearch>, но имеют <DataHistory>.
|
||||
if context != 'account-flag':
|
||||
indexing = 'DontIndex'
|
||||
if 'index' in parsed.get('flags', []):
|
||||
indexing = 'Index'
|
||||
if 'indexadditional' in parsed.get('flags', []):
|
||||
indexing = 'IndexWithAdditionalOrder'
|
||||
if parsed.get('indexing'):
|
||||
indexing = parsed['indexing']
|
||||
X(f'{indent}\t\t<Indexing>{indexing}</Indexing>')
|
||||
X(f'{indent}\t\t<FullTextSearch>{parsed.get("fullTextSearch") or "Use"}</FullTextSearch>')
|
||||
# DataHistory — not for Chart* types and non-InformationRegister register family
|
||||
if context not in ('chart', 'register-other'):
|
||||
X(f'{indent}\t\t<DataHistory>{parsed.get("dataHistory") or "Use"}</DataHistory>')
|
||||
X(f'{indent}\t</Properties>')
|
||||
X(f'{indent}</Attribute>')
|
||||
X(f'{indent}</{elem_tag}>')
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 9. TabularSection emitter
|
||||
@@ -2615,77 +2634,104 @@ def emit_chart_of_accounts_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
X(f'{i}<Comment/>')
|
||||
X(f'{i}<UseStandardCommands>true</UseStandardCommands>')
|
||||
ext_dim_types = str(defn['extDimensionTypes']) if defn.get('extDimensionTypes') else ''
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
else:
|
||||
X(f'{i}<Comment/>')
|
||||
X(f'{i}<UseStandardCommands>{"true" if get_bool_prop("useStandardCommands", True) else "false"}</UseStandardCommands>')
|
||||
X(f'{i}<IncludeHelpInContents>{"true" if get_bool_prop("includeHelpInContents", False) else "false"}</IncludeHelpInContents>')
|
||||
emit_based_on(i, defn.get('basedOn'))
|
||||
# ExtDimensionTypes — ссылка на ПВХ видов субконто (прощающий ввод: ПланВидовХарактеристик.X → ChartOfCharacteristicTypes.X).
|
||||
ext_dim_types = ''
|
||||
if defn.get('extDimensionTypes'):
|
||||
ext_dim_types = str(defn['extDimensionTypes'])
|
||||
if '.' in ext_dim_types:
|
||||
edt_pfx, edt_sfx = ext_dim_types.split('.', 1)
|
||||
if edt_pfx in object_type_synonyms:
|
||||
edt_pfx = object_type_synonyms[edt_pfx]
|
||||
ext_dim_types = f'{edt_pfx}.{edt_sfx}'
|
||||
if ext_dim_types:
|
||||
X(f'{i}<ExtDimensionTypes>{ext_dim_types}</ExtDimensionTypes>')
|
||||
X(f'{i}<ExtDimensionTypes>{esc_xml(ext_dim_types)}</ExtDimensionTypes>')
|
||||
else:
|
||||
X(f'{i}<ExtDimensionTypes/>')
|
||||
max_ext_dim = str(defn['maxExtDimensionCount']) if defn.get('maxExtDimensionCount') is not None else '3'
|
||||
X(f'{i}<MaxExtDimensionCount>{max_ext_dim}</MaxExtDimensionCount>')
|
||||
code_mask = str(defn['codeMask']) if defn.get('codeMask') else ''
|
||||
if code_mask:
|
||||
X(f'{i}<CodeMask>{code_mask}</CodeMask>')
|
||||
if defn.get('codeMask'):
|
||||
X(f'{i}<CodeMask>{esc_xml_text(str(defn["codeMask"]))}</CodeMask>')
|
||||
else:
|
||||
X(f'{i}<CodeMask/>')
|
||||
code_length = str(defn['codeLength']) if defn.get('codeLength') is not None else '8'
|
||||
description_length = str(defn['descriptionLength']) if defn.get('descriptionLength') is not None else '120'
|
||||
code_series = str(defn['codeSeries']) if defn.get('codeSeries') else 'WholeChartOfAccounts'
|
||||
auto_order = 'false' if defn.get('autoOrderByCode') is False else 'true'
|
||||
order_length = str(defn['orderLength']) if defn.get('orderLength') is not None else '5'
|
||||
code_length = str(defn['codeLength']) if defn.get('codeLength') is not None else '9'
|
||||
description_length = str(defn['descriptionLength']) if defn.get('descriptionLength') is not None else '25'
|
||||
X(f'{i}<CodeLength>{code_length}</CodeLength>')
|
||||
X(f'{i}<DescriptionLength>{description_length}</DescriptionLength>')
|
||||
X(f'{i}<CodeSeries>{code_series}</CodeSeries>')
|
||||
X(f'{i}<CheckUnique>false</CheckUnique>')
|
||||
X(f'{i}<DefaultPresentation>AsDescription</DefaultPresentation>')
|
||||
X(f'{i}<AutoOrderByCode>{auto_order}</AutoOrderByCode>')
|
||||
X(f'{i}<OrderLength>{order_length}</OrderLength>')
|
||||
X(f'{i}<EditType>InDialog</EditType>')
|
||||
X(f'{i}<CodeSeries>{get_enum_prop("CodeSeries", "codeSeries", "WholeChartOfAccounts")}</CodeSeries>')
|
||||
X(f'{i}<CheckUnique>{"false" if defn.get("checkUnique") is False else "true"}</CheckUnique>')
|
||||
X(f'{i}<DefaultPresentation>{get_enum_prop("DefaultPresentation", "defaultPresentation", "AsCode")}</DefaultPresentation>')
|
||||
emit_standard_attributes(i, 'ChartOfAccounts')
|
||||
emit_characteristics(i, defn.get('characteristics'))
|
||||
# StandardTabularSections — ExtDimensionTypes (обёртка платформенно-константна: Synonym с пустым lang «Виды субконто»,
|
||||
# Comment/ToolTip/FillChecking; 4 вложенных стандартных реквизита, ExtDimensionType → FillChecking=ShowError).
|
||||
X(f'{i}<StandardTabularSections>')
|
||||
X(f'{i}\t<xr:StandardTabularSection name="ExtDimensionTypes">')
|
||||
X(f'{i}\t\t<xr:Synonym>')
|
||||
X(f'{i}\t\t\t<v8:item>')
|
||||
X(f'{i}\t\t\t\t<v8:lang/>')
|
||||
X(f'{i}\t\t\t\t<v8:content>Виды субконто</v8:content>')
|
||||
X(f'{i}\t\t\t</v8:item>')
|
||||
X(f'{i}\t\t</xr:Synonym>')
|
||||
X(f'{i}\t\t<xr:Comment/>')
|
||||
X(f'{i}\t\t<xr:ToolTip/>')
|
||||
X(f'{i}\t\t<xr:FillChecking>DontCheck</xr:FillChecking>')
|
||||
X(f'{i}\t\t<xr:StandardAttributes>')
|
||||
for st_attr in ['TurnoversOnly', 'Predefined', 'ExtDimensionType', 'LineNumber']:
|
||||
emit_standard_attribute(f'{i}\t\t\t', st_attr)
|
||||
st_ov = {'FillChecking': 'ShowError'} if st_attr == 'ExtDimensionType' else None
|
||||
emit_standard_attribute(f'{i}\t\t\t', st_attr, st_ov)
|
||||
X(f'{i}\t\t</xr:StandardAttributes>')
|
||||
X(f'{i}\t</xr:StandardTabularSection>')
|
||||
X(f'{i}</StandardTabularSections>')
|
||||
X(f'{i}<Characteristics/>')
|
||||
X(f'{i}<PredefinedDataUpdate>Auto</PredefinedDataUpdate>')
|
||||
quick_choice = 'true' if defn.get('quickChoice') is True else 'false'
|
||||
X(f'{i}<QuickChoice>{quick_choice}</QuickChoice>')
|
||||
X(f'{i}<ChoiceMode>BothWays</ChoiceMode>')
|
||||
X(f'{i}<InputByString>')
|
||||
X(f'{i}\t<xr:Field>ChartOfAccounts.{obj_name}.StandardAttribute.Description</xr:Field>')
|
||||
X(f'{i}\t<xr:Field>ChartOfAccounts.{obj_name}.StandardAttribute.Code</xr:Field>')
|
||||
X(f'{i}</InputByString>')
|
||||
X(f'{i}<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>')
|
||||
X(f'{i}<PredefinedDataUpdate>{get_enum_prop("PredefinedDataUpdate", "predefinedDataUpdate", "Auto")}</PredefinedDataUpdate>')
|
||||
X(f'{i}<EditType>{get_enum_prop("EditType", "editType", "InDialog")}</EditType>')
|
||||
X(f'{i}<QuickChoice>{"true" if defn.get("quickChoice") is True else "false"}</QuickChoice>')
|
||||
X(f'{i}<ChoiceMode>{get_enum_prop("ChoiceMode", "choiceMode", "BothWays")}</ChoiceMode>')
|
||||
# InputByString: override ЛИБО дефолт [Descr при D>0]+[Code при C>0] (prefix ChartOfAccounts).
|
||||
if 'inputByString' in defn:
|
||||
ib_fields = [expand_data_path(str(x)) for x in (defn.get('inputByString') or [])]
|
||||
else:
|
||||
ib_fields = []
|
||||
if int(description_length) > 0:
|
||||
ib_fields.append(f'ChartOfAccounts.{obj_name}.StandardAttribute.Description')
|
||||
if int(code_length) > 0:
|
||||
ib_fields.append(f'ChartOfAccounts.{obj_name}.StandardAttribute.Code')
|
||||
emit_field_block(i, 'InputByString', ib_fields)
|
||||
X(f'{i}<SearchStringModeOnInputByString>{get_enum_prop("SearchStringModeOnInputByString", "searchStringModeOnInputByString", "Begin")}</SearchStringModeOnInputByString>')
|
||||
X(f'{i}<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>')
|
||||
X(f'{i}<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>')
|
||||
X(f'{i}<DefaultObjectForm/>')
|
||||
X(f'{i}<DefaultListForm/>')
|
||||
X(f'{i}<DefaultChoiceForm/>')
|
||||
X(f'{i}<AuxiliaryObjectForm/>')
|
||||
X(f'{i}<AuxiliaryListForm/>')
|
||||
X(f'{i}<AuxiliaryChoiceForm/>')
|
||||
X(f'{i}<IncludeHelpInContents>false</IncludeHelpInContents>')
|
||||
X(f'{i}<BasedOn/>')
|
||||
X(f'{i}<DataLockFields/>')
|
||||
data_lock_control_mode = get_enum_prop('DataLockControlMode', 'dataLockControlMode', 'Automatic')
|
||||
X(f'{i}<DataLockControlMode>{data_lock_control_mode}</DataLockControlMode>')
|
||||
full_text_search = get_enum_prop('FullTextSearch', 'fullTextSearch', 'Use')
|
||||
X(f'{i}<FullTextSearch>{full_text_search}</FullTextSearch>')
|
||||
X(f'{i}<CreateOnInput>{get_enum_prop("CreateOnInput", "createOnInput", "DontUse")}</CreateOnInput>')
|
||||
X(f'{i}<ChoiceHistoryOnInput>{get_enum_prop("ChoiceHistoryOnInput", "choiceHistoryOnInput", "Auto")}</ChoiceHistoryOnInput>')
|
||||
emit_form_ref(i, 'DefaultObjectForm', defn.get('defaultObjectForm'))
|
||||
emit_form_ref(i, 'DefaultListForm', defn.get('defaultListForm'))
|
||||
emit_form_ref(i, 'DefaultChoiceForm', defn.get('defaultChoiceForm'))
|
||||
emit_form_ref(i, 'AuxiliaryObjectForm', defn.get('auxiliaryObjectForm'))
|
||||
emit_form_ref(i, 'AuxiliaryListForm', defn.get('auxiliaryListForm'))
|
||||
emit_form_ref(i, 'AuxiliaryChoiceForm', defn.get('auxiliaryChoiceForm'))
|
||||
auto_order = 'false' if defn.get('autoOrderByCode') is False else 'true'
|
||||
X(f'{i}<AutoOrderByCode>{auto_order}</AutoOrderByCode>')
|
||||
order_length = str(defn['orderLength']) if defn.get('orderLength') is not None else '9'
|
||||
X(f'{i}<OrderLength>{order_length}</OrderLength>')
|
||||
dl_fields = [expand_data_path(str(x)) for x in defn.get('dataLockFields', [])] if 'dataLockFields' in defn else []
|
||||
emit_field_block(i, 'DataLockFields', dl_fields)
|
||||
X(f'{i}<DataLockControlMode>{get_enum_prop("DataLockControlMode", "dataLockControlMode", "Automatic")}</DataLockControlMode>')
|
||||
X(f'{i}<FullTextSearch>{get_enum_prop("FullTextSearch", "fullTextSearch", "Use")}</FullTextSearch>')
|
||||
X(f'{i}<DataHistory>{get_enum_prop("DataHistory", "dataHistory", "DontUse")}</DataHistory>')
|
||||
upd_dh = 'true' if get_bool_prop('updateDataHistoryImmediatelyAfterWrite', False) else 'false'
|
||||
X(f'{i}<UpdateDataHistoryImmediatelyAfterWrite>{upd_dh}</UpdateDataHistoryImmediatelyAfterWrite>')
|
||||
exec_dh = 'true' if get_bool_prop('executeAfterWriteDataHistoryVersionProcessing', False) else 'false'
|
||||
X(f'{i}<ExecuteAfterWriteDataHistoryVersionProcessing>{exec_dh}</ExecuteAfterWriteDataHistoryVersionProcessing>')
|
||||
emit_mltext(i, 'ObjectPresentation', defn.get('objectPresentation'))
|
||||
emit_mltext(i, 'ExtendedObjectPresentation', defn.get('extendedObjectPresentation'))
|
||||
emit_mltext(i, 'ListPresentation', defn.get('listPresentation'))
|
||||
emit_mltext(i, 'ExtendedListPresentation', defn.get('extendedListPresentation'))
|
||||
emit_mltext(i, 'Explanation', defn.get('explanation'))
|
||||
X(f'{i}<CreateOnInput>DontUse</CreateOnInput>')
|
||||
X(f'{i}<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>')
|
||||
X(f'{i}<DataHistory>DontUse</DataHistory>')
|
||||
X(f'{i}<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>')
|
||||
X(f'{i}<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>')
|
||||
|
||||
def emit_accounting_register_properties(indent):
|
||||
i = indent
|
||||
@@ -3006,68 +3052,6 @@ def emit_column(indent, col_def):
|
||||
X(f'{indent}\t</Properties>')
|
||||
X(f'{indent}</Column>')
|
||||
|
||||
def emit_accounting_flag(indent, flag_name):
|
||||
uid = new_uuid()
|
||||
flag_synonym = split_camel_case(flag_name)
|
||||
X(f'{indent}<AccountingFlag uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(flag_name)}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', flag_synonym)
|
||||
X(f'{indent}\t\t<Comment/>')
|
||||
X(f'{indent}\t\t<Type>')
|
||||
X(f'{indent}\t\t\t<v8:Type>xs:boolean</v8:Type>')
|
||||
X(f'{indent}\t\t</Type>')
|
||||
X(f'{indent}\t\t<PasswordMode>false</PasswordMode>')
|
||||
X(f'{indent}\t\t<Format/>')
|
||||
X(f'{indent}\t\t<EditFormat/>')
|
||||
X(f'{indent}\t\t<ToolTip/>')
|
||||
X(f'{indent}\t\t<MarkNegatives>false</MarkNegatives>')
|
||||
X(f'{indent}\t\t<Mask/>')
|
||||
X(f'{indent}\t\t<MultiLine>false</MultiLine>')
|
||||
X(f'{indent}\t\t<ExtendedEdit>false</ExtendedEdit>')
|
||||
X(f'{indent}\t\t<MinValue xsi:nil="true"/>')
|
||||
X(f'{indent}\t\t<MaxValue xsi:nil="true"/>')
|
||||
X(f'{indent}\t\t<FillChecking>DontCheck</FillChecking>')
|
||||
X(f'{indent}\t\t<ChoiceParameterLinks/>')
|
||||
X(f'{indent}\t\t<ChoiceParameters/>')
|
||||
X(f'{indent}\t\t<QuickChoice>Auto</QuickChoice>')
|
||||
X(f'{indent}\t\t<ChoiceForm/>')
|
||||
X(f'{indent}\t\t<LinkByType/>')
|
||||
X(f'{indent}\t\t<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>')
|
||||
X(f'{indent}\t</Properties>')
|
||||
X(f'{indent}</AccountingFlag>')
|
||||
|
||||
def emit_ext_dimension_accounting_flag(indent, flag_name):
|
||||
uid = new_uuid()
|
||||
flag_synonym = split_camel_case(flag_name)
|
||||
X(f'{indent}<ExtDimensionAccountingFlag uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(flag_name)}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', flag_synonym)
|
||||
X(f'{indent}\t\t<Comment/>')
|
||||
X(f'{indent}\t\t<Type>')
|
||||
X(f'{indent}\t\t\t<v8:Type>xs:boolean</v8:Type>')
|
||||
X(f'{indent}\t\t</Type>')
|
||||
X(f'{indent}\t\t<PasswordMode>false</PasswordMode>')
|
||||
X(f'{indent}\t\t<Format/>')
|
||||
X(f'{indent}\t\t<EditFormat/>')
|
||||
X(f'{indent}\t\t<ToolTip/>')
|
||||
X(f'{indent}\t\t<MarkNegatives>false</MarkNegatives>')
|
||||
X(f'{indent}\t\t<Mask/>')
|
||||
X(f'{indent}\t\t<MultiLine>false</MultiLine>')
|
||||
X(f'{indent}\t\t<ExtendedEdit>false</ExtendedEdit>')
|
||||
X(f'{indent}\t\t<MinValue xsi:nil="true"/>')
|
||||
X(f'{indent}\t\t<MaxValue xsi:nil="true"/>')
|
||||
X(f'{indent}\t\t<FillChecking>DontCheck</FillChecking>')
|
||||
X(f'{indent}\t\t<ChoiceParameterLinks/>')
|
||||
X(f'{indent}\t\t<ChoiceParameters/>')
|
||||
X(f'{indent}\t\t<QuickChoice>Auto</QuickChoice>')
|
||||
X(f'{indent}\t\t<ChoiceForm/>')
|
||||
X(f'{indent}\t\t<LinkByType/>')
|
||||
X(f'{indent}\t\t<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>')
|
||||
X(f'{indent}\t</Properties>')
|
||||
X(f'{indent}</ExtDimensionAccountingFlag>')
|
||||
|
||||
def emit_url_template(indent, tmpl_name, tmpl_def):
|
||||
uid = new_uuid()
|
||||
tmpl_synonym = split_camel_case(tmpl_name)
|
||||
@@ -3321,14 +3305,15 @@ if obj_type in types_with_attr_ts:
|
||||
for k, v in ts_data.items():
|
||||
ts_sections[k] = new_ts_entry(v)
|
||||
ts_order.append(k)
|
||||
# ChartOfAccounts: AccountingFlags + ExtDimensionAccountingFlags
|
||||
# ChartOfAccounts: AccountingFlags + ExtDimensionAccountingFlags (признаки учёта — структурно как реквизит,
|
||||
# но без Indexing/FullTextSearch/Use; тип по умолчанию Boolean). Парсим как реквизиты.
|
||||
acct_flags = []
|
||||
ext_dim_flags = []
|
||||
if obj_type == 'ChartOfAccounts':
|
||||
if defn.get('accountingFlags'):
|
||||
acct_flags = _as_list(defn['accountingFlags'])
|
||||
acct_flags = [parse_attribute_shorthand(af) for af in _as_list(defn['accountingFlags'])]
|
||||
if defn.get('extDimensionAccountingFlags'):
|
||||
ext_dim_flags = _as_list(defn['extDimensionAccountingFlags'])
|
||||
ext_dim_flags = [parse_attribute_shorthand(edf) for edf in _as_list(defn['extDimensionAccountingFlags'])]
|
||||
# Task: AddressingAttributes
|
||||
addr_attrs = []
|
||||
if obj_type == 'Task' and defn.get('addressingAttributes'):
|
||||
@@ -3355,7 +3340,9 @@ if obj_type in types_with_attr_ts:
|
||||
context = 'processor'
|
||||
elif obj_type == 'ChartOfCharacteristicTypes':
|
||||
context = 'catalog' # реквизиты ПВХ структурно как у справочника (Use/FillFromFillingValue/DataHistory)
|
||||
elif obj_type in ('ChartOfAccounts', 'ChartOfCalculationTypes'):
|
||||
elif obj_type == 'ChartOfAccounts':
|
||||
context = 'account' # как catalog, но БЕЗ <Use> (реквизиты ПС не иерархичны как справочник)
|
||||
elif obj_type == 'ChartOfCalculationTypes':
|
||||
context = 'chart'
|
||||
else:
|
||||
context = 'object'
|
||||
@@ -3365,11 +3352,9 @@ if obj_type in types_with_attr_ts:
|
||||
e = ts_sections[ts_name]
|
||||
emit_tabular_section('\t\t\t', ts_name, e['columns'], obj_type, obj_name, e['synonym'], e['tooltip'], e['comment'], e.get('lineNumber'))
|
||||
for af in acct_flags:
|
||||
af_name = af['name'] if isinstance(af, dict) else str(af)
|
||||
emit_accounting_flag('\t\t\t', af_name)
|
||||
emit_attribute('\t\t\t', af, 'account-flag', 'AccountingFlag')
|
||||
for edf in ext_dim_flags:
|
||||
edf_name = edf['name'] if isinstance(edf, dict) else str(edf)
|
||||
emit_ext_dimension_accounting_flag('\t\t\t', edf_name)
|
||||
emit_attribute('\t\t\t', edf, 'account-flag', 'ExtDimensionAccountingFlag')
|
||||
for aa in addr_attrs:
|
||||
emit_addressing_attribute('\t\t\t', aa)
|
||||
for cmd in commands:
|
||||
@@ -3663,6 +3648,83 @@ def build_predefined_xml(items, xsi_type, code_type):
|
||||
out.append('</PredefinedData>')
|
||||
return '\n'.join(out) + '\n'
|
||||
|
||||
# --- Предопределённые СЧЕТА Плана счетов (отдельная грамматика: AccountType/OffBalance/Order/AccountingFlags/
|
||||
# ExtDimensionTypes/ChildItems). Флаги перечисляем по def-порядку признаков плана; в DSL — только TRUE. ---
|
||||
def _predef_acc_get(o, keys):
|
||||
for k in keys:
|
||||
if isinstance(o, dict):
|
||||
if k in o:
|
||||
return o[k]
|
||||
return None
|
||||
|
||||
def emit_predef_account_flags(out, indent, tag, ref_kind, obj_nm, flag_names, true_set):
|
||||
if not flag_names:
|
||||
out.append(f'{indent}<{tag}/>')
|
||||
return
|
||||
tset = set(str(t) for t in (true_set or []))
|
||||
out.append(f'{indent}<{tag}>')
|
||||
for fn in flag_names:
|
||||
v = 'true' if fn in tset else 'false'
|
||||
out.append(f'{indent}\t<Flag ref="ChartOfAccounts.{obj_nm}.{ref_kind}.{fn}">{v}</Flag>')
|
||||
out.append(f'{indent}</{tag}>')
|
||||
|
||||
def emit_predef_account(out, val, indent, obj_nm, acct_flag_names, ext_dim_flag_names):
|
||||
name = str(_predef_acc_get(val, ('name', 'имя')) or '')
|
||||
code_v = _predef_acc_get(val, ('code', 'код'))
|
||||
code = str(code_v) if code_v is not None else ''
|
||||
has_desc = isinstance(val, dict) and ('description' in val or 'наименование' in val)
|
||||
desc_v = _predef_acc_get(val, ('description', 'наименование'))
|
||||
desc = str(desc_v) if has_desc else split_camel_case(name)
|
||||
acct_type = str(_predef_acc_get(val, ('accountType', 'видСчета', 'вид')) or '') or 'ActivePassive'
|
||||
off = 'true' if _predef_acc_get(val, ('offBalance', 'забалансовый')) is True else 'false'
|
||||
order = str(_predef_acc_get(val, ('order', 'порядок')) or '')
|
||||
flags = _predef_acc_get(val, ('flags', 'признаки'))
|
||||
subconto = _predef_acc_get(val, ('subconto', 'extDimensionTypes', 'видыСубконто'))
|
||||
children = _predef_acc_get(val, ('childItems', 'подчиненные'))
|
||||
|
||||
out.append(f'{indent}<Item id="{new_uuid()}">')
|
||||
out.append(f'{indent}\t<Name>{esc_xml_text(name)}</Name>')
|
||||
out.append(f'{indent}\t<Code/>' if not code else f'{indent}\t<Code>{esc_xml_text(code)}</Code>')
|
||||
out.append(f'{indent}\t<Description/>' if desc == '' else f'{indent}\t<Description>{esc_xml_text(desc)}</Description>')
|
||||
out.append(f'{indent}\t<AccountType>{acct_type}</AccountType>')
|
||||
out.append(f'{indent}\t<OffBalance>{off}</OffBalance>')
|
||||
out.append(f'{indent}\t<Order>{esc_xml_text(order)}</Order>')
|
||||
emit_predef_account_flags(out, f'{indent}\t', 'AccountingFlags', 'AccountingFlag', obj_nm, acct_flag_names, flags)
|
||||
sub_arr = list(subconto) if subconto else []
|
||||
if not sub_arr:
|
||||
out.append(f'{indent}\t<ExtDimensionTypes/>')
|
||||
else:
|
||||
out.append(f'{indent}\t<ExtDimensionTypes>')
|
||||
for sc in sub_arr:
|
||||
sc_type = str(_predef_acc_get(sc, ('type', 'тип')) or '')
|
||||
if '.' in sc_type:
|
||||
sc_pfx, sc_sfx = sc_type.split('.', 1)
|
||||
if sc_pfx in object_type_synonyms:
|
||||
sc_pfx = object_type_synonyms[sc_pfx]
|
||||
sc_type = f'{sc_pfx}.{sc_sfx}'
|
||||
sc_turn = 'true' if _predef_acc_get(sc, ('turnover', 'оборотный')) is True else 'false'
|
||||
sc_flags = _predef_acc_get(sc, ('flags', 'признаки'))
|
||||
out.append(f'{indent}\t\t<ExtDimensionType name="{esc_xml(sc_type)}">')
|
||||
out.append(f'{indent}\t\t\t<Turnover>{sc_turn}</Turnover>')
|
||||
emit_predef_account_flags(out, f'{indent}\t\t\t', 'AccountingFlags', 'ExtDimensionAccountingFlag', obj_nm, ext_dim_flag_names, sc_flags)
|
||||
out.append(f'{indent}\t\t</ExtDimensionType>')
|
||||
out.append(f'{indent}\t</ExtDimensionTypes>')
|
||||
child_arr = list(children) if children else []
|
||||
if child_arr:
|
||||
out.append(f'{indent}\t<ChildItems>')
|
||||
for c in child_arr:
|
||||
emit_predef_account(out, c, f'{indent}\t\t', obj_nm, acct_flag_names, ext_dim_flag_names)
|
||||
out.append(f'{indent}\t</ChildItems>')
|
||||
out.append(f'{indent}</Item>')
|
||||
|
||||
def build_predefined_account_xml(items, obj_nm, acct_flag_names, ext_dim_flag_names):
|
||||
out = ['<?xml version="1.0" encoding="UTF-8"?>']
|
||||
out.append(f'<PredefinedData xmlns="http://v8.1c.ru/8.3/xcf/predef" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChartOfAccountsPredefinedItems" version="{format_version}">')
|
||||
for it in items:
|
||||
emit_predef_account(out, it, '\t', obj_nm, acct_flag_names, ext_dim_flag_names)
|
||||
out.append('</PredefinedData>')
|
||||
return '\n'.join(out) + '\n'
|
||||
|
||||
# Special files
|
||||
if obj_type == 'ExchangePlan':
|
||||
content_path = os.path.join(ext_dir, 'Content.xml')
|
||||
@@ -3682,7 +3744,16 @@ if obj_type == 'BusinessProcess':
|
||||
|
||||
# Предопределённые элементы (Ext/Predefined.xml). Root-элемент по типу.
|
||||
predef_root_by_type = {'Catalog': 'CatalogPredefinedItems', 'ChartOfCharacteristicTypes': 'PlanOfCharacteristicKindPredefinedItems'}
|
||||
if obj_type in predef_root_by_type and defn.get('predefined'):
|
||||
if obj_type == 'ChartOfAccounts' and defn.get('predefined'):
|
||||
# Предопределённые СЧЕТА — отдельная грамматика (флаги разворачиваются по def-порядку признаков плана).
|
||||
ensure_ext_dir()
|
||||
af_names = [parse_attribute_shorthand(af)['name'] for af in _as_list(defn['accountingFlags'])] if defn.get('accountingFlags') else []
|
||||
edf_names = [parse_attribute_shorthand(edf)['name'] for edf in _as_list(defn['extDimensionAccountingFlags'])] if defn.get('extDimensionAccountingFlags') else []
|
||||
predef_xml = build_predefined_account_xml(defn['predefined'], obj_name, af_names, edf_names)
|
||||
predef_path = os.path.join(ext_dir, 'Predefined.xml')
|
||||
write_utf8_bom(predef_path, predef_xml)
|
||||
modules_created.append(predef_path)
|
||||
elif obj_type in predef_root_by_type and defn.get('predefined'):
|
||||
ensure_ext_dir()
|
||||
cat_code_type = str(defn['codeType']) if defn.get('codeType') else 'String'
|
||||
predef_xml = build_predefined_xml(defn['predefined'], predef_root_by_type[obj_type], cat_code_type)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# meta-decompile v0.25 — XML объекта метаданных 1С → JSON-черновик формата meta-compile
|
||||
# meta-decompile v0.26 — XML объекта метаданных 1С → JSON-черновик формата meta-compile
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
#
|
||||
# Поддержаны: Catalog, ExchangePlan, ChartOfCharacteristicTypes. Инверс meta-compile (omit-on-default: ключ эмитим только
|
||||
# Поддержаны: Catalog, ExchangePlan, ChartOfCharacteristicTypes, ChartOfAccounts. Инверс meta-compile (omit-on-default: ключ эмитим только
|
||||
# когда значение в XML отличается от умолчания компилятора). Неподдерживаемый тип / не-MetaDataObject
|
||||
# root → exit 3 (ring3, как form-decompile).
|
||||
param(
|
||||
@@ -91,8 +91,8 @@ foreach ($c in $rootEl.ChildNodes) { if ($c.NodeType -eq 'Element') { $objNode =
|
||||
if (-not $objNode) { [Console]::Error.WriteLine("meta-decompile: пустой MetaDataObject"); exit 3 }
|
||||
$objType = $objNode.LocalName
|
||||
|
||||
if ($objType -notin @('Catalog', 'ExchangePlan', 'ChartOfCharacteristicTypes')) {
|
||||
[Console]::Error.WriteLine("meta-decompile: тип '$objType' пока не поддержан (Catalog, ExchangePlan, ChartOfCharacteristicTypes)"); exit 3
|
||||
if ($objType -notin @('Catalog', 'ExchangePlan', 'ChartOfCharacteristicTypes', 'ChartOfAccounts')) {
|
||||
[Console]::Error.WriteLine("meta-decompile: тип '$objType' пока не поддержан (Catalog, ExchangePlan, ChartOfCharacteristicTypes, ChartOfAccounts)"); exit 3
|
||||
}
|
||||
|
||||
$props = $objNode.SelectSingleNode('md:Properties', $nsm)
|
||||
@@ -394,9 +394,10 @@ Add-EnumProp 'subordinationUse' 'SubordinationUse' 'ToItems'
|
||||
# Тип-зависимые дефолты (компилятор задаёт их по типу — декомпилятор обязан зеркалить, иначе omit ≠ значению).
|
||||
$descrLenDef = switch ($objType) { 'ExchangePlan' { 150 } 'ChartOfCharacteristicTypes' { 100 } default { 25 } }
|
||||
$createInpDef = if ($objType -eq 'Catalog') { 'Use' } else { 'DontUse' }
|
||||
$dataLockDef = if ($objType -eq 'Catalog') { 'Automatic' } else { 'Managed' }
|
||||
$codeSeriesDef = if ($objType -eq 'ChartOfCharacteristicTypes') { 'WholeCharacteristicKind' } else { 'WholeCatalog' }
|
||||
$checkUniqueDef = ($objType -eq 'ChartOfCharacteristicTypes') # ПВХ дефолт true, Catalog false
|
||||
$dataLockDef = if ($objType -in @('Catalog', 'ChartOfAccounts')) { 'Automatic' } else { 'Managed' }
|
||||
$codeSeriesDef = switch ($objType) { 'ChartOfCharacteristicTypes' { 'WholeCharacteristicKind' } 'ChartOfAccounts' { 'WholeChartOfAccounts' } default { 'WholeCatalog' } }
|
||||
$checkUniqueDef = ($objType -in @('ChartOfCharacteristicTypes', 'ChartOfAccounts')) # ПВХ/ПС дефолт true, Catalog false
|
||||
$defPresDef = if ($objType -eq 'ChartOfAccounts') { 'AsCode' } else { 'AsDescription' } # ПС по умолчанию AsCode
|
||||
Add-IntProp 'codeLength' 'CodeLength' 9
|
||||
Add-IntProp 'descriptionLength' 'DescriptionLength' $descrLenDef
|
||||
Add-EnumProp 'codeType' 'CodeType' 'String'
|
||||
@@ -404,7 +405,7 @@ Add-EnumProp 'codeAllowedLength' 'CodeAllowedLength' 'Variable'
|
||||
Add-BoolProp 'autonumbering' 'Autonumbering' $true
|
||||
Add-BoolProp 'checkUnique' 'CheckUnique' $checkUniqueDef
|
||||
Add-EnumProp 'codeSeries' 'CodeSeries' $codeSeriesDef
|
||||
Add-EnumProp 'defaultPresentation' 'DefaultPresentation' 'AsDescription'
|
||||
Add-EnumProp 'defaultPresentation' 'DefaultPresentation' $defPresDef
|
||||
Add-BoolProp 'quickChoice' 'QuickChoice' $false
|
||||
Add-EnumProp 'choiceMode' 'ChoiceMode' 'BothWays'
|
||||
Add-EnumProp 'dataLockControlMode' 'DataLockControlMode' $dataLockDef
|
||||
@@ -437,6 +438,17 @@ if ($objType -eq 'ChartOfCharacteristicTypes') {
|
||||
if ($vtStr -and $vtStr -ne 'Boolean + String(100) + Number(15,2) + DateTime') { $dsl['valueType'] = $vtStr }
|
||||
}
|
||||
}
|
||||
# ChartOfAccounts-специфичные свойства (у Catalog этих тегов нет → блок его не трогает).
|
||||
if ($objType -eq 'ChartOfAccounts') {
|
||||
$edt = P 'ExtDimensionTypes'; if ($edt) { $dsl['extDimensionTypes'] = $edt }
|
||||
Add-IntProp 'maxExtDimensionCount' 'MaxExtDimensionCount' 3
|
||||
$cm = P 'CodeMask'; if ($cm) { $dsl['codeMask'] = $cm }
|
||||
Add-BoolProp 'autoOrderByCode' 'AutoOrderByCode' $true
|
||||
Add-IntProp 'orderLength' 'OrderLength' 9
|
||||
Add-EnumProp 'dataHistory' 'DataHistory' 'DontUse'
|
||||
Add-BoolProp 'updateDataHistoryImmediatelyAfterWrite' 'UpdateDataHistoryImmediatelyAfterWrite' $false
|
||||
Add-BoolProp 'executeAfterWriteDataHistoryVersionProcessing' 'ExecuteAfterWriteDataHistoryVersionProcessing' $false
|
||||
}
|
||||
|
||||
# Короткая форма поля: <Type>.<Name>.StandardAttribute.X / .Attribute.X → StandardAttribute.X / Attribute.X
|
||||
# (Expand-DataPath компилятора разворачивает частичную форму обратно — dogfood резолвера).
|
||||
@@ -557,6 +569,11 @@ $stdProfileByType = @{
|
||||
'Description' = @{ fillChecking = 'ShowError' }
|
||||
'Parent' = @{ fillFromFillingValue = $true }
|
||||
}
|
||||
'ChartOfAccounts' = @{
|
||||
'Description' = @{ fillChecking = 'ShowError' }
|
||||
'Code' = @{ fillChecking = 'ShowError' }
|
||||
'Parent' = @{ fillFromFillingValue = $true }
|
||||
}
|
||||
}
|
||||
$catStdProfile = if ($stdProfileByType.ContainsKey($objType)) { $stdProfileByType[$objType] } else { @{} }
|
||||
# Фикс-список стандартных реквизитов типа (зеркало standardAttributesByType компилятора) — чтобы отличать
|
||||
@@ -565,11 +582,12 @@ $stdFixedByType = @{
|
||||
'Catalog' = @('PredefinedDataName','Predefined','Ref','DeletionMark','IsFolder','Owner','Parent','Description','Code')
|
||||
'ExchangePlan' = @('Ref','DeletionMark','Code','Description','ThisNode','SentNo','ReceivedNo')
|
||||
'ChartOfCharacteristicTypes' = @('PredefinedDataName','Predefined','Ref','DeletionMark','Description','Code','Parent','ValueType')
|
||||
'ChartOfAccounts' = @('PredefinedDataName','Order','OffBalance','Type','Description','Code','Parent','Predefined','DeletionMark','Ref')
|
||||
}
|
||||
$stdFixed = if ($stdFixedByType.ContainsKey($objType)) { $stdFixedByType[$objType] } else { @() }
|
||||
# Условные типы: блок эмитим-как-триггер даже пустым (материализуется при отклонении ≥1 реквизита от schema-default;
|
||||
# у ExchangePlan это почти всегда — Description/Code=ShowError; редкий all-default EP блок опускает).
|
||||
$stdConditionalTypes = @('Catalog', 'ExchangePlan', 'ChartOfCharacteristicTypes')
|
||||
$stdConditionalTypes = @('Catalog', 'ExchangePlan', 'ChartOfCharacteristicTypes', 'ChartOfAccounts')
|
||||
$saNode = $props.SelectSingleNode('md:StandardAttributes', $nsm)
|
||||
if ($saNode) {
|
||||
$saMap = [ordered]@{}
|
||||
@@ -617,6 +635,20 @@ if ($childObjs) {
|
||||
foreach ($a in $attrs) { [void]$arr.Add((Attr-ToDsl $a)) }
|
||||
$dsl['attributes'] = $arr
|
||||
}
|
||||
# ChartOfAccounts: признаки учёта (AccountingFlag) и признаки учёта субконто (ExtDimensionAccountingFlag) —
|
||||
# структурно как реквизит, захватываем тем же Attr-ToDsl (тип Boolean уходит в короткую запись).
|
||||
$acctFlagNodes = @($childObjs.SelectNodes('md:AccountingFlag', $nsm))
|
||||
if ($acctFlagNodes.Count -gt 0) {
|
||||
$arr = [System.Collections.ArrayList]@()
|
||||
foreach ($a in $acctFlagNodes) { [void]$arr.Add((Attr-ToDsl $a)) }
|
||||
$dsl['accountingFlags'] = $arr
|
||||
}
|
||||
$extDimFlagNodes = @($childObjs.SelectNodes('md:ExtDimensionAccountingFlag', $nsm))
|
||||
if ($extDimFlagNodes.Count -gt 0) {
|
||||
$arr = [System.Collections.ArrayList]@()
|
||||
foreach ($a in $extDimFlagNodes) { [void]$arr.Add((Attr-ToDsl $a)) }
|
||||
$dsl['extDimensionAccountingFlags'] = $arr
|
||||
}
|
||||
$tsNodes = @($childObjs.SelectNodes('md:TabularSection', $nsm))
|
||||
if ($tsNodes.Count -gt 0) {
|
||||
$tsMap = [ordered]@{}
|
||||
@@ -755,8 +787,65 @@ if (Test-Path -LiteralPath $predefPath) {
|
||||
}
|
||||
return $o
|
||||
}
|
||||
# Предопределённые СЧЕТА Плана счетов — отдельная грамматика (AccountType/OffBalance/Order/AccountingFlags/
|
||||
# ExtDimensionTypes). Флаги: захватываем только TRUE (компилятор развернёт по def-порядку признаков плана).
|
||||
function PredefAccount-ToDsl {
|
||||
param($itemEl)
|
||||
$name = ($itemEl.SelectSingleNode("*[local-name()='Name']")).InnerText
|
||||
$codeEl = $itemEl.SelectSingleNode("*[local-name()='Code']")
|
||||
$code = if ($codeEl -and $codeEl.InnerText) { $codeEl.InnerText } else { '' }
|
||||
$descEl = $itemEl.SelectSingleNode("*[local-name()='Description']")
|
||||
$desc = if ($descEl) { $descEl.InnerText } else { '' }
|
||||
$atEl = $itemEl.SelectSingleNode("*[local-name()='AccountType']")
|
||||
$acctType = if ($atEl) { $atEl.InnerText } else { 'ActivePassive' }
|
||||
$offEl = $itemEl.SelectSingleNode("*[local-name()='OffBalance']")
|
||||
$off = ($offEl -and $offEl.InnerText -eq 'true')
|
||||
$ordEl = $itemEl.SelectSingleNode("*[local-name()='Order']")
|
||||
$order = if ($ordEl) { $ordEl.InnerText } else { '' }
|
||||
$auto = Split-CamelWords $name
|
||||
# TRUE-флаги (leaf после последней точки в ref).
|
||||
$trueFlags = @()
|
||||
foreach ($fl in @($itemEl.SelectNodes("*[local-name()='AccountingFlags']/*[local-name()='Flag']"))) {
|
||||
if ($fl.InnerText -eq 'true') { $r = $fl.GetAttribute('ref'); $trueFlags += ($r -split '\.')[-1] }
|
||||
}
|
||||
# ExtDimensionTypes → subconto [{type, turnover?, flags?}].
|
||||
$subconto = [System.Collections.ArrayList]@()
|
||||
foreach ($edt in @($itemEl.SelectNodes("*[local-name()='ExtDimensionTypes']/*[local-name()='ExtDimensionType']"))) {
|
||||
$so = [ordered]@{ type = $edt.GetAttribute('name') }
|
||||
$tEl = $edt.SelectSingleNode("*[local-name()='Turnover']")
|
||||
if ($tEl -and $tEl.InnerText -eq 'true') { $so['turnover'] = $true }
|
||||
$stf = @()
|
||||
foreach ($fl in @($edt.SelectNodes("*[local-name()='AccountingFlags']/*[local-name()='Flag']"))) {
|
||||
if ($fl.InnerText -eq 'true') { $r = $fl.GetAttribute('ref'); $stf += ($r -split '\.')[-1] }
|
||||
}
|
||||
if ($stf.Count -gt 0) { $so['flags'] = [System.Collections.ArrayList]@($stf) }
|
||||
[void]$subconto.Add($so)
|
||||
}
|
||||
$childContainer = $itemEl.SelectSingleNode("*[local-name()='ChildItems']")
|
||||
$kids = @(if ($childContainer) { $childContainer.SelectNodes("*[local-name()='Item']") } else { @() })
|
||||
|
||||
$o = [ordered]@{ name = $name }
|
||||
if ($code) { $o['code'] = $code }
|
||||
if ($desc -ne $auto) { $o['description'] = $desc }
|
||||
$o['accountType'] = $acctType
|
||||
if ($off) { $o['offBalance'] = $true }
|
||||
$o['order'] = $order
|
||||
if ($trueFlags.Count -gt 0) { $o['flags'] = [System.Collections.ArrayList]@($trueFlags) }
|
||||
if ($subconto.Count -gt 0) { $o['subconto'] = $subconto }
|
||||
if ($kids.Count -gt 0) {
|
||||
$sub = [System.Collections.ArrayList]@()
|
||||
foreach ($k in $kids) { [void]$sub.Add((PredefAccount-ToDsl $k)) }
|
||||
$o['childItems'] = $sub
|
||||
}
|
||||
return $o
|
||||
}
|
||||
|
||||
$rootItems = [System.Collections.ArrayList]@()
|
||||
foreach ($it in @($pdoc.DocumentElement.SelectNodes("*[local-name()='Item']"))) { [void]$rootItems.Add((PredefItem-ToDsl $it)) }
|
||||
if ($objType -eq 'ChartOfAccounts') {
|
||||
foreach ($it in @($pdoc.DocumentElement.SelectNodes("*[local-name()='Item']"))) { [void]$rootItems.Add((PredefAccount-ToDsl $it)) }
|
||||
} else {
|
||||
foreach ($it in @($pdoc.DocumentElement.SelectNodes("*[local-name()='Item']"))) { [void]$rootItems.Add((PredefItem-ToDsl $it)) }
|
||||
}
|
||||
if ($rootItems.Count -gt 0) { $dsl['predefined'] = $rootItems }
|
||||
}
|
||||
|
||||
|
||||
+57
-29
@@ -653,6 +653,62 @@ omit-on-empty. Поля пишутся частичной формой (`Standar
|
||||
]
|
||||
```
|
||||
|
||||
### 7.2c ChartOfAccounts (План счетов)
|
||||
|
||||
Иерархический ссылочный тип бухгалтерских счетов (без папок/уровней/владельцев). Общий с Catalog слой: `synonym`,
|
||||
`comment`, `useStandardCommands`, `includeHelpInContents`, коды (`codeLength`/`descriptionLength`/`checkUnique`/
|
||||
`codeMask`), `defaultPresentation`, `standardAttributes` (§7.1.1), `characteristics` (§7.1.4), `inputByString` (§7.1.5),
|
||||
формы (без `*Folder*`), `basedOn`, `dataLockFields`, презентации.
|
||||
|
||||
| Поле JSON | Умолчание | XML элемент |
|
||||
|-----------|----------|-------------|
|
||||
| `extDimensionTypes` | пусто | ExtDimensionTypes (ссылка на ПВХ видов субконто; `ПланВидовХарактеристик.X` → `ChartOfCharacteristicTypes.X`) |
|
||||
| `maxExtDimensionCount` | `3` | MaxExtDimensionCount (число субконто; `0` → нет субконто) |
|
||||
| `codeMask` | пусто | CodeMask (маска кода счёта) |
|
||||
| `codeSeries` | `WholeChartOfAccounts` | CodeSeries |
|
||||
| `checkUnique` | `true` | CheckUnique *(≠ Catalog `false`)* |
|
||||
| `defaultPresentation` | `AsCode` | DefaultPresentation *(≠ Catalog `AsDescription`)* |
|
||||
| `autoOrderByCode` | `true` | AutoOrderByCode |
|
||||
| `orderLength` | `9` | OrderLength |
|
||||
| `dataLockControlMode` | `Automatic` | DataLockControlMode |
|
||||
| `dataHistory` + `updateDataHistoryImmediatelyAfterWrite` + `executeAfterWriteDataHistoryVersionProcessing` | `DontUse`/`false`/`false` | DataHistory-триплет |
|
||||
| `accountingFlags` | `[]` | AccountingFlag в ChildObjects (признаки учёта — как реквизит, тип по умолчанию Boolean; §4.2) |
|
||||
| `extDimensionAccountingFlags` | `[]` | ExtDimensionAccountingFlag в ChildObjects (признаки учёта субконто; как реквизит) |
|
||||
| `predefined` | `[]` | Ext/Predefined.xml — предопределённые счета (грамматика ниже) |
|
||||
|
||||
Стандартные реквизиты ПС: PredefinedDataName, Order, OffBalance, Type, Description, Code, Parent, Predefined,
|
||||
DeletionMark, Ref (профиль: Наименование/Код → FillChecking=ShowError, Родитель → FillFromFillingValue=true). Блок
|
||||
**условный** (`standardAttributes`). Реквизит `Type` (Тип счёта) несёт FillValue-перечисление **`ent:AccountType`** —
|
||||
значения `Active`/`Passive`/`ActivePassive` (распознаются автоматически в `fillValue`/параметрах выбора). Всегда
|
||||
эмитится вложенный блок субконто `StandardTabularSections/ExtDimensionTypes` (платформенно-константен: обёртка
|
||||
«Виды субконто», вложенный ExtDimensionType → FillChecking=ShowError).
|
||||
|
||||
**Предопределённые счета** — отдельная грамматика (объектная форма). Признаки (`flags`) перечисляют только
|
||||
**включённые** (`true`) имена; компилятор разворачивает полный список по def-порядку `accountingFlags`/
|
||||
`extDimensionAccountingFlags` плана. `order` — вербатим (не выводится). `description` опускается при равенстве
|
||||
Split-CamelCase имени.
|
||||
|
||||
| Поле счёта | Умолчание | XML |
|
||||
|-----------|----------|-----|
|
||||
| `name` / `code` / `description` | — / пусто / *(авто из имени)* | Name / Code / Description |
|
||||
| `accountType` | `ActivePassive` | AccountType (`Active`/`Passive`/`ActivePassive`) |
|
||||
| `offBalance` | `false` | OffBalance |
|
||||
| `order` | — | Order (строка сортировки, вербатим) |
|
||||
| `flags` | `[]` | AccountingFlags → `<Flag>` по каждому признаку плана |
|
||||
| `subconto` | `[]` | ExtDimensionTypes → `<ExtDimensionType name="…">` `{type, turnover?, flags?}` |
|
||||
| `childItems` | `[]` | ChildItems (иерархия счетов) |
|
||||
|
||||
```json
|
||||
"predefined": [
|
||||
{ "name": "ОсновныеСредства", "code": "01", "accountType": "Active", "order": " 01",
|
||||
"flags": ["Количественный"],
|
||||
"subconto": [{ "type": "ChartOfCharacteristicTypes.ВидыСубконто.ОсновныеСредства", "flags": ["Суммовой"] }],
|
||||
"childItems": [
|
||||
{ "name": "ОС в организации", "code": "01.01", "accountType": "Active", "order": " 01.01" }
|
||||
] }
|
||||
]
|
||||
```
|
||||
|
||||
### 7.3 Enum
|
||||
|
||||
| Поле JSON | Умолчание | XML элемент |
|
||||
@@ -886,35 +942,7 @@ DSL для `columns` (§12).
|
||||
|
||||
### 7.16 ChartOfAccounts
|
||||
|
||||
| Поле JSON | Умолчание | XML элемент |
|
||||
|-----------|----------|-------------|
|
||||
| `extDimensionTypes` | `""` | ExtDimensionTypes (ссылка на ПВХ) |
|
||||
| `maxExtDimensionCount` | `3` | MaxExtDimensionCount |
|
||||
| `codeMask` | `""` | CodeMask |
|
||||
| `codeLength` | `8` | CodeLength |
|
||||
| `descriptionLength` | `120` | DescriptionLength |
|
||||
| `codeSeries` | `WholeChartOfAccounts` | CodeSeries |
|
||||
| `autoOrderByCode` | `true` | AutoOrderByCode |
|
||||
| `orderLength` | `5` | OrderLength |
|
||||
| `hierarchical` | `false` | Hierarchical |
|
||||
| `dataLockControlMode` | `Automatic` | DataLockControlMode |
|
||||
| `fullTextSearch` | `Use` | FullTextSearch |
|
||||
| `accountingFlags` | `[]` | → AccountingFlag в ChildObjects (§13) |
|
||||
| `extDimensionAccountingFlags` | `[]` | → ExtDimensionAccountingFlag в ChildObjects (§14) |
|
||||
| `attributes` | `[]` | → Attribute в ChildObjects |
|
||||
| `tabularSections` | `{}` | → TabularSection в ChildObjects |
|
||||
|
||||
Модули: `Ext/ObjectModule.bsl` (пустой).
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "ChartOfAccounts", "name": "Хозрасчетный",
|
||||
"extDimensionTypes": "ChartOfCharacteristicTypes.ВидыСубконто", "maxExtDimensionCount": 3,
|
||||
"codeMask": "@@@.@@.@", "codeLength": 8,
|
||||
"accountingFlags": ["Валютный", "Количественный"],
|
||||
"extDimensionAccountingFlags": ["Суммовой", "Валютный"]
|
||||
}
|
||||
```
|
||||
Полное описание типа (все поля, стандартные реквизиты, грамматика предопределённых счетов) — см. **§7.2c**.
|
||||
|
||||
### 7.17 AccountingRegister
|
||||
|
||||
|
||||
@@ -1,15 +1,42 @@
|
||||
{
|
||||
"name": "План счетов с признаками учёта",
|
||||
"name": "План счетов: признаки учёта и предопределённые счета",
|
||||
"input": {
|
||||
"type": "ChartOfAccounts",
|
||||
"name": "Хозрасчетный",
|
||||
"codeLength": 4,
|
||||
"synonym": { "ru": "План счетов бухгалтерского учета", "en": "Chart of accounts" },
|
||||
"codeLength": 8,
|
||||
"descriptionLength": 120,
|
||||
"codeMask": "@@@.@@.@",
|
||||
"maxExtDimensionCount": 0,
|
||||
"accountingFlags": ["Валютный", "Количественный"]
|
||||
"checkUnique": true,
|
||||
"accountingFlags": [
|
||||
{ "name": "Валютный", "synonym": "Валютный учет", "tooltip": "Ведется валютный учет" },
|
||||
"Количественный"
|
||||
],
|
||||
"predefined": [
|
||||
{
|
||||
"name": "ОсновныеСредства",
|
||||
"code": "01",
|
||||
"description": "Основные средства",
|
||||
"accountType": "Active",
|
||||
"order": " 01",
|
||||
"flags": ["Количественный"],
|
||||
"childItems": [
|
||||
{
|
||||
"name": "ОсновныеСредстваВОрганизации",
|
||||
"code": "01.01",
|
||||
"description": "Основные средства в организации",
|
||||
"accountType": "Active",
|
||||
"order": " 01.01",
|
||||
"flags": ["Количественный"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{ "name": "Служебный", "code": "000", "accountType": "ActivePassive", "order": " 00" }
|
||||
]
|
||||
},
|
||||
"validatePath": "ChartsOfAccounts/Хозрасчетный",
|
||||
"expect": {
|
||||
"files": ["ChartsOfAccounts/Хозрасчетный.xml", "ChartsOfAccounts/Хозрасчетный/Ext/ObjectModule.bsl"]
|
||||
"files": ["ChartsOfAccounts/Хозрасчетный.xml", "ChartsOfAccounts/Хозрасчетный/Ext/Predefined.xml"]
|
||||
}
|
||||
}
|
||||
|
||||
+47
-281
@@ -36,286 +36,37 @@
|
||||
<Synonym>
|
||||
<v8:item>
|
||||
<v8:lang>ru</v8:lang>
|
||||
<v8:content>Хозрасчетный</v8:content>
|
||||
<v8:content>План счетов бухгалтерского учета</v8:content>
|
||||
</v8:item>
|
||||
<v8:item>
|
||||
<v8:lang>en</v8:lang>
|
||||
<v8:content>Chart of accounts</v8:content>
|
||||
</v8:item>
|
||||
</Synonym>
|
||||
<Comment/>
|
||||
<UseStandardCommands>true</UseStandardCommands>
|
||||
<IncludeHelpInContents>false</IncludeHelpInContents>
|
||||
<BasedOn/>
|
||||
<ExtDimensionTypes/>
|
||||
<MaxExtDimensionCount>0</MaxExtDimensionCount>
|
||||
<CodeMask/>
|
||||
<CodeLength>4</CodeLength>
|
||||
<CodeMask>@@@.@@.@</CodeMask>
|
||||
<CodeLength>8</CodeLength>
|
||||
<DescriptionLength>120</DescriptionLength>
|
||||
<CodeSeries>WholeChartOfAccounts</CodeSeries>
|
||||
<CheckUnique>false</CheckUnique>
|
||||
<DefaultPresentation>AsDescription</DefaultPresentation>
|
||||
<AutoOrderByCode>true</AutoOrderByCode>
|
||||
<OrderLength>5</OrderLength>
|
||||
<EditType>InDialog</EditType>
|
||||
<StandardAttributes>
|
||||
<xr:StandardAttribute name="PredefinedDataName">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
<xr:MaxValue xsi:nil="true"/>
|
||||
<xr:ToolTip/>
|
||||
<xr:ExtendedEdit>false</xr:ExtendedEdit>
|
||||
<xr:Format/>
|
||||
<xr:ChoiceForm/>
|
||||
<xr:QuickChoice>Auto</xr:QuickChoice>
|
||||
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
|
||||
<xr:EditFormat/>
|
||||
<xr:PasswordMode>false</xr:PasswordMode>
|
||||
<xr:DataHistory>Use</xr:DataHistory>
|
||||
<xr:MarkNegatives>false</xr:MarkNegatives>
|
||||
<xr:MinValue xsi:nil="true"/>
|
||||
<xr:Synonym/>
|
||||
<xr:Comment/>
|
||||
<xr:FullTextSearch>Use</xr:FullTextSearch>
|
||||
<xr:ChoiceParameterLinks/>
|
||||
<xr:FillValue xsi:nil="true"/>
|
||||
<xr:Mask/>
|
||||
<xr:ChoiceParameters/>
|
||||
</xr:StandardAttribute>
|
||||
<xr:StandardAttribute name="Predefined">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
<xr:MaxValue xsi:nil="true"/>
|
||||
<xr:ToolTip/>
|
||||
<xr:ExtendedEdit>false</xr:ExtendedEdit>
|
||||
<xr:Format/>
|
||||
<xr:ChoiceForm/>
|
||||
<xr:QuickChoice>Auto</xr:QuickChoice>
|
||||
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
|
||||
<xr:EditFormat/>
|
||||
<xr:PasswordMode>false</xr:PasswordMode>
|
||||
<xr:DataHistory>Use</xr:DataHistory>
|
||||
<xr:MarkNegatives>false</xr:MarkNegatives>
|
||||
<xr:MinValue xsi:nil="true"/>
|
||||
<xr:Synonym/>
|
||||
<xr:Comment/>
|
||||
<xr:FullTextSearch>Use</xr:FullTextSearch>
|
||||
<xr:ChoiceParameterLinks/>
|
||||
<xr:FillValue xsi:nil="true"/>
|
||||
<xr:Mask/>
|
||||
<xr:ChoiceParameters/>
|
||||
</xr:StandardAttribute>
|
||||
<xr:StandardAttribute name="Ref">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
<xr:MaxValue xsi:nil="true"/>
|
||||
<xr:ToolTip/>
|
||||
<xr:ExtendedEdit>false</xr:ExtendedEdit>
|
||||
<xr:Format/>
|
||||
<xr:ChoiceForm/>
|
||||
<xr:QuickChoice>Auto</xr:QuickChoice>
|
||||
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
|
||||
<xr:EditFormat/>
|
||||
<xr:PasswordMode>false</xr:PasswordMode>
|
||||
<xr:DataHistory>Use</xr:DataHistory>
|
||||
<xr:MarkNegatives>false</xr:MarkNegatives>
|
||||
<xr:MinValue xsi:nil="true"/>
|
||||
<xr:Synonym/>
|
||||
<xr:Comment/>
|
||||
<xr:FullTextSearch>Use</xr:FullTextSearch>
|
||||
<xr:ChoiceParameterLinks/>
|
||||
<xr:FillValue xsi:nil="true"/>
|
||||
<xr:Mask/>
|
||||
<xr:ChoiceParameters/>
|
||||
</xr:StandardAttribute>
|
||||
<xr:StandardAttribute name="DeletionMark">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
<xr:MaxValue xsi:nil="true"/>
|
||||
<xr:ToolTip/>
|
||||
<xr:ExtendedEdit>false</xr:ExtendedEdit>
|
||||
<xr:Format/>
|
||||
<xr:ChoiceForm/>
|
||||
<xr:QuickChoice>Auto</xr:QuickChoice>
|
||||
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
|
||||
<xr:EditFormat/>
|
||||
<xr:PasswordMode>false</xr:PasswordMode>
|
||||
<xr:DataHistory>Use</xr:DataHistory>
|
||||
<xr:MarkNegatives>false</xr:MarkNegatives>
|
||||
<xr:MinValue xsi:nil="true"/>
|
||||
<xr:Synonym/>
|
||||
<xr:Comment/>
|
||||
<xr:FullTextSearch>Use</xr:FullTextSearch>
|
||||
<xr:ChoiceParameterLinks/>
|
||||
<xr:FillValue xsi:nil="true"/>
|
||||
<xr:Mask/>
|
||||
<xr:ChoiceParameters/>
|
||||
</xr:StandardAttribute>
|
||||
<xr:StandardAttribute name="Description">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
<xr:MaxValue xsi:nil="true"/>
|
||||
<xr:ToolTip/>
|
||||
<xr:ExtendedEdit>false</xr:ExtendedEdit>
|
||||
<xr:Format/>
|
||||
<xr:ChoiceForm/>
|
||||
<xr:QuickChoice>Auto</xr:QuickChoice>
|
||||
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
|
||||
<xr:EditFormat/>
|
||||
<xr:PasswordMode>false</xr:PasswordMode>
|
||||
<xr:DataHistory>Use</xr:DataHistory>
|
||||
<xr:MarkNegatives>false</xr:MarkNegatives>
|
||||
<xr:MinValue xsi:nil="true"/>
|
||||
<xr:Synonym/>
|
||||
<xr:Comment/>
|
||||
<xr:FullTextSearch>Use</xr:FullTextSearch>
|
||||
<xr:ChoiceParameterLinks/>
|
||||
<xr:FillValue xsi:nil="true"/>
|
||||
<xr:Mask/>
|
||||
<xr:ChoiceParameters/>
|
||||
</xr:StandardAttribute>
|
||||
<xr:StandardAttribute name="Code">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
<xr:MaxValue xsi:nil="true"/>
|
||||
<xr:ToolTip/>
|
||||
<xr:ExtendedEdit>false</xr:ExtendedEdit>
|
||||
<xr:Format/>
|
||||
<xr:ChoiceForm/>
|
||||
<xr:QuickChoice>Auto</xr:QuickChoice>
|
||||
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
|
||||
<xr:EditFormat/>
|
||||
<xr:PasswordMode>false</xr:PasswordMode>
|
||||
<xr:DataHistory>Use</xr:DataHistory>
|
||||
<xr:MarkNegatives>false</xr:MarkNegatives>
|
||||
<xr:MinValue xsi:nil="true"/>
|
||||
<xr:Synonym/>
|
||||
<xr:Comment/>
|
||||
<xr:FullTextSearch>Use</xr:FullTextSearch>
|
||||
<xr:ChoiceParameterLinks/>
|
||||
<xr:FillValue xsi:nil="true"/>
|
||||
<xr:Mask/>
|
||||
<xr:ChoiceParameters/>
|
||||
</xr:StandardAttribute>
|
||||
<xr:StandardAttribute name="Parent">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
<xr:MaxValue xsi:nil="true"/>
|
||||
<xr:ToolTip/>
|
||||
<xr:ExtendedEdit>false</xr:ExtendedEdit>
|
||||
<xr:Format/>
|
||||
<xr:ChoiceForm/>
|
||||
<xr:QuickChoice>Auto</xr:QuickChoice>
|
||||
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
|
||||
<xr:EditFormat/>
|
||||
<xr:PasswordMode>false</xr:PasswordMode>
|
||||
<xr:DataHistory>Use</xr:DataHistory>
|
||||
<xr:MarkNegatives>false</xr:MarkNegatives>
|
||||
<xr:MinValue xsi:nil="true"/>
|
||||
<xr:Synonym/>
|
||||
<xr:Comment/>
|
||||
<xr:FullTextSearch>Use</xr:FullTextSearch>
|
||||
<xr:ChoiceParameterLinks/>
|
||||
<xr:FillValue xsi:nil="true"/>
|
||||
<xr:Mask/>
|
||||
<xr:ChoiceParameters/>
|
||||
</xr:StandardAttribute>
|
||||
<xr:StandardAttribute name="Order">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
<xr:MaxValue xsi:nil="true"/>
|
||||
<xr:ToolTip/>
|
||||
<xr:ExtendedEdit>false</xr:ExtendedEdit>
|
||||
<xr:Format/>
|
||||
<xr:ChoiceForm/>
|
||||
<xr:QuickChoice>Auto</xr:QuickChoice>
|
||||
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
|
||||
<xr:EditFormat/>
|
||||
<xr:PasswordMode>false</xr:PasswordMode>
|
||||
<xr:DataHistory>Use</xr:DataHistory>
|
||||
<xr:MarkNegatives>false</xr:MarkNegatives>
|
||||
<xr:MinValue xsi:nil="true"/>
|
||||
<xr:Synonym/>
|
||||
<xr:Comment/>
|
||||
<xr:FullTextSearch>Use</xr:FullTextSearch>
|
||||
<xr:ChoiceParameterLinks/>
|
||||
<xr:FillValue xsi:nil="true"/>
|
||||
<xr:Mask/>
|
||||
<xr:ChoiceParameters/>
|
||||
</xr:StandardAttribute>
|
||||
<xr:StandardAttribute name="Type">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
<xr:MaxValue xsi:nil="true"/>
|
||||
<xr:ToolTip/>
|
||||
<xr:ExtendedEdit>false</xr:ExtendedEdit>
|
||||
<xr:Format/>
|
||||
<xr:ChoiceForm/>
|
||||
<xr:QuickChoice>Auto</xr:QuickChoice>
|
||||
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
|
||||
<xr:EditFormat/>
|
||||
<xr:PasswordMode>false</xr:PasswordMode>
|
||||
<xr:DataHistory>Use</xr:DataHistory>
|
||||
<xr:MarkNegatives>false</xr:MarkNegatives>
|
||||
<xr:MinValue xsi:nil="true"/>
|
||||
<xr:Synonym/>
|
||||
<xr:Comment/>
|
||||
<xr:FullTextSearch>Use</xr:FullTextSearch>
|
||||
<xr:ChoiceParameterLinks/>
|
||||
<xr:FillValue xsi:nil="true"/>
|
||||
<xr:Mask/>
|
||||
<xr:ChoiceParameters/>
|
||||
</xr:StandardAttribute>
|
||||
<xr:StandardAttribute name="OffBalance">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
<xr:MaxValue xsi:nil="true"/>
|
||||
<xr:ToolTip/>
|
||||
<xr:ExtendedEdit>false</xr:ExtendedEdit>
|
||||
<xr:Format/>
|
||||
<xr:ChoiceForm/>
|
||||
<xr:QuickChoice>Auto</xr:QuickChoice>
|
||||
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
|
||||
<xr:EditFormat/>
|
||||
<xr:PasswordMode>false</xr:PasswordMode>
|
||||
<xr:DataHistory>Use</xr:DataHistory>
|
||||
<xr:MarkNegatives>false</xr:MarkNegatives>
|
||||
<xr:MinValue xsi:nil="true"/>
|
||||
<xr:Synonym/>
|
||||
<xr:Comment/>
|
||||
<xr:FullTextSearch>Use</xr:FullTextSearch>
|
||||
<xr:ChoiceParameterLinks/>
|
||||
<xr:FillValue xsi:nil="true"/>
|
||||
<xr:Mask/>
|
||||
<xr:ChoiceParameters/>
|
||||
</xr:StandardAttribute>
|
||||
</StandardAttributes>
|
||||
<CheckUnique>true</CheckUnique>
|
||||
<DefaultPresentation>AsCode</DefaultPresentation>
|
||||
<Characteristics/>
|
||||
<StandardTabularSections>
|
||||
<xr:StandardTabularSection name="ExtDimensionTypes">
|
||||
<xr:Synonym>
|
||||
<v8:item>
|
||||
<v8:lang/>
|
||||
<v8:content>Виды субконто</v8:content>
|
||||
</v8:item>
|
||||
</xr:Synonym>
|
||||
<xr:Comment/>
|
||||
<xr:ToolTip/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:StandardAttributes>
|
||||
<xr:StandardAttribute name="TurnoversOnly">
|
||||
<xr:LinkByType/>
|
||||
@@ -371,7 +122,7 @@
|
||||
</xr:StandardAttribute>
|
||||
<xr:StandardAttribute name="ExtDimensionType">
|
||||
<xr:LinkByType/>
|
||||
<xr:FillChecking>DontCheck</xr:FillChecking>
|
||||
<xr:FillChecking>ShowError</xr:FillChecking>
|
||||
<xr:MultiLine>false</xr:MultiLine>
|
||||
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
|
||||
<xr:CreateOnInput>Auto</xr:CreateOnInput>
|
||||
@@ -424,8 +175,8 @@
|
||||
</xr:StandardAttributes>
|
||||
</xr:StandardTabularSection>
|
||||
</StandardTabularSections>
|
||||
<Characteristics/>
|
||||
<PredefinedDataUpdate>Auto</PredefinedDataUpdate>
|
||||
<EditType>InDialog</EditType>
|
||||
<QuickChoice>false</QuickChoice>
|
||||
<ChoiceMode>BothWays</ChoiceMode>
|
||||
<InputByString>
|
||||
@@ -435,27 +186,27 @@
|
||||
<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>
|
||||
<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>
|
||||
<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>
|
||||
<CreateOnInput>DontUse</CreateOnInput>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<DefaultObjectForm/>
|
||||
<DefaultListForm/>
|
||||
<DefaultChoiceForm/>
|
||||
<AuxiliaryObjectForm/>
|
||||
<AuxiliaryListForm/>
|
||||
<AuxiliaryChoiceForm/>
|
||||
<IncludeHelpInContents>false</IncludeHelpInContents>
|
||||
<BasedOn/>
|
||||
<AutoOrderByCode>true</AutoOrderByCode>
|
||||
<OrderLength>9</OrderLength>
|
||||
<DataLockFields/>
|
||||
<DataLockControlMode>Automatic</DataLockControlMode>
|
||||
<FullTextSearch>Use</FullTextSearch>
|
||||
<DataHistory>DontUse</DataHistory>
|
||||
<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>
|
||||
<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>
|
||||
<ObjectPresentation/>
|
||||
<ExtendedObjectPresentation/>
|
||||
<ListPresentation/>
|
||||
<ExtendedListPresentation/>
|
||||
<Explanation/>
|
||||
<CreateOnInput>DontUse</CreateOnInput>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<DataHistory>DontUse</DataHistory>
|
||||
<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>
|
||||
<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>
|
||||
</Properties>
|
||||
<ChildObjects>
|
||||
<AccountingFlag uuid="UUID-016">
|
||||
@@ -464,7 +215,7 @@
|
||||
<Synonym>
|
||||
<v8:item>
|
||||
<v8:lang>ru</v8:lang>
|
||||
<v8:content>Валютный</v8:content>
|
||||
<v8:content>Валютный учет</v8:content>
|
||||
</v8:item>
|
||||
</Synonym>
|
||||
<Comment/>
|
||||
@@ -474,20 +225,30 @@
|
||||
<PasswordMode>false</PasswordMode>
|
||||
<Format/>
|
||||
<EditFormat/>
|
||||
<ToolTip/>
|
||||
<ToolTip>
|
||||
<v8:item>
|
||||
<v8:lang>ru</v8:lang>
|
||||
<v8:content>Ведется валютный учет</v8:content>
|
||||
</v8:item>
|
||||
</ToolTip>
|
||||
<MarkNegatives>false</MarkNegatives>
|
||||
<Mask/>
|
||||
<MultiLine>false</MultiLine>
|
||||
<ExtendedEdit>false</ExtendedEdit>
|
||||
<MinValue xsi:nil="true"/>
|
||||
<MaxValue xsi:nil="true"/>
|
||||
<FillFromFillingValue>false</FillFromFillingValue>
|
||||
<FillValue xsi:type="xs:string"/>
|
||||
<FillChecking>DontCheck</FillChecking>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<ChoiceParameterLinks/>
|
||||
<ChoiceParameters/>
|
||||
<QuickChoice>Auto</QuickChoice>
|
||||
<CreateOnInput>Auto</CreateOnInput>
|
||||
<ChoiceForm/>
|
||||
<LinkByType/>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<DataHistory>Use</DataHistory>
|
||||
</Properties>
|
||||
</AccountingFlag>
|
||||
<AccountingFlag uuid="UUID-017">
|
||||
@@ -513,13 +274,18 @@
|
||||
<ExtendedEdit>false</ExtendedEdit>
|
||||
<MinValue xsi:nil="true"/>
|
||||
<MaxValue xsi:nil="true"/>
|
||||
<FillFromFillingValue>false</FillFromFillingValue>
|
||||
<FillValue xsi:type="xs:string"/>
|
||||
<FillChecking>DontCheck</FillChecking>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<ChoiceParameterLinks/>
|
||||
<ChoiceParameters/>
|
||||
<QuickChoice>Auto</QuickChoice>
|
||||
<CreateOnInput>Auto</CreateOnInput>
|
||||
<ChoiceForm/>
|
||||
<LinkByType/>
|
||||
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||
<DataHistory>Use</DataHistory>
|
||||
</Properties>
|
||||
</AccountingFlag>
|
||||
</ChildObjects>
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<PredefinedData xmlns="http://v8.1c.ru/8.3/xcf/predef" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChartOfAccountsPredefinedItems" version="2.17">
|
||||
<Item id="UUID-001">
|
||||
<Name>ОсновныеСредства</Name>
|
||||
<Code>01</Code>
|
||||
<Description>Основные средства</Description>
|
||||
<AccountType>Active</AccountType>
|
||||
<OffBalance>false</OffBalance>
|
||||
<Order> 01</Order>
|
||||
<AccountingFlags>
|
||||
<Flag ref="ChartOfAccounts.Хозрасчетный.AccountingFlag.Валютный">false</Flag>
|
||||
<Flag ref="ChartOfAccounts.Хозрасчетный.AccountingFlag.Количественный">true</Flag>
|
||||
</AccountingFlags>
|
||||
<ExtDimensionTypes/>
|
||||
<ChildItems>
|
||||
<Item id="UUID-002">
|
||||
<Name>ОсновныеСредстваВОрганизации</Name>
|
||||
<Code>01.01</Code>
|
||||
<Description>Основные средства в организации</Description>
|
||||
<AccountType>Active</AccountType>
|
||||
<OffBalance>false</OffBalance>
|
||||
<Order> 01.01</Order>
|
||||
<AccountingFlags>
|
||||
<Flag ref="ChartOfAccounts.Хозрасчетный.AccountingFlag.Валютный">false</Flag>
|
||||
<Flag ref="ChartOfAccounts.Хозрасчетный.AccountingFlag.Количественный">true</Flag>
|
||||
</AccountingFlags>
|
||||
<ExtDimensionTypes/>
|
||||
</Item>
|
||||
</ChildItems>
|
||||
</Item>
|
||||
<Item id="UUID-003">
|
||||
<Name>Служебный</Name>
|
||||
<Code>000</Code>
|
||||
<Description>Служебный</Description>
|
||||
<AccountType>ActivePassive</AccountType>
|
||||
<OffBalance>false</OffBalance>
|
||||
<Order> 00</Order>
|
||||
<AccountingFlags>
|
||||
<Flag ref="ChartOfAccounts.Хозрасчетный.AccountingFlag.Валютный">false</Flag>
|
||||
<Flag ref="ChartOfAccounts.Хозрасчетный.AccountingFlag.Количественный">false</Flag>
|
||||
</AccountingFlags>
|
||||
<ExtDimensionTypes/>
|
||||
</Item>
|
||||
</PredefinedData>
|
||||
Reference in New Issue
Block a user