Skip to content

Commit f758d7e

Browse files
Merge branch '4.4' into feature/issue-6147-baseinfo-schema
納品書PDFの出力項目トグル (6197) が 4.4 へ入ったため取り込む。 衝突 5 ファイルはいずれも両側が同じ位置へ追記した形なので、双方を残して解消した。 - Entity/BaseInfo: 4.4 の order_pdf_visible_* と本ブランチの構造化データ項目・ OpeningHours コレクションを併存させる - locale (ja/en): tooltip を双方とも残す - ShopMasterTypeTest: 双方のテストメソッドを残す - e2e/admin-basicinfo.spec.ts: 双方の test を残す。テストIDが両側とも EA0701-UC01-T18 で重複したため、本ブランチ側を EA0701-UC01-T19 へ振り直した
2 parents 97f3925 + 6244b8f commit f758d7e

11 files changed

Lines changed: 754 additions & 29 deletions

File tree

e2e/tests/admin-basicinfo.spec.ts

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,68 @@ test.describe('Admin Basic Info (EA07)', () => {
13261326
await expect(page.locator('#page_admin_setting_shop_calendar .alert-success')).toContainText('保存しました');
13271327
});
13281328

1329-
test('basicinfo_構造化データ_営業時間とSNS等URL - EA0701-UC01-T18', async ({ page }) => {
1329+
test('basicinfo_納品書PDFの出力項目トグル - EA0701-UC01-T18', async ({ page }) => {
1330+
// dev 環境の Symfony デバッグツールバーが送信ボタンを覆うことがあるため非表示にする
1331+
// (CI の test 環境ではツールバー自体が存在しないため no-op)。
1332+
const hideDebugToolbar = () => page.addStyleTag({
1333+
content: '.sf-toolbar, .sf-minitoolbar { display: none !important; }',
1334+
}).catch(() => { /* ツールバーが無い環境では無視 */ });
1335+
1336+
await page.goto(`/${adminRoute}/setting/shop`);
1337+
await page.waitForLoadState('load');
1338+
await ensureAdminLoggedIn(page);
1339+
if (!page.url().includes('/setting/shop')) {
1340+
await page.goto(`/${adminRoute}/setting/shop`);
1341+
await page.waitForLoadState('load');
1342+
}
1343+
await hideDebugToolbar();
1344+
1345+
// 納品書PDFの出力トグルが各入力欄の横(店舗情報/税設定カード)に表示されていること
1346+
const hourCheckbox = page.locator('#shop_master_order_pdf_visible_business_hour');
1347+
const invoiceCheckbox = page.locator('#shop_master_order_pdf_visible_invoice_number');
1348+
await expect(hourCheckbox).toBeAttached();
1349+
await expect(invoiceCheckbox).toBeAttached();
1350+
1351+
// 初期状態を退避(アサーション失敗時も finally で必ず復元する)
1352+
const hourInitial = await hourCheckbox.isChecked();
1353+
const invoiceInitial = await invoiceCheckbox.isChecked();
1354+
1355+
try {
1356+
// 既定 OFF の「店舗営業時間」と既定 ON の「インボイス登録番号」を反転して保存
1357+
await page.locator('label[for="shop_master_order_pdf_visible_business_hour"]').click();
1358+
await page.locator('label[for="shop_master_order_pdf_visible_invoice_number"]').click();
1359+
await page.waitForTimeout(500);
1360+
await page.locator('button.ladda-button[type="submit"]').click();
1361+
await page.waitForLoadState('load');
1362+
await expect(page.locator('.alert-success')).toContainText('保存しました', { timeout: 30_000 });
1363+
1364+
// 再表示して反転後の状態が保持されていること
1365+
await page.goto(`/${adminRoute}/setting/shop`);
1366+
await page.waitForLoadState('load');
1367+
await hideDebugToolbar();
1368+
await expect(page.locator('#shop_master_order_pdf_visible_business_hour')).toBeChecked({ checked: !hourInitial });
1369+
await expect(page.locator('#shop_master_order_pdf_visible_invoice_number')).toBeChecked({ checked: !invoiceInitial });
1370+
} finally {
1371+
// 初期状態へ復元して保存(アサーションが失敗しても設定を元に戻す)
1372+
await page.goto(`/${adminRoute}/setting/shop`);
1373+
await page.waitForLoadState('load');
1374+
await hideDebugToolbar();
1375+
const hourNow = await page.locator('#shop_master_order_pdf_visible_business_hour').isChecked();
1376+
if (hourNow !== hourInitial) {
1377+
await page.locator('label[for="shop_master_order_pdf_visible_business_hour"]').click();
1378+
}
1379+
const invoiceNow = await page.locator('#shop_master_order_pdf_visible_invoice_number').isChecked();
1380+
if (invoiceNow !== invoiceInitial) {
1381+
await page.locator('label[for="shop_master_order_pdf_visible_invoice_number"]').click();
1382+
}
1383+
await page.waitForTimeout(500);
1384+
await page.locator('button.ladda-button[type="submit"]').click();
1385+
await page.waitForLoadState('load');
1386+
await expect(page.locator('.alert-success')).toContainText('保存しました', { timeout: 30_000 });
1387+
}
1388+
});
1389+
1390+
test('basicinfo_構造化データ_営業時間とSNS等URL - EA0701-UC01-T19', async ({ page }) => {
13301391
test.setTimeout(120_000);
13311392

13321393
const sameAsUrl = 'https://example.com/official-sns';

src/Eccube/Entity/BaseInfo.php

Lines changed: 179 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,33 @@ class BaseInfo extends AbstractEntity
173173
#[ORM\Column(name: 'mcp_enabled', type: Types::BOOLEAN, options: ['default' => false])]
174174
private bool $mcp_enabled = false;
175175

176+
// 納品書PDFの店舗情報の出力項目トグル(#6197)。
177+
// 既定は「現状出力している項目+インボイス要件の会社名」を ON、新規項目は OFF とし、
178+
// アップグレード時も既存の納品書の見た目を極力維持する。
179+
#[ORM\Column(name: 'order_pdf_visible_shop_name', type: Types::BOOLEAN, options: ['default' => true])]
180+
private bool $order_pdf_visible_shop_name = true;
181+
182+
#[ORM\Column(name: 'order_pdf_visible_shop_name_eng', type: Types::BOOLEAN, options: ['default' => false])]
183+
private bool $order_pdf_visible_shop_name_eng = false;
184+
185+
#[ORM\Column(name: 'order_pdf_visible_address', type: Types::BOOLEAN, options: ['default' => true])]
186+
private bool $order_pdf_visible_address = true;
187+
188+
#[ORM\Column(name: 'order_pdf_visible_company_name', type: Types::BOOLEAN, options: ['default' => true])]
189+
private bool $order_pdf_visible_company_name = true;
190+
191+
#[ORM\Column(name: 'order_pdf_visible_phone_number', type: Types::BOOLEAN, options: ['default' => true])]
192+
private bool $order_pdf_visible_phone_number = true;
193+
194+
#[ORM\Column(name: 'order_pdf_visible_business_hour', type: Types::BOOLEAN, options: ['default' => false])]
195+
private bool $order_pdf_visible_business_hour = false;
196+
197+
#[ORM\Column(name: 'order_pdf_visible_email', type: Types::BOOLEAN, options: ['default' => true])]
198+
private bool $order_pdf_visible_email = true;
199+
200+
#[ORM\Column(name: 'order_pdf_visible_invoice_number', type: Types::BOOLEAN, options: ['default' => true])]
201+
private bool $order_pdf_visible_invoice_number = true;
202+
176203
#[ORM\Column(name: 'same_as', type: Types::TEXT, nullable: true)]
177204
private ?string $same_as = null;
178205

@@ -979,6 +1006,158 @@ public function setMcpEnabled(bool $mcpEnabled): BaseInfo
9791006
return $this;
9801007
}
9811008

1009+
/**
1010+
* Get mcpEnabled.
1011+
*/
1012+
public function isMcpEnabled(): bool
1013+
{
1014+
return $this->mcp_enabled;
1015+
}
1016+
1017+
/**
1018+
* Set orderPdfVisibleShopName.
1019+
*/
1020+
public function setOrderPdfVisibleShopName(bool $orderPdfVisibleShopName): BaseInfo
1021+
{
1022+
$this->order_pdf_visible_shop_name = $orderPdfVisibleShopName;
1023+
1024+
return $this;
1025+
}
1026+
1027+
/**
1028+
* Get orderPdfVisibleShopName.
1029+
*/
1030+
public function isOrderPdfVisibleShopName(): bool
1031+
{
1032+
return $this->order_pdf_visible_shop_name;
1033+
}
1034+
1035+
/**
1036+
* Set orderPdfVisibleShopNameEng.
1037+
*/
1038+
public function setOrderPdfVisibleShopNameEng(bool $orderPdfVisibleShopNameEng): BaseInfo
1039+
{
1040+
$this->order_pdf_visible_shop_name_eng = $orderPdfVisibleShopNameEng;
1041+
1042+
return $this;
1043+
}
1044+
1045+
/**
1046+
* Get orderPdfVisibleShopNameEng.
1047+
*/
1048+
public function isOrderPdfVisibleShopNameEng(): bool
1049+
{
1050+
return $this->order_pdf_visible_shop_name_eng;
1051+
}
1052+
1053+
/**
1054+
* Set orderPdfVisibleAddress.
1055+
*/
1056+
public function setOrderPdfVisibleAddress(bool $orderPdfVisibleAddress): BaseInfo
1057+
{
1058+
$this->order_pdf_visible_address = $orderPdfVisibleAddress;
1059+
1060+
return $this;
1061+
}
1062+
1063+
/**
1064+
* Get orderPdfVisibleAddress.
1065+
*/
1066+
public function isOrderPdfVisibleAddress(): bool
1067+
{
1068+
return $this->order_pdf_visible_address;
1069+
}
1070+
1071+
/**
1072+
* Set orderPdfVisibleCompanyName.
1073+
*/
1074+
public function setOrderPdfVisibleCompanyName(bool $orderPdfVisibleCompanyName): BaseInfo
1075+
{
1076+
$this->order_pdf_visible_company_name = $orderPdfVisibleCompanyName;
1077+
1078+
return $this;
1079+
}
1080+
1081+
/**
1082+
* Get orderPdfVisibleCompanyName.
1083+
*/
1084+
public function isOrderPdfVisibleCompanyName(): bool
1085+
{
1086+
return $this->order_pdf_visible_company_name;
1087+
}
1088+
1089+
/**
1090+
* Set orderPdfVisiblePhoneNumber.
1091+
*/
1092+
public function setOrderPdfVisiblePhoneNumber(bool $orderPdfVisiblePhoneNumber): BaseInfo
1093+
{
1094+
$this->order_pdf_visible_phone_number = $orderPdfVisiblePhoneNumber;
1095+
1096+
return $this;
1097+
}
1098+
1099+
/**
1100+
* Get orderPdfVisiblePhoneNumber.
1101+
*/
1102+
public function isOrderPdfVisiblePhoneNumber(): bool
1103+
{
1104+
return $this->order_pdf_visible_phone_number;
1105+
}
1106+
1107+
/**
1108+
* Set orderPdfVisibleBusinessHour.
1109+
*/
1110+
public function setOrderPdfVisibleBusinessHour(bool $orderPdfVisibleBusinessHour): BaseInfo
1111+
{
1112+
$this->order_pdf_visible_business_hour = $orderPdfVisibleBusinessHour;
1113+
1114+
return $this;
1115+
}
1116+
1117+
/**
1118+
* Get orderPdfVisibleBusinessHour.
1119+
*/
1120+
public function isOrderPdfVisibleBusinessHour(): bool
1121+
{
1122+
return $this->order_pdf_visible_business_hour;
1123+
}
1124+
1125+
/**
1126+
* Set orderPdfVisibleEmail.
1127+
*/
1128+
public function setOrderPdfVisibleEmail(bool $orderPdfVisibleEmail): BaseInfo
1129+
{
1130+
$this->order_pdf_visible_email = $orderPdfVisibleEmail;
1131+
1132+
return $this;
1133+
}
1134+
1135+
/**
1136+
* Get orderPdfVisibleEmail.
1137+
*/
1138+
public function isOrderPdfVisibleEmail(): bool
1139+
{
1140+
return $this->order_pdf_visible_email;
1141+
}
1142+
1143+
/**
1144+
* Set orderPdfVisibleInvoiceNumber.
1145+
*/
1146+
public function setOrderPdfVisibleInvoiceNumber(bool $orderPdfVisibleInvoiceNumber): BaseInfo
1147+
{
1148+
$this->order_pdf_visible_invoice_number = $orderPdfVisibleInvoiceNumber;
1149+
1150+
return $this;
1151+
}
1152+
1153+
/**
1154+
* Get orderPdfVisibleInvoiceNumber.
1155+
*/
1156+
public function isOrderPdfVisibleInvoiceNumber(): bool
1157+
{
1158+
return $this->order_pdf_visible_invoice_number;
1159+
}
1160+
9821161
/**
9831162
* Get sameAs.
9841163
*
@@ -999,14 +1178,6 @@ public function setSameAs(?string $sameAs): BaseInfo
9991178
return $this;
10001179
}
10011180

1002-
/**
1003-
* Get mcpEnabled.
1004-
*/
1005-
public function isMcpEnabled(): bool
1006-
{
1007-
return $this->mcp_enabled;
1008-
}
1009-
10101181
/**
10111182
* Get foundingDate.
10121183
*/

src/Eccube/Form/Type/Admin/ShopMasterType.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
290290
->add('ucp_checkout_enabled', ToggleSwitchType::class)
291291
// MCP サーバ機能の有効化フラグ (既定 OFF。 OFF の間は ^/admin/mcp が 404)
292292
->add('mcp_enabled', ToggleSwitchType::class)
293+
// 納品書PDFの店舗情報出力項目トグル(#6197)。並び順は納品書の描画順にそろえる
294+
->add('order_pdf_visible_shop_name', ToggleSwitchType::class)
295+
->add('order_pdf_visible_shop_name_eng', ToggleSwitchType::class)
296+
->add('order_pdf_visible_address', ToggleSwitchType::class)
297+
->add('order_pdf_visible_company_name', ToggleSwitchType::class)
298+
->add('order_pdf_visible_phone_number', ToggleSwitchType::class)
299+
->add('order_pdf_visible_business_hour', ToggleSwitchType::class)
300+
->add('order_pdf_visible_email', ToggleSwitchType::class)
301+
->add('order_pdf_visible_invoice_number', ToggleSwitchType::class)
293302
;
294303

295304
$builder->add(

src/Eccube/Resource/locale/messages.en.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,7 @@ admin.setting.shop.shop.agent_commerce.ucp_checkout_enabled: "Enable UCP checkou
13141314
admin.setting.shop.shop.mcp: "MCP Server"
13151315
admin.setting.shop.shop.mcp.description: "Enables the MCP server (^/admin/mcp) that lets AI clients (Claude Desktop, Cursor, etc.) read management data. Read-only. Disabled by default; while disabled the endpoint returns 404. Requires the API plugin (api44) enabled with an OAuth2 token issued."
13161316
admin.setting.shop.shop.mcp_enabled: "Enable MCP server"
1317+
admin.setting.shop.shop.order_pdf: "Delivery slip PDF"
13171318

13181319
#------------------------------------------------------------------------------------
13191320
# Settings:Store Settings:Trade Law Settings
@@ -1887,6 +1888,7 @@ tooltip.setting.shop.shop.number_of_employees: The number of employees, output t
18871888
tooltip.setting.shop.shop.copyright_year: The starting year of the copyright notice, output to structured data (WebSite.copyrightYear).
18881889
tooltip.setting.shop.shop.site_image: The absolute URL of the site image, output to structured data (Organization.image).
18891890
tooltip.setting.shop.shop.opening_hours: The opening hours output to structured data (Organization.openingHoursSpecification). Set the days of the week (multiple allowed) and the opening/closing times per row.
1891+
tooltip.setting.shop.shop.order_pdf: Items printed in the shop information area of the delivery slip PDF. Among the items turned ON, only those with a value entered are printed.
18901892
tooltip.setting.shop.shop.option_delivery_fee_free_amount: Shipping charge will be waived if a customer purchases more than this amount.
18911893
tooltip.setting.shop.shop.option_delivery_fee_free_quantity: Shipping charge will be waived if a customer purchases more than this quantity.
18921894
tooltip.setting.shop.shop.option_delivery_fee_by_product: If turned on, you can set shipping charge per product.

src/Eccube/Resource/locale/messages.ja.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@ admin.setting.shop.shop.agent_commerce.ucp_checkout_enabled: "UCP チェック
13131313
admin.setting.shop.shop.mcp: "MCP サーバ"
13141314
admin.setting.shop.shop.mcp.description: "AI クライアント(Claude Desktop / Cursor 等)が管理データを参照する MCP サーバ(^/admin/mcp)を有効化します。読み取り専用です。既定は無効で、無効の間はエンドポイントを 404 で塞ぎます。利用には API プラグイン(api44)が有効で、OAuth2 トークンを発行済みである必要があります。"
13151315
admin.setting.shop.shop.mcp_enabled: "MCP サーバを有効にする"
1316+
admin.setting.shop.shop.order_pdf: "納品書PDF"
13161317

13171318
#------------------------------------------------------------------------------------
13181319
# 設定:店舗設定:特定商取引法設定
@@ -1887,6 +1888,7 @@ tooltip.setting.shop.shop.number_of_employees: 構造化データ(Organization
18871888
tooltip.setting.shop.shop.copyright_year: 構造化データ(WebSite.copyrightYear)に出力する著作権表示の開始年です。
18881889
tooltip.setting.shop.shop.site_image: 構造化データ(Organization.image)に出力するサイト代表画像の絶対URLです。
18891890
tooltip.setting.shop.shop.opening_hours: 構造化データ(Organization.openingHoursSpecification)に出力する営業時間です。曜日(複数選択可)と開店・閉店時刻を行ごとに設定できます。
1891+
tooltip.setting.shop.shop.order_pdf: 納品書PDFの店舗情報欄に出力する項目です。ONにした項目のうち、値が入力されているものだけが出力されます。
18901892
tooltip.setting.shop.shop.option_delivery_fee_free_amount: この金額を超える購入があった場合、送料を無料とします。
18911893
tooltip.setting.shop.shop.option_delivery_fee_free_quantity: この個数を超える購入があった場合、送料を無料とします。
18921894
tooltip.setting.shop.shop.option_delivery_fee_by_product: ここをオンにすると、商品ごとに送料を指定できるようになります。

0 commit comments

Comments
 (0)