Merge branch 'test' into dev
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
commit
1cc196983e
|
@ -36,10 +36,14 @@ module.exports = Self => {
|
|||
]
|
||||
});
|
||||
|
||||
{if (!address)
|
||||
throw new UserError(`This address doesn't exist`);}
|
||||
if (!address)
|
||||
throw new UserError(`This address doesn't exist`);
|
||||
|
||||
if (address.client().type().code === 'normal') {
|
||||
let agency;
|
||||
if (params && params.agencyModeFk)
|
||||
agency = await Self.app.models.AgencyMode.findById(params.agencyModeFk);
|
||||
|
||||
if (address.client().type().code === 'normal' && (!agency || agency.code != 'refund')) {
|
||||
if (address.client().isFreezed)
|
||||
throw new UserError(`You can't create a ticket for a frozen client`);
|
||||
|
||||
|
@ -54,10 +58,6 @@ module.exports = Self => {
|
|||
throw new UserError(`You can't create a ticket for a client that has a debt`);
|
||||
}
|
||||
|
||||
let agency;
|
||||
if (params.agencyModeFk)
|
||||
agency = await Self.app.models.AgencyMode.findById(params.agencyModeFk);
|
||||
|
||||
if (!params.shipped && params.landed) {
|
||||
params.shipped = await Self.app.models.Agency.getShipped({
|
||||
landed: params.landed,
|
||||
|
|
Loading…
Reference in New Issue