parent
5303994ac3
commit
a43d358680
@ -36,6 +36,10 @@ class KukaReconciliationPageData
|
||||
|
||||
private const INVENTORY_SAP_CODE = 'OA01207289';
|
||||
|
||||
private const VIRTUAL_SUPPLIER_NAME = '欧伯娜';
|
||||
|
||||
private const VIRTUAL_SUPPLIER_CODE = self::INVENTORY_SAP_CODE;
|
||||
|
||||
public function __construct(
|
||||
private readonly DatabaseManager $databases,
|
||||
private readonly KukaPostingBaseRepository $baseRepository,
|
||||
@ -440,11 +444,15 @@ class KukaReconciliationPageData
|
||||
private function virtualRows(array $lineItems, string $generatedAt): array
|
||||
{
|
||||
$rows = [];
|
||||
foreach ($lineItems as $index => $row) {
|
||||
$serial = 0;
|
||||
$datePrefix = str_replace('-', '', substr($generatedAt, 0, 10));
|
||||
foreach ($lineItems as $row) {
|
||||
if (($row['posting_tag'] ?? '') !== '是') {
|
||||
continue;
|
||||
}
|
||||
$serial++;
|
||||
$rows[] = [
|
||||
$row['year'],
|
||||
$row['month'],
|
||||
(string) ($index + 1),
|
||||
(string) $serial,
|
||||
$row['material_number'],
|
||||
$row['product_name'],
|
||||
$this->formatQuantity($row['quantity']),
|
||||
@ -452,12 +460,9 @@ class KukaReconciliationPageData
|
||||
$row['supplier_amount'],
|
||||
$row['sales_unit_price'],
|
||||
$row['sales_amount'],
|
||||
$row['supplier_name'],
|
||||
$row['supplier_account'],
|
||||
$row['order_no'],
|
||||
$row['internal_order_no'],
|
||||
$row['express_no'],
|
||||
$generatedAt,
|
||||
self::VIRTUAL_SUPPLIER_NAME,
|
||||
self::VIRTUAL_SUPPLIER_CODE,
|
||||
$datePrefix.str_pad((string) $serial, 6, '0', STR_PAD_LEFT),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -46,11 +46,10 @@
|
||||
'icon' => 'swap_horiz',
|
||||
'description' => '已按工作簿4“灵珊虚拟过账”子表放入表头,数据待接入。',
|
||||
'source_sheet' => '灵珊虚拟过账',
|
||||
'numeric_columns' => [2, 5, 6, 7, 8, 9],
|
||||
'numeric_columns' => [0, 3, 4, 5, 6, 7],
|
||||
'headers' => $simpleHeaders([
|
||||
'年份', '月份', '序号', '顾家料号', '品名', '采购数量', '单价', '供货商金额',
|
||||
'销售单价', '销售金额', '供货商', '供应商编码', '淘宝单号', 'N单号', '装载号',
|
||||
'导入时间',
|
||||
'序号', '顾家料号', '品名', '采购数量', '单价', '供货商金额',
|
||||
'销售单价', '销售金额', '供货商', '供应商编码', '淘宝单号',
|
||||
]),
|
||||
],
|
||||
[
|
||||
|
||||
@ -45,7 +45,6 @@ class KukaReconciliationPageTest extends FeatureTestCase
|
||||
->assertSee('data-kuka-toc-quantity-card', false)
|
||||
->assertDontSeeText('有效物料行')
|
||||
->assertSeeText('供货商金额')
|
||||
->assertSeeText('装载号')
|
||||
->assertSeeText('nationalSubsidySubject')
|
||||
->assertSeeText('提交人电话(手机)')
|
||||
->assertSeeText('toElsAccount')
|
||||
@ -57,7 +56,7 @@ class KukaReconciliationPageTest extends FeatureTestCase
|
||||
$this->assertSame([
|
||||
'posting-data' => 7,
|
||||
'toc-orders' => 6,
|
||||
'lingshan-virtual-posting' => 16,
|
||||
'lingshan-virtual-posting' => 11,
|
||||
'erp-product-import' => 34,
|
||||
'invoice-entry-template' => 20,
|
||||
'inventory-management-template' => 28,
|
||||
|
||||
@ -166,20 +166,20 @@ class KukaReconciliationPageDataTest extends TestCase
|
||||
$this->assertSame([[
|
||||
'2026', '10', $numericOrderNo, 'M-1', '测试物料', '2',
|
||||
]], $data['views']['toc-orders']['rows']);
|
||||
$this->assertSame(1, $data['views']['lingshan-virtual-posting']['total']);
|
||||
|
||||
$virtual = $data['views']['lingshan-virtual-posting']['rows'][0];
|
||||
$this->assertSame('1', $virtual[2]);
|
||||
$this->assertSame('M-1', $virtual[3]);
|
||||
$this->assertSame('2', $virtual[5]);
|
||||
$this->assertSame('10.00', $virtual[6]);
|
||||
$this->assertSame('20.00', $virtual[7]);
|
||||
$this->assertSame('11.11', $virtual[8]);
|
||||
$this->assertSame('22.22', $virtual[9]);
|
||||
$this->assertSame('常州欧伯娜家居有限公司', $virtual[10]);
|
||||
$this->assertSame('435421', $virtual[11]);
|
||||
$this->assertSame($numericOrderNo, $virtual[12]);
|
||||
$this->assertSame('INTERNAL-8', $virtual[13]);
|
||||
$this->assertSame('EXPRESS-1', $virtual[14]);
|
||||
$this->assertSame('1', $virtual[0]);
|
||||
$this->assertSame('M-1', $virtual[1]);
|
||||
$this->assertSame('测试商品', $virtual[2]);
|
||||
$this->assertSame('2', $virtual[3]);
|
||||
$this->assertSame('10.00', $virtual[4]);
|
||||
$this->assertSame('20.00', $virtual[5]);
|
||||
$this->assertSame('11.11', $virtual[6]);
|
||||
$this->assertSame('22.22', $virtual[7]);
|
||||
$this->assertSame('欧伯娜', $virtual[8]);
|
||||
$this->assertSame('OA01207289', $virtual[9]);
|
||||
$this->assertSame(now()->format('Ymd').'000001', $virtual[10]);
|
||||
|
||||
$erp = $data['views']['erp-product-import']['rows'][0];
|
||||
$this->assertSame('2', $erp[5]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user