UPO 4.3, fixes for invoices
This commit is contained in:
@@ -13,6 +13,7 @@ vi.mock('../../../shared/PDF-functions', () => ({
|
||||
getContentTable: vi.fn(),
|
||||
getTable: vi.fn(),
|
||||
getValue: vi.fn(),
|
||||
getTStawkaPodatku: vi.fn()
|
||||
}));
|
||||
|
||||
describe(generateWiersze.name, () => {
|
||||
@@ -27,6 +28,7 @@ describe(generateWiersze.name, () => {
|
||||
P_7: { _text: 'Product 1' },
|
||||
P_9A: { _text: '100' },
|
||||
P_8B: { _text: '2' },
|
||||
P_12: { _text: '23' },
|
||||
},
|
||||
],
|
||||
KodWaluty: { _text: 'PLN' },
|
||||
@@ -106,7 +108,7 @@ describe(generateWiersze.name, () => {
|
||||
});
|
||||
|
||||
it('should display "brutto" when P_11 is not in fieldsWithValue', () => {
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([{ NrWierszaFa: { _text: '1' } }] as any);
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([{ NrWierszaFa: { _text: '1' }, P_12: {_text: '23'} }] as any);
|
||||
|
||||
vi.mocked(PDFFunctions.getContentTable).mockReturnValue({
|
||||
content: { table: {} } as any,
|
||||
@@ -148,7 +150,7 @@ describe(generateWiersze.name, () => {
|
||||
});
|
||||
|
||||
it('should generate two tables when fieldsWithValue.length > 8', () => {
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([{ NrWierszaFa: { _text: '1' } }] as any);
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([{ NrWierszaFa: { _text: '1' }, P_12: {_text: '23'} }] as any);
|
||||
|
||||
vi.mocked(PDFFunctions.getContentTable)
|
||||
.mockReturnValueOnce({
|
||||
@@ -175,7 +177,7 @@ describe(generateWiersze.name, () => {
|
||||
});
|
||||
|
||||
it('should not add second table if it has only 1 field with value', () => {
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([{ NrWierszaFa: { _text: '1' } }] as any);
|
||||
vi.mocked(PDFFunctions.getTable).mockReturnValue([{ NrWierszaFa: { _text: '1' }, P_12: {_text: '23'} }] as any);
|
||||
|
||||
vi.mocked(PDFFunctions.getContentTable)
|
||||
.mockReturnValueOnce({
|
||||
|
||||
Reference in New Issue
Block a user