bug fixes

Merge branch 'r-1902001-01-dev' into r-1902001-01
This commit is contained in:
Thein Lin Kyaw
2019-12-27 20:01:26 +06:30
5 changed files with 20 additions and 17 deletions

View File

@@ -232,3 +232,7 @@ i.logout_icon{
color: rgba(0, 0, 0, 0.54);
padding: 10px;
}
.input-group-addon {
margin-bottom: 20px;
}

View File

@@ -29,7 +29,6 @@
}
.bmd-form-group {
position: relative;
padding-top: 0 !important;
}
.btn_create_induty{
display: inline;
@@ -93,4 +92,4 @@
.add_to_charges{
width:100%;
padding:1rem;
}
}

View File

@@ -206,8 +206,6 @@ class Origami::PaymentsController < BaseOrigamiController
#end
end
logger.debug 'saleObj++++++++++++++++++++++++++'
logger.debug saleObj.to_json
if !saleObj.nil?
# InventoryJob.perform_now(self.id)
# InventoryDefinition.calculate_product_count(saleObj)

View File

@@ -662,7 +662,7 @@ class SalePayment < ApplicationRecord
is_credit = sale.sale_payments.any? { |x| x.payment_method == "creditnote" }
is_foc = sale.sale_payments.any? { |x| x.payment_method == "foc" }
if (sale.grand_total <= all_received_amount)
if sale.grand_total <= all_received_amount && sale.sale_status == "new"
sale.payment_status = "paid"
if is_credit
sale.payment_status = "outstanding"

View File

@@ -73,12 +73,12 @@
<th></th>
<th colspan="<%= @count + 1 %>" style='text-align:center;'>Income</th>
<th colspan=4 style='text-align:center;'>Outgoing</th>
<th style='text-align:center;'><i class="material-icons md-18" data-toggle="tooltip" data-placement="top" title="Gross Sales = (Income+Discount) - (FOC+Void)">live_help</i></th>
<th style='text-align:center;'><i class="material-icons md-18" data-toggle="tooltip" data-placement="top" title="Total Sales = Gross Sales - Discount">live_help</i></th>
<th style='text-align:center;' data-toggle="tooltip" data-placement="top" title="Gross Sales = (Income+Discount) - (FOC+Void)"><i class="material-icons md-18">live_help</i></th>
<th style='text-align:center;' data-toggle="tooltip" data-placement="top" title="Total Sales = Gross Sales - Discount"><i class="material-icons md-18">live_help</i></th>
<% if @tax.blank? %>
<th style='text-align:center;'><i class="material-icons md-18" data-toggle="tooltip" data-placement="top" title="Tax = Total Sales / 21">live_help</i></th>
<th style='text-align:center;' data-toggle="tooltip" data-placement="top" title="Tax = Total Sales / 21"><i class="material-icons md-18">live_help</i></th>
<th style='text-align:center;' data-toggle="tooltip" data-placement="top" title="Net Sales = Total Sales - Tax"><i class="material-icons md-18">live_help</i></th>
<% end %>
<th style='text-align:center;'><i class="material-icons md-18" data-toggle="tooltip" data-placement="top" title="Net Sales = Total Sales - Tax">live_help</i></th>
</tr>
<tr>
<th style='text-align:center;'><%= t("views.right_panel.detail.sr") %></th>
@@ -132,8 +132,8 @@
<th style='text-align:center;'><%= t("views.right_panel.detail.total_sales") %></th>
<% if @tax.blank? %>
<th style='text-align:center;'><%= t("views.right_panel.detail.tax") %></th>
<% end %>
<th style='text-align:center;'><%= t("views.right_panel.detail.net_sales") %></th>
<% end %>
</tr>
</thead>
@@ -241,8 +241,8 @@
<td style='text-align:right;'><%= number_format(sale[:total_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if @tax.blank? %>
<td style='text-align:right;'><%= number_format(sale[:tax], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<td style='text-align:right;'><%= number_format(sale[:net_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
</tr>
<% count = count + 1 %>
@@ -329,8 +329,10 @@
<td style='text-align:right;'><%= number_format(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(gross_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(total_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(tax, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% if @tax.blank? %>
<td style='text-align:right;'><%= number_format(tax, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
</tr>
<tr style="font-weight:600;">
@@ -342,20 +344,20 @@
<% @tax.each do |tax|
total_tax += tax.tax_amount.to_f %>
<tr style="font-weight:600;">
<td colspan="<%= colspan %>" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
<td colspan="2" style='text-align:right;'><%= number_format(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td colspan="<%= colspan + 2 %>" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
<td colspan="5" style='text-align:right;'><%= number_format(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<% end %>
<% net = grand_total %>
<% net = net - rounding_adj%>
<% net = net - total_tax %>
<tr style="font-weight:600;">
<td colspan="<%= colspan %>" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td colspan="<%= colspan + 2 %>" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td colspan="5" style='text-align:right;'><%= number_format(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<% else %>
<tr style="font-weight:600;">
<td colspan="<%= colspan %>" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td colspan="<%= colspan + 2 %>" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td colspan="5" style='text-align:right;'><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<% end %>