This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to format amounts with commas and 2 decimals | |
const FormatToLocalString = (num) => { | |
if (num === null || undefined) { | |
return num = 0.00; | |
} else { | |
//Check if amount is float. | |
let isFloat = Number(num) === num && num % 1 !== 0; | |
if (isFloat) { | |
// Format amount with 2 decimals | |
num = Math.round(num * 100) / 100; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
old_stock = Inventory::StockByWarehouse.where(master_data_item: master_data_item) | |
.where(' warehouse_id in (?)', warehouses_ids) | |
.select('sum(physical_quantity) as physical_quantity, | |
sum(reserved_quantity) as reserved_quantity') | |
old_total = old_stock[0].physical_quantity.nil? ? 0 : (old_stock[0].physical_quantity * master_data_item.unit_cost) | |
buy = (transaction_cost * quantity) | |
new_cost = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > UpdateExpenseOrderTotal.rb | |
a = load "#{Rails.root}/UpdateExpenseOrderTotal.rb" | |
a = UpdateExpenseOrderTotal | |
a.new('tenant').run | |
class UpdateExpenseOrderTotal | |
def initialize(tenant) | |
@tenant = tenant | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UpdateExpenseOrderSummary | |
def initialize(id:) | |
Apartment::Tenant.switch! 'aidelrio' | |
@order_id = id | |
update_finance_order_summary | |
end | |
def get_all_expense_orders | |
Finance::ExpenseOrder.where(id: @order_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Form.Item | |
name="workOrderType" | |
label={ | |
<Tooltip | |
title={ | |
<FormattedMessage | |
id="activities.workOrderType.hint" | |
defaultMessage="hint" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description | |
Please include a summary of the change and which issue is fixed or feature, include relevant context and List any dependencies that are required for this change. | |
Feature/Fix # [(Referenced card)](URL) | |
## Type of change | |
- [ ] Bug fix (non-breaking change which fixes an issue) | |
- [ ] New feature (non-breaking change which adds functionality) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import { slice } from 'lodash'; | |
import { ArrowRightOutlined } from '@ant-design/icons'; | |
import { | |
Button, | |
Col, | |
Divider, | |
Row, | |
Typography, | |
} from 'antd'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ContractorWorker.all.each do |worker| | |
worker_status = if worker.banished_at? | |
ContractorWorker::Status::DISABLED | |
elsif !worker.approved? | |
ContractorWorker::Status::REJECTED | |
elsif worker.approved? && worker.without_access | |
ContractorWorker::Status::INCOMPLETE | |
elsif worker.approved? && !worker.without_access | |
ContractorWorker::Status::APPROVED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import User from '../User' | |
function Welcome() { | |
return ( | |
<div className="Welcome"> | |
Welcome page rendered after login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DeactivateInactiveContractorWorkers | |
def perform | |
Site.where(app: 'mall').includes(staffing_contractors: :non_archived_jobs).each do |site| | |
next unless site.contractor_worker_expiration_days | |
@expiration_days = site.contractor_worker_expiration_days | |
site.staffing_contractors do |contractor| | |
next if has_active_job?(contractor) | |
active_contractor_workers = contractor.alive_contractor_workers |
OlderNewer