
create or replace VIEW `view_unpost_other_receive` AS 
select `a`.`projectID` AS `projectID`,`a`.`receiveFrom` AS `receiveFrom`,`a`.`ID` AS `otherReceiveID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,
b.lineNo ,`b`.`description` AS `itemdescription`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `drAccountID`,
`b`.`accountNoID` AS `crAccountID`,
(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `drTaxAccountID`,
(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `crTaxAccountID`
from (`comp_receive_payment_others` `a` join `comp_receive_payment_others_detail` `b`) where ((`a`.`ID` = `b`.`receivePaymentOthersID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0));


alter table tbl_usermaster drop index `index 3`;
alter table tbl_usermaster add index `index 3` (password); 


create or replace VIEW `view_search` AS select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,
concat(if((`a`.`updateAble` = 1),'arTransaction/editcashsale/','arReports/cashsalelistDetail/'),`a`.`ID`) AS `searchLink`,
concat('Cash Sale&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`salesInvoiceDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`paymentFrom`) AS `searchKey`,
`a`.`salesInvoiceDate` AS `transDate` 
from `comp_cash_sales` `a` 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'sotransaction/SalesDO/','soreport/DeliveryOrderDetail/'),`a`.`ID`) AS `searchLink`,concat('Delivery Order&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`deliveryOrderDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`deliveryOrderDate` AS `transDate` from (`comp_delivery_order` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateable` = 1),'locationtransfer/edit/','locationtransfer/reportdetail/'),`a`.`ID`) AS `searchLink`,concat('Inventory Transfer&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(`a`.`formNo` using utf8),'[',convert(lpad(`a`.`serialNo`,8,'0') using utf8),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`dateTransfer`,'%d/%m/%Y') using utf8),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`code`,'&nbsp',`b`.`desc`) AS `searchKey`,`a`.`dateTransfer` AS `transDate` from (`comp_location_transfer` `a` join `tbl_location` `b`) where (`a`.`fromLocationID` = `b`.`fldid`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'aptransaction/editPayment/','Apreports/supplierpaymentDetail/'),`a`.`ID`) AS `searchLink`,concat('Payment&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`paymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`paymentDate` AS `transDate` from (`comp_payment` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'othersPayment/editPayWithoutItem/','othersPayment/otherpaywithoutDetail/'),`a`.`ID`) AS `searchLink`,concat('Payment Others&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`paymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`payTo`) AS `searchKey`,`a`.`paymentDate` AS `transDate` from `comp_payment_others` `a` 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'PO_Transaction/edit/','purchaseReports/PODetails/'),`a`.`ID`) AS `searchLink`,concat('Purchase Order&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`poDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`poDate` AS `transDate` from (`comp_purchase_order` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('soreport/SalesQuotationDetail/',`a`.`ID`) AS `searchLink`,concat('Quotation&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`quotationDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`quotationDate` AS `transDate` from (`comp_quotation` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'receiveItems/editReceiveItem/','receiveItems/ReceiveItemDetails/'),`a`.`ID`) AS `searchLink`,concat('Receive Item&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`deliveryDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`deliveryDate` AS `transDate` from (`comp_receive_item` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'artransaction/editReceivePayment/','arReports/compRecPaymentDetail/'),`a`.`ID`) AS `searchLink`,concat('Receive Payment&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`receivePaymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`receivePaymentDate` AS `transDate` from (`comp_receive_payment` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'gltransaction/editotherreceive/','glreports/otherReceiveAdviceRpt/'),`a`.`ID`) AS `searchLink`,concat('Receive Payment Others&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`receivePaymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`receiveFrom`) AS `searchKey`,`a`.`receivePaymentDate` AS `transDate` from `comp_receive_payment_others` `a` 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'artransaction/editSaleCreditNote/','arreports/salescreditnoteDetail/'),`a`.`ID`) AS `searchLink`,concat('Sales Credit Note&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`creditNoteDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`creditNoteDate` AS `transDate` from (`comp_sales_creditnote` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'artransaction/editSaleDebitNote/','arreports/salesdebitnoteDetail/'),`a`.`ID`) AS `searchLink`,concat('Sales Debit Note&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`debitNoteDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`debitNoteDate` AS `transDate` from (`comp_sales_debitnote` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('arReports/salesInvoiceDetail/',`a`.`ID`) AS `searchLink`,concat('Sales Invoice&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`salesInvoiceDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`salesInvoiceDate` AS `transDate` from (`comp_sales_invoice` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('soreport/SalesOrderDetail/',`a`.`ID`) AS `searchLink`,concat('Sales Order&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`salesOrderDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`salesOrderDate` AS `transDate` from (`comp_sales_order` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'aptransaction/editCreditNote/','Apreports/creditNoteDetail/'),`a`.`ID`) AS `searchLink`,concat('Supplier Credit Note&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`creditNoteDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`creditNoteDate` AS `transDate` from (`comp_supplier_creditnote` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'aptransaction/editDebitNote/','Apreports/debitNoteDetail/'),`a`.`ID`) AS `searchLink`,concat('Supplier Debit Note&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`debitNoteDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`debitNoteDate` AS `transDate` from (`comp_supplier_debitnote` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) 
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('apreports/purchaseInvoiceDetail/',`a`.`ID`) AS `searchLink`,concat('Purchase Invoice&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`invoiceDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`invoiceDate` AS `transDate` from (`comp_supplier_invoice` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`)

union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('glreports/otherReceiveAdviceRpt/',`a`.`ID`) AS `searchLink`,
concat('Sale&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`receivePaymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`description`) AS `searchKey`,`a`.`receivePaymentDate` AS `transDate` 
from (`comp_receive_payment_others` `a` join `comp_receive_payment_others_detail` `b`) 
where (`a`.`ID` = `b`.`receivePaymentOthersID`)
union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('othersPayment/otherpaywithoutDetail/',`a`.`ID`) AS `searchLink`,
concat('Sale&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',convert(date_format(`a`.`paymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class=""i-play"" aria-hidden=""true""></i>&nbsp',`b`.`itemDescription`) AS `searchKey`,`a`.`paymentDate` AS `transDate` 
from (`comp_payment_others` `a` join `comp_payment_others_without_item` `b`) 
where (`a`.`ID` = `b`.`otherPaymentID`)
;

ALTER TABLE `comp_supplier_invoice` ADD INDEX `is_delete` (`is_delete`);
ALTER TABLE `comp_supplier_invoice` ADD INDEX `journalNo` (`journalNo`);


ALTER TABLE `comp_finalcial_year` ADD INDEX `is_delete` (`is_delete`);
ALTER TABLE `comp_finalcial_year` ADD INDEX `companyID` (`companyID`);

create or replace VIEW `view_customer_statement` AS select `comp_sales_invoice`.`ID` AS `ID`,`comp_sales_invoice`.`ID` AS `parent`,`comp_sales_invoice`.`companyID` AS `companyID`,`comp_sales_invoice`.`customerID` AS `customerID`,'Invoice' AS `transType`,`comp_sales_invoice`.`salesInvoiceDate` AS `transDate`,`comp_sales_invoice`.`customerPoNo` AS `refNo`,concat(concat(concat(`comp_sales_invoice`.`formNo`,'['),convert(lpad(`comp_sales_invoice`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`comp_sales_invoice`.`totalamount` AS `dr`,NULL AS `cr`,1 AS `seq` from `comp_sales_invoice` where (`comp_sales_invoice`.`updateAble` = 0 and `comp_sales_invoice`.`is_delete` = 0)
union select `a`.`ID` AS `ID`,`a`.`salesInvoiceID` AS `parent`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,'DebitNote' AS `transType`,`a`.`debitNoteDate` AS `transDate`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `refno`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`totalAmount` AS `dr`,NULL AS `cr`,2 AS `seq` from (`comp_sales_debitnote` `a` join `comp_sales_invoice` `b`) where ((`a`.`updateAble` = 0 and `a`.`is_delete` = 0) and (`b`.`ID` = `a`.`salesInvoiceID`))
union select `a`.`ID` AS `ID`,`a`.`salesInvoiceID` AS `parent`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,'CreditNote' AS `transType`,`a`.`creditNoteDate` AS `transDate`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `refno`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,NULL AS `dr`,`a`.`totalAmount` AS `cr`,3 AS `seq` from (`comp_sales_creditnote` `a` join `comp_sales_invoice` `b`) where ((`a`.`updateAble` = 0 and `a`.`is_delete` = 0) and (`b`.`ID` = `a`.`salesInvoiceID`))
union select `b`.`ID` AS `ID`,0 AS `parent`,`b`.`companyID` AS `companyID`,`b`.`customerID` AS `customerID`,
if(b.updateAble = 0,'Payment','** Payment') AS `transType`,`b`.`receivePaymentDate` AS `transDate`,`b`.`referenceNo` AS `refNo`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,NULL AS `dr`,`b`.`totalReceived` AS `cr`,4 AS `seq` 
from `comp_receive_payment` `b` where (`b`.`is_delete` = 0)
union select `b`.`ID` AS `ID`,0 AS `parent`,`b`.`companyID` AS `companyID`,`b`.`customerID` AS `customerID`,'Discount' AS `transType`,`b`.`receivePaymentDate` AS `transDate`,NULL AS `refNo`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,NULL AS `dr`,`b`.`totalDiscount` AS `cr`,4 AS `seq` from `comp_receive_payment` `b` where (`b`.`totalDiscount` > 0 and `b`.`updateAble` = 0 and `b`.`is_delete` = 0)
union select `b`.`ID` AS `ID`,0 AS `parent`,`b`.`companyID` AS `companyID`,`b`.`customerID` AS `customerID`,'Historical Invoice' AS `transType`,`b`.`salesInvoiceDate` AS `transDate`,customerPoNo AS `refNo`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `formNo`, b.totalAmount AS `dr`,null AS `cr`,1 AS `seq` from `comp_historical_customer_invoice` `b` where (`b`.`updateAble` = 0 and `b`.`is_delete` = 0);



ALTER TABLE `comp_receive_payment` ADD INDEX `companyID` (`companyID`);
ALTER TABLE `comp_receive_payment` ADD INDEX `customerID` (`customerID`); 
ALTER TABLE `comp_receive_payment` ADD INDEX `journalNO` (`journalNo`);
ALTER TABLE `comp_receive_payment` ADD INDEX `is_delete`(`is_delete`);  
ALTER TABLE `comp_receive_payment` ADD INDEX `updateAble`(`updateAble`);

-- --comp_payment
ALTER TABLE `comp_payment` ADD INDEX `companyID` (`companyID`);
ALTER TABLE `comp_payment` ADD INDEX `supplierID` (`supplierID`);
ALTER TABLE `comp_payment` ADD INDEX `updateAble`(`updateAble`);

-- --comp_payment_others
ALTER TABLE `comp_payment_others` ADD INDEX `companyID` (`companyID`);
ALTER TABLE `comp_payment_others` ADD INDEX `supplierID` (`journalNo`);
ALTER TABLE `comp_payment_others` ADD INDEX `updateAble`(`updateAble`);

ALTER TABLE `comp_journal_detail`ADD INDEX `journalID`(`journalID`);
ALTER TABLE `comp_journal_detail`ADD INDEX `sequence` (`sequence`);




update comp_receive_payment set currencyID = 1 where currencyID = 0; 
update comp_receive_payment set exchangeRate = 1 where exchangeRate = 0; 
update comp_receive_payment_others set currencyID = 1 where currencyID = 0; 
update comp_receive_payment_others set exchangeRate = 1 where exchangeRate = 0; 
update comp_sales_invoice set currencyID = 1 where currencyID = 0; 
update comp_sales_invoice set exchangeRate = 1 where exchangeRate = 0;
update comp_sales_debitnote set currencyID = 1 where currencyID = 0; 
update comp_sales_debitnote set exchangeRate = 1 where exchangeRate = 0;
update comp_sales_creditnote set currencyID = 1 where currencyID = 0; 
update comp_sales_creditnote set exchangeRate = 1 where exchangeRate = 0;
update comp_supplier_invoice set currencyID = 1 where currencyID = 0; 
update comp_supplier_invoice set exchangeRate = 1 where exchangeRate = 0;
update comp_supplier_debitnote set currencyID = 1 where currencyID = 0; 
update comp_supplier_debitnote set exchangeRate = 1 where exchangeRate = 0;
update comp_supplier_creditnote set currencyID = 1 where currencyID = 0; 
update comp_supplier_creditnote set exchangeRate = 1 where exchangeRate = 0;
update comp_currency_conv set rateConv = 1 where rateConv = 0;  
update comp_payment set exchangeRate = 1 where exchangeRate = 0;















































































