mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 19:56:29 +01:00
invoice save text fix
This commit is contained in:
parent
a645d292d5
commit
45bcc7bc9b
7 changed files with 27 additions and 106 deletions
|
@ -111,7 +111,7 @@ sub battery_percent {
|
||||||
my $max_bars = shift || 0;
|
my $max_bars = shift || 0;
|
||||||
my $current_bars = shift || 0;#by user input
|
my $current_bars = shift || 0;#by user input
|
||||||
|
|
||||||
my $current_percent = 0;
|
my $current_percent = 1;#keep 1 % for Mietjournal view
|
||||||
if($max_bars == 5){
|
if($max_bars == 5){
|
||||||
$current_percent = 10 if($current_bars >= 1);
|
$current_percent = 10 if($current_bars >= 1);
|
||||||
$current_percent = 30 if($current_bars >= 2);
|
$current_percent = 30 if($current_bars >= 2);
|
||||||
|
|
|
@ -812,9 +812,11 @@ sub fetch_tablerecord(){
|
||||||
$where .= " and $key $op $value";
|
$where .= " and $key $op $value";
|
||||||
}elsif($key =~ /time$/ && $value){
|
}elsif($key =~ /time$/ && $value){
|
||||||
$where .= " and $key $op '$value'";
|
$where .= " and $key $op '$value'";
|
||||||
}elsif($key =~ /^(c_id|u_id|ct_id|ca_id|barcode|int\d+|owner|template_id)$/ && $value){
|
}elsif($key =~ /^(c_id|u_id|ct_id|ca_id|barcode|int\d+|owner|template_id)$/ && (looks_like_number($value) || $value)){
|
||||||
if($value eq "null"){
|
if($value eq "null"){
|
||||||
$where .= " and ($key is null OR $key = 0)";
|
$where .= " and ($key is null OR $key = 0)";
|
||||||
|
}elsif($value eq "nullOR1"){
|
||||||
|
$where .= " and ($key is null OR $key = 1)";
|
||||||
}else{
|
}else{
|
||||||
$where .= " and $key $op $value";
|
$where .= " and $key $op $value";
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,9 +348,9 @@ sub handler {
|
||||||
if($R::rel_edit eq "save_relation" && $R::main_id && $R::main_id >= 200000){
|
if($R::rel_edit eq "save_relation" && $R::main_id && $R::main_id >= 200000){
|
||||||
$return = $pl->save_relation($q,$R::main_id,$users_dms->{u_id});
|
$return = $pl->save_relation($q,$R::main_id,$users_dms->{u_id});
|
||||||
}elsif($R::rel_edit eq "delete_relation" && $R::main_id && $R::main_id >= 200000){
|
}elsif($R::rel_edit eq "delete_relation" && $R::main_id && $R::main_id >= 200000){
|
||||||
$return = $pl->delete_relation($R::main_id,$users_dms->{u_id});
|
$return = $pl->delete_relation($q,$R::main_id,$users_dms->{u_id});
|
||||||
}elsif($R::rel_edit eq "new_relation" && $R::main_id && $R::main_id >= 200000){
|
}elsif($R::rel_edit eq "new_relation" && $R::main_id && $R::main_id >= 200000){
|
||||||
$return = $pl->new_relation($R::main_id,$users_dms->{u_id});
|
$return = $pl->new_relation($q,$R::main_id,$users_dms->{u_id});
|
||||||
}elsif($R::rel_edit eq "save_ctuser" && $R::main_id && $R::main_id >= 200000){
|
}elsif($R::rel_edit eq "save_ctuser" && $R::main_id && $R::main_id >= 200000){
|
||||||
#$return = "failure::under development, $node_meta->{tpl_name}";
|
#$return = "failure::under development, $node_meta->{tpl_name}";
|
||||||
$return = $pl->save_service_desc($q,$R::c_id,$users_dms);
|
$return = $pl->save_service_desc($q,$R::c_id,$users_dms);
|
||||||
|
@ -375,14 +375,14 @@ sub handler {
|
||||||
if($users_dms_primary->{u_id} && $users_dms_primary->{int03} == 2 && $users_dms->{u_id} && $users_dms->{int03} == 2){#DMS Faktura rw
|
if($users_dms_primary->{u_id} && $users_dms_primary->{int03} == 2 && $users_dms->{u_id} && $users_dms->{int03} == 2){#DMS Faktura rw
|
||||||
$db->update_users4trans($R::c_id4trans,$R::tpl_id4trans,"",$users_dms->{u_id}) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans));
|
$db->update_users4trans($R::c_id4trans,$R::tpl_id4trans,"",$users_dms->{u_id}) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans));
|
||||||
if($R::ct_trans =~ /set_workflow2invoice|set_workflow2storno/){
|
if($R::ct_trans =~ /set_workflow2invoice|set_workflow2storno/){
|
||||||
$return = $pl->set_workflow($users_dms,$R::c_id4trans,$R::set_main_id4workflow) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans) && looks_like_number($R::set_main_id4workflow));
|
$return = $pl->set_workflow($q,$users_dms,$R::c_id4trans,$R::set_main_id4workflow) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans) && looks_like_number($R::set_main_id4workflow));
|
||||||
}elsif($R::ct_trans =~ /set_accounting2invoice/){
|
}elsif($R::ct_trans =~ /set_accounting2invoice/){
|
||||||
$return = $pl->set_accounting2invoice($users_dms,$R::c_id4trans,$R::set_main_id4workflow) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans) && looks_like_number($R::set_main_id4workflow));
|
$return = $pl->set_accounting2invoice($q,$users_dms,$R::c_id4trans,$R::set_main_id4workflow) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans) && looks_like_number($R::set_main_id4workflow));
|
||||||
}elsif($R::ct_trans =~ /save_text|save_adr/){
|
}elsif($R::ct_trans =~ /save_text|save_adr/){
|
||||||
$return = $pl->save_text2contenttrans($users_dms,$R::c_id4trans) if(looks_like_number($R::c_id4trans));
|
$return = $pl->save_text2contenttrans($q,$users_dms,$R::c_id4trans) if(looks_like_number($R::c_id4trans));
|
||||||
}elsif($R::detail_search && $R::detail_search eq "operator_accounting"){
|
}elsif($R::detail_search && $R::detail_search eq "operator_accounting"){
|
||||||
my $ck4ex = "@R::ck4ex" || "";
|
my $ck4ex = "@R::ck4ex" || "";
|
||||||
$return = $pl->operator_accounting($users_dms,$users_sharee,$R::accounting_type,$ck4ex);
|
$return = $pl->operator_accounting($q,$users_dms,$users_sharee,$R::accounting_type,$ck4ex);
|
||||||
}else{
|
}else{
|
||||||
$return .= "|";
|
$return .= "|";
|
||||||
$return .= $pre->preinit($users_dms,$lang);#transactions logic
|
$return .= $pre->preinit($users_dms,$lang);#transactions logic
|
||||||
|
@ -394,12 +394,12 @@ sub handler {
|
||||||
|
|
||||||
#DMS Mietjournal
|
#DMS Mietjournal
|
||||||
if($node_meta->{ct_table} eq "contenttranspos" && $R::base_edit eq "save_pos"){
|
if($node_meta->{ct_table} eq "contenttranspos" && $R::base_edit eq "save_pos"){
|
||||||
$return = $pl->save_contenttranspos($R::c_id,$users_dms->{u_id});
|
$return = $pl->save_contenttranspos($q,$R::c_id,$users_dms->{u_id});
|
||||||
}
|
}
|
||||||
|
|
||||||
#DMS insert part or fee
|
#DMS insert part or fee
|
||||||
if($node_meta->{ct_table} eq "contenttranspos" && $R::insert_contenttranspos){
|
if($node_meta->{ct_table} eq "contenttranspos" && $R::insert_contenttranspos){
|
||||||
$return = $pl->insert_contenttranspos($R::cc_id,$R::ca_id,$R::ct_id,$users_dms->{u_id});
|
$return = $pl->insert_contenttranspos($q,$R::cc_id,$R::ca_id,$R::ct_id,$users_dms->{u_id});
|
||||||
}
|
}
|
||||||
|
|
||||||
$users_dms = $dbt->select_users($dbh,$users_dms->{u_id},"");#just to get update after save
|
$users_dms = $dbt->select_users($dbh,$users_dms->{u_id},"");#just to get update after save
|
||||||
|
|
|
@ -452,81 +452,6 @@ sub checkdate(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#collect node_name and builds path
|
|
||||||
sub make_uri2(){
|
|
||||||
my $self = shift;
|
|
||||||
my ($main_id,$lang,$mandantsub_id,$start_id) = @_;
|
|
||||||
my $gpath;
|
|
||||||
my $m_id;
|
|
||||||
my @genpath;
|
|
||||||
my $i=$1 if($main_id =~ /^(\d)/);
|
|
||||||
foreach my $id (sort {$nall->{$b}->{main_id} <=> $nall->{$a}->{main_id}} keys (%$nall)){
|
|
||||||
#print "xxxx ($main_id =~ /^($i\d+)/) && ($start_id && $main_id >= $start_id) && ($main_id == $nall->{$id}->{main_id})<br>";
|
|
||||||
if(($main_id =~ /^($i\d+)/) && ($start_id && $main_id >= $start_id) && ($main_id == $nall->{$id}->{main_id})){
|
|
||||||
## wegen multible mandanten sub-sub-level, bsp. Waren/[300] Sonstiges
|
|
||||||
if($mandantsub_id && $i==3){
|
|
||||||
if($mandantsub_id == $nall->{$id}->{parent_id}){
|
|
||||||
$i--;
|
|
||||||
$main_id = $nall->{$id}->{parent_id};
|
|
||||||
$m_id = $nall->{$id}->{main_id} if(!$m_id);
|
|
||||||
$genpath[$i] = "/$nall->{$id}->{node_name}";
|
|
||||||
#print "$i x/$nall->{$id}->{node_name} ($nall->{$id}->{main_id})<br />";
|
|
||||||
}
|
|
||||||
##
|
|
||||||
}else{
|
|
||||||
$i--;
|
|
||||||
$main_id = $nall->{$id}->{parent_id};
|
|
||||||
$main_id = $start_id if($start_id && $i==1);
|
|
||||||
$m_id = $nall->{$id}->{main_id} if(!$m_id);
|
|
||||||
$genpath[$i] = "/$nall->{$id}->{node_name}";
|
|
||||||
#print "$i /$nall->{$id}->{node_name} ($nall->{$id}->{main_id})<br />";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (@genpath){
|
|
||||||
#print "$_|";
|
|
||||||
$_ =~ s/\/root//;
|
|
||||||
$gpath .= "$_";
|
|
||||||
}
|
|
||||||
return ("$m_id","$gpath");
|
|
||||||
}
|
|
||||||
|
|
||||||
#new init for make_uri3 with returning nall object
|
|
||||||
sub init_nodes5uri(){
|
|
||||||
my $self = shift;
|
|
||||||
$nall = $db->collect_node4all();
|
|
||||||
return $nall;
|
|
||||||
}
|
|
||||||
|
|
||||||
#5. collect node_name and builds path without mandant-logic
|
|
||||||
sub make_uri5(){
|
|
||||||
my $self = shift;
|
|
||||||
my ($main_id,$nall,$depth_start) = @_;
|
|
||||||
$depth_start = 0 if(!$depth_start);
|
|
||||||
my $gpath;
|
|
||||||
my $m_id;
|
|
||||||
my @genpath;
|
|
||||||
my $depth=$1 if($main_id =~ /^(\d)/ && $main_id >= 100000);
|
|
||||||
foreach my $id (sort {$nall->{$b}->{main_id} <=> $nall->{$a}->{main_id}} keys (%$nall)){
|
|
||||||
if(($main_id =~ /^($depth\d+)/) && ($main_id == $nall->{$id}->{main_id})){
|
|
||||||
$depth--;
|
|
||||||
$main_id = $nall->{$id}->{parent_id};
|
|
||||||
$m_id = $nall->{$id}->{main_id} if(!$m_id);
|
|
||||||
$genpath[$depth] = "/$nall->{$id}->{node_name}" if($depth > $depth_start);
|
|
||||||
#print "$depth|$main_id /$nall->{$id}->{node_name} ($nall->{$id}->{main_id})<br />";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (@genpath){
|
|
||||||
#print "$_|";
|
|
||||||
$_ =~ s/\/root//;
|
|
||||||
$gpath .= "$_";
|
|
||||||
}
|
|
||||||
return ("$m_id","$gpath");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub sub4txt(){
|
sub sub4txt(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($txt,$index,$length,$cut,$cut_last) = @_;
|
my ($txt,$index,$length,$cut,$cut_last) = @_;
|
||||||
|
@ -563,28 +488,14 @@ sub sub4txt(){
|
||||||
|
|
||||||
sub newline(){
|
sub newline(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $txtxx = shift;
|
my $txtxx = shift || "";
|
||||||
my $not_used = shift || "";#old
|
my $not_used = shift || "";#old
|
||||||
my $editor = shift || "";
|
my $editor = shift || "";
|
||||||
$txtxx =~ s/\r\n/<br \/>/g if(!$editor);
|
if($txtxx && !$editor){
|
||||||
$txtxx =~ s/\n/<br \/>/g if(!$editor);
|
$txtxx =~ s/\r\n/<br \/>/g;
|
||||||
return $txtxx;
|
$txtxx =~ s/\n/<br \/>/g;
|
||||||
}
|
|
||||||
|
|
||||||
#der tiny_mce editor init
|
|
||||||
sub wyedit(){
|
|
||||||
my $self = shift;
|
|
||||||
my ($users_tiny_mce) = @_;
|
|
||||||
my $wy="";
|
|
||||||
if($varenv{js4tiny_mce} && $users_tiny_mce){
|
|
||||||
$wy = "<script type='text/javascript'>
|
|
||||||
tinyMCE.init({
|
|
||||||
theme : \"advanced\",
|
|
||||||
mode : \"textareas\",
|
|
||||||
});
|
|
||||||
</script>";
|
|
||||||
}
|
}
|
||||||
return $wy;
|
return $txtxx;
|
||||||
}
|
}
|
||||||
|
|
||||||
#Komplettset compset logic
|
#Komplettset compset logic
|
||||||
|
|
|
@ -34,7 +34,6 @@ my $bw = new Basework;
|
||||||
my $apif = new APIfunc;
|
my $apif = new APIfunc;
|
||||||
my $pri = new Pricing;
|
my $pri = new Pricing;
|
||||||
my $si = new APIsigclient;
|
my $si = new APIsigclient;
|
||||||
my $q = new CGI;
|
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
|
@ -55,6 +54,7 @@ my $debug=1;
|
||||||
#save invoice address or text
|
#save invoice address or text
|
||||||
sub save_text2contenttrans {
|
sub save_text2contenttrans {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $q = shift;
|
||||||
my $users_dms = shift;
|
my $users_dms = shift;
|
||||||
my $c_id = shift;
|
my $c_id = shift;
|
||||||
|
|
||||||
|
@ -94,6 +94,7 @@ sub save_text2contenttrans {
|
||||||
#part or fee to invoice
|
#part or fee to invoice
|
||||||
sub insert_contenttranspos {
|
sub insert_contenttranspos {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $q = shift;
|
||||||
my $cc_id = shift || "";#part
|
my $cc_id = shift || "";#part
|
||||||
my $ca_id = shift || "";#adr
|
my $ca_id = shift || "";#adr
|
||||||
my $ct_id = shift || "";#invoice
|
my $ct_id = shift || "";#invoice
|
||||||
|
@ -160,6 +161,7 @@ sub insert_contenttranspos {
|
||||||
|
|
||||||
sub save_contenttranspos {
|
sub save_contenttranspos {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $q = shift;
|
||||||
my $c_id = shift;
|
my $c_id = shift;
|
||||||
my $owner = shift;
|
my $owner = shift;
|
||||||
|
|
||||||
|
@ -379,6 +381,7 @@ sub save_contenttranspos {
|
||||||
#set Faktura workflow like Rechnung to Storno
|
#set Faktura workflow like Rechnung to Storno
|
||||||
sub set_workflow {
|
sub set_workflow {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $q = shift;
|
||||||
my $users_dms = shift;
|
my $users_dms = shift;
|
||||||
my $c_id = shift;
|
my $c_id = shift;
|
||||||
my $set_main_id = shift || "";
|
my $set_main_id = shift || "";
|
||||||
|
@ -479,6 +482,7 @@ sub set_workflow {
|
||||||
#generate invoice from operator accounting
|
#generate invoice from operator accounting
|
||||||
sub set_accounting2invoice {
|
sub set_accounting2invoice {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $q = shift;
|
||||||
my $users_dms = shift;
|
my $users_dms = shift;
|
||||||
my $c_id = shift;
|
my $c_id = shift;
|
||||||
my $set_main_id = shift || "";
|
my $set_main_id = shift || "";
|
||||||
|
@ -541,6 +545,7 @@ sub set_accounting2invoice {
|
||||||
#new node relation with option to create subnode for Servicelog
|
#new node relation with option to create subnode for Servicelog
|
||||||
sub new_relation {
|
sub new_relation {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $q = shift;
|
||||||
my $main_id = shift;
|
my $main_id = shift;
|
||||||
my $owner = shift;
|
my $owner = shift;
|
||||||
my %varenv = $cf->envonline();
|
my %varenv = $cf->envonline();
|
||||||
|
@ -716,6 +721,7 @@ sub save_relation {
|
||||||
#delete node relation with some ki deleting sub content
|
#delete node relation with some ki deleting sub content
|
||||||
sub delete_relation {
|
sub delete_relation {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $q = shift;
|
||||||
my $main_id = shift;
|
my $main_id = shift;
|
||||||
my $owner = shift;
|
my $owner = shift;
|
||||||
my %varenv = $cf->envonline();
|
my %varenv = $cf->envonline();
|
||||||
|
@ -916,6 +922,7 @@ sub save_service_desc {
|
||||||
#Operator Accounting
|
#Operator Accounting
|
||||||
sub operator_accounting {
|
sub operator_accounting {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $q = shift;
|
||||||
my $users_dms = shift;
|
my $users_dms = shift;
|
||||||
my $users_sharee = shift;
|
my $users_sharee = shift;
|
||||||
my $accounting_type = shift || "";
|
my $accounting_type = shift || "";
|
||||||
|
|
|
@ -402,7 +402,7 @@ sub tpl(){
|
||||||
my $user_device = "";
|
my $user_device = "";
|
||||||
my $charge = "";
|
my $charge = "";
|
||||||
$charge .= " → lock-charge $cttpos->{$pid}->{int14} %" if(looks_like_number($cttpos->{$pid}->{int14}));
|
$charge .= " → lock-charge $cttpos->{$pid}->{int14} %" if(looks_like_number($cttpos->{$pid}->{int14}));
|
||||||
$charge .= " → bike-charge $cttpos->{$pid}->{int19} %" if(looks_like_number($cttpos->{$pid}->{int19}));
|
$charge .= " → bike-charge $cttpos->{$pid}->{int19} %" if(looks_like_number($cttpos->{$pid}->{int19}) && $cttpos->{$pid}->{int19} >= 1);
|
||||||
if($users_dms_primary->{u_id} && $dbt->{copri_conf}->{contributors} && $users_dms_primary->{u_id} =~ /$dbt->{copri_conf}->{contributors}/){
|
if($users_dms_primary->{u_id} && $dbt->{copri_conf}->{contributors} && $users_dms_primary->{u_id} =~ /$dbt->{copri_conf}->{contributors}/){
|
||||||
$pos_id = $q->div({-class=>"popup",-onclick=>"toggle_box('$pid')"},"$cttpos->{$pid}->{c_id}", $q->span({-class=>"popuptext",-id=>"$pid"},"$pos_details"));
|
$pos_id = $q->div({-class=>"popup",-onclick=>"toggle_box('$pid')"},"$cttpos->{$pid}->{c_id}", $q->span({-class=>"popuptext",-id=>"$pid"},"$pos_details"));
|
||||||
$user_device = "";
|
$user_device = "";
|
||||||
|
|
1
copri4/main/src/scripts/mailTransportInnofact.pl
Symbolic link
1
copri4/main/src/scripts/mailTransportInnofact.pl
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../../../../sharee.bike/copri-bike/main/src/scripts/mailTransportInnofact.pl
|
Loading…
Add table
Reference in a new issue