Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
kmkalam24 committed Mar 1, 2023
1 parent 9dc2de2 commit 83bd788
Show file tree
Hide file tree
Showing 58 changed files with 695 additions and 1,344 deletions.
114 changes: 57 additions & 57 deletions core/ajax/ajax_data.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions core/ajax/ajax_pos.php
Expand Up @@ -137,7 +137,7 @@
$salesChanges = 0;


$insertSaleItems = "INSERT INTO {$table_prefeix}product_stock(
$insertSaleItems = "INSERT INTO {$table_prefix}product_stock(
stock_type,
stock_entry_date,
stock_sales_id,
Expand Down Expand Up @@ -310,7 +310,7 @@
bg_product_qnt
",
"join" => array(
"inner join {$table_prefeix}bg_product_items as bg_product on bg_product_id = product_id"
"inner join {$table_prefix}bg_product_items as bg_product on bg_product_id = product_id"
),
"where" => array(
"( product.has_sub_product = 1 or product.product_type = 'Bundle' ) and bg_product.is_raw_materials = 0 and product.product_id = {$productId}"
Expand Down
4 changes: 2 additions & 2 deletions core/ajax/ajax_pos_back.php
Expand Up @@ -149,7 +149,7 @@
$salesChanges = 0;


$insertSaleItems = "INSERT INTO {$table_prefeix}product_stock(
$insertSaleItems = "INSERT INTO {$table_prefix}product_stock(
stock_type,
stock_entry_date,
stock_sales_id,
Expand Down Expand Up @@ -322,7 +322,7 @@
bg_product_qnt
",
"join" => array(
"inner join {$table_prefeix}bg_product_items on bg_product_id = product_id"
"inner join {$table_prefix}bg_product_items on bg_product_id = product_id"
),
"where" => array(
"product.has_sub_product = 1 and product.product_id = {$productId}"
Expand Down
16 changes: 8 additions & 8 deletions core/ajax/ajax_select2.php
Expand Up @@ -426,7 +426,7 @@
{$warehouseFilter}
group by vp_id
) as pbs on pbs.vp_id = product.product_id",
"left join {$table_prefeix}product_brands on brand_id = product_brand_id"
"left join {$table_prefix}product_brands on brand_id = product_brand_id"
),
"where" => array (
"product.is_trash = 0 and is_disabled = 0 and product_parent_id is null {$searchQuery}"
Expand Down Expand Up @@ -486,7 +486,7 @@
from product_base_stock
group by vp_id
) as pbs on pbs.vp_id = product.product_id",
"left join {$table_prefeix}product_brands on brand_id = product_brand_id"
"left join {$table_prefix}product_brands on brand_id = product_brand_id"
),
"where" => array (
"product.is_trash = 0 and is_disabled = 0 and product_parent_id is null {$searchQuery}"
Expand Down Expand Up @@ -571,8 +571,8 @@
"table" => "customers as customer",
"fields" => "customer_id, customer_name, upazila_name, district_name",
"join" => array(
"left join {$table_prefeix}upazilas on customer_upazila = upazila_id",
"left join {$table_prefeix}districts on customer_district = district_id"
"left join {$table_prefix}upazilas on customer_upazila = upazila_id",
"left join {$table_prefix}districts on customer_district = district_id"
),
"where" => array(
"customer.is_trash = 0",
Expand Down Expand Up @@ -723,8 +723,8 @@
" and institute_upazila" => isset($_GET["upazila_id"]) ? $_GET["upazila_id"] : ""
),
"join" => array(
"left join {$table_prefeix}upazilas on institute_upazila = upazila_id",
"left join {$table_prefeix}districts on upazila_district_id = district_id"
"left join {$table_prefix}upazilas on institute_upazila = upazila_id",
"left join {$table_prefix}districts on upazila_district_id = district_id"
)
));

Expand Down Expand Up @@ -883,7 +883,7 @@
"table" => "persons as person",
"fields" => "person_id, person_full_name, institute_name",
"join" => array(
"left join {$table_prefeix}institute on person_institute = institute_id"
"left join {$table_prefix}institute on person_institute = institute_id"
),
"where" => array(
"person.is_trash = 0 and ( person_full_name LIKE '%". $personSearch ."%'",
Expand Down Expand Up @@ -1094,7 +1094,7 @@
"table" => "users as users",
"fields" => "user_id, emp_PIN, emp_firstname, emp_lastname, emp_positions",
"join" => array(
"left join {$table_prefeix}employees on emp_id = user_emp_id"
"left join {$table_prefix}employees on emp_id = user_emp_id"
),
"where" => array(
"users.is_trash = 0 and emp_firstname LIKE '%". safe_input($search) ."%'",
Expand Down
1 change: 1 addition & 0 deletions core/config.php
Expand Up @@ -25,6 +25,7 @@
define('ACTIVE_THEME', 'rui');
define('TABLE_PREFIX', 'bms_');
define('AUTO_LOGOUT_TIME', 300); // in Second. Default is five minutes
define('VERSION', '2.0.2');

// Directory Configuration
define('DIR_CORE', DIR_BASE . 'core/');
Expand Down
2 changes: 1 addition & 1 deletion core/loader.php
Expand Up @@ -46,7 +46,7 @@
CASE WHEN option_name = 'decimalPlaces' THEN @decimalPlace:= option_value END,
CASE WHEN option_name = 'mysqlTimeFormat' THEN @mysqlTimeFormat:= option_value END,
CASE WHEN option_name = 'mysqlDateFormat' THEN @mysqlDateFormat:= option_value END
FROM ro_options WHERE option_name in('decimalPlaces', 'mysqlDateFormat', 'mysqlTimeFormat');
FROM {$table_prefix}options WHERE option_name in('decimalPlaces', 'mysqlDateFormat', 'mysqlTimeFormat');
");

// Get the page slug
Expand Down
2 changes: 1 addition & 1 deletion include/apps/generator/js-generator.php
Expand Up @@ -27,7 +27,7 @@
include( DIR_ASSETS . "js/functions.min.js");

// Include BMS JS
include( DIR_ASSETS . "js/bms.js");
include( DIR_ASSETS . "js/bms.min.js");


} else if( isset($_GET["q"]) and $_GET["q"] === "foot" ) {
Expand Down
2 changes: 1 addition & 1 deletion include/db/db.php
Expand Up @@ -31,6 +31,6 @@
$conn->get_all_error = array();

// Table Prefix variable
$table_prefeix = TABLE_PREFIX;
$table_prefix = TABLE_PREFIX;

?>
6 changes: 3 additions & 3 deletions include/system/door/login.php
Expand Up @@ -41,7 +41,7 @@
"table" => "users as user",
"fields" => "user_id, user_emp_id, user_pass, user_language, user_email, user_name, user_status, user_homepage, user_locked_reason, biller_shop_id, biller_accounts_id, biller_warehouse_id",
"join" => array(
"left join {$table_prefeix}billers on biller_user_id = user_id"
"left join {$table_prefix}billers on biller_user_id = user_id"
),
"where" => array(
"user.is_trash = 0 and ( user_email" => $_POST["user-email"],
Expand Down Expand Up @@ -86,7 +86,7 @@
$failedAttemptInLastFiveMinuteForUser = easySelectD("
SELECT
COUNT(*) AS totalAttempt
FROM {$table_prefeix}login_attempts
FROM {$table_prefix}login_attempts
WHERE attempt_user_id = '{$selectUser["data"][0]["user_id"]}' and attempt_time >= NOW() - INTERVAL 5 MINUTE
")["data"][0]["totalAttempt"];

Expand All @@ -113,7 +113,7 @@
$failedAttemptInLastFiveMinuteForHost = easySelectD("
SELECT
COUNT(*) AS totalAttempt
FROM {$table_prefeix}login_attempts
FROM {$table_prefix}login_attempts
WHERE attempt_ipaddr = '{$get_user_ip}' and attempt_time >= NOW() - INTERVAL 5 MINUTE
")["data"][0]["totalAttempt"];

Expand Down
42 changes: 21 additions & 21 deletions module/accounts/ajax.php
Expand Up @@ -551,8 +551,8 @@
"transfer_money as transfer_money",
"transfer_money_id, transfer_money_date, from_accounts.accounts_name as from_accounts_name, to_accounts.accounts_name as to_accounts_name, transfer_money_amount, transfer_money_description",
array (
"inner join {$table_prefeix}accounts as from_accounts on transfer_money_from = from_accounts.accounts_id",
"inner join {$table_prefeix}accounts as to_accounts on transfer_money_to = to_accounts.accounts_id"
"inner join {$table_prefix}accounts as from_accounts on transfer_money_from = from_accounts.accounts_id",
"inner join {$table_prefix}accounts as to_accounts on transfer_money_to = to_accounts.accounts_id"
),
array (
"transfer_money.is_trash" => 0,
Expand All @@ -576,8 +576,8 @@
"transfer_money as transfer_money",
"transfer_money_id, transfer_money_date, from_accounts.accounts_name as from_accounts_name, to_accounts.accounts_name as to_accounts_name, transfer_money_amount, transfer_money_description",
array (
"inner join {$table_prefeix}accounts as from_accounts on transfer_money_from = from_accounts.accounts_id",
"inner join {$table_prefeix}accounts as to_accounts on transfer_money_to = to_accounts.accounts_id"
"inner join {$table_prefix}accounts as from_accounts on transfer_money_from = from_accounts.accounts_id",
"inner join {$table_prefix}accounts as to_accounts on transfer_money_to = to_accounts.accounts_id"
),
array(
"transfer_money.is_trash" => 0
Expand Down Expand Up @@ -921,7 +921,7 @@
"capital as capital",
"capital_received_date, accounts_name, capital_amounts, capital_description",
array (
"inner join {$table_prefeix}accounts on capital_accounts = accounts_id"
"inner join {$table_prefix}accounts on capital_accounts = accounts_id"
),
array (
"capital.is_trash" => 0,
Expand All @@ -944,7 +944,7 @@
"capital as capital",
"capital_received_date, accounts_name, capital_amounts, capital_description",
array (
"inner join {$table_prefeix}accounts on capital_accounts = accounts_id"
"inner join {$table_prefix}accounts on capital_accounts = accounts_id"
),
array(
"capital.is_trash" => 0
Expand Down Expand Up @@ -1098,7 +1098,7 @@
"table" => "closings as closings",
"fields" => "closings_id, closings_customer, customer_name, closings_title, closings_date",
"join" => array(
"left join {$table_prefeix}customers on customer_id = closings_customer"
"left join {$table_prefix}customers on customer_id = closings_customer"
),
"where" => array(
"closings.is_trash = 0",
Expand All @@ -1121,7 +1121,7 @@
"table" => "closings as closings",
"fields" => "closings_id, closings_customer, customer_name, closings_title, closings_date",
"join" => array(
"left join {$table_prefeix}customers on customer_id = closings_customer"
"left join {$table_prefix}customers on customer_id = closings_customer"
),
"where" => array(
"closings.is_trash = 0"
Expand Down Expand Up @@ -1216,7 +1216,7 @@
"table" => "closings as closings",
"fields" => "closings_id, closings_customer, customer_name, closings_title, closings_date",
"join" => array(
"left join {$table_prefeix}customers on customer_id = closings_customer"
"left join {$table_prefix}customers on customer_id = closings_customer"
),
"where" => array(
"closings.is_trash = 0 and closings_id" => $_GET["id"]
Expand Down Expand Up @@ -1348,9 +1348,9 @@
if(payment_return_amount_before_filtered_date is null, 0, payment_return_amount_before_filtered_date)
), 2) as previous_balance,
customer_phone, customer_address, upazila_name, district_name
from {$table_prefeix}customers as customer
left join {$table_prefeix}upazilas on customer_upazila = upazila_id
left join {$table_prefeix}districts on customer_district = district_id
from {$table_prefix}customers as customer
left join {$table_prefix}upazilas on customer_upazila = upazila_id
left join {$table_prefix}districts on customer_district = district_id
left join (
select
sales_customer_id,
Expand All @@ -1359,33 +1359,33 @@
sum( case when is_return = 0 and sales_delivery_date between '{$dateRange[0]}' and '{$dateRange[1]}' then sales_shipping end ) as sales_shipping_in_filtered_date,
sum( case when is_return = 1 and sales_delivery_date between '{$dateRange[0]}' and '{$dateRange[1]}' then sales_grand_total end ) as product_returns_grand_total_in_filtered_date,
sum( case when is_return = 1 and sales_delivery_date < '{$dateRange[0]}' then sales_grand_total end ) as total_return_before_filtered_date
from {$table_prefeix}sales where is_trash = 0 and sales_status = 'Delivered' group by sales_customer_id
from {$table_prefix}sales where is_trash = 0 and sales_status = 'Delivered' group by sales_customer_id
) as sales on sales_customer_id = customer_id
left join ( select
wastage_sale_customer,
sum( case when wastage_sale_date between '{$dateRange[0]}' and '{$dateRange[1]}' then wastage_sale_grand_total end ) as wastage_sale_grand_total_in_filtered_date,
sum( case when wastage_sale_date < '{$dateRange[0]}' then wastage_sale_grand_total end ) as wastage_sale_grand_total_before_filtered_date
from {$table_prefeix}wastage_sale where is_trash = 0 group by wastage_sale_customer
from {$table_prefix}wastage_sale where is_trash = 0 group by wastage_sale_customer
) as wastage_sale on wastage_sale_customer = customer_id
left join ( select
received_payments_from,
sum( case when date(received_payments_datetime) between '{$dateRange[0]}' and '{$dateRange[1]}' then received_payments_amount end ) as received_payments_amount_in_filtered_date,
sum( case when date(received_payments_datetime) < '{$dateRange[0]}' then received_payments_amount end ) as received_payments_amount_before_filtered_date,
sum( case when date(received_payments_datetime) between '{$dateRange[0]}' and '{$dateRange[1]}' then received_payments_bonus end ) as received_payments_bonus_in_filtered_date,
sum( case when date(received_payments_datetime) < '{$dateRange[0]}' then received_payments_bonus end ) as received_payments_bonus_before_filtered_date
from {$table_prefeix}received_payments where is_trash = 0 and received_payments_type != 'Discounts' group by received_payments_from
from {$table_prefix}received_payments where is_trash = 0 and received_payments_type != 'Discounts' group by received_payments_from
) as received_payments on received_payments.received_payments_from = customer_id
left join ( select
received_payments_from,
sum( case when date(received_payments_datetime) between '{$dateRange[0]}' and '{$dateRange[1]}' then received_payments_amount end ) as discounts_amount_in_filtered_date,
sum( case when date(received_payments_datetime) < '{$dateRange[0]}' then received_payments_amount end ) as discounts_amount_before_filtered_date
from {$table_prefeix}received_payments where is_trash = 0 and received_payments_type = 'Discounts' group by received_payments_from
from {$table_prefix}received_payments where is_trash = 0 and received_payments_type = 'Discounts' group by received_payments_from
) as given_discounts on given_discounts.received_payments_from = customer_id
left join (select
payments_return_customer_id,
sum( case when date(payments_return_date) between '{$dateRange[0]}' and '{$dateRange[1]}' then payments_return_amount end ) as payment_return_amount_in_filtered_date,
sum( case when date(payments_return_date) < '{$dateRange[0]}' then payments_return_amount end ) as payment_return_amount_before_filtered_date
from {$table_prefeix}payments_return where is_trash = 0 and payments_return_type = 'Outgoing' group by payments_return_customer_id
from {$table_prefix}payments_return where is_trash = 0 and payments_return_type = 'Outgoing' group by payments_return_customer_id
) as payment_return on payments_return_customer_id = customer_id
where customer.is_trash = 0 and customer_name like '{$search}%'
Expand Down Expand Up @@ -1480,23 +1480,23 @@
if(totalBill is null, 0, totalBill) as totalBill,
if(totalPaymentAmount is null, 0, totalPaymentAmount) as totalPaymentAmount,
if(totalPaymentAdjustment is null, 0, totalPaymentAdjustment) as totalPaymentAdjustment
from {$table_prefeix}companies as company
from {$table_prefix}companies as company
left join (select
bills_company_id,
sum(bills_amount) as totalBill
from {$table_prefeix}bills
from {$table_prefix}bills
where is_trash = 0 group by bills_company_id
) as bill on bills_company_id = company_id
left join (select
payment_to_company,
sum(payment_amount) as totalPaymentAmount
from {$table_prefeix}payments
from {$table_prefix}payments
where is_trash = 0 and payment_type is not null group by payment_to_company
) as payment on payment_to_company = company_id
left join (SELECT
pa_company,
sum(pa_amount) as totalPaymentAdjustment
from {$table_prefeix}payment_adjustment where is_trash = 0 group by pa_company
from {$table_prefix}payment_adjustment where is_trash = 0 group by pa_company
) as payment_adjustment on pa_company = company_id
where company.is_trash = 0 and company_name like '{$search}%'
Expand Down

0 comments on commit 83bd788

Please sign in to comment.