add cancel qr payment in dailysale report
This commit is contained in:
@@ -757,7 +757,8 @@ class Sale < ApplicationRecord
|
||||
IFNULL(SUM(case when (sale_status='completed') then old_grand_total else 0 end),0) as old_grand_total,
|
||||
IFNULL(SUM(case when (sale_status='completed') then total_discount else 0 end),0) as total_discount,
|
||||
IFNULL(SUM(case when (sale_status='completed') then amount_changed else 0 end),0) as total_change_amount,
|
||||
IFNULL(SUM(case when (sale_status='void') then grand_total else 0 end),0) as void_amount,
|
||||
IFNULL(SUM(case when (sale_status='void' AND sa_salevoid.sale_audit_id IS NOT NULL) then grand_total else 0 end),0) as void_amount,
|
||||
IFNULL(SUM(case when (sale_status='void' AND sa_mmqr.sale_audit_id IS NOT NULL) then grand_total else 0 end),0) as mmqr_cancelled_void_amount,
|
||||
IFNULL(SUM(case when (sale_status='completed') then rounding_adjustment else 0 end),0) as rounding_adj,
|
||||
#{tax_profiles.map { |name| "IFNULL(SUM(case when (sale_status='completed') then `#{name.parameterize}` else 0 end),0) as `#{name.parameterize}`"}.push('').join(', ') if tax_profiles.present?}
|
||||
IFNULL(SUM(case when (sale_status='completed') then total_tax else 0 end),0) as tax,
|
||||
@@ -776,6 +777,8 @@ class Sale < ApplicationRecord
|
||||
#{sales.to_sql}
|
||||
) as s
|
||||
LEFT JOIN (#{sale_taxes.to_sql}) AS st ON s.sale_id = st.sale_id
|
||||
LEFT JOIN sale_audits sa_salevoid ON s.sale_id = sa_salevoid.sale_id AND sa_salevoid.action = 'SALEVOID'
|
||||
LEFT JOIN sale_audits sa_mmqr ON s.sale_id = sa_mmqr.sale_id AND sa_mmqr.action = 'CANCEL_MMQR_PAYMENT'
|
||||
GROUP BY DATE(CONVERT_TZ(receipt_date,'+00:00','+06:30'))").to_hash.map(&:symbolize_keys)
|
||||
return daily_total
|
||||
end
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.cash_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.credit_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.void_amount") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.mmqr_void_amount") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.foc_sales") %></th>
|
||||
<th style='text-align:center;'>(<%= t("views.right_panel.detail.discount") %>)</th>
|
||||
<% if @tax_profiles.present? %>
|
||||
@@ -62,6 +63,7 @@
|
||||
<% unless @sale_data.blank? %>
|
||||
<tbody>
|
||||
<% void = 0 %>
|
||||
<% mmqr_void = 0 %>
|
||||
<% cash = 0 %>
|
||||
<% credit = 0 %>
|
||||
<% foc = 0 %>
|
||||
@@ -77,6 +79,7 @@
|
||||
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% void += sale[:void_amount] %>
|
||||
<% mmqr_void += sale[:mmqr_cancelled_void_amount] %>
|
||||
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
|
||||
<% credit += sale[:credit_amount] %>
|
||||
<% foc += sale[:foc_amount] %>
|
||||
@@ -98,6 +101,7 @@
|
||||
<td style='text-align:right;'><%= number_format(sale[:cash_amount]-sale[:total_change_amount], precision:precision.to_i, delimiter: delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(sale[:credit_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='color:red;text-align:right;'><%= number_format(sale[:void_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='color:red;text-align:right;'><%= number_format(sale[:mmqr_cancelled_void_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(sale[:foc_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
|
||||
<td style='text-align:right;'>(<%= number_format(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>)</td>
|
||||
@@ -127,6 +131,7 @@
|
||||
<td style='text-align:right;'><%= number_format(cash, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='color:red;text-align:right;'><%= number_format(void, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='color:red;text-align:right;'><%= number_format(mmqr_void, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_format(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>)</td>
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.cash_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.credit_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.void_amount") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.mmqr_void_amount") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.foc_sales") %></th>
|
||||
<th style='text-align:center;'>(<%= t("views.right_panel.detail.discount") %>)</th>
|
||||
<% if @tax_profiles.present? %>
|
||||
@@ -51,6 +52,7 @@
|
||||
<% unless @sale_data.blank? %>
|
||||
<tbody>
|
||||
<% void = 0 %>
|
||||
<% mmqr_void = 0 %>
|
||||
<% cash = 0 %>
|
||||
<% credit = 0 %>
|
||||
<% foc = 0 %>
|
||||
@@ -65,6 +67,7 @@
|
||||
<% count = 1 %> <% rounding_adj = 0 %>
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% void += sale[:void_amount] %>
|
||||
<% mmqr_void += sale[:mmqr_cancelled_void_amount] %>
|
||||
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
|
||||
<% credit += sale[:credit_amount] %>
|
||||
<% foc += sale[:foc_amount] %>
|
||||
@@ -86,6 +89,7 @@
|
||||
<td style='text-align:right;'><%= number_format(sale[:cash_amount]-sale[:total_change_amount], precision:precision.to_i, delimiter: delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(sale[:credit_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='color:red;text-align:right;'><%= number_format(sale[:void_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='color:red;text-align:right;'><%= number_format(sale[:mmqr_cancelled_void_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(sale[:foc_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
|
||||
<td style='text-align:right;'>(<%= number_format(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>)</td>
|
||||
@@ -115,6 +119,7 @@
|
||||
<td style='text-align:right;'><%= number_format(cash, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='color:red;text-align:right;'><%= number_format(void, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='color:red;text-align:right;'><%= number_format(mmqr_void, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'>(<%= number_format(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>)</td>
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
<% grand_rounding_adjustment = 0.0 %>
|
||||
<% @sale_data.each do |result| %>
|
||||
<% result[:items].each do |item| %>
|
||||
<% byebug %>
|
||||
<tr>
|
||||
<td><%= item.receipt_no rescue '-' %> </td>
|
||||
<td><%= item.receipt_date.strftime("%e %b %I:%M%p") rescue '-' %></td>
|
||||
|
||||
@@ -424,6 +424,7 @@ en:
|
||||
to_date: "To Date"
|
||||
sr: "Sr"
|
||||
void_amount: "Void Amount"
|
||||
mmqr_void_amount: "MMQR Void Amount"
|
||||
mpu_sales: "MPU Sales"
|
||||
master_sales: "Master Sales"
|
||||
visa_sales: "Visa Sales"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
mm:
|
||||
welcome: "မင်္ဂလာပါ"
|
||||
welcome: "မင်္ဂလာပါ"
|
||||
main_navigation: "မာတိကာ"
|
||||
dashboard: "ပင်မမျက်နှာစာ"
|
||||
oqs: "အမှာစာနေရာများ"
|
||||
@@ -83,9 +83,9 @@ mm:
|
||||
debit: "Debit"
|
||||
reservation: "Reservation"
|
||||
make_reservation: "Make Reservation"
|
||||
|
||||
|
||||
views:
|
||||
btn:
|
||||
btn:
|
||||
create: "အသစ်တည်ဆောက်ရန်"
|
||||
new: "အသစ်ခေါ်ရန်"
|
||||
add: "ထည့်သွင်းရန်"
|
||||
@@ -118,7 +118,7 @@ mm:
|
||||
customer: "စားသုံးသူ"
|
||||
discount: "လျှော့စျေး"
|
||||
charges: "ပိုက်ဆံကောက်သည်"
|
||||
commissions: "ကော်မရှင်များ"
|
||||
commissions: "ကော်မရှင်များ"
|
||||
in_duties: "တာဝန်ကျသူများ"
|
||||
move: "ရွေ့ပြောင်းသည်"
|
||||
req_bill: "ကျသင့်ငွေတောင်းခံသည်"
|
||||
@@ -143,7 +143,7 @@ mm:
|
||||
new_inventory_product: "ကုန်လှောင်ရုံရောက်ပစ္စည်းအသစ်များ"
|
||||
generate_report: "အစီရင်ခံစာများရှာဖွေရန်"
|
||||
exp_to_excel: "Excel သို့ ပို့ပြီးဆက်လက်လုပ်ဆောင်ရန်"
|
||||
|
||||
|
||||
card_settle: "CB ကဒ် စာရင်းရှင်းတမ်း"
|
||||
gift_voucher: "GiftVoucher"
|
||||
pagination:
|
||||
@@ -153,7 +153,7 @@ mm:
|
||||
next: "ေရ့သို့ ›"
|
||||
truncate: "…"
|
||||
|
||||
right_panel:
|
||||
right_panel:
|
||||
header:
|
||||
page_detail: "စာမျက်နှာအသေးစိတ်"
|
||||
button_lists: "ခလုတ်စာရင်း"
|
||||
@@ -176,7 +176,7 @@ mm:
|
||||
membership_actions: "အဖွဲ့၀င်မှုဆိုင်ရာချိတ်ဆက်မှု"
|
||||
membership_setting: "အဖွဲ့၀င်မှုဆိုင်ရာပြင်ဆင်ချက်များ"
|
||||
|
||||
button:
|
||||
button:
|
||||
new: "အသစ်"
|
||||
create: "တည်ဆောက်"
|
||||
show: "ပြသ"
|
||||
@@ -418,6 +418,7 @@ mm:
|
||||
to_date: "ထိရက်စွဲ"
|
||||
sr: "အမှတ်စဥ်"
|
||||
void_amount: "ပြန်ဖျက်သည့်ပမာဏ"
|
||||
mmqr_void_amount: "MMQR ပြန်ဖျက်သည့်ပမာဏ"
|
||||
mpu_sales: "MPU ရောင်းရငွေ"
|
||||
master_sales: "Master ရောင်းရငွေ"
|
||||
visa_sales: "Visa ရောင်းရငွေ"
|
||||
@@ -496,7 +497,7 @@ mm:
|
||||
checked_by: "Checked By"
|
||||
order_source: "Order Source"
|
||||
paymal_transactions: "Paymal Transactions"
|
||||
|
||||
|
||||
code_txt: "ကုတ်ဒ် "
|
||||
charge_txt: "ကောက်ခံသည်"
|
||||
time_txt: "အချိန်"
|
||||
@@ -532,7 +533,7 @@ mm:
|
||||
menu_txt: "မီနူး"
|
||||
menu_categories_txt: "ဟင်းပွဲအမျိုးအစားများ"
|
||||
item_set_txt: "ဟင်းပွဲအစုံလိုက်"
|
||||
valid_days_txt: " အကြုံး၀င်ရက်စွဲများ ([၁- ၇] => [တနင်္လာ - တနင်္ဂနွေ) "
|
||||
valid_days_txt: " အကြုံး၀င်ရက်စွဲများ ([၁- ၇] => [တနင်္လာ - တနင်္ဂနွေ) "
|
||||
valid_from_txt: "မှ ရက်စွဲ/စတင်ချိန်"
|
||||
valid_to_txt: "ထိ ရက်စွဲ/ပြီးဆုံးချိန် "
|
||||
select_txt: "ရွေးချယ်"
|
||||
@@ -662,7 +663,7 @@ mm:
|
||||
gateway_url_txt: "အဓိကလမ်းကြောင်းဆက်သွယ်မှုလိပ်စာ"
|
||||
membership_setting_txt: "အဖွဲ့၀င်မှုဆိုင်ရာပြင်ဆင်ချက်များ"
|
||||
lookup_txt: "သတ်မှတ်ချက်"
|
||||
|
||||
|
||||
cancel_btn_txt: "ပြန်ဖျက်ရန်"
|
||||
image_btn_txt: "တင်သွင်းရန်"
|
||||
create_btn_txt: "တည်ဆောက်ရန်"
|
||||
@@ -681,4 +682,4 @@ mm:
|
||||
one: "Displaying <b>1</b> %{entry_name}"
|
||||
other: "Displaying <b>all %{count}</b> %{entry_name}"
|
||||
more_pages:
|
||||
display_entries: "Displaying %{entry_name} <b>%{first} - %{last}</b> of <b>%{total}</b> in total"
|
||||
display_entries: "Displaying %{entry_name} <b>%{first} - %{last}</b> of <b>%{total}</b> in total"
|
||||
|
||||
Reference in New Issue
Block a user