правки в экспорт

This commit is contained in:
PotapovaA 2026-10-20 15:35:46 +03:00
parent 487a8521da
commit c6a10e4604
2 changed files with 3 additions and 8 deletions

View File

@ -55,11 +55,6 @@ def _write_context(sheet: Worksheet, info: MatrixExportInfo) -> None:
def _write_values(sheet: Worksheet, row: int, column: int, cell: IntercompanyMatrixCellOut) -> None:
for offset, amount in enumerate((cell.variance_amount, cell.amount_a, cell.amount_b)):
sheet.cell(row + offset, column, amount).number_format = MONEY_FORMAT
for offset, correction_ids in ((1, cell.correction_ids_debit), (2, cell.correction_ids_credit)):
if correction_ids:
sheet.cell(row + offset, column).comment = Comment(
"ID корректировок: " + ", ".join(map(str, correction_ids)), "АРМ КА"
)
if cell.variance_percent is not None:
sheet.cell(row + 3, column, cell.variance_percent).number_format = PERCENT_FORMAT
_skipped_comment(sheet, row, column, cell.skipped_osv_entry_count)

View File

@ -134,14 +134,14 @@ def test_matrix_export_has_three_rows_per_debit_company_and_highlights_threshold
for offset in range(4)
)
debit_correction_id = UUID("44444444-4444-4444-4444-444444444444")
debit_correction_id = UUID("796d1add-eaed-4802-8c79-8b3cdae2cca1")
credit_correction_id = UUID("55555555-5555-5555-5555-555555555555")
matrix.cells[0].correction_ids_debit = [debit_correction_id]
matrix.cells[0].correction_ids_credit = [credit_correction_id]
preset_sheet = load_workbook(BytesIO(build_matrix_workbook(matrix, _info(mode="PRESET")))).active
assert preset_sheet is not None
assert str(debit_correction_id) in preset_sheet["D12"].comment.text
assert str(credit_correction_id) in preset_sheet["D13"].comment.text
assert preset_sheet["D12"].comment is None
assert preset_sheet["D13"].comment is None
async def test_export_routes_use_matrix_calculation() -> None: