[CodeIgniter] conversion de monnaie changeable

Fermé
tridam23 Messages postés 99 Date d'inscription mercredi 5 novembre 2014 Statut Membre Dernière intervention 11 juin 2021 - 20 oct. 2017 à 15:07
tridam23 Messages postés 99 Date d'inscription mercredi 5 novembre 2014 Statut Membre Dernière intervention 11 juin 2021 - 22 oct. 2017 à 16:58
Bonjour. Application pour une pharmacie.
J’explique : dans mon pays (Congo - Kinshasa), le prix des fournisseurs est en dollars américains. Mais nos prix de vente sont en franc congolais (CDF).
Le taux varie et change tous les jours. Ce qui affecte quotidiennement notre prix de vente. Il me faut chaque matin mettre le prix de vente à jour.
Ce dont j’ai besoin c’est la possibilité de mettre à jour mon taux en fonction des prix en dollars des fournisseurs.

1. Sur mon tableau de bord, j’aimerai à avoir une case de taux du jour changeable manuellement. Une fois le taux du jour inséré que cela mette automatiquement à jour le prix sur tous les produits

<?php
    $CI =& get_instance();
    $CI->load->model('Web_settings');
    $CI->load->model('Reports');
    $CI->load->model('Users');
    $Web_settings = $CI->Web_settings->retrieve_setting_editdata();
    $users = $CI->Users->profile_edit_data();
    $out_of_stock = $CI->Reports->out_of_stock_count();
?>
<!-- Admin header end -->
<header class="main-header"> 
    <a href="<?php echo base_url()?>" class="logo"> <!-- Logo -->
        <span class="logo-mini">
            <!--<b>A</b>BD-->
            <img src="<?php if (isset($Web_settings[0]['favicon'])) {
               echo $Web_settings[0]['favicon']; }?>" alt="">
        </span>
        <span class="logo-lg">
            <!--<b>Admin</b>BD-->
            <img src="<?php if (isset($Web_settings[0]['logo'])) {
               echo $Web_settings[0]['logo']; }?>" alt="">
        </span>
    </a>
    <!-- Header Navbar -->
    <nav class="navbar navbar-static-top">
        <a href="#" rel="nofollow noopener noreferrer" target="_blank" class="sidebar-toggle" data-toggle="offcanvas" role="button"> <!-- Sidebar toggle button-->
            <span class="sr-only">Toggle navigation</span>
            <span class="pe-7s-keypad"></span>
        </a>
        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                  <li class="dropdown notifications-menu">
                    <a href="<?php echo base_url('Creport/out_of_stock')?>" >
                        <i class="pe-7s-attention" title="<?php echo display('out_of_stock')?>"></i>
                        <span class="label label-danger"><?php echo $out_of_stock?></span>
                    </a>
                </li>
                <!-- settings -->
                <li class="dropdown dropdown-user">
                    <a href="#" rel="nofollow noopener noreferrer" target="_blank" class="dropdown-toggle" data-toggle="dropdown"> <i class="pe-7s-settings"></i></a>
                    <ul class="dropdown-menu">
                        <li><a href="<?php echo base_url('Admin_dashboard/edit_profile')?>"><i class="pe-7s-users"></i><?php echo display('user_profile') ?></a></li>
                        <li><a href="<?php echo base_url('Admin_dashboard/change_password_form')?>"><i class="pe-7s-settings"></i><?php echo display('change_password') ?></a></li>
                        <li><a href="<?php echo base_url('Admin_dashboard/logout')?>"><i class="pe-7s-key"></i><?php echo display('logout') ?></a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
</header>

