mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-24 17:18:44 -04:00
Set update_row response datatype to html
Remove MY_Validation override (not needed anymore) Add jquery validation check for account_number
This commit is contained in:
1 parent
9d0fb43fb1
commit
c7c4ac15d6
15 files changed
+66
-39
No files matched your search
@@ -93,6 +93,12 @@ class Customers extends Person_controller
|
||||
}
|
||||
}
|
||||
|
||||
function check_account_number()
|
||||
{
|
||||
$exists = $this->Customer->account_number_exists($this->input->post('account_number'),$this->input->post('person_id'));
|
||||
echo json_encode(array('success'=>!$exists,'message'=>$this->lang->line('customers_account_number_duplicate')));
|
||||
}
|
||||
|
||||
/*
|
||||
This deletes customers from the customers table
|
||||
*/
|
||||
|
||||
@@ -14,3 +14,4 @@ $lang["customers_successful_deleted"] = "You have successfully deleted";
|
||||
$lang["customers_successful_updating"] = "You have successfully updated customer";
|
||||
$lang["customers_taxable"] = "Taxable";
|
||||
$lang["customers_update"] = "Update Customer";
|
||||
$lang["customers_account_number_duplicate"] = "This account number is already present in the database";
|
||||
@@ -14,3 +14,4 @@ $lang["customers_successful_deleted"] = "Has borrado satisfactoriamente a";
|
||||
$lang["customers_successful_updating"] = "No se ha podido agregar el cliente";
|
||||
$lang["customers_taxable"] = "Gravable";
|
||||
$lang["customers_update"] = "Actualizar Cliente";
|
||||
$lang["customers_account_number_duplicate"] = "This account number is already present in the database";
|
||||
@@ -14,3 +14,4 @@ $lang["customers_successful_deleted"] = "Suppréssion réussie";
|
||||
$lang["customers_successful_updating"] = "Édition client réussie";
|
||||
$lang["customers_taxable"] = "Imposable";
|
||||
$lang["customers_update"] = "Éditer Client";
|
||||
$lang["customers_account_number_duplicate"] = "This account number is already present in the database";
|
||||
@@ -14,3 +14,4 @@ $lang["customers_successful_deleted"] = "Anda telah berhasil menghapus pelanggan
|
||||
$lang["customers_successful_updating"] = "Anda telah berhasil memperbarui pelanggan";
|
||||
$lang["customers_taxable"] = "Dapat dikenakan pajak";
|
||||
$lang["customers_update"] = "Ubah Pelanggan";
|
||||
$lang["customers_account_number_duplicate"] = "This account number is already present in the database";
|
||||
@@ -14,3 +14,4 @@ $lang["customers_successful_deleted"] = "Er werd(en)";
|
||||
$lang["customers_successful_updating"] = "Wijzigingen klantgegevens bewaard voor ";
|
||||
$lang["customers_taxable"] = "Belastbaar";
|
||||
$lang["customers_update"] = "Bewerk Klant";
|
||||
$lang["customers_account_number_duplicate"] = "Deze VAT nummer is reeds aanwezig in de database";
|
||||
@@ -14,3 +14,4 @@ $lang["customers_successful_deleted"] = "Вы успешно удалили";
|
||||
$lang["customers_successful_updating"] = "Вы успешно обновили клиент";
|
||||
$lang["customers_taxable"] = "облагаемый";
|
||||
$lang["customers_update"] = "Обновлять Клиент";
|
||||
$lang["customers_account_number_duplicate"] = "This account number is already present in the database";
|
||||
@@ -14,3 +14,4 @@ $lang["customers_successful_deleted"] = "คุณได้ทำการลบ
|
||||
$lang["customers_successful_updating"] = "คุณได้ทำการแก้ไขข้อมูลลูกค้าเรียบร้อยแล้ว";
|
||||
$lang["customers_taxable"] = "ต้องเสียภาษี";
|
||||
$lang["customers_update"] = "แก้ไขข้อมูลลูกค้า";
|
||||
$lang["customers_account_number_duplicate"] = "This account number is already present in the database";
|
||||
@@ -14,3 +14,4 @@ $lang["customers_successful_deleted"] = "Silme başarılı";
|
||||
$lang["customers_successful_updating"] = "Müşteri güncellendi";
|
||||
$lang["customers_taxable"] = "Vergilendirilebilir";
|
||||
$lang["customers_update"] = "Müşteri Güncelle";
|
||||
$lang["customers_account_number_duplicate"] = "This account number is already present in the database";
|
||||
@@ -14,3 +14,4 @@ $lang["customers_successful_deleted"] = "成功刪除";
|
||||
$lang["customers_successful_updating"] = "成功更新顧客";
|
||||
$lang["customers_taxable"] = "應課稅";
|
||||
$lang["customers_update"] = "更新客戶";
|
||||
$lang["customers_account_number_duplicate"] = "This account number is already present in the database";
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
class MY_Form_validation extends CI_Form_validation
|
||||
{
|
||||
function MY_Form_validation($rules = array())
|
||||
{
|
||||
parent::__construct($rules);
|
||||
}
|
||||
|
||||
function get_error_message()
|
||||
{
|
||||
return $this->error_string;
|
||||
}
|
||||
|
||||
function get_error_messages()
|
||||
{
|
||||
return $this->_error_array;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -14,6 +14,19 @@ class Customer extends Person
|
||||
return ($query->num_rows()==1);
|
||||
}
|
||||
|
||||
function account_number_exists($account_number,$person_id='')
|
||||
{
|
||||
$this->db->from('customers');
|
||||
$this->db->where('account_number', $account_number);
|
||||
if (!empty($person_id))
|
||||
{
|
||||
$this->db->where('person_id !=', $person_id);
|
||||
}
|
||||
$query=$this->db->get();
|
||||
return ($query->num_rows()==1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Returns all the customers
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ echo form_open('customers/save/'.$person_info->person_id,array('id'=>'customer_f
|
||||
<?php echo form_input(array(
|
||||
'name'=>'account_number',
|
||||
'id'=>'account_number',
|
||||
'class'=>'account_number',
|
||||
'value'=>$person_info->account_number)
|
||||
);?>
|
||||
</div>
|
||||
@@ -41,6 +42,24 @@ echo form_close();
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
$.validator.addMethod("account_number", function(value, element)
|
||||
{
|
||||
return JSON.parse($.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
url: '<?php echo site_url($controller_name . "/check_account_number")?>',
|
||||
data: {'person_id' : '<?php echo $person_info->person_id; ?>', 'account_number' : $(element).val() },
|
||||
success: function(response)
|
||||
{
|
||||
success=response.success;
|
||||
},
|
||||
async:false,
|
||||
dataType: 'json'
|
||||
}).responseText).success;
|
||||
|
||||
}, '<?php echo $this->lang->line("customers_account_number_duplicate"); ?>');
|
||||
|
||||
$('#customer_form').validate({
|
||||
submitHandler:function(form)
|
||||
{
|
||||
@@ -60,7 +79,8 @@ $(document).ready(function()
|
||||
{
|
||||
first_name: "required",
|
||||
last_name: "required",
|
||||
email: "email"
|
||||
email: "email",
|
||||
account_number: { account_number: true }
|
||||
},
|
||||
messages:
|
||||
{
|
||||
|
||||
+1
-1
@@ -292,7 +292,7 @@ function update_row(row_id,url,callback)
|
||||
reinit_row(row_id);
|
||||
hightlight_row(row_id);
|
||||
callback && typeof(callback) == "function" && callback();
|
||||
});
|
||||
}, 'html');
|
||||
}
|
||||
|
||||
function reinit_row(checkbox_id)
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
"label","nl-BE","es","en","fr","zh","ru","th","tr","id"
|
||||
"customers_account_number","Btwnummer","Cuenta #","Account #","# Compte","帳號 #","Номер счота","บัญชี #","Hesap No","No.Pelanggan"
|
||||
"customers_basic_information","Klantgegevens","Información de Clientes","Customer Information","Informations Client","客戶資訊","Информация о клиенте","ข้อมูลลูกค้า","Müşteri bilgisi","Informasi Pelanggan"
|
||||
"customers_cannot_be_deleted","De geselecteerde klanten konden niet worden verwijderd. Eén of meerdere klanten hebben verkoopsgegevens in de database zitten.","No se pudo borrar los clientes seleccionados. Uno o más de éstos tiene ventas.","Could not deleted selected customers, one or more of the selected customers has sales.","Impossible de supprimer. Un ou plusiers client(s) sélectionné(s) ont des ventes.","無法刪除選定的客戶,選定的客戶存有銷售紀錄。","Невозможно удалить выбранных клиентов, один или более из них имеет продаж.","ไม่สามารลบลูกค้าที่ถูกเลือก, ลูกค้าที่ถูกเลือกถูขายไปแล้ว.","Seçili müşteriler silinemedi, müşterilerin satışları var.","pelanggan terpilih tidak bisa dihapus; satu atau lebih dari pelanggan yang dipilih memiliki penjualan."
|
||||
"customers_confirm_delete","Bent u zeker dat u de geselecteerde klanten wil verwijderen?","¿Estás seguro(a) de que quieres borrar a los clientes seleccionados?","Are you sure you want to delete the selected customers?","Etes vous sûr(e) de vouloir supprimer ces clients?","你確定要刪除選定的客戶?","Вы уверены, что хотите удалить выбранных клиентов?","ยืนยันลบข้อมูลลูกค้า?","Seçili müşteriyi silmek istediğinize emin misiniz?","Apakah Anda yakin ingin menghapus pelanggan yang dipilih?"
|
||||
"customers_customer","Klant","Cliente","Customer","Client","客戶","Клиент","ลูกค้า","Müşteri","Pelanggan"
|
||||
"customers_error_adding_updating","Fout bij het toevoegen/bewerken van een klant","Error agregando/actualizando cliente","Error adding/updating customer","Érreur lors de l\'ajout/suppression de client","添加/更新客戶錯誤","Ошибка при добавлении/обновлении клиента","แก้ไขข้อมูลลูกค้าผิดพลาด","Müşteri ekleme/güncelleme hatası","Menambah / Memperbarui Pelanggan Salah"
|
||||
"customers_new","Nieuwe Klant","Nuevo Cliente","New Customer","Nouveau Client","新客戶","Новый Клиент","ลูกค้าใหม่","Yeni Müşteri","Pelanggan Baru"
|
||||
"customers_none_selected","U hebt geen klanten geselecteerd","No has selccionado clientes para ser borrados","You have not selected any customers to delete","Vous n\\\'avez pas sélectionné de client à supprimer","您還沒有選擇任何客戶進行刪除","Вы не выбрали ни клиентов, чтобы удалить.","คุณยังไม่ได้ทำการเลือกลูกค้า","Silmek için müşteri seçmediniz","Anda belum memilih pelanggan untuk dihapus"
|
||||
"customers_one_or_multiple","klant(en) verwijderd","cliente(s)","customer(s)","client(s)","客戶","клиент(ов)","ลูกค้า","müşteri","pelanggan"
|
||||
"customers_successful_adding","Klant succesvol aangemaakt","Has agregado satisfactoriamente el cliente","You have successfully added customer","Vous avez ajouté un nouveau client","成功新增顧客","Вы успешно добавили клиентов","คุณได้ทำการเพิ่มลูกค้าเรียบร้อยแล้ว","Müşteri eklendi","Anda telah berhasil menambah pelanggan"
|
||||
"customers_successful_deleted","Er werd(en)","Has borrado satisfactoriamente a","You have successfully deleted","Suppréssion réussie","成功刪除","Вы успешно удалили","คุณได้ทำการลบข้อมูลเรียบร้อยแล้ว","Silme başarılı","Anda telah berhasil menghapus pelanggan"
|
||||
"customers_successful_updating","Wijzigingen klantgegevens bewaard voor ","No se ha podido agregar el cliente","You have successfully updated customer","Édition client réussie","成功更新顧客","Вы успешно обновили клиент","คุณได้ทำการแก้ไขข้อมูลลูกค้าเรียบร้อยแล้ว","Müşteri güncellendi","Anda telah berhasil memperbarui pelanggan"
|
||||
"customers_taxable","Belastbaar","Gravable","Taxable","Imposable","應課稅","облагаемый","ต้องเสียภาษี","Vergilendirilebilir","Dapat dikenakan pajak"
|
||||
"customers_update","Bewerk Klant","Actualizar Cliente","Update Customer","Éditer Client","更新客戶","Обновлять Клиент","แก้ไขข้อมูลลูกค้า","Müşteri Güncelle","Ubah Pelanggan"
|
||||
label,nl-BE,es,en,fr,zh,ru,th,tr,id
|
||||
customers_account_number,Btwnummer,Cuenta #,Account #,# Compte,帳號 #,Номер счота,บัญชี #,Hesap No,No.Pelanggan
|
||||
customers_basic_information,Klantgegevens,Información de Clientes,Customer Information,Informations Client,客戶資訊,Информация о клиенте,ข้อมูลลูกค้า,Müşteri bilgisi,Informasi Pelanggan
|
||||
customers_cannot_be_deleted,De geselecteerde klanten konden niet worden verwijderd. Eén of meerdere klanten hebben verkoopsgegevens in de database zitten.,No se pudo borrar los clientes seleccionados. Uno o más de éstos tiene ventas.,"Could not deleted selected customers, one or more of the selected customers has sales.",Impossible de supprimer. Un ou plusiers client(s) sélectionné(s) ont des ventes.,無法刪除選定的客戶,選定的客戶存有銷售紀錄。,"Невозможно удалить выбранных клиентов, один или более из них имеет продаж.","ไม่สามารลบลูกค้าที่ถูกเลือก, ลูกค้าที่ถูกเลือกถูขายไปแล้ว.","Seçili müşteriler silinemedi, müşterilerin satışları var.",pelanggan terpilih tidak bisa dihapus; satu atau lebih dari pelanggan yang dipilih memiliki penjualan.
|
||||
customers_confirm_delete,Bent u zeker dat u de geselecteerde klanten wil verwijderen?,¿Estás seguro(a) de que quieres borrar a los clientes seleccionados?,Are you sure you want to delete the selected customers?,Etes vous sûr(e) de vouloir supprimer ces clients?,你確定要刪除選定的客戶?,"Вы уверены, что хотите удалить выбранных клиентов?",ยืนยันลบข้อมูลลูกค้า?,Seçili müşteriyi silmek istediğinize emin misiniz?,Apakah Anda yakin ingin menghapus pelanggan yang dipilih?
|
||||
customers_customer,Klant,Cliente,Customer,Client,客戶,Клиент,ลูกค้า,Müşteri,Pelanggan
|
||||
customers_error_adding_updating,Fout bij het toevoegen/bewerken van een klant,Error agregando/actualizando cliente,Error adding/updating customer,Érreur lors de l\'ajout/suppression de client,添加/更新客戶錯誤,Ошибка при добавлении/обновлении клиента,แก้ไขข้อมูลลูกค้าผิดพลาด,Müşteri ekleme/güncelleme hatası,Menambah / Memperbarui Pelanggan Salah
|
||||
customers_new,Nieuwe Klant,Nuevo Cliente,New Customer,Nouveau Client,新客戶,Новый Клиент,ลูกค้าใหม่,Yeni Müşteri,Pelanggan Baru
|
||||
customers_none_selected,U hebt geen klanten geselecteerd,No has selccionado clientes para ser borrados,You have not selected any customers to delete,Vous n\\\'avez pas sélectionné de client à supprimer,您還沒有選擇任何客戶進行刪除,"Вы не выбрали ни клиентов, чтобы удалить.",คุณยังไม่ได้ทำการเลือกลูกค้า,Silmek için müşteri seçmediniz,Anda belum memilih pelanggan untuk dihapus
|
||||
customers_one_or_multiple,klant(en) verwijderd,cliente(s),customer(s),client(s),客戶,клиент(ов),ลูกค้า,müşteri,pelanggan
|
||||
customers_successful_adding,Klant succesvol aangemaakt,Has agregado satisfactoriamente el cliente,You have successfully added customer,Vous avez ajouté un nouveau client,成功新增顧客,Вы успешно добавили клиентов,คุณได้ทำการเพิ่มลูกค้าเรียบร้อยแล้ว,Müşteri eklendi,Anda telah berhasil menambah pelanggan
|
||||
customers_successful_deleted,Er werd(en),Has borrado satisfactoriamente a,You have successfully deleted,Suppréssion réussie,成功刪除,Вы успешно удалили,คุณได้ทำการลบข้อมูลเรียบร้อยแล้ว,Silme başarılı,Anda telah berhasil menghapus pelanggan
|
||||
customers_successful_updating,Wijzigingen klantgegevens bewaard voor ,No se ha podido agregar el cliente,You have successfully updated customer,Édition client réussie,成功更新顧客,Вы успешно обновили клиент,คุณได้ทำการแก้ไขข้อมูลลูกค้าเรียบร้อยแล้ว,Müşteri güncellendi,Anda telah berhasil memperbarui pelanggan
|
||||
customers_taxable,Belastbaar,Gravable,Taxable,Imposable,應課稅,облагаемый,ต้องเสียภาษี,Vergilendirilebilir,Dapat dikenakan pajak
|
||||
customers_update,Bewerk Klant,Actualizar Cliente,Update Customer,Éditer Client,更新客戶,Обновлять Клиент,แก้ไขข้อมูลลูกค้า,Müşteri Güncelle,Ubah Pelanggan
|
||||
customers_account_number_duplicate,Deze VAT nummer is reeds aanwezig in de database,This account number is already present in the database,This account number is already present in the database,This account number is already present in the database,This account number is already present in the database,This account number is already present in the database,This account number is already present in the database,This account number is already present in the database,This account number is already present in the database
|
||||
|
Reference in new issue
Block a user