<?php $__env->startSection('title','الاعدادات الاساسية'); ?>
<?php $__env->startSection('content'); ?>
<div class="app-content content ">
    <div class="content-overlay"></div>
    <div class="header-navbar-shadow"></div>
    <div class="content-wrapper container-xxl p-0">
      <div class="content-header row">
        <div class="content-header-left col-md-9 col-12 mb-2">
          <div class="row breadcrumbs-top">
            <div class="col-12">

              <h2 class="content-header-title float-start mb-0">
                الإعدادات الأساسية
             </h2>
              <div class="breadcrumb-wrapper">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item"><a href="<?php echo e(route('client.home')); ?>">لوحة التحكم </a>
                  </li>
                  <li class="breadcrumb-item active" >  
                    الإعدادت             
                  </li>
                  <li class="breadcrumb-item active" > 
                    الإعدادات الأساسية
                  </li>
                </ol>
              </div>
            </div>
          </div>
        </div>
        <div class="content-header-right text-md-end col-md-3 col-12 d-md-block d-none">

        </div>
    </div>
      <div class="content-body">
        <section class="app-user-view-account">
<div class="row">
  <!-- User Sidebar -->

  <!-- User Content -->
  <div class="col-xl-12 col-lg-12 col-md-12 order-0 order-md-12">
    <!-- User Pills -->
    <ul class="nav nav-pills mb-2">
      <li class="nav-item">
        <a class="nav-link <?php echo e(Request::is('*/settings/basic') ? 'active' : ''); ?>" href="<?php echo e(route('client.basic.settings.edit')); ?>">
          <i data-feather="settings" class="font-medium-3 me-50"></i>
          <span class="fw-bold">الإعدادات الأساسية</span></a
        >
      </li>
      <li class="nav-item">
        <a class="nav-link <?php echo e(Request::is('*/settings/extra') ? 'active' : ''); ?>" href="<?php echo e(route('client.extra.settings.edit')); ?>">
          <i data-feather="hexagon" class="font-medium-3 me-50"></i>
          <span class="fw-bold">الإعدادات الإضافية</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link <?php echo e(Request::is('*/settings/backup') ? 'active' : ''); ?>" href="<?php echo e(route('client.backup.settings.edit')); ?>">
          <i data-feather="database" class="font-medium-3 me-50"></i>
          <span class="fw-bold">النسخ الإحطياطي</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link <?php echo e(Request::is('*/settings/email') ? 'active' : ''); ?>" href="<?php echo e(route('client.email.settings.edit')); ?>">
          <i data-feather="mail" class="font-medium-3 me-50"></i><span class="fw-bold">البريد الإلكتروني</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link <?php echo e(Request::is('*/settings/billing') ? 'active' : ''); ?>" href="<?php echo e(route('client.billing.settings.edit')); ?>">
            <i data-feather="credit-card" class="font-medium-3 me-50"></i><span class="fw-bold">الفواتير والضرائب</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link <?php echo e(Request::is('*/settings/screens') ? 'active' : ''); ?>" href="<?php echo e(route('screens.settings')); ?>">
            <i data-feather="airplay" class="font-medium-3 me-50"></i><span class="fw-bold"> الشاشات</span>
        </a>
      </li>
    </ul>
    <!--/ User Pills -->

    <!-- Project table -->
    <div class="card">
        <div class="card-header">
            <h4 class="card-title">بيانات الضريبة و الفواتير</h4>
        </div>

    <div class="card-body">
        <form id="form" method="POST">
            <?php echo csrf_field(); ?>
            <input type="hidden" name="company_id" value="<?php echo e($company->id); ?>"/>
            <div class="row">
                    <div class="col-md-4 col-12">
                        <div class="mb-6">
                            <b for="tax_number">الرقم الضريبى</b>
                            <input style="width:100%" type="text" class="form-control"
                                   value="<?php echo e($company->tax_number); ?>" placeholder="الرقم الضريبى" 
                                   name="tax_number" id="tax_number"/>
                        </div>
                    </div>
                    <div class="col-md-4 col-12">
                        <div class="mb-6">
                            <b for="commercial_register">السجل التجارى</b>
                            <input type="text" class="form-control"
                                   name="commercial_registration_number"
                                   value="<?php echo e($company->commercial_registration_number); ?>" placeholder="السجل التجارى"
                                   id="commercial_registration_number"/>
                        </div>
                    </div>
                    <div class="col-md-4 col-12">
                        <div class="mb-6">
                            <b for="tax_value_added">ضريبة القيمة المضافة</b>
                            <div class="input-group">
                                    <span class="input-group-addon"
                                          style="font-size: 18px;font-weight: bold;"></span>
                                <input type="number" class="form-control input-spec"
                                       value="<?php echo e($company->tax_value_added); ?>"
                                       name="tax_value_added" placeholder="نسبة ضريبة القيمة المضافة "
                                       id="tax_value_added"/>
                            </div>
                        </div>
                    </div>
            </div>
            <div class="col-12" align="center">
                <br>
                  <button type="submit" class="btn btn-success me-1">تعديل</button>
                  <button type="button" class="btn btn-outline-danger" onclick="window.history.back()">رجوع</button>
                </div>
            </div>
            <div class="clearfix"></div>
        </form>

    </div>
    </div>

    <div class="card">
        <div class="card-header">
            <h4 class="card-title">بيانات السنة المالية </h4>
        </div>

    <div class="card-body">
        <form id="form2" method="POST">
            <?php echo csrf_field(); ?>
            <input type="hidden" name="company_id" value="<?php echo e($company->id); ?>"/>

            <div class="row">
                    <div class="col-md-4 col-12">
                        <div class="mb-6">
                            <b for="tax_number">السنة المالية</b>
                            <input style="width:100%" readonly type="text" class="form-control"
                                   value="<?php echo e($fiscal->fiscal_year); ?>"
                                   name="fiscal_year" id="fiscal_year"/>
                        </div>
                    </div>
                    <div class="col-md-4 col-12">
                        <div class="mb-6">
                            <b for="tax_number"> تبدأ يوم </b>
                            <input style="width:100%" type="date" class="form-control"
                                   value="<?php echo e($fiscal->start_date); ?>"
                                   name="start_date" id="start_date"/>
                        </div>
                    </div>
                    <div class="col-md-4 col-12">
                        <div class="mb-6">
                            <b for="tax_number"> تنتهى يوم </b>
                            <input style="width:100%" type="date" class="form-control"
                                   value="<?php echo e($fiscal->end_date); ?>"
                                   name="end_date" id="end_date"/>
                        </div>
                    </div>

                    <div class="col-12" align="center">
                        <br>
                          <button type="submit" class="btn btn-success me-1">تعديل</button>
                          <button type="button" class="btn btn-outline-danger" onclick="window.history.back()">رجوع</button>
                        </div>
                </div>
            </div>

            <div class="clearfix"></div>
        </form>
    </div>
  </div>
  <!--/ User Content -->