<aside class="main-sidebar">
	<!-- sidebar -->
	<div class="sidebar">
	    <!-- Sidebar user panel -->
	    <div class="user-panel text-center">
	        <div class="image">
	            <img src="<?php echo $users[0]['logo']?>" class="img-circle" alt="User Image">
	        </div>
	        <div class="info">
	            <p><?php echo $this->session->userdata('user_name')?></p>
	            <a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="fa fa-circle text-success"></i> <?php echo display('online') ?></a>
	        </div>
	    </div>
	    <!-- sidebar menu -->
	    <ul class="sidebar-menu">

	        <li class="<?php if ($this->uri->segment('1') == ("")) { echo "active";}else{ echo " ";}?>">
	            <a href="<?php echo base_url()?>"><i class="ti-dashboard"></i> <span><?php echo display('dashboard') ?></span>
	                <span class="pull-right-container">
	                    <span class="label label-success pull-right"></span>
	                </span>
	            </a>
	        </li>

            <!-- Invoice menu start -->
            <li class="treeview <?php if ($this->uri->segment('1') == ("Cinvoice")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-layout-accordion-list"></i><span><?php echo display('invoice') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Cinvoice')?>"><?php echo display('new_invoice') ?></a></li>
                    <li><a href="<?php echo base_url('Cinvoice/manage_invoice')?>"><?php echo display('manage_invoice') ?></a></li>
                    <li><a href="<?php echo base_url('Cinvoice/pos_invoice')?>"><?php echo display('pos_invoice') ?></a></li>
                </ul>
            </li>
            <!-- Invoice menu end -->

            <!-- Product menu start -->
            <li class="treeview <?php if ($this->uri->segment('1') == ("Cproduct") || $this->uri->segment('1') == ("Cqrcode") || $this->uri->segment('1') == ("Cbarcode")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-bag"></i><span><?php echo display('product') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Cproduct')?>"><?php echo display('add_product') ?></a></li>
                    <li><a href="<?php echo base_url('Cproduct/add_product_csv')?>"><?php echo display('import_product_csv') ?></a></li>
                    <li><a href="<?php echo base_url('Cproduct/manage_product')?>"><?php echo display('manage_product') ?></a></li>
                    <?php 
                    if ($this->uri->segment(2) == "product_details") {
                    ?>
                    <li><a href="<?php echo base_url($product_statement)?>"><?php echo display('product_statement') ?></a></li>
                    <?php
                    }?>
                </ul>
            </li>
            <!-- Product menu end -->

            <!-- Customer menu start -->
            <li class="treeview <?php if ($this->uri->segment('1') == ("Ccustomer")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="fa fa-handshake-o"></i><span><?php echo display('customer') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Ccustomer')?>"><?php echo display('add_customer') ?></a></li>
                    <li><a href="<?php echo base_url('Ccustomer/manage_customer')?>"><?php echo display('manage_customer') ?></a></li>
                    <li><a href="<?php echo base_url('Ccustomer/credit_customer')?>"><?php echo display('credit_customer') ?></a></li>
                    <li><a href="<?php echo base_url('Ccustomer/paid_customer')?>"><?php echo display('paid_customer') ?></a></li>
                </ul>
            </li>
            <!-- Customer menu end -->

            <!-- Category menu start -->
            <li class="treeview <?php if ($this->uri->segment('1') == ("Ccategory")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-tag"></i><span><?php echo display('category') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Ccategory')?>"><?php echo display('add_category') ?></a></li>
                    <li><a href="<?php echo base_url('Ccategory/manage_category')?>"><?php echo display('manage_category') ?></a></li>
                </ul>
            </li>
            <!-- Category menu end -->

	        <!-- Supplier menu start -->
	        <li class="treeview <?php if ($this->uri->segment('1') == ("Csupplier")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-user"></i><span><?php echo display('supplier') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Csupplier')?>"><?php echo display('add_supplier') ?></a></li>
                    <li><a href="<?php echo base_url('Csupplier/manage_supplier')?>"><?php echo display('manage_supplier') ?></a></li>
                    <?php 
                    if (isset($supplier_ledger)) {
                    ?>
                    <li><a href="<?php echo base_url($supplier_ledger)?>"><?php echo display('supplier_ledger') ?></a></li>
                    <li><a href="<?php echo base_url($supplier_sales_details)?>"><?php echo display('supplier_sales_details') ?></a></li>
                    <li><a href="<?php echo base_url($supplier_sales_summary)?>"><?php echo display('supplier_sales_summary') ?></a></li>
                    <li><a href="<?php echo base_url($sales_payment_actual)?>"><?php echo display('supplier_payment_actual') ?></a></li>
                    <?php
                    }?>
                </ul>
            </li>
            <!-- Supplier menu end -->

            <!-- Purchase menu start -->
	        <li class="treeview <?php if ($this->uri->segment('1') == ("Cpurchase")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-shopping-cart"></i><span><?php echo display('purchase') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Cpurchase')?>"><?php echo display('add_purchase') ?></a></li>
                    <li><a href="<?php echo base_url('Cpurchase/manage_purchase')?>"><?php echo display('manage_purchase') ?></a></li>
                </ul>
            </li>
            <!-- Purchase menu end -->

            <!-- Stock menu start -->
            <li class="treeview <?php if ($this->uri->segment('1') == ("Creport")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-bar-chart"></i><span><?php echo display('stock') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Creport')?>"><?php echo display('stock_report') ?></a></li>
                    <li><a href="<?php echo base_url('Creport/stock_report_supplier_wise')?>"><?php echo display('stock_report_supplier_wise') ?></a></li>
                    <li><a href="<?php echo base_url('Creport/stock_report_product_wise')?>"><?php echo display('stock_report_product_wise') ?></a></li>

                </ul>
            </li>
            <!-- Stock menu end -->

            
            <!-- Search menu start -->
            <li class="treeview <?php if ($this->uri->segment('1') == ("Csearch")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-search"></i><span><?php echo display('search') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Csearch/medicine')?>"><?php echo display('medicine') ?></a></li>
                    <li><a href="<?php echo base_url('Csearch/customer')?>"><?php echo display('customer') ?> </a></li>
                    <li><a href="<?php echo base_url('Csearch/invoice')?>"><?php echo display('invoice') ?> </a></li>
                    <li><a href="<?php echo base_url('Csearch/purchase')?>"><?php echo display('purchase') ?> </a></li>
                </ul>
            </li>
            <!-- Search menu end -->

            <?php
                if ($this->session->userdata('user_type') == '1') {
            ?>

            <!-- Accounts menu start -->
            <li class="treeview <?php if ($this->uri->segment('1') == ("Caccounts") || $this->uri->segment('2') == ("table_create") || $this->uri->segment('2') == ("table_list") || $this->uri->segment('2') == ("table_edit")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-pencil-alt"></i><span><?php echo display('accounts') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Csettings/table_create/')?>"><?php echo display('create_accounts') ?> </a></li>
                    <li><a href="<?php echo base_url('Csettings/table_list/')?>"><?php echo display('manage_accounts') ?> </a></li>
                    <li><a href="<?php echo base_url('Caccounts')?>"><?php echo display('income') ?></a></li>
                    <li><a href="<?php echo base_url('Caccounts/outflow/')?>"><?php echo display('expense') ?></a></li>
                    <li><a href="<?php echo base_url('Caccounts/add_tax/')?>"><?php echo display('add_tax') ?></a></li>
                    <li><a href="<?php echo base_url('Caccounts/manage_tax/')?>"><?php echo display('manage_tax') ?></a></li>
                    <li><a href="<?php echo base_url('Caccounts/summary/')?>"><?php echo display('accounts_summary') ?></a></li>
                    <li><a href="<?php echo base_url('Caccounts/cheque_manager/')?>"><?php echo display('cheque_manager') ?></a></li>
                    <li><a href="<?php echo base_url('Caccounts/closing/')?>"><?php echo display('closing') ?></a></li>
                    <li><a href="<?php echo base_url('Caccounts/closing_report/')?>"><?php echo display('closing_report') ?></a></li>
                </ul>
            </li>
            <!-- Accounts menu end -->

            <!-- Report menu start -->
            <li class="treeview <?php if ($this->uri->segment('2') == ("all_report") || $this->uri->segment('2') == ("todays_sales_report") || $this->uri->segment('2') == ("todays_purchase_report") || $this->uri->segment('2') == ("product_sales_reports_date_wise") || $this->uri->segment('2') == ("total_profit_report") ) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-book"></i><span><?php echo display('report') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Admin_dashboard/all_report')?>"><?php echo display('todays_report') ?></a></li>
                    <li><a href="<?php echo base_url('Admin_dashboard/todays_sales_report')?>"><?php echo display('sales_report') ?></a></li>
                    <li><a href="<?php echo base_url('Admin_dashboard/todays_purchase_report')?>"><?php echo display('purchase_report') ?></a></li>
                    <li><a href="<?php echo base_url('Admin_dashboard/product_sales_reports_date_wise')?>"><?php echo display('sales_report_product_wise') ?></a></li>
                    <li><a href="<?php echo base_url('Admin_dashboard/total_profit_report')?>"><?php echo display('profit_report') ?></a></li>
                </ul>
            </li>
            <!-- Report menu end -->

            <!-- Bank menu start -->
            <li class="treeview <?php if ($this->uri->segment('2') == ("index") || $this->uri->segment('2') == ("bank_list")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-briefcase"></i><span><?php echo display('settings') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Csettings/index')?>"><?php echo display('add_new_bank') ?></a></li>
                    <li><a href="<?php echo base_url('Csettings/bank_list/')?>"><?php echo display('manage_bank') ?></a></li>
                </ul>
            </li>
            <!-- Bank menu end -->

            <!-- Synchronizer setting start -->
            <li class="treeview <?php if ($this->uri->segment('2') == ("form") || $this->uri->segment('2') == ("synchronize") || $this->uri->segment('1') == ("Backup_restore")) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-reload"></i><span><?php echo display('data_synchronizer') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <?php 
                        $localhost=false;
                        if (in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1', 'localhost'))) {
                    ?>
                    <li><a href="<?php echo base_url('data_synchronizer/form')?>"><?php echo display('setting') ?></a></li>
                    <?php
                        } 
                    ?>
                    <li><a href="<?php echo base_url('data_synchronizer/synchronize/')?>"><?php echo display('synchronize') ?></a></li>
                    <li><a href="<?php echo base_url('Backup_restore/')?>"><?php echo display('backup_restore') ?></a></li>
                </ul>
            </li>
            <!-- Synchronizer setting end -->

            <!-- Software Settings menu start -->
            <li class="treeview <?php if ($this->uri->segment('1') == ("Company_setup") || $this->uri->segment('1') == ("User") || $this->uri->segment('1') == ("Cweb_setting") || $this->uri->segment('1') == ("Language") ) { echo "active";}else{ echo " ";}?>">
                <a href="#" rel="nofollow noopener noreferrer" target="_blank">
                    <i class="ti-settings"></i><span><?php echo display('web_settings') ?></span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="<?php echo base_url('Company_setup/manage_company')?>"><?php echo display('manage_company') ?></a></li>
                    <li><a href="<?php echo base_url('User')?>"><?php echo display('add_user') ?></a></li>
                    <li><a href="<?php echo base_url('User/manage_user')?>"><?php echo display('manage_users') ?> </a></li>
                    <li><a href="<?php echo base_url('Language')?>"><?php echo display('language') ?> </a></li>
                    <li><a href="<?php echo base_url('Cweb_setting')?>"><?php echo display('setting') ?> </a></li>
                </ul>
            </li>
            <!-- Software Settings menu end -->
            <?php
                }
            ?>
	    </ul>
	</div> <!-- /.sidebar -->
