feat: 增加未定价账期汇总与导出 (#1179)
Co-authored-by: 苏木 <594326199@qq.com> Co-committed-by: 苏木 <594326199@qq.com>
This commit is contained in:
parent
cad98ba3e9
commit
c658bbed99
@ -4411,6 +4411,8 @@ class Pages extends Controller
|
||||
),
|
||||
static fn (array $row): bool => (string) ($row['_accounting_period'] ?? '') === $period,
|
||||
));
|
||||
$deliverySummary = $this->unpricedCycleSummary($deliveryRows, 'amount', 'guessAmount');
|
||||
$returnSummary = $this->unpricedCycleSummary($returnRows, 'amount', 'guess_amount');
|
||||
|
||||
$deliveryPage = max(1, (int) request('delivery_page', 1));
|
||||
$returnPage = max(1, (int) request('return_page', 1));
|
||||
@ -4419,6 +4421,12 @@ class Pages extends Controller
|
||||
'dataset' => 'previous-unpriced-current-priced',
|
||||
'period' => $period,
|
||||
'active_tab' => $activeTab,
|
||||
'delivery_summary' => $deliverySummary,
|
||||
'return_summary' => $returnSummary,
|
||||
'export_url' => route(
|
||||
'business.supplier-payables-final.previous-unpriced-current-priced.export',
|
||||
['month' => $period],
|
||||
),
|
||||
'delivery_fields' => collect($registry->fields($sectionSlug, 'delivery-unpriced'))
|
||||
->map(static fn (array $definition, string $name): array => ['name' => $name] + $definition)
|
||||
->values()
|
||||
@ -4452,6 +4460,38 @@ class Pages extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<array<string,mixed>> $rows
|
||||
* @return array{record_count:int,quantity:float,amount:float,estimated_amount:float}
|
||||
*/
|
||||
private function unpricedCycleSummary(
|
||||
array $rows,
|
||||
string $amountField,
|
||||
string $estimatedAmountField,
|
||||
): array {
|
||||
$quantity = 0.0;
|
||||
$amount = 0.0;
|
||||
$estimatedAmount = 0.0;
|
||||
foreach ($rows as $row) {
|
||||
if (is_numeric($row['qty'] ?? null)) {
|
||||
$quantity += (float) $row['qty'];
|
||||
}
|
||||
if (is_numeric($row[$amountField] ?? null)) {
|
||||
$amount += (float) $row[$amountField];
|
||||
}
|
||||
if (is_numeric($row[$estimatedAmountField] ?? null)) {
|
||||
$estimatedAmount += (float) $row[$estimatedAmountField];
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'record_count' => count($rows),
|
||||
'quantity' => $quantity,
|
||||
'amount' => $amount,
|
||||
'estimated_amount' => $estimatedAmount,
|
||||
];
|
||||
}
|
||||
|
||||
/** @return array{0:LengthAwarePaginator,1:?string} */
|
||||
private function inventoryReportRows(): array
|
||||
{
|
||||
|
||||
214
app/Http/Controllers/Business/PayablesUnpricedCycleExport.php
Normal file
214
app/Http/Controllers/Business/PayablesUnpricedCycleExport.php
Normal file
@ -0,0 +1,214 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Business;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Modules\EcommerceFinance\Services\PayablesFinalRegistry;
|
||||
use Modules\EcommerceFinance\Services\PayablesUnpricedCycleProcessor;
|
||||
use Modules\EcommerceFinance\Services\SupplierPayableOverrideStore;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Border;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Fill;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
class PayablesUnpricedCycleExport extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly SupplierPayableOverrideStore $store,
|
||||
private readonly PayablesFinalRegistry $registry,
|
||||
) {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('company.identify');
|
||||
}
|
||||
|
||||
public function export(Request $request): StreamedResponse
|
||||
{
|
||||
$requestedPeriod = trim((string) $request->query('month', ''));
|
||||
$period = preg_match('/^\d{4}-\d{2}$/', $requestedPeriod) === 1
|
||||
? $requestedPeriod
|
||||
: now()->subMonthNoOverflow()->format('Y-m');
|
||||
$companyId = (int) (company_id() ?: 1);
|
||||
|
||||
$deliveryRows = $this->periodRows(
|
||||
PayablesUnpricedCycleProcessor::DELIVERY_PRICED_DATASET,
|
||||
$period,
|
||||
$companyId,
|
||||
);
|
||||
$returnRows = $this->periodRows(
|
||||
PayablesUnpricedCycleProcessor::RETURN_PRICED_DATASET,
|
||||
$period,
|
||||
$companyId,
|
||||
);
|
||||
$deliverySummary = $this->summary($deliveryRows, 'guessAmount', 'amount');
|
||||
$returnSummary = $this->summary($returnRows, 'guess_amount', 'amount');
|
||||
|
||||
$spreadsheet = new Spreadsheet();
|
||||
$summarySheet = $spreadsheet->getActiveSheet();
|
||||
$summarySheet->setTitle('账期汇总');
|
||||
$summarySheet->fromArray([
|
||||
['类型', '记录数', '件数', '金额', '预估金额'],
|
||||
['送货未定价', $deliverySummary['count'], $deliverySummary['quantity'], $deliverySummary['amount'], $deliverySummary['estimated_amount']],
|
||||
['退货未定价', $returnSummary['count'], $returnSummary['quantity'], $returnSummary['amount'], $returnSummary['estimated_amount']],
|
||||
], null, 'A1');
|
||||
$this->styleSheet($summarySheet, 5, 3, [2 => 'number', 3 => 'number', 4 => 'number', 5 => 'number']);
|
||||
$summarySheet->getColumnDimension('A')->setWidth(18);
|
||||
foreach (['B', 'C', 'D', 'E'] as $column) {
|
||||
$summarySheet->getColumnDimension($column)->setWidth(18);
|
||||
}
|
||||
|
||||
$deliverySheet = $spreadsheet->createSheet();
|
||||
$this->writeDetailSheet(
|
||||
$deliverySheet,
|
||||
'送货未定价',
|
||||
$this->registry->fields(PayablesFinalRegistry::SECTION_SUPPLIER, 'delivery-unpriced'),
|
||||
$deliveryRows,
|
||||
);
|
||||
|
||||
$returnSheet = $spreadsheet->createSheet();
|
||||
$this->writeDetailSheet(
|
||||
$returnSheet,
|
||||
'退货未定价',
|
||||
$this->registry->fields(PayablesFinalRegistry::SECTION_SUPPLIER, 'return-unpriced'),
|
||||
$returnRows,
|
||||
);
|
||||
$spreadsheet->setActiveSheetIndex(0);
|
||||
|
||||
$fileName = '之前月未定价-本月定价_' . $period . '_' . now()->format('Ymd_His') . '.xlsx';
|
||||
|
||||
return response()->streamDownload(function () use ($spreadsheet): void {
|
||||
(new Xlsx($spreadsheet))->save('php://output');
|
||||
$spreadsheet->disconnectWorksheets();
|
||||
}, $fileName, [
|
||||
'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'Cache-Control' => 'private, no-store',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array<string,mixed>>
|
||||
*/
|
||||
private function periodRows(string $dataset, string $period, int $companyId): array
|
||||
{
|
||||
return array_values(array_filter(
|
||||
$this->store->listRows($dataset, $companyId),
|
||||
static fn (array $row): bool => (string) ($row['_accounting_period'] ?? '') === $period,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<array<string,mixed>> $rows
|
||||
* @return array{count:int,quantity:float,amount:float,estimated_amount:float}
|
||||
*/
|
||||
private function summary(array $rows, string $estimatedAmountField, string $amountField): array
|
||||
{
|
||||
$quantity = 0.0;
|
||||
$amount = 0.0;
|
||||
$estimatedAmount = 0.0;
|
||||
foreach ($rows as $row) {
|
||||
if (is_numeric($row['qty'] ?? null)) {
|
||||
$quantity += (float) $row['qty'];
|
||||
}
|
||||
if (is_numeric($row[$amountField] ?? null)) {
|
||||
$amount += (float) $row[$amountField];
|
||||
}
|
||||
if (is_numeric($row[$estimatedAmountField] ?? null)) {
|
||||
$estimatedAmount += (float) $row[$estimatedAmountField];
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'count' => count($rows),
|
||||
'quantity' => $quantity,
|
||||
'amount' => $amount,
|
||||
'estimated_amount' => $estimatedAmount,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string,array{label:string,type:string}> $fields
|
||||
* @param list<array<string,mixed>> $rows
|
||||
*/
|
||||
private function writeDetailSheet(
|
||||
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $sheet,
|
||||
string $title,
|
||||
array $fields,
|
||||
array $rows,
|
||||
): void {
|
||||
$sheet->setTitle($title);
|
||||
$headers = array_merge(['序号'], array_column($fields, 'label'));
|
||||
$sheet->fromArray($headers, null, 'A1');
|
||||
|
||||
$data = [];
|
||||
foreach ($rows as $index => $row) {
|
||||
$line = [$index + 1];
|
||||
foreach ($fields as $field => $definition) {
|
||||
$value = $row[$field] ?? '';
|
||||
$line[] = $definition['type'] === 'number' && is_numeric($value)
|
||||
? (float) $value
|
||||
: (string) $value;
|
||||
}
|
||||
$data[] = $line;
|
||||
}
|
||||
if ($data !== []) {
|
||||
$sheet->fromArray($data, null, 'A2');
|
||||
}
|
||||
|
||||
$lastColumn = Coordinate::stringFromColumnIndex(count($headers));
|
||||
$lastRow = max(1, count($data) + 1);
|
||||
$types = [];
|
||||
$columnIndex = 2;
|
||||
foreach ($fields as $definition) {
|
||||
if ($definition['type'] === 'number') {
|
||||
$types[$columnIndex] = 'number';
|
||||
}
|
||||
$column = Coordinate::stringFromColumnIndex($columnIndex);
|
||||
$sheet->getColumnDimension($column)->setWidth(min(32, max(12, mb_strlen($definition['label']) * 2 + 5)));
|
||||
$columnIndex++;
|
||||
}
|
||||
$sheet->getColumnDimension('A')->setWidth(9);
|
||||
$this->styleSheet($sheet, count($headers), $lastRow, $types);
|
||||
$sheet->freezePane('A2');
|
||||
$sheet->setAutoFilter('A1:' . $lastColumn . $lastRow);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int,string> $types
|
||||
*/
|
||||
private function styleSheet(
|
||||
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $sheet,
|
||||
int $columnCount,
|
||||
int $rowCount,
|
||||
array $types,
|
||||
): void {
|
||||
$lastColumn = Coordinate::stringFromColumnIndex($columnCount);
|
||||
$headerRange = 'A1:' . $lastColumn . '1';
|
||||
$sheet->getStyle($headerRange)->applyFromArray([
|
||||
'font' => ['bold' => true, 'color' => ['rgb' => 'FFFFFF']],
|
||||
'fill' => ['fillType' => Fill::FILL_SOLID, 'startColor' => ['rgb' => '856632']],
|
||||
'alignment' => ['horizontal' => Alignment::HORIZONTAL_CENTER, 'vertical' => Alignment::VERTICAL_CENTER],
|
||||
'borders' => ['allBorders' => ['borderStyle' => Border::BORDER_THIN, 'color' => ['rgb' => 'D8D2C7']]],
|
||||
]);
|
||||
$sheet->getRowDimension(1)->setRowHeight(24);
|
||||
if ($rowCount > 1) {
|
||||
$sheet->getStyle('A2:' . $lastColumn . $rowCount)
|
||||
->getBorders()
|
||||
->getAllBorders()
|
||||
->setBorderStyle(Border::BORDER_THIN)
|
||||
->getColor()
|
||||
->setRGB('E7E2D8');
|
||||
}
|
||||
foreach ($types as $index => $type) {
|
||||
if ($type !== 'number') {
|
||||
continue;
|
||||
}
|
||||
$column = Coordinate::stringFromColumnIndex($index);
|
||||
$sheet->getStyle($column . '2:' . $column . max(2, $rowCount))
|
||||
->getNumberFormat()
|
||||
->setFormatCode('#,##0.00');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,9 @@
|
||||
$returnFields = $cycle['return_fields'] ?? [];
|
||||
$deliveryRows = $cycle['delivery_rows'];
|
||||
$returnRows = $cycle['return_rows'];
|
||||
$deliverySummary = $cycle['delivery_summary'] ?? [];
|
||||
$returnSummary = $cycle['return_summary'] ?? [];
|
||||
$exportUrl = $cycle['export_url'] ?? '';
|
||||
@endphp
|
||||
|
||||
<div class="previous-priced-page" data-unpriced-cycle-root data-active-tab="{{ $activeTab }}">
|
||||
@ -30,8 +33,11 @@
|
||||
display: inline-flex; height: 2.25rem; align-items: center; justify-content: center; gap: 0.35rem;
|
||||
padding: 0 0.85rem; border: 1px solid var(--cycle-border); border-radius: 0.5rem;
|
||||
background: var(--vip-content-accent-dark, #856632); color: #fff;
|
||||
font-size: 0.8125rem; font-weight: 600; cursor: pointer;
|
||||
font-size: 0.8125rem; font-weight: 600; cursor: pointer; text-decoration: none;
|
||||
}
|
||||
.previous-priced-button.is-secondary { background: var(--vip-surface, #FFFFFF); color: var(--vip-content-ink, #171717); }
|
||||
.previous-priced-button.is-secondary:hover,
|
||||
.previous-priced-button.is-secondary:focus { border-color: var(--vip-content-accent-dark, #856632); color: var(--vip-content-accent-dark, #856632); }
|
||||
.previous-priced-tabs {
|
||||
display: flex; gap: 1.5rem; margin-bottom: 0.75rem; padding: 0 1rem;
|
||||
border: 1px solid var(--cycle-border); border-radius: 0.5rem 0.5rem 0 0;
|
||||
@ -58,6 +64,13 @@
|
||||
border: 1px solid var(--cycle-border); border-top: 0; border-radius: 0 0 0.5rem 0.5rem;
|
||||
background: var(--vip-surface, #FFFFFF); overflow: hidden;
|
||||
}
|
||||
.previous-priced-summary {
|
||||
display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.4rem;
|
||||
margin-bottom: 0.75rem; padding: 0.75rem 1rem; border: 1px solid var(--cycle-border);
|
||||
border-radius: 0.5rem; background: var(--vip-surface, #FFFFFF);
|
||||
}
|
||||
.previous-priced-summary__item { display: inline-flex; align-items: baseline; gap: 0.35rem; color: var(--vip-content-muted, #595959); font-size: 0.75rem; }
|
||||
.previous-priced-summary__value { color: var(--vip-content-ink, #171717); font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
|
||||
.previous-priced-scroll { width: 100%; overflow-x: auto; }
|
||||
.previous-priced-table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
|
||||
.previous-priced-table th,
|
||||
@ -99,6 +112,10 @@
|
||||
<span class="material-icons-outlined" aria-hidden="true">search</span>
|
||||
<span>查询</span>
|
||||
</button>
|
||||
<a href="{{ $exportUrl }}" class="previous-priced-button is-secondary">
|
||||
<span class="material-icons-outlined" aria-hidden="true">download</span>
|
||||
<span>导出</span>
|
||||
</a>
|
||||
</form>
|
||||
|
||||
<div class="previous-priced-tabs" role="tablist" aria-label="未定价类型">
|
||||
@ -132,6 +149,12 @@
|
||||
data-unpriced-cycle-pane="delivery"
|
||||
@if ($activeTab !== 'delivery') hidden @endif
|
||||
>
|
||||
<div class="previous-priced-summary" aria-label="送货未定价账期汇总">
|
||||
<span class="previous-priced-summary__item">记录数 <strong class="previous-priced-summary__value" data-cycle-summary="delivery-record-count">{{ number_format((int) ($deliverySummary['record_count'] ?? 0)) }}</strong></span>
|
||||
<span class="previous-priced-summary__item">件数 <strong class="previous-priced-summary__value" data-cycle-summary="delivery-quantity">{{ number_format((float) ($deliverySummary['quantity'] ?? 0), 2) }}</strong></span>
|
||||
<span class="previous-priced-summary__item">金额 <strong class="previous-priced-summary__value" data-cycle-summary="delivery-amount">¥{{ number_format((float) ($deliverySummary['amount'] ?? 0), 2) }}</strong></span>
|
||||
<span class="previous-priced-summary__item">预估金额 <strong class="previous-priced-summary__value" data-cycle-summary="delivery-estimated-amount">¥{{ number_format((float) ($deliverySummary['estimated_amount'] ?? 0), 2) }}</strong></span>
|
||||
</div>
|
||||
<div class="previous-priced-card">
|
||||
<div class="previous-priced-scroll">
|
||||
<table class="previous-priced-table">
|
||||
@ -190,6 +213,12 @@
|
||||
data-unpriced-cycle-pane="return"
|
||||
@if ($activeTab !== 'return') hidden @endif
|
||||
>
|
||||
<div class="previous-priced-summary" aria-label="退货未定价账期汇总">
|
||||
<span class="previous-priced-summary__item">记录数 <strong class="previous-priced-summary__value" data-cycle-summary="return-record-count">{{ number_format((int) ($returnSummary['record_count'] ?? 0)) }}</strong></span>
|
||||
<span class="previous-priced-summary__item">件数 <strong class="previous-priced-summary__value" data-cycle-summary="return-quantity">{{ number_format((float) ($returnSummary['quantity'] ?? 0), 2) }}</strong></span>
|
||||
<span class="previous-priced-summary__item">金额 <strong class="previous-priced-summary__value" data-cycle-summary="return-amount">¥{{ number_format((float) ($returnSummary['amount'] ?? 0), 2) }}</strong></span>
|
||||
<span class="previous-priced-summary__item">预估金额 <strong class="previous-priced-summary__value" data-cycle-summary="return-estimated-amount">¥{{ number_format((float) ($returnSummary['estimated_amount'] ?? 0), 2) }}</strong></span>
|
||||
</div>
|
||||
<div class="previous-priced-card">
|
||||
<div class="previous-priced-scroll">
|
||||
<table class="previous-priced-table">
|
||||
|
||||
@ -17,6 +17,7 @@ use App\Http\Controllers\Business\ServiceCompanyReconciliation as ServiceCompany
|
||||
use App\Http\Controllers\Business\SupplierPayableActions;
|
||||
use App\Http\Controllers\Business\SupplierNegativeAlertDingTalkActions;
|
||||
use App\Http\Controllers\Business\PayablesFinalActions;
|
||||
use App\Http\Controllers\Business\PayablesUnpricedCycleExport;
|
||||
use App\Http\Controllers\Business\SupplierReconciliation as SupplierReconciliationActions;
|
||||
use App\Http\Controllers\Business\SystemizationTodos;
|
||||
use App\Http\Controllers\Business\WithdrawalManagement;
|
||||
@ -460,6 +461,13 @@ foreach ($payablesFinalDatasets as $finalSection => $finalDatasets) {
|
||||
}
|
||||
}
|
||||
|
||||
Route::get(
|
||||
'workspace/supplier-payables-final/actions/previous-unpriced-current-priced/export',
|
||||
[PayablesUnpricedCycleExport::class, 'export'],
|
||||
)
|
||||
->middleware('business.page:supplier-payables-final,previous-unpriced-current-priced')
|
||||
->name('business.supplier-payables-final.previous-unpriced-current-priced.export');
|
||||
|
||||
// 供应商对账:对账单模板下载 + 厂家对账单上传(严格按模板校验)
|
||||
Route::get('workspace/supplier-portal', [\App\Http\Controllers\Business\SupplierPortal::class, 'home'])
|
||||
->middleware('business.page:supplier-reconciliation,supplier-data')
|
||||
|
||||
@ -134,13 +134,13 @@ class PayablesUnpricedCycleTest extends FeatureTestCase
|
||||
|
||||
$store->saveBatch(PayablesUnpricedCycleProcessor::DELIVERY_PRICED_DATASET, [
|
||||
'id:page:delivery' => [
|
||||
'barCode' => 'DELIVERY-PRICE-1', 'qty' => '2', 'unitPrice' => '10', 'amount' => '20',
|
||||
'barCode' => 'DELIVERY-PRICE-1', 'qty' => '2', 'unitPrice' => '10', 'amount' => '20', 'guessAmount' => '30',
|
||||
'_accounting_period' => '2026-10',
|
||||
],
|
||||
], $companyId, (int) $this->user->id, 'test');
|
||||
$store->saveBatch(PayablesUnpricedCycleProcessor::RETURN_PRICED_DATASET, [
|
||||
'id:page:return' => [
|
||||
'barcode' => 'RETURN-PRICE-1', 'qty' => '1', 'unit_price' => '8', 'amount' => '8',
|
||||
'barcode' => 'RETURN-PRICE-1', 'qty' => '1', 'unit_price' => '8', 'amount' => '8', 'guess_amount' => '10',
|
||||
'_accounting_period' => '2026-10',
|
||||
],
|
||||
], $companyId, (int) $this->user->id, 'test');
|
||||
@ -159,7 +159,37 @@ class PayablesUnpricedCycleTest extends FeatureTestCase
|
||||
->assertSeeText('采购金额')
|
||||
->assertSeeText('DELIVERY-PRICE-1')
|
||||
->assertSeeText('RETURN-PRICE-1')
|
||||
->assertSee('value="2026-10"', false);
|
||||
->assertSee('value="2026-10"', false)
|
||||
->assertSee('data-cycle-summary="delivery-record-count">1</strong>', false)
|
||||
->assertSee('data-cycle-summary="delivery-quantity">2.00</strong>', false)
|
||||
->assertSee('data-cycle-summary="delivery-amount">¥20.00</strong>', false)
|
||||
->assertSee('data-cycle-summary="return-estimated-amount">¥10.00</strong>', false)
|
||||
->assertSee('>导出</span>', false);
|
||||
|
||||
$export = $this->loginAs()->get(route(
|
||||
'business.supplier-payables-final.previous-unpriced-current-priced.export',
|
||||
['month' => '2026-10'],
|
||||
))->assertOk();
|
||||
$path = tempnam(sys_get_temp_dir(), 'caiwu-cycle-export') . '.xlsx';
|
||||
|
||||
try {
|
||||
file_put_contents($path, $export->streamedContent());
|
||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($path);
|
||||
$this->assertSame(['账期汇总', '送货未定价', '退货未定价'], $spreadsheet->getSheetNames());
|
||||
$summary = $spreadsheet->getSheetByName('账期汇总')->rangeToArray('A1:E3');
|
||||
$this->assertSame(['类型', '记录数', '件数', '金额', '预估金额'], $summary[0]);
|
||||
$this->assertSame('送货未定价', $summary[1][0]);
|
||||
$this->assertSame(2.0, (float) $summary[1][2]);
|
||||
$this->assertSame(20.0, (float) $summary[1][3]);
|
||||
$deliveryHeader = $spreadsheet->getSheetByName('送货未定价')->rangeToArray('A1:T1')[0];
|
||||
$this->assertContains('计划单号', $deliveryHeader);
|
||||
$this->assertContains('预估金额', $deliveryHeader);
|
||||
$returnHeader = $spreadsheet->getSheetByName('退货未定价')->rangeToArray('A1:Q1')[0];
|
||||
$this->assertContains('采购金额', $returnHeader);
|
||||
$spreadsheet->disconnectWorksheets();
|
||||
} finally {
|
||||
@unlink($path);
|
||||
}
|
||||
}
|
||||
|
||||
private function makeFile(string $name, string $content): string
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user