231801_test_to_master #1519

Merged
alexm merged 490 commits from 231801_test_to_master into master 2023-05-12 06:29:59 +00:00
5 changed files with 40 additions and 1 deletions
Showing only changes of commit 955e55a7f4 - Show all commits

View File

@ -0,0 +1 @@
ALTER TABLE `vn`.`ticketConfig` ADD daysForWarningClaim INT DEFAULT 2 NOT NULL COMMENT 'dias restantes hasta que salte el aviso de reclamación fuerade plazo';

View File

@ -14,6 +14,15 @@
},
"scopeDays": {
"type": "number"
},
"pickingDelay": {
"type": "number"
},
"packagingInvoicingDated": {
"type": "date"
},
"daysForWarningClaim": {
"type": "number"
}
}
}

View File

@ -480,6 +480,13 @@
on-accept="$ctrl.transferSales($ctrl.transfer.ticketId)">
</vn-confirm>
<vn-confirm
vn-id="claimConfirm"
question="Do you want to continue?"
message="Claim out of time"
on-accept="$ctrl.onCreateClaimAccepted()">
</vn-confirm>
<vn-menu vn-id="moreOptions">
<vn-item translate
name="sms"
@ -502,6 +509,7 @@
ng-click="$ctrl.createClaim()"
ng-if="$ctrl.isClaimable">
Add claim
</vn-item>
<vn-item translate
name="reserve"

View File

@ -7,6 +7,7 @@ class Controller extends Section {
super($element, $);
this._sales = [];
this.manaCode = 'mana';
this.getConfig();
}
get manaCode() {
@ -43,6 +44,15 @@ class Controller extends Section {
return ticketState && ticketState.state.code;
}
getConfig() {
let filter = {
fields: ['daysForWarningClaim'],
};
this.$http.get(`TicketConfigs`, {filter})
.then(res => {
this.ticketConfig = res.data;
});
}
get isClaimable() {
if (this.ticket) {
@ -184,13 +194,22 @@ class Controller extends Section {
}
createClaim() {
const timeDifference = new Date().getTime() - new Date(this.ticket.shipped).getTime();
const pastDays = Math.floor(timeDifference / 86400000);
if (pastDays >= this.ticketConfig[0].daysForWarningClaim)
this.$.claimConfirm.show();
else
this.onCreateClaimAccepted();
}
onCreateClaimAccepted() {
const sales = this.selectedValidSales();
const params = {ticketId: this.ticket.id, sales: sales};
this.resetChanges();
this.$http.post(`Claims/createFromSales`, params)
.then(res => this.$state.go('claim.card.basicData', {id: res.data.id}));
}
showTransferPopover(event) {
this.setTransferParams();
this.$.transfer.show(event);

View File

@ -40,3 +40,5 @@ Refund: Abono
Promotion mana: Maná promoción
Claim mana: Maná reclamación
History: Historial
Do you want to continue?: ¿Desea continuar?
Claim out of time: Reclamación fuera de plazo