</aside>


2. Que le prix en franc congolais soit affiché sur la fiche détaillée du produit

<!-- Product details page start -->
<div class="content-wrapper">
	<section class="content-header">
	    <div class="header-icon">
	        <i class="pe-7s-note2"></i>
	    </div>
	    <div class="header-title">
	        <h1><?php echo display('product_report') ?></h1>
	        <small><?php echo display('product_sales_and_purchase_report') ?></small>
	        <ol class="breadcrumb">
	            <li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="pe-7s-home"></i> <?php echo display('home') ?></a></li>
	            <li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><?php echo display('report') ?></a></li>
	            <li class="active"><?php echo display('product_report') ?></li>
	        </ol>
	    </div>
	</section>

	<section class="content">

		<!-- Alert Message -->
	    <?php
	        $message = $this->session->userdata('message');
	        if (isset($message)) {
	    ?>
	    <div class="alert alert-info alert-dismissable">
	        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
	        <?php echo $message ?>                    
	    </div>
	    <?php 
	        $this->session->unset_userdata('message');
	        }
	        $error_message = $this->session->userdata('error_message');
	        if (isset($error_message)) {
	    ?>
	    <div class="alert alert-danger alert-dismissable">
	        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
	        <?php echo $error_message ?>                    
	    </div>
	    <?php 
	        $this->session->unset_userdata('error_message');
	        }
	    ?>


		<div class="row">
		    <div class="col-sm-12">
		        <div class="panel panel-bd lobidrag">
		            <div class="panel-heading">
		                <div class="panel-title">
		                    <h4><?php echo display('product_details') ?> </h4>
		                </div>
		            </div>
		            <div class="panel-body">
						<h2> <span style="font-weight:normal;"><?php echo display('product_name') ?>: </span><span style="color:#005580;">{product_name}</span></h2>
						<h4> <span style="font-weight:normal;"><?php echo display('model') ?>:</span> <span style="color:#005580;">{product_model}</span></h4>
						<h4> <span style="font-weight:normal;"><?php echo display('price') ?>:</span> <span style="color:#005580;"> 
						<?php echo (($position==0)?"$currency {price}":"{price} $currency") ?></span></h4>
						<table class="table">
							<tr>
								<th><?php echo display('total_purchase') ?> = <span style="color:#ff0000;">{total_purchase}</span></th>
								<th><?php echo display('total_sales') ?> = <span style="color:#ff0000;"> {total_sales}</span></th>
								<th><?php echo display('stock') ?> = <span style="color:#ff0000;"> {stock}</span></th>
							</tr>
						</table>
		            </div>
		        </div>
		    </div>
		 </div>

		<!-- Total Purchase report -->
		<div class="row">
		    <div class="col-sm-12">
		        <div class="panel panel-bd lobidrag">
		            <div class="panel-heading">
		                <div class="panel-title">
		                    <h4><?php echo display('purchase_report') ?> </h4>
		                </div>
		            </div>
		            <div class="panel-body">
		                <div class="table-responsive">
		                    <table id="dataTableExample2" class="table table-bordered table-striped table-hover">
				            	<thead>
									<tr>
										<th><?php echo display('date') ?></th>
										<th><?php echo display('invoice_no') ?></th>
										<th><?php echo display('supplier_name') ?></th>
										<th><?php echo display('quantity') ?></th>
										<th><?php echo display('rate') ?></th>
										<th style="text-align:right;"><?php echo display('total_ammount') ?></th>
									</tr>
								</thead>
								<tbody>
								<?php
									if ($purchaseData) {
								?>
								{purchaseData}
									<tr>
										<td>{final_date}</td>
										<td>
											<a href="<?php echo base_url().'Cpurchase/purchase_details_data/{purchase_id}'; ?>">
												{chalan_no}
											</a>
										</td>
										<td>
											<a href="<?php echo base_url().'Csupplier/supplier_details/{supplier_id}'; ?>">{supplier_name}</a>
										</td>
										<td>{quantity}</td>
										<td><?php echo (($position==0)?"$currency {rate}":"{rate} $currency") ?></td>
										<td style="text-align:right;"> <?php echo (($position==0)?"$currency {total_amount}":"{total_amount} $currency") ?></td>
									</tr>
								{/purchaseData}
								<?php
									}
								?>
								</tbody>
								<tfoot>
									<tr>
										<td colspan="3" style="text-align:right;"><b><?php echo display('grand_total') ?>:</b></td>
										<td> {total_purchase}</td>
										<td></td>
										<td style="text-align:right;"><b> <?php echo (($position==0)?"$currency {purchaseTotalAmount}":"{purchaseTotalAmount} $currency") ?></b></td>
									</tr>
								</tfoot>
		                    </table>
		                </div>
		            </div>
		        </div>
		    </div>
		</div>

		<!--Total sales report -->
		<div class="row">
		    <div class="col-sm-12">
		        <div class="panel panel-bd lobidrag">
		            <div class="panel-heading">
		                <div class="panel-title">
		                    <h4><?php echo display('sales_report') ?> </h4>
		                </div>
		            </div>
		            <div class="panel-body">
		                <div class="table-responsive">
		                    <table id="dataTableExample3" class="table table-bordered table-striped table-hover">
		             			<thead>
									<tr>
										<th><?php echo display('date') ?></th>
										<th><?php echo display('invoice_no') ?></th>
										<th><?php echo display('customer_name') ?></th>
										<th><?php echo display('quantity') ?></th>
										<th><?php echo display('rate') ?></th>
										<th style="text-align:right;"><?php echo display('total_ammount') ?></th>
									</tr>
								</thead>
								<tbody>
								<?php
									if ($salesData) {
								?>
								{salesData}
									<tr>
										<td>{final_date}</td>
										<td>
											<a href="<?php echo base_url().'Cinvoice/invoice_inserted_data/{invoice_id}'; ?>">
												{invoice_id}
											</a>
										</td>
										<td>
											<a href="<?php echo base_url().'Ccustomer/customer_ledger/{customer_id}'; ?>">{customer_name}</a>
										</td>
										<td>{quantity}</td>
										<td> <?php echo (($position==0)?"$currency {rate}":"{rate} $currency") ?></td>
										<td style="text-align:right;"> <?php echo (($position==0)?"$currency {total_price}":"{total_price} $currency") ?></td>
									</tr>
								{/salesData}
								<?php
									}
								?>
								</tbody>
								<tfoot>
									<tr>
										<td colspan="3" style="text-align:right;"><b><?php echo display('grand_total') ?>:</b></td>
										<td>  {total_sales}</td>
										<td> </td>
										<td  style="text-align:right;"><b> <?php echo (($position==0)?"$currency {salesTotalAmount}":"{salesTotalAmount} $currency") ?></b></td>
									</tr>
								</tfoot>
		                    </table>
		                </div>
		            </div>
		        </div>
		    </div>
		</div>
	</section>
</div>
<!-- Product details page end -->


3. Si possible, avoir un rapport de l’historique des taux de jours.

Un coup de pouce svp ?
A voir également:

1 réponse

yg_be Messages postés 23309 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 2 novembre 2024 Ambassadeur 1 551
22 oct. 2017 à 11:21
bonjour, peux-tu expliquer où sont enregistrés les prix des fournisseurs et les prix de vente des produits?
0
tridam23 Messages postés 99 Date d'inscription mercredi 5 novembre 2014 Statut Membre Dernière intervention 11 juin 2021
22 oct. 2017 à 14:03
Dans une base de donnée. Si je comprend bien ta question. Sinon c'est un fichier dont tu parle ?
0
yg_be Messages postés 23309 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 2 novembre 2024 1 551 > tridam23 Messages postés 99 Date d'inscription mercredi 5 novembre 2014 Statut Membre Dernière intervention 11 juin 2021
22 oct. 2017 à 14:52
eh bien alors je pense que c'est assez simple, il suffit de faire ceci quand le taux change:
- faire une requête SQL UPDATE pour modifier tous les prix de vente des produits
- faire une requête SQL INSERT pour mémoriser le taux dans une table spécifique
0
tridam23 Messages postés 99 Date d'inscription mercredi 5 novembre 2014 Statut Membre Dernière intervention 11 juin 2021 > yg_be Messages postés 23309 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 2 novembre 2024
22 oct. 2017 à 16:57
T'aurai un bout de code a me montrer ou des pistes. Suis apprenti. C'est un ami (décédé) avec qui je bossai dessus. C'était lui le codeur.j'essaye juste de finaliser notre projet.
0
tridam23 Messages postés 99 Date d'inscription mercredi 5 novembre 2014 Statut Membre Dernière intervention 11 juin 2021 > yg_be Messages postés 23309 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 2 novembre 2024
22 oct. 2017 à 16:58
Il travaillait ca avec codeigniter
0