Skip to content

Commit

Permalink
Merge pull request #142 from odoo-brazil/fix/timezone_problem_paid_or…
Browse files Browse the repository at this point in the history
…ders_show_list

[FIX] Tratar o timezone na lista de orders pagas
  • Loading branch information
lfdivino authored Apr 27, 2022
2 parents 3ee5043 + 763d244 commit bba0864
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions l10n_br_pos/static/src/js/screens.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,13 @@ odoo.define("l10n_br_pos.screens", function (require) {
for(var i = 0, len = Math.min(orders.length,1000); i < len; i++){
var order = orders[i];
order.amount_total = round_pr(parseFloat(order.amount_total), rounding);
var date = new Date(order.fiscal_coupon_date);
var new_date = this.add_zero_to_date(date.getDate()) + '/' + this.add_zero_to_date(date.getMonth() + 1) + '/' + this.add_zero_to_date(date.getFullYear()) + ' ' + this.add_zero_to_date((date.getHours()-3)) + ':' + this.add_zero_to_date(date.getMinutes()) + ':' + this.add_zero_to_date(date.getSeconds())
order.fiscal_coupon_date = new_date;

if (!order.fiscal_coupon_date.includes('/')) {
var date = new Date(order.fiscal_coupon_date.replace(" ", "T")+"+00:00");
var new_date = this.add_zero_to_date(date.getDate()) + '/' + this.add_zero_to_date(date.getMonth() + 1) + '/' + this.add_zero_to_date(date.getFullYear()) + ' ' + this.add_zero_to_date(date.getHours()) + ':' + this.add_zero_to_date(date.getMinutes()) + ':' + this.add_zero_to_date(date.getSeconds())
order.fiscal_coupon_date = new_date;
}

var myHashStates = {
'paid': 'Pago',
'done': 'Pago',
Expand Down

0 comments on commit bba0864

Please sign in to comment.