</div>
</section>
      </div>
  </div>
  <!-- END: Content-->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <script>
        var selectForm = $('#form');

if (selectForm) {
    selectForm.validate({

        rules: {
      'tax_number': {
        required: true,
      },
      'commercial_registration_number': {
        required: true,
      },
      'tax_value_added': {
        required: true
      }

    
    
    }
  });
}

$("#form").on('submit',(function(e) {

e.preventDefault();

$.ajax({

  url: "<?php echo e(route('client.billing.settings.update')); ?>",

  type: "POST",

  data:  new FormData(this),

  dataType:  'json',

  contentType: false,

  cache: false,

  processData:false,
  
  beforeSend : function (){var ifConnected = window.navigator.onLine;if (!ifConnected) {toastr.info("يتم الآن إعادة الإتصال","لا يوجد إتصال بالإنترنت",{positionClass: "toast-top-right",tapToDismiss: !1,timeOut: 2e3,rtl: $("html").attr("data-textdirection")});}},

  success: function(response) {

    if(response.status){

            toastr.success("",response.message,{
			positionClass: "toast-top-right",
			tapToDismiss: !1,
			timeOut: 2e3,
			rtl: $("html").attr("data-textdirection")
		    });      
            document.getElementById("addForm").reset();

    }else{
        toastr.warning("",response.message,{
			positionClass: "toast-top-right",
			tapToDismiss: !1,
			timeOut: 2e3,
			rtl: $("html").attr("data-textdirection")
		    });   
    } 

  },
  error: function(response){
          $.each(response.responseJSON.errors, function (key, item) 
          {
            toastr.error("",item,{
			positionClass: "toast-top-right",
			tapToDismiss: !1,
			timeOut: 2e3,
			rtl: $("html").attr("data-textdirection")
		    });

          });
  },

 });

}));



$("#form2").on('submit',(function(e) {

e.preventDefault();

$.ajax({

  url: "<?php echo e(route('client.fiscal.settings.update')); ?>",

  type: "POST",

  data:  new FormData(this),

  dataType:  'json',

  contentType: false,

  cache: false,

  processData:false,
  
  beforeSend : function (){var ifConnected = window.navigator.onLine;if (!ifConnected) {toastr.info("يتم الآن إعادة الإتصال","لا يوجد إتصال بالإنترنت",{positionClass: "toast-top-right",tapToDismiss: !1,timeOut: 2e3,rtl: $("html").attr("data-textdirection")});}},

  success: function(response) {

    if(response.status){

            toastr.success("",response.message,{
			positionClass: "toast-top-right",
			tapToDismiss: !1,
			timeOut: 2e3,
			rtl: $("html").attr("data-textdirection")
		    });      
            document.getElementById("addForm").reset();

    }else{
        toastr.warning("",response.message,{
			positionClass: "toast-top-right",
			tapToDismiss: !1,
			timeOut: 2e3,
			rtl: $("html").attr("data-textdirection")
		    });   
    } 

  },
  error: function(response){
          $.each(response.responseJSON.errors, function (key, item) 
          {
            toastr.error("",item,{
			positionClass: "toast-top-right",
			tapToDismiss: !1,
			timeOut: 2e3,
			rtl: $("html").attr("data-textdirection")
		    });

          });
  },

 });

}));
    </script>

    <?php $__env->stopSection(); ?>
<?php echo $__env->make('client.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\xampp\htdocs\sales\resources\views/client/settings/billing.blade.php ENDPATH**/ ?>