-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(model): add SalesReturn and SalesReturnPosition
- Loading branch information
Showing
8 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { | ||
DocumentWithPositions, | ||
DocumentWithPositionsPatch, | ||
EntityRef, | ||
HasVat | ||
} from '.' | ||
import type { PartialNullable } from '../tools' | ||
|
||
export type ReturnMetaType = 'salesreturn' | 'retailsalesreturn' | ||
|
||
export type AbstractReturnFields = { | ||
demand: EntityRef<'demand'> | ||
} | ||
|
||
export type AbstractReturn<T extends ReturnMetaType> = | ||
DocumentWithPositions<T> & HasVat | ||
|
||
export type AbstractReturnPatch<T extends ReturnMetaType> = | ||
DocumentWithPositionsPatch<T> & | ||
PartialNullable<Pick<AbstractReturnFields, 'demand'>> & | ||
Partial<HasVat> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { | ||
AbstractReturn, | ||
AbstractReturnPatch, | ||
EntityRef, | ||
TaxSystem | ||
} from '.' | ||
import type { PartialNullable } from '../tools' | ||
|
||
export type RetailSalesReturnFields = { | ||
retailStore: EntityRef<'retailstore'> | ||
|
||
retailShift: EntityRef<'retailshift'> | ||
|
||
taxSystem: TaxSystem | ||
|
||
readonly cashSum: number | ||
readonly noCashSum: number | ||
readonly qrSum: number | ||
} | ||
|
||
export type RetailSalesReturn = AbstractReturn<'retailsalesreturn'> | ||
|
||
export type RetailSalesReturnPatch = AbstractReturnPatch<'retailsalesreturn'> & | ||
PartialNullable< | ||
Pick<RetailSalesReturnFields, 'retailStore' | 'retailShift' | 'taxSystem'> | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { AbstractReturn, AbstractReturnPatch, EntityRef } from '.' | ||
|
||
export type SalesReturnFields = { | ||
readonly payedSum: number | ||
} | ||
|
||
export type SalesReturn = AbstractReturn<'salesreturn'> | ||
|
||
export type SalesReturnPatch = AbstractReturnPatch<'salesreturn'> | ||
// & PartialNullable<Pick<SalesReturnFields, 'demand'>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { EntityRef, Position, PositionPatch } from '.' | ||
import type { PartialNullable } from '../tools' | ||
|
||
export type SalesReturnPositionFields = { | ||
/** | ||
* НДС | ||
*/ | ||
vat: number | ||
|
||
// TODO vatEnabled: разобраться с где и как отмечается в позициях | ||
vatEnabled: boolean | ||
|
||
/** ГТД (только для salesreturn) */ | ||
gtd?: { | ||
name: string | ||
} | ||
|
||
/** Страна (только для salesreturn) */ | ||
country?: EntityRef<'country'> | ||
} | ||
|
||
export type SalesReturnPosition = Position<'salesreturnposition'> & | ||
SalesReturnPositionFields | ||
|
||
export type SalesReturnPositionPatch = PositionPatch<'demandposition'> & | ||
PartialNullable< | ||
Pick<SalesReturnPositionFields, 'vat' | 'vatEnabled' | 'gtd' | 'country'> | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters