$(document).on('page:init', '.page[data-name="inventory"]', async function (e) {

  console.log('app inventory ready')

  let js = JSON.parse(localStorage.getItem('f03_inventory'));

  let dt = js.data;

  console.log(dt)

  var strHtml = `

<div class="container mt-20">

  <div class="list detailed-list list-dividers full-width notification-list">

    <ul>`;

  for(let i=0;i<dt.length;i++) {

    strHtml +=`

    <li>

      <a href="/inventory_edit/`+i+`" class="item-link item-content">

       <div class="item-media">

        <img src="`+dt[i].image+`" class="event-thumbnail" alt="">

       </div>

       <div class="item-inner">

         <div class="item-title">

            <div class="item-date-container">

              <div class="item-date">`+dt[i].qty+` `+dt[i].unit+`</div>

              <div class="item-time"></div>

            </div>

            <div class="item-description">

            `+dt[i].name+`<br>

            <div class="fs-sm fw-300">Penyusutan: `+dt[i].will_age+` (tahun)</div>

            </div>

         </div>

         <div class="item-after">

         `+dt[i].rp+`

         </div>

       </div>

      </a>

    </li>

      `;

  }

   strHtml += `

    </ul>

  </div>

</div>

   `;  

  $$("#inventory_content").html(strHtml);

})

/*

<li>

        <a href="/inventory_edit/`+i+`">

          <div class="item-inner">

            <div class="item-title-row">

              <div class="item-title">`+dt[i].name+`</div>

              <div class="item-after">`+dt[i].code+`</div>

            </div>

            <div class="item-subtitle">`+dt[i].qty+` `+dt[i].unit+`</div>

            <div class="item-text">Rp.`+dt[i].rp+`, depretiation: `+dt[i].will_age+` year</div>

          </div>

        </a>

      </li>

*/