mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-06 19:50:20 +03:00
Centralized empty-value handling: shorthand `=`, `= _`, `= null` and object-form `value: null` / `""` now serialize per type, matching what 1C Designer writes: - ref / no-type → <value xsi:nil="true"/> - string → <value xsi:type="xs:string"/> - date/decimal/boolean → typed zero (0001-01-01 / 0 / false) - StandardPeriod → Custom variant with zero dates - @valueList → omit <value> entirely Closes BUG-1 (StandardPeriod @autoDates) and BUG-2 (CatalogRef.X = _ producing invalid <value>_</value>) reported by titan team. New helpers Test-EmptyValue / Emit-EmptyValue (ps1) and is_empty_value / emit_empty_value (py) shared by Emit-ParamValue, availableValues loop, and explicit dataParameters emit. Shorthand regex .+ → .* so trailing `=` parses as empty. Reference: upload/erf/ПроверкаЭкранирования (live Designer dump). New test case empty-param-values covers all 10 type×sentinel combos; 3 existing snapshots regenerated to include the now-correct <value> tags. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
104 lines
3.3 KiB
XML
104 lines
3.3 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<DataCompositionSchema xmlns="http://v8.1c.ru/8.1/data-composition-system/schema"
|
|
xmlns:dcscom="http://v8.1c.ru/8.1/data-composition-system/common"
|
|
xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core"
|
|
xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings"
|
|
xmlns:v8="http://v8.1c.ru/8.1/data/core"
|
|
xmlns:v8ui="http://v8.1c.ru/8.1/data/ui"
|
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
<dataSource>
|
|
<name>ИсточникДанных1</name>
|
|
<dataSourceType>Local</dataSourceType>
|
|
</dataSource>
|
|
<dataSet xsi:type="DataSetQuery">
|
|
<name>Основной</name>
|
|
<field xsi:type="DataSetFieldField">
|
|
<dataPath>Сумма</dataPath>
|
|
<field>Сумма</field>
|
|
<title xsi:type="v8:LocalStringType">
|
|
<v8:item>
|
|
<v8:lang>ru</v8:lang>
|
|
<v8:content>Сумма продажи</v8:content>
|
|
</v8:item>
|
|
<v8:item>
|
|
<v8:lang>en</v8:lang>
|
|
<v8:content>Sale amount</v8:content>
|
|
</v8:item>
|
|
</title>
|
|
<valueType>
|
|
<v8:Type>xs:decimal</v8:Type>
|
|
<v8:NumberQualifiers>
|
|
<v8:Digits>15</v8:Digits>
|
|
<v8:FractionDigits>2</v8:FractionDigits>
|
|
<v8:AllowedSign>Any</v8:AllowedSign>
|
|
</v8:NumberQualifiers>
|
|
</valueType>
|
|
</field>
|
|
<dataSource>ИсточникДанных1</dataSource>
|
|
<query>ВЫБРАТЬ Т.Сумма ИЗ Регистр КАК Т</query>
|
|
</dataSet>
|
|
<calculatedField>
|
|
<dataPath>Маржа</dataPath>
|
|
<expression>Сумма * 0.2</expression>
|
|
<title xsi:type="v8:LocalStringType">
|
|
<v8:item>
|
|
<v8:lang>ru</v8:lang>
|
|
<v8:content>Маржа</v8:content>
|
|
</v8:item>
|
|
<v8:item>
|
|
<v8:lang>en</v8:lang>
|
|
<v8:content>Margin</v8:content>
|
|
</v8:item>
|
|
</title>
|
|
</calculatedField>
|
|
<totalField>
|
|
<dataPath>Сумма</dataPath>
|
|
<expression>Сумма(Сумма)</expression>
|
|
</totalField>
|
|
<parameter>
|
|
<name>Период</name>
|
|
<title xsi:type="v8:LocalStringType">
|
|
<v8:item>
|
|
<v8:lang>ru</v8:lang>
|
|
<v8:content>Период</v8:content>
|
|
</v8:item>
|
|
<v8:item>
|
|
<v8:lang>en</v8:lang>
|
|
<v8:content>Period</v8:content>
|
|
</v8:item>
|
|
</title>
|
|
<valueType>
|
|
<v8:Type>v8:StandardPeriod</v8:Type>
|
|
</valueType>
|
|
<value xsi:type="v8:StandardPeriod">
|
|
<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
|
|
<v8:startDate>0001-01-01T00:00:00</v8:startDate>
|
|
<v8:endDate>0001-01-01T00:00:00</v8:endDate>
|
|
</value>
|
|
</parameter>
|
|
<settingsVariant>
|
|
<dcsset:name>Основной</dcsset:name>
|
|
<dcsset:presentation xsi:type="v8:LocalStringType">
|
|
<v8:item>
|
|
<v8:lang>ru</v8:lang>
|
|
<v8:content>Продажи</v8:content>
|
|
</v8:item>
|
|
<v8:item>
|
|
<v8:lang>en</v8:lang>
|
|
<v8:content>Sales</v8:content>
|
|
</v8:item>
|
|
</dcsset:presentation>
|
|
<dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows">
|
|
<dcsset:selection>
|
|
<dcsset:item xsi:type="dcsset:SelectedItemField">
|
|
<dcsset:field>Сумма</dcsset:field>
|
|
</dcsset:item>
|
|
<dcsset:item xsi:type="dcsset:SelectedItemField">
|
|
<dcsset:field>Маржа</dcsset:field>
|
|
</dcsset:item>
|
|
</dcsset:selection>
|
|
</dcsset:settings>
|
|
</settingsVariant>
|
|
</DataCompositionSchema>
|