新增手工开票 MING SONG 公司选项

This commit is contained in:
andy
2026-08-05 23:04:52 +08:00
parent d56587a078
commit 6cc9bb4439
4 changed files with 61 additions and 1 deletions

View File

@@ -527,6 +527,52 @@ describe('ReservationManualInvoiceView', () => {
expect(wrapper.find('a[href="https://oss.example/invoices/manual-91001.pdf"]').exists()).toBe(true)
})
it('prefills MING SONG directory data and submits its stable recipient codes', async () => {
vi.mocked(service.generateManualReservationInvoice).mockResolvedValue(createResult())
const wrapper = mountView()
await wrapper.find('[data-testid="recipient-company-code"]').setValue('MING_SONG')
expect((wrapper.find('[data-testid="recipient-contact-id"]').element as HTMLSelectElement).value).toBe(
'MING_SONG_KHUN_JIN',
)
expect((wrapper.find('[data-testid="recipient-company-input"]').element as HTMLInputElement).value).toBe(
'MING SONG CO.LTD',
)
expect((wrapper.find('[data-testid="recipient-attention-input"]').element as HTMLInputElement).value).toBe(
'KHUN JIN',
)
expect((wrapper.find('[data-testid="recipient-address"]').element as HTMLTextAreaElement).value).toBe(
'290 Soi Lat Phrao 94 (Panjamit), Phlapphla Subdistrict, Wang Thonglang District, Bangkok, TH, 10310',
)
expect((wrapper.find('[data-testid="recipient-telephone"]').element as HTMLInputElement).value).toBe(
'098-2519896',
)
expect((wrapper.find('[data-testid="recipient-email"]').element as HTMLInputElement).value).toBe(
'taiziyoutravel@gmail.com',
)
await fillMinimumInvoiceForm(wrapper)
await wrapper.find('[data-testid="manual-invoice-submit"]').trigger('click')
await flushPromises()
expect(service.generateManualReservationInvoice).toHaveBeenCalledWith(
expect.objectContaining({
invoice_payload: expect.objectContaining({
recipient: expect.objectContaining({
company_code: 'MING_SONG',
contact_id: 'MING_SONG_KHUN_JIN',
company: 'MING SONG CO.LTD',
attention: 'KHUN JIN',
address: '290 Soi Lat Phrao 94 (Panjamit), Phlapphla Subdistrict, Wang Thonglang District, Bangkok, TH, 10310',
telephone: '098-2519896',
email: 'taiziyoutravel@gmail.com',
}),
}),
}),
)
})
it('downloads the generated PDF through a browser blob URL', async () => {
vi.mocked(service.generateManualReservationInvoice).mockResolvedValue(createResult())
const fetchMock = vi.fn().mockResolvedValue({

View File

@@ -870,6 +870,19 @@ const recipientCompanies: RecipientCompanySeed[] = [
},
],
},
{
company_code: 'MING_SONG',
company: 'MING SONG CO.LTD',
contacts: [
{
contact_id: 'MING_SONG_KHUN_JIN',
attention: 'KHUN JIN',
address: '290 Soi Lat Phrao 94 (Panjamit), Phlapphla Subdistrict, Wang Thonglang District, Bangkok, TH, 10310',
telephone: '098-2519896',
email: 'taiziyoutravel@gmail.com',
},
],
},
{
company_code: 'HANATOUR',
company: 'HANATOUR TD CO., LTD.',