Revision 07d71c33
Von Stephan Köhler vor etwa 19 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
|
||
my ($self, $myconfig, $form) = @_;
|
||
|
||
# set pricegroup to default
|
||
if ($form->{klass}) { }
|
||
else { $form->{klass} = 0; }
|
||
|
||
# connect to database
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
##LINET
|
||
map({ $form->{"cp_${_}"} = $form->{"selected_cp_${_}"}
|
||
if ($form->{"selected_cp_${_}"});
|
||
map({
|
||
$form->{"cp_${_}"} = $form->{"selected_cp_${_}"}
|
||
if ($form->{"selected_cp_${_}"});
|
||
} qw(title greeting));
|
||
|
||
#
|
||
# escape '
|
||
map { $form->{$_} =~ s/\'/\'\'/g }
|
||
qw(customernumber name street zipcode city country homepage contact notes cp_title cp_greeting language);
|
||
qw(customernumber name street zipcode city country homepage contact notes cp_title cp_greeting language pricegroup);
|
||
##/LINET
|
||
# assign value discount, terms, creditlimit
|
||
$form->{discount} = $form->parse_amount($myconfig, $form->{discount});
|
||
... | ... | |
username = '$form->{username}',
|
||
salesman_id = '$form->{salesman_id}',
|
||
user_password = '$form->{user_password}',
|
||
c_vendor_id = '$form->{c_vendor_id}'
|
||
c_vendor_id = '$form->{c_vendor_id}',
|
||
klass = '$form->{klass}'
|
||
WHERE id = $form->{id}|;
|
||
$dbh->do($query) || $form->dberror($query);
|
||
|
||
... | ... | |
# connect to database
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
##LINET
|
||
map({ $form->{"cp_${_}"} = $form->{"selected_cp_${_}"}
|
||
if ($form->{"selected_cp_${_}"});
|
||
map({
|
||
$form->{"cp_${_}"} = $form->{"selected_cp_${_}"}
|
||
if ($form->{"selected_cp_${_}"});
|
||
} qw(title greeting));
|
||
|
||
# escape '
|
SL/Form.pm | ||
---|---|---|
$jsscript = qq|
|
||
<style type="text/css">\@import url(js/jscalendar/calendar-win2k-1.css);</style>
|
||
<script type="text/javascript" src="js/jscalendar/calendar.js"></script>
|
||
? <script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>
|
||
? <script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
|
||
<script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>
|
||
<script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
|
||
$self->{javascript}
|
||
|;
|
||
}
|
||
... | ... | |
|
||
$trigger_1 = qq|
|
||
Calendar.setup(
|
||
? {
|
||
??? inputField ?: "$inputField_1",
|
||
??? ifFormat ???:"$ifFormat",
|
||
???align ???: "$align_1", ????
|
||
??? button ?????: "$button_1"
|
||
? }
|
||
? );
|
||
{
|
||
inputField : "$inputField_1",
|
||
ifFormat :"$ifFormat",
|
||
align : "$align_1",
|
||
button : "$button_1"
|
||
}
|
||
);
|
||
|;
|
||
|
||
if ($qty == 2) {
|
||
$trigger_2 = qq|
|
||
Calendar.setup(
|
||
{
|
||
??? inputField ?: "$inputField_2",
|
||
?? ? ifFormat ???:"$ifFormat",
|
||
??? align ???: "$align_2", ????
|
||
??? button ?????: "$button_2"
|
||
? }
|
||
? );
|
||
inputField : "$inputField_2",
|
||
ifFormat :"$ifFormat",
|
||
align : "$align_2",
|
||
button : "$button_2"
|
||
}
|
||
);
|
||
|;
|
||
}
|
||
$jsscript = qq|
|
||
... | ... | |
}
|
||
|
||
|
||
sub get_pricegroup {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my ($self, $myconfig, $p) = @_;
|
||
|
||
my $dbh = $self->dbconnect($myconfig);
|
||
|
||
my $query = qq|SELECT p.id, p.pricegroup
|
||
FROM pricegroup p|;
|
||
|
||
$query .= qq|
|
||
ORDER BY pricegroup|;
|
||
|
||
if ($p->{all}) {
|
||
$query = qq|SELECT id, pricegroup FROM pricegroup
|
||
ORDER BY pricegroup|;
|
||
}
|
||
|
||
my $sth = $dbh->prepare($query);
|
||
$sth->execute || $self->dberror($query);
|
||
|
||
$self->{all_pricegroup} = ();
|
||
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
||
push @{ $self->{all_pricegroup} }, $ref;
|
||
}
|
||
$sth->finish;
|
||
$dbh->disconnect;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
|
||
sub audittrail {
|
||
my ($self, $dbh, $myconfig, $audittrail) = @_;
|
||
|
SL/IC.pm | ||
---|---|---|
#======================================================================
|
||
|
||
package IC;
|
||
|
||
use Data::Dumper;
|
||
sub get_part {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
... | ... | |
$form->{amount}{IC_expense} = $form->{expense_accno};
|
||
$form->{amount}{IC_cogs} = $form->{expense_accno};
|
||
|
||
# get prices
|
||
$query =
|
||
qq|SELECT p.parts_id, p.pricegroup_id, p.price, (SELECT pg.pricegroup FROM pricegroup pg WHERE pg.id=p.pricegroup_id) AS pricegroup FROM prices p
|
||
WHERE parts_id = $form->{id}
|
||
ORDER by pricegroup|;
|
||
|
||
$sth = $dbh->prepare($query);
|
||
$sth->execute || $form->dberror($query);
|
||
|
||
@pricegroups = ();
|
||
@pricegroups_not_used = ();
|
||
|
||
#for pricegroups
|
||
my $i = 1;
|
||
while (
|
||
($form->{"klass_$i"}, $form->{"pricegroup_id_$i"},
|
||
$form->{"price_$i"}, $form->{"pricegroup_$i"})
|
||
= $sth->fetchrow_array
|
||
) {
|
||
$form->{"price_$i"} = $form->round_amount($form->{"price_$i"}, 5);
|
||
$form->{"price_$i"} =
|
||
$form->format_amount($myconfig, $form->{"price_$i"}, 5);
|
||
push @pricegroups, $form->{"pricegroup_id_$i"};
|
||
$i++;
|
||
}
|
||
|
||
$sth->finish;
|
||
|
||
# get pricegroups
|
||
$query = qq|SELECT p.id, p.pricegroup FROM pricegroup p|;
|
||
|
||
$pkq = $dbh->prepare($query);
|
||
$pkq->execute || $form->dberror($query);
|
||
while ($pkr = $pkq->fetchrow_hashref(NAME_lc)) {
|
||
push @{ $form->{PRICEGROUPS} }, $pkr;
|
||
}
|
||
$pkq->finish;
|
||
|
||
#find not used pricegroups
|
||
while ($tmp = pop @{ $form->{PRICEGROUPS} }) {
|
||
my $insert = 0;
|
||
foreach $item (@pricegroups) {
|
||
if ($item eq $tmp->{id}) {
|
||
|
||
#drop
|
||
$insert = 1;
|
||
}
|
||
}
|
||
if ($insert == 0) {
|
||
push @pricegroups_not_used, $tmp;
|
||
}
|
||
}
|
||
|
||
# if not used pricegroups are avaible
|
||
if (@pricegroups_not_used) {
|
||
|
||
foreach $name (@pricegroups_not_used) {
|
||
$form->{"klass_$i"} = "$name->{id}";
|
||
$form->{"price_$i"} = $form->round_amount($form->{sellprice}, 5);
|
||
$form->{"price_$i"} =
|
||
$form->format_amount($myconfig, $form->{"price_$i"}, 5);
|
||
$form->{"pricegroup_id_$i"} = "$name->{id}";
|
||
$form->{"pricegroup_$i"} = "$name->{pricegroup}\n";
|
||
$i++;
|
||
}
|
||
}
|
||
|
||
#correct rows
|
||
$form->{price_rows} = $i - 1;
|
||
|
||
unless ($form->{item} eq 'service') {
|
||
|
||
# get makes
|
||
... | ... | |
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub get_pricegroups {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my ($self, $myconfig, $form) = @_;
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
my $i = 1;
|
||
my @pricegroups_not_used = ();
|
||
|
||
# get pricegroups
|
||
my $query = qq|SELECT p.id, p.pricegroup FROM pricegroup p|;
|
||
|
||
my $pkq = $dbh->prepare($query);
|
||
$pkq->execute || $form->dberror($query);
|
||
while ($pkr = $pkq->fetchrow_hashref(NAME_lc)) {
|
||
push @{ $form->{PRICEGROUPS} }, $pkr;
|
||
}
|
||
$pkq->finish;
|
||
|
||
#find not used pricegroups
|
||
while ($tmp = pop @{ $form->{PRICEGROUPS} }) {
|
||
push @pricegroups_not_used, $tmp;
|
||
}
|
||
|
||
# if not used pricegroups are avaible
|
||
if (@pricegroups_not_used) {
|
||
|
||
foreach $name (@pricegroups_not_used) {
|
||
$form->{"klass_$i"} = "$name->{id}";
|
||
$form->{"price_$i"} = $form->round_amount($form->{sellprice}, 5);
|
||
$form->{"price_$i"} =
|
||
$form->format_amount($myconfig, $form->{"price_$i"}, 5);
|
||
$form->{"pricegroup_id_$i"} = "$name->{id}";
|
||
$form->{"pricegroup_$i"} = "$name->{pricegroup}\n";
|
||
$i++;
|
||
}
|
||
}
|
||
|
||
#correct rows
|
||
$form->{price_rows} = $i - 1;
|
||
|
||
$dbh->disconnect;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
|
||
sub save {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
... | ... | |
WHERE id = $form->{id}|;
|
||
$dbh->do($query) || $form->dberror($query);
|
||
|
||
# delete price records
|
||
$query = qq|DELETE FROM prices
|
||
WHERE parts_id = $form->{id}|;
|
||
$dbh->do($query) || $form->dberror($query);
|
||
|
||
# insert price records only if different to sellprice
|
||
for my $i (1 .. $form->{price_rows}) {
|
||
if ($form->{"price_$i"} eq "0") {
|
||
$form->{"price_$i"} = $form->{sellprice};
|
||
}
|
||
if (( $form->{"price_$i"}
|
||
|| $form->{"klass_$i"}
|
||
|| $form->{"pricegroup_id_$i"}) and $form->{"price_$i"} != $form->{sellprice}) {
|
||
$klass = $form->parse_amount($myconfig, $form->{"klass_$i"});
|
||
$price = $form->parse_amount($myconfig, $form->{"price_$i"});
|
||
$pricegroup_id =
|
||
$form->parse_amount($myconfig, $form->{"pricegroup_id_$i"});
|
||
$query = qq|INSERT INTO prices (parts_id, pricegroup_id, price)
|
||
VALUES($form->{id},$pricegroup_id,$price)|;
|
||
$dbh->do($query) || $form->dberror($query);
|
||
}
|
||
}
|
||
|
||
# insert makemodel records
|
||
unless ($form->{item} eq 'service') {
|
||
for my $i (1 .. $form->{makemodel_rows}) {
|
SL/IS.pm | ||
---|---|---|
|
||
package IS;
|
||
|
||
use Data::Dumper;
|
||
|
||
sub invoice_details {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
... | ... | |
|
||
sub post_invoice {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
print STDERR "IS.pm-post_invoice\n";
|
||
my ($self, $myconfig, $form) = @_;
|
||
|
||
# connect to database, turn off autocommit
|
||
... | ... | |
? qq|'$form->{"deliverydate_$i"}'|
|
||
: "NULL";
|
||
|
||
|
||
# get pricegroup_id and save ist
|
||
($null, my $pricegroup_id) = split /--/, $form->{"sellprice_drag_$i"};
|
||
$pricegroup_id *= 1;
|
||
|
||
# save detail record in invoice table
|
||
$query = qq|INSERT INTO invoice (trans_id, parts_id, description, qty,
|
||
sellprice, fxsellprice, discount, allocated, assemblyitem,
|
||
unit, deliverydate, project_id, serialnumber)
|
||
unit, deliverydate, project_id, serialnumber, pricegroup_id)
|
||
VALUES ($form->{id}, $form->{"id_$i"},
|
||
'$form->{"description_$i"}', $form->{"qty_$i"},
|
||
$form->{"sellprice_$i"}, $fxsellprice,
|
||
$form->{"discount_$i"}, $allocated, 'f',
|
||
'$form->{"unit_$i"}', $deliverydate, (SELECT id from project where projectnumber = '$project_id'),
|
||
'$form->{"serialnumber_$i"}')|;
|
||
'$form->{"serialnumber_$i"}',
|
||
'$pricegroup_id')|;
|
||
$dbh->do($query) || $form->dberror($query);
|
||
|
||
if ($form->{lizenzen}) {
|
||
... | ... | |
|
||
sub retrieve_invoice {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
print STDERR "IS.pm-retrieve_invoice\n";
|
||
my ($self, $myconfig, $form) = @_;
|
||
|
||
# connect to database
|
||
... | ... | |
i.discount, i.parts_id AS id, i.unit, i.deliverydate,
|
||
i.project_id, pr.projectnumber, i.serialnumber,
|
||
p.partnumber, p.assembly, p.bin, p.notes AS partnotes, i.id AS invoice_pos,
|
||
pg.partsgroup
|
||
pg.partsgroup, i.pricegroup_id, (SELECT pricegroup FROM pricegroup WHERE id=i.pricegroup_id) as pricegroup
|
||
FROM invoice i
|
||
JOIN parts p ON (i.parts_id = p.id)
|
||
LEFT JOIN project pr ON (i.project_id = pr.id)
|
||
... | ... | |
c.email, c.cc, c.bcc, c.language,
|
||
c.street, c.zipcode, c.city, c.country,
|
||
$duedate + c.terms AS duedate, c.notes AS intnotes,
|
||
b.discount AS tradediscount, b.description AS business
|
||
b.discount AS tradediscount, b.description AS business, c.klass as customer_klass
|
||
FROM customer c
|
||
LEFT JOIN business b ON (b.id = c.business_id)
|
||
WHERE c.id = $form->{customer_id}|;
|
||
... | ... | |
$stw->finish;
|
||
}
|
||
}
|
||
|
||
}
|
||
$sth->finish;
|
||
$dbh->disconnect;
|
||
... | ... | |
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
##########################
|
||
# get pricegroups from database
|
||
# build up selected pricegroup
|
||
# if an exchange rate - change price
|
||
# for each part
|
||
#
|
||
sub get_pricegroups_for_parts {
|
||
print STDERR "IS.pm - get_pricegroups_for_parts\n";
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my ($self, $myconfig, $form) = @_;
|
||
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
|
||
my $i = 1;
|
||
my $id = 0;
|
||
|
||
while (($form->{"id_$i"}) or ($form->{"new_id_$i"})) {
|
||
|
||
$id = $form->{"id_$i"};
|
||
|
||
if (!($form->{"id_$i"}) and $form->{"new_id_$i"}) {
|
||
|
||
$id = $form->{"new_id_$i"};
|
||
}
|
||
|
||
($price, $selectedpricegroup_id) = split /--/, $form->{"sellprice_drag_$i"};
|
||
# print (STDERR "sellprice_drag_$i", Dumper($form->{"sellprice_drag_$i"}));
|
||
|
||
$pricegroup_old = $form->{"pricegroup_old_$i"};
|
||
# print (STDERR "pricegroup_old_i-$i", Dumper($pricegroup_old));
|
||
|
||
$price_new = $form->{"price_new_$i"};
|
||
|
||
$price_old = $form->{"price_old_$i"};
|
||
|
||
|
||
$query = qq|SELECT pricegroup_id, (SELECT p.sellprice from parts p where p.id = $id) as default_sellprice,(SELECT pg.pricegroup FROM pricegroup pg WHERE id=pricegroup_id) AS pricegroup, price, '' AS selected FROM prices WHERE parts_id = $id UNION SELECT 0 as pricegroup_id,(SELECT sellprice FROM parts WHERE id=$id) as default_sellprice,'' as pricegroup, (SELECT DISTINCT sellprice from parts where id=$id) as price, 'selected' AS selected from prices ORDER BY pricegroup|;
|
||
|
||
$pkq = $dbh->prepare($query);
|
||
$pkq->execute || $form->dberror($query);
|
||
while ($pkr = $pkq->fetchrow_hashref(NAME_lc)) {
|
||
# push @{ $form->{PRICES}{$id} }, $pkr;
|
||
push @{ $form->{PRICES}{$i} }, $pkr;
|
||
$pkr->{id} = $id;
|
||
$pkr->{selected} = '';
|
||
|
||
# if there is an exchange rate change price
|
||
if (($form->{exchangerate} * 1) != 0) {
|
||
# print STDERR "WECHSELKURS?-$form->{exchangerate}\n";
|
||
$pkr->{price} /= $form->{exchangerate};
|
||
}
|
||
$pkr->{price} = $form->format_amount($myconfig,$pkr->{price},5);
|
||
|
||
|
||
if ($selectedpricegroup_id eq undef) {
|
||
if ($pkr->{pricegroup_id} eq $form->{customer_klass}) {
|
||
print STDERR " INIT ROW \n";
|
||
#print (STDERR " PREIS", Dumper($pkr->{price}));
|
||
$pkr->{selected} = ' selected';
|
||
$last->{selected} = '';
|
||
# print (STDERR " SELLPRICE", Dumper($form->{"sellprice_$i"}));
|
||
|
||
# no customer pricesgroup set
|
||
if ($pkr->{price} == $pkr->{default_sellprice}) {
|
||
print (STDERR " PREIS IST DEFAULT-SELLPRICE", Dumper($form->{"sellprice_$i"}));
|
||
$pkr->{price} = $form->{"sellprice_$i"};
|
||
|
||
# if ($form->{tradediscount}){
|
||
# print (STDERR "TRADE--", Dumper($pkr->{price}));
|
||
# $pkr->{price} =$pkr->{price} * (1 - $form->{tradediscount});
|
||
# $pkr->{price} = $form->format_amount($myconfig,$pkr->{price},5);
|
||
# print (STDERR "TRADE--", Dumper($pkr->{price}));
|
||
# }
|
||
|
||
} else {
|
||
print STDERR " PREIS IST NICHT NULL\n";
|
||
$form->{"sellprice_$i"} = $pkr->{price};
|
||
}
|
||
# print (STDERR " PRICE", Dumper($pkr->{price}));
|
||
|
||
} else {
|
||
print STDERR " INIT ROW but what\n";
|
||
print (STDERR " PREIS -", Dumper($pkr->{price}), "Default", Dumper($pkr->{default_sellprice}));
|
||
if ($pkr->{price} == $pkr->{default_sellprice}) {
|
||
print (STDERR " PREIS IST DEFAULT-", Dumper($form->{"sellprice_$i"}));
|
||
$pkr->{price} = $form->{"sellprice_$i"};
|
||
$pkr->{selected} = ' selected';
|
||
}
|
||
}
|
||
}
|
||
if ($selectedpricegroup_id or $selectedpricegroup_id == 0){
|
||
if ($selectedpricegroup_id ne $pricegroup_old) {
|
||
if ($pkr->{pricegroup_id} eq $selectedpricegroup_id) {
|
||
if ($price_new != $form->{"sellprice_$i"}) {
|
||
print STDERR " MANUELLEN PREIS W?HLEN\n";
|
||
} else {
|
||
print STDERR " UPDATE CHANGE PRICEGROUP\n";
|
||
$pkr->{selected} = ' selected';
|
||
$last->{selected} = '';
|
||
#$form->{"pricegroup_old_$i"} = $pkr->{$pricegroup_id};
|
||
}
|
||
}
|
||
} else {
|
||
if (($price_new != $form->{"sellprice_$i"}) and ($price_new ne 0)) {
|
||
if ($pkr->{pricegroup_id} == 0) {
|
||
print STDERR " UPDATE CHANGE PRICEGROUP with price manuelly\n";
|
||
print (STDERR " SELLPRICE??? ---", Dumper($form->{"sellprice_$i"}));
|
||
print (STDERR " NEWPRICE??? ---", Dumper($price_new));
|
||
$pkr->{price} = $form->{"sellprice_$i"};
|
||
$pkr->{selected} = ' selected';
|
||
$last->{selected} = '';
|
||
#$form->{"sellprice_$i"} = $form->format_amount($myconfig, $price_new, 2);
|
||
# print (STDERR "----5555---", Dumper($pkr));
|
||
}
|
||
} else {
|
||
if ($pkr->{pricegroup_id} eq $selectedpricegroup_id) {
|
||
print STDERR " UPDATE NO CHANGE\n";
|
||
$pkr->{selected} = ' selected';
|
||
$last->{selected} = '';
|
||
print STDERR " DEFAULTPRICE??? ---$pkr->{default_sellprice}\n";
|
||
print (STDERR " SELLPRICE??? ---", Dumper($form->{"sellprice_$i"}));
|
||
# print (STDERR " HIER DER SELLPRICE DEFAULT??? ---", Dumper($form));
|
||
print STDERR " NEWPRICE??? ---$price_new_\n";
|
||
if (($pkr->{pricegroup_id} == 0) and ($pkr->{price} == $form->{"sellprice_$i"})) {
|
||
print (STDERR " UPDATE NO CHANGE BUT PRICE MANUELLY SET", Dumper($pkr->{price}));
|
||
# $pkr->{price} = $form->{"sellprice_$i"};
|
||
} else {
|
||
$pkr->{price} = $form->{"sellprice_$i"};
|
||
}
|
||
#print (STDERR " FEHLER", Dumper($form->{"sellprice_$i"}));
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
$i++;
|
||
|
||
$pkq->finish;
|
||
}
|
||
|
||
$dbh->disconnect;
|
||
|
||
# print (STDERR "TEST", Dumper($form->{PRICES}));
|
||
# print (STDERR "TEST id_$i", Dumper($form->{"id_$i"}));
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub webdav_folder {
|
||
$main::lxdebug->enter_sub();
|
||
|
SL/OE.pm | ||
---|---|---|
$reqdate =
|
||
($form->{"reqdate_$i"}) ? qq|'$form->{"reqdate_$i"}'| : "NULL";
|
||
|
||
# get pricegroup_id and save ist
|
||
($null, my $pricegroup_id) = split /--/, $form->{"sellprice_drag_$i"};
|
||
$pricegroup_id *= 1;
|
||
|
||
# save detail record in orderitems table
|
||
$query = qq|INSERT INTO orderitems (|;
|
||
$query .= "id, " if $form->{"orderitems_id_$i"};
|
||
$query .= qq|trans_id, parts_id, description, qty, sellprice, discount,
|
||
unit, reqdate, project_id, serialnumber, ship)
|
||
unit, reqdate, project_id, serialnumber, ship, pricegroup_id)
|
||
VALUES (|;
|
||
$query .= qq|$form->{"orderitems_id_$i"},|
|
||
if $form->{"orderitems_id_$i"};
|
||
... | ... | |
'$form->{"description_$i"}', $form->{"qty_$i"},
|
||
$fxsellprice, $form->{"discount_$i"},
|
||
'$form->{"unit_$i"}', $reqdate, (SELECT id from project where projectnumber = '$project_id'),
|
||
'$form->{"serialnumber_$i"}', $form->{"ship_$i"})|;
|
||
'$form->{"serialnumber_$i"}', $form->{"ship_$i"},
|
||
'$pricegroup_id')|;
|
||
$dbh->do($query) || $form->dberror($query);
|
||
|
||
$form->{"sellprice_$i"} = $fxsellprice;
|
||
... | ... | |
o.sellprice, o.parts_id AS id, o.unit, o.discount, p.bin, p.notes AS partnotes,
|
||
o.reqdate, o.project_id, o.serialnumber, o.ship,
|
||
pr.projectnumber,
|
||
pg.partsgroup
|
||
pg.partsgroup, o.pricegroup_id, (SELECT pricegroup FROM pricegroup WHERE id=o.pricegroup_id) as pricegroup
|
||
FROM orderitems o
|
||
JOIN parts p ON (o.parts_id = p.id)
|
||
LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id)
|
SL/PE.pm | ||
---|---|---|
|
||
package PE;
|
||
|
||
use Data::Dumper;
|
||
|
||
sub projects {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
... | ... | |
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
##########################
|
||
# get pricegroups from database
|
||
#
|
||
sub pricegroups {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my ($self, $myconfig, $form) = @_;
|
||
|
||
my $var;
|
||
|
||
# connect to database
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
|
||
my $sortorder = ($form->{sort}) ? $form->{sort} : "pricegroup";
|
||
|
||
my $query = qq|SELECT g.id, g.pricegroup
|
||
FROM pricegroup g|;
|
||
|
||
my $where = "1 = 1";
|
||
|
||
if ($form->{pricegroup}) {
|
||
$var = $form->like(lc $form->{pricegroup});
|
||
$where .= " AND lower(g.pricegroup) LIKE '$var'";
|
||
}
|
||
$query .= qq|
|
||
WHERE $where
|
||
ORDER BY $sortorder|;
|
||
|
||
if ($form->{status} eq 'orphaned') {
|
||
$query = qq|SELECT pg.*
|
||
FROM pricegroup pg
|
||
LEFT JOIN prices p ON (p.pricegroup_id = pg.id)
|
||
WHERE $where
|
||
EXCEPT
|
||
SELECT pg.*
|
||
FROM pricegroup pg
|
||
JOIN prices p ON (p.pricegroup_id = pg.id)
|
||
WHERE $where
|
||
ORDER BY $sortorder|;
|
||
}
|
||
print STDERR "asdfasdf-$query\n";
|
||
|
||
$sth = $dbh->prepare($query);
|
||
$sth->execute || $form->dberror($query);
|
||
|
||
my $i = 0;
|
||
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
||
push @{ $form->{item_list} }, $ref;
|
||
$i++;
|
||
}
|
||
|
||
$sth->finish;
|
||
$dbh->disconnect;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
|
||
return $i;
|
||
}
|
||
########################
|
||
# save pricegruop to database
|
||
#
|
||
sub save_pricegroup {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my ($self, $myconfig, $form) = @_;
|
||
|
||
# connect to database
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
|
||
map { $form->{$_} =~ s/\'/\'\'/g } (pricegroup);
|
||
|
||
$form->{discount} /= 100;
|
||
|
||
if ($form->{id}) {
|
||
$query = qq|UPDATE pricegroup SET
|
||
pricegroup = '$form->{pricegroup}'
|
||
WHERE id = $form->{id}|;
|
||
} else {
|
||
$query = qq|INSERT INTO pricegroup
|
||
(pricegroup)
|
||
VALUES ('$form->{pricegroup}')|;
|
||
}
|
||
$dbh->do($query) || $form->dberror($query);
|
||
|
||
$dbh->disconnect;
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
############################
|
||
# get one pricegroup from database
|
||
#
|
||
sub get_pricegroup {
|
||
$main::lxdebug->enter_sub();
|
||
print STDERR "PE.pm-get_pricegroup\n";
|
||
my ($self, $myconfig, $form) = @_;
|
||
|
||
# connect to database
|
||
my $dbh = $form->dbconnect($myconfig);
|
||
|
||
my $query = qq|SELECT p.id, p.pricegroup
|
||
FROM pricegroup p
|
||
WHERE p.id = $form->{id}|;
|
||
my $sth = $dbh->prepare($query);
|
||
$sth->execute || $form->dberror($query);
|
||
|
||
my $ref = $sth->fetchrow_hashref(NAME_lc);
|
||
|
||
map { $form->{$_} = $ref->{$_} } keys %$ref;
|
||
|
||
$sth->finish;
|
||
|
||
# check if it is orphaned
|
||
$query = qq|SELECT count(*)
|
||
FROM prices p
|
||
WHERE p.pricegroup_id = $form->{id}|;
|
||
$sth = $dbh->prepare($query);
|
||
$sth->execute || $form->dberror($query);
|
||
|
||
($form->{orphaned}) = $sth->fetchrow_array;
|
||
$form->{orphaned} = !$form->{orphaned};
|
||
|
||
$sth->finish;
|
||
|
||
$dbh->disconnect;
|
||
#print (STDERR " ", Dumper($form));
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
1;
|
||
|
bin/mozilla/ct.pl | ||
---|---|---|
if ($form->{db} eq 'vendor') {
|
||
$gifi = qq|
|
||
<td><input name="l_gifi_accno" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text('GIFI')
|
||
. qq|</td>
|
||
. $locale->text('GIFI') . qq|</td>
|
||
|;
|
||
}
|
||
|
||
... | ... | |
<td><input name=status class=radio type=radio value=all checked> |
|
||
. $locale->text('All') . qq|
|
||
<input name=status class=radio type=radio value=orphaned> |
|
||
. $locale->text('Orphaned')
|
||
. qq|</td>
|
||
. $locale->text('Orphaned') . qq|</td>
|
||
</tr>
|
||
<tr>
|
||
<th align=right nowrap>| . $locale->text('Include in Report') . qq|</th>
|
||
... | ... | |
<table>
|
||
<tr>
|
||
<td><input name="l_id" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text('ID')
|
||
. qq|</td>
|
||
. $locale->text('ID') . qq|</td>
|
||
<td><input name="l_$form->{db}number" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text($label . ' Number')
|
||
. qq|</td>
|
||
. $locale->text($label . ' Number') . qq|</td>
|
||
<td><input name="l_name" type=checkbox class=checkbox value=Y checked> |
|
||
. $locale->text('Company Name')
|
||
. qq|</td>
|
||
. $locale->text('Company Name') . qq|</td>
|
||
<td><input name="l_address" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text('Address')
|
||
. qq|</td>
|
||
. $locale->text('Address') . qq|</td>
|
||
</tr>
|
||
<tr>
|
||
<td><input name="l_contact" type=checkbox class=checkbox value=Y checked> |
|
||
. $locale->text('Contact')
|
||
. qq|</td>
|
||
. $locale->text('Contact') . qq|</td>
|
||
<td><input name="l_phone" type=checkbox class=checkbox value=Y checked> |
|
||
. $locale->text('Phone')
|
||
. qq|</td>
|
||
. $locale->text('Phone') . qq|</td>
|
||
<td><input name="l_fax" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text('Fax')
|
||
. qq|</td>
|
||
. $locale->text('Fax') . qq|</td>
|
||
<td><input name="l_email" type=checkbox class=checkbox value=Y checked> |
|
||
. $locale->text('E-mail')
|
||
. qq|</td>
|
||
. $locale->text('E-mail') . qq|</td>
|
||
</tr>
|
||
<tr>
|
||
<td><input name="l_taxnumber" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text('Tax Number')
|
||
. qq|</td>
|
||
. $locale->text('Tax Number') . qq|</td>
|
||
$gifi
|
||
<td><input name="l_sic_code" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text('SIC')
|
||
. qq|</td>
|
||
. $locale->text('SIC') . qq|</td>
|
||
<td><input name="l_business" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text('Type of Business')
|
||
. qq|</td>
|
||
. $locale->text('Type of Business') . qq|</td>
|
||
</tr>
|
||
<tr>
|
||
<td><input name="l_invnumber" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text('Invoices')
|
||
. qq|</td>
|
||
. $locale->text('Invoices') . qq|</td>
|
||
<td><input name="l_ordnumber" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text('Orders')
|
||
. qq|</td>
|
||
. $locale->text('Orders') . qq|</td>
|
||
<td><input name="l_quonumber" type=checkbox class=checkbox value=Y> |
|
||
. $locale->text('Quotations')
|
||
. qq|</td>
|
||
. $locale->text('Quotations') . qq|</td>
|
||
</tr>
|
||
</table>
|
||
</td>
|
||
... | ... | |
|
||
if ($ref->{id} eq $sameid) {
|
||
map { $column_data{$_} = "<td> </td>" } @column_index;
|
||
map { $column_data{$_} = "<td>$ref->{$_} </td>" } (invnumber, ordnumber, quonumber);
|
||
} else {
|
||
map { $column_data{$_} = "<td>$ref->{$_} </td>" } @column_index;
|
||
|
||
... | ... | |
</tr>
|
||
|;
|
||
}
|
||
|
||
$form->{selectbusiness} = qq|<option>\n|;
|
||
map {
|
||
$form->{selectbusiness} .= qq|<option value=$_->{id}>$_->{description}\n|
|
||
$form->{selectbusiness} .=
|
||
qq|<option value=$_->{id}>$_->{description}\n|
|
||
} @{ $form->{all_business} };
|
||
if ($form->{business_save}) {
|
||
$form->{selectbusiness} = $form->{business_save};
|
||
... | ... | |
|
||
$select_greeting =
|
||
qq| <select name=selected_cp_greeting><option></option>|;
|
||
map({ $select_greeting .= qq|<option>$_</option>|; } @{ $form->{GREETINGS} });
|
||
map(
|
||
{ $select_greeting .= qq|<option>$_</option>|; } @{ $form->{GREETINGS} });
|
||
$select_greeting .= qq|</select>|;
|
||
## /LINET
|
||
|
||
if ($form->{db} eq 'customer') {
|
||
#get pricegroup and form it
|
||
$form->get_pricegroup(\%myconfig, { all => 1 });
|
||
|
||
$form->{pricegroup} = "$form->{klass}";
|
||
$form->{pricegroup_id} = "$form->{klass}";
|
||
|
||
if (@{ $form->{all_pricegroup} }) {
|
||
|
||
$form->{selectpricegroup} = qq|<option>\n|;
|
||
map {
|
||
$form->{selectpricegroup} .=
|
||
qq|<option value="$_->{id}">$_->{pricegroup}\n|
|
||
} @{ $form->{all_pricegroup} };
|
||
}
|
||
|
||
if ($form->{selectpricegroup}) {
|
||
$form->{selectpricegroup} = $form->unescape($form->{selectpricegroup});
|
||
|
||
$pricegroup =
|
||
qq|<input type=hidden name=selectpricegroup value="|
|
||
. $form->escape($form->{selectpricegroup}, 1) . qq|">|;
|
||
|
||
$form->{selectpricegroup} =~
|
||
s/(<option value="\Q$form->{klass}\E")/$1 selected/;
|
||
|
||
$pricegroup .= qq|<select name=klass>$form->{selectpricegroup}</select>|;
|
||
|
||
$group = $locale->text('Hola');
|
||
}
|
||
}
|
||
# $locale->text('Customer Number')
|
||
# $locale->text('Vendor Number')
|
||
$form->{fokus} = "ct.name";
|
||
... | ... | |
<table width=100%>
|
||
<tr class=listheading>
|
||
<th class=listheading colspan=2 width=50%>|
|
||
. $locale->text('Billing Address')
|
||
. qq|</th>
|
||
. $locale->text('Billing Address') . qq|</th>
|
||
<th class=listheading width=50%>|
|
||
. $locale->text('Shipping Address')
|
||
. qq|</th>
|
||
. $locale->text('Shipping Address') . qq|</th>
|
||
</tr>
|
||
<tr height="5"></tr>
|
||
$business_salesman
|
||
... | ... | |
</tr>
|
||
<tr>
|
||
<th align=right nowrap>|
|
||
. $locale->text('Zipcode') . "/"
|
||
. $locale->text('City')
|
||
. qq|</th>
|
||
. $locale->text('Zipcode') . "/" . $locale->text('City') . qq|</th>
|
||
<td><input name=zipcode size=5 tabindex=5 maxlength=10 value="$form->{zipcode}">
|
||
<input name=city size=30 tabindex=6 maxlength=75 value="$form->{city}"></td>
|
||
<td><input name=shiptozipcode size=5 maxlength=10 value="$form->{shiptozipcode}">
|
||
... | ... | |
<table>
|
||
<tr>
|
||
<th align=right nowrap>|
|
||
. $locale->text('Contact Person')
|
||
. qq|</th>
|
||
. $locale->text('Contact Person') . qq|</th>
|
||
</tr>
|
||
<tr>
|
||
<th></th>
|
||
... | ... | |
<tr>
|
||
<th></th>
|
||
<th align=left nowrap>|
|
||
. $locale->text('Given Name')
|
||
. qq|</th>
|
||
. $locale->text('Given Name') . qq|</th>
|
||
<td><input name=cp_givenname size=30 maxlength=40 value="$form->{cp_givenname}"></td>
|
||
<th align=left nowrap>| . $locale->text('Name') . qq|</th>
|
||
<td><input name=cp_name size=30 maxlength=40 value="$form->{cp_name}"></td>
|
||
... | ... | |
<td><input name=creditlimit tabindex=13 size=9 value="$form->{creditlimit}"></td>
|
||
<th align=right>| . $locale->text('Terms: Net') . qq|</th>
|
||
<td><input name=terms tabindex=14 size=2 value="$form->{terms}">|
|
||
. $locale->text('days')
|
||
. qq|</td>
|
||
. $locale->text('days') . qq|</td>
|
||
<th align=right>| . $locale->text('Discount') . qq|</th>
|
||
<td><input name=discount tabindex=15 size=4 value="$form->{discount}">
|
||
%</td>
|
||
... | ... | |
<th align=right>| . $locale->text('Language') . qq|</th>
|
||
<td><select name=language tabindex=23>$lang
|
||
</select></td>|;
|
||
if ($form->{db} eq 'customer'){
|
||
|
||
print qq|
|
||
<th align=right>| . $locale->text('Preisklasse') . qq|</th>
|
||
<td>$pricegroup</td>|;
|
||
}
|
||
print qq| </tr>
|
||
<tr>
|
||
<td align=right>| . $locale->text('Obsolete') . qq|</td>
|
||
... | ... | |
<input type=hidden name=callback value="$form->{callback}">
|
||
<input type=hidden name=db value=$form->{db}>
|
||
|
||
|
||
|
||
<br>
|
||
$update_button
|
||
<input class=submit type=submit name=action accesskey="s" value="|
|
bin/mozilla/ic.pl | ||
---|---|---|
#======================================================================
|
||
|
||
use SL::IC;
|
||
#use SL::PE;
|
||
|
||
require "$form->{path}/io.pl";
|
||
|
||
... | ... | |
|
||
$form->{unit} =
|
||
($form->{item} eq 'service') ? $locale->text('hr') : $locale->text('ea');
|
||
|
||
IC->get_pricegroups(\%myconfig, \%$form);
|
||
&link_part;
|
||
&display_form;
|
||
|
||
... | ... | |
$button1 = qq|
|
||
<td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>
|
||
<td><input type=button name=transdatefrom id="trigger1" value=|
|
||
. $locale->text('button')
|
||
. qq|></td>
|
||
. $locale->text('button') . qq|></td>
|
||
|;
|
||
$button2 = qq|
|
||
<td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>
|
||
<td><input type=button name=transdateto name=transdateto id="trigger2" value=|
|
||
. $locale->text('button')
|
||
. qq|></td>
|
||
. $locale->text('button') . qq|></td>
|
||
|;
|
||
|
||
#write Trigger
|
||
... | ... | |
|
||
$l_serialnumber = qq|
|
||
<td><input name=l_serialnumber class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('Serial Number')
|
||
. qq|</td>
|
||
. $locale->text('Serial Number') . qq|</td>
|
||
|;
|
||
|
||
}
|
||
... | ... | |
</tr>
|
||
<tr>
|
||
<th align=right nowrap>|
|
||
. $locale->text('Part Description')
|
||
. qq|</th>
|
||
. $locale->text('Part Description') . qq|</th>
|
||
<td colspan=3><input name=description size=40></td>
|
||
</tr>
|
||
<tr>
|
||
... | ... | |
</tr>
|
||
<tr>
|
||
<th align=right nowrap>|
|
||
. $locale->text('Include in Report')
|
||
. qq|</th>
|
||
. $locale->text('Include in Report') . qq|</th>
|
||
<td colspan=3>
|
||
<table>
|
||
<tr>
|
||
<td><input name=l_partnumber class=checkbox type=checkbox value=Y checked> |
|
||
. $locale->text('Part Number')
|
||
. qq|</td>
|
||
. $locale->text('Part Number') . qq|</td>
|
||
<td><input name=l_description class=checkbox type=checkbox value=Y checked> |
|
||
. $locale->text('Part Description')
|
||
. qq|</td>
|
||
. $locale->text('Part Description') . qq|</td>
|
||
$l_serialnumber
|
||
<td><input name=l_unit class=checkbox type=checkbox value=Y checked> |
|
||
. $locale->text('Unit of measure')
|
||
. qq|</td>
|
||
. $locale->text('Unit of measure') . qq|</td>
|
||
</tr>
|
||
<tr>
|
||
<td><input name=l_listprice class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('List Price')
|
||
. qq|</td>
|
||
. $locale->text('List Price') . qq|</td>
|
||
<td><input name=l_sellprice class=checkbox type=checkbox value=Y checked> |
|
||
. $locale->text('Sell Price')
|
||
. qq|</td>
|
||
. $locale->text('Sell Price') . qq|</td>
|
||
<td><input name=l_lastcost class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('Last Cost')
|
||
. qq|</td>
|
||
. $locale->text('Last Cost') . qq|</td>
|
||
<td><input name=l_linetotal class=checkbox type=checkbox value=Y checked> |
|
||
. $locale->text('Line Total')
|
||
. qq|</td>
|
||
. $locale->text('Line Total') . qq|</td>
|
||
</tr>
|
||
<tr>
|
||
<td><input name=l_priceupdate class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('Updated')
|
||
. qq|</td>
|
||
. $locale->text('Updated') . qq|</td>
|
||
<td><input name=l_bin class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('Bin')
|
||
. qq|</td>
|
||
. $locale->text('Bin') . qq|</td>
|
||
<td><input name=l_rop class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('ROP')
|
||
. qq|</td>
|
||
. $locale->text('ROP') . qq|</td>
|
||
<td><input name=l_weight class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('Weight')
|
||
. qq|</td>
|
||
. $locale->text('Weight') . qq|</td>
|
||
</tr>
|
||
<tr>
|
||
<td><input name=l_image class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('Image')
|
||
. qq|</td>
|
||
. $locale->text('Image') . qq|</td>
|
||
<td><input name=l_drawing class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('Drawing')
|
||
. qq|</td>
|
||
. $locale->text('Drawing') . qq|</td>
|
||
<td><input name=l_microfiche class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('Microfiche')
|
||
. qq|</td>
|
||
. $locale->text('Microfiche') . qq|</td>
|
||
<td><input name=l_partsgroup class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('Group')
|
||
. qq|</td>
|
||
. $locale->text('Group') . qq|</td>
|
||
</tr>
|
||
<tr>
|
||
<td><input name=l_subtotal class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('Subtotal')
|
||
. qq|</td>
|
||
. $locale->text('Subtotal') . qq|</td>
|
||
<td><input name=l_soldtotal class=checkbox type=checkbox value=Y> |
|
||
. $locale->text('soldtotal')
|
||
. qq|</td>
|
||
. $locale->text('soldtotal') . qq|</td>
|
||
</tr>
|
||
</table>
|
||
</td>
|
||
... | ... | |
<table>
|
||
<tr class=listheading>
|
||
<th class=listheading nowrap>|
|
||
. $locale->text('Part Number')
|
||
. qq|</th>
|
||
. $locale->text('Part Number') . qq|</th>
|
||
<th class=listheading nowrap>|
|
||
. $locale->text('Part Description')
|
||
. qq|</th>
|
||
. $locale->text('Part Description') . qq|</th>
|
||
</tr>
|
||
<tr valign=top>
|
||
<td><input type=text name=partnumber size=20 value=></td>
|
||
... | ... | |
$option .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|;
|
||
}
|
||
|
||
@columns =
|
||
$form->sort_columns(
|
||
@columns = $form->sort_columns(
|
||
qw(number partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal)
|
||
);
|
||
);
|
||
|
||
if ($form->{l_linetotal}) {
|
||
$form->{l_onhand} = "Y";
|
||
... | ... | |
$option .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|;
|
||
}
|
||
|
||
@columns =
|
||
$form->sort_columns(
|
||
@columns = $form->sort_columns(
|
||
qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal)
|
||
);
|
||
);
|
||
|
||
if ($form->{l_linetotal}) {
|
||
$form->{l_onhand} = "Y";
|
||
... | ... | |
delete $form->{amount};
|
||
|
||
$form->get_partsgroup(\%myconfig, { all => 1 });
|
||
|
||
$form->{partsgroup} = "$form->{partsgroup}--$form->{partsgroup_id}";
|
||
|
||
if (@{ $form->{all_partsgroup} }) {
|
||
$form->{selectpartsgroup} = qq|<option>\n|;
|
||
map {
|
||
... | ... | |
}
|
||
}
|
||
}
|
||
|
||
if ($form->{selectpartsgroup}) {
|
||
$form->{selectpartsgroup} = $form->unescape($form->{selectpartsgroup});
|
||
$partsgroup =
|
||
... | ... | |
$lastcost = qq|
|
||
<tr>
|
||
<th align="right" nowrap="true">|
|
||
. $locale->text('Last Cost')
|
||
. qq|</th>
|
||
. $locale->text('Last Cost') . qq|</th>
|
||
<td><input name=lastcost size=11 value=$form->{lastcost}></td>
|
||
</tr>
|
||
|;
|
||
... | ... | |
<tr>
|
||
<th align="right" nowrap>| . $locale->text('On Hand') . qq|</th>
|
||
<th align=left nowrap class="plus$n"> |
|
||
. $form->format_amount(\%myconfig, $form->{onhand})
|
||
. qq|</th>
|
||
. $form->format_amount(\%myconfig, $form->{onhand}) . qq|</th>
|
||
</tr>
|
||
|;
|
||
|
||
... | ... | |
$vegv = qq|
|
||
<tr>
|
||
<th align="right" nowrap="true">|
|
||
. $locale->text('Verrechnungseinheit')
|
||
. qq|</th>
|
||
. $locale->text('Verrechnungseinheit') . qq|</th>
|
||
<td><input name=ve size=10 value=$form->{ve}></td>
|
||
</tr>
|
||
<tr>
|
||
<th align="right" nowrap="true">|
|
||
. $locale->text('Gesch?ftsvolumen')
|
||
. qq|</th>
|
||
. $locale->text('Gesch?ftsvolumen') . qq|</th>
|
||
<td><input name=gv size=10 value=$form->{gv}></td>
|
||
</tr>
|
||
|;
|
||
... | ... | |
$obsolete .= qq|
|
||
<tr>
|
||
<th align=right nowrap>|
|
||
. $locale->text('Shopartikel')
|
||
. qq|</th>
|
||
. $locale->text('Shopartikel') . qq|</th>
|
||
<td><input class=checkbox type=checkbox name=shop value=1 $shopok></td>
|
||
</tr>
|
||
|;
|
||
... | ... | |
$button1 = qq|
|
||
<td width="13"><input name=priceupdate id=priceupdate size=11 title="$myconfig{dateformat}" value="$form->{priceupdate}"></td>
|
||
<td width="4" align="left"><input type=button name=priceupdate id="trigger1" value=|
|
||
. $locale->text('button')
|
||
. qq|></td>
|
||
. $locale->text('button') . qq|></td>
|
||
|;
|
||
|
||
#write Trigger
|
||
... | ... | |
<table width="100%" height="100%">
|
||
<tr class="listheading">
|
||
<th class="listheading" align="center" colspan=2>|
|
||
. $locale->text('Link Accounts')
|
||
. qq|</th>
|
||
. $locale->text('Link Accounts') . qq|</th>
|
||
</tr>
|
||
$linkaccounts
|
||
<tr>
|
||
... | ... | |
<table width="100%">
|
||
<tr>
|
||
<th align="right" nowrap="true">|
|
||
. $locale->text('Updated')
|
||
. qq|</th>
|
||
. $locale->text('Updated') . qq|</th>
|
||
$button1
|
||
</tr>
|
||
<tr>
|
||
... | ... | |
<table width="100%">
|
||
<tr>
|
||
<th colspan=2 align=right>|
|
||
. $locale->text('Total')
|
||
. qq| </th>
|
||
. $locale->text('Total') . qq| </th>
|
||
<th align=right>|
|
||
. $form->format_amount(\%myconfig, $form->{assemblytotal}, 2)
|
||
. qq|</th>
|
||
. $form->format_amount(\%myconfig, $form->{assemblytotal}, 2) . qq|</th>
|
||
</tr>
|
||
</table>
|
||
</td>
|
||
... | ... | |
|;
|
||
}
|
||
|
||
print qq|
|
||
<input type=hidden name=price_rows value=$form->{price_rows}>|;
|
||
|
||
print qq|
|
||
<input class=submit type=submit name=action value="|
|
||
. $locale->text('Save') . qq|">|;
|
||
... | ... | |
if ($form->{item} eq 'service') {
|
||
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
|
||
qw(sellprice listprice);
|
||
|
||
&form_header;
|
||
&form_footer;
|
||
}
|
||
... | ... | |
<table>
|
||
<tr>
|
||
<th align="right" nowrap="true">|
|
||
. $locale->text('Part Number')
|
||
. qq|</th>
|
||
. $locale->text('Part Number') . qq|</th>
|
||
<td><input name=partnumber size=20></td>
|
||
<td> </td>
|
||
</tr>
|
||
<tr>
|
||
<th align="right" nowrap="true">|
|
||
. $locale->text('Part Description')
|
||
. qq|</th>
|
||
. $locale->text('Part Description') . qq|</th>
|
||
<td><input name=description size=40></td>
|
||
</tr>
|
||
</table>
|
||
... | ... | |
$lxdebug->leave_sub();
|
||
}
|
||
|
||
sub price_row {
|
||
$lxdebug->enter_sub();
|
||
|
||
my ($numrows) = @_;
|
||
|
||
print qq|
|
||
<tr>
|
||
<td>
|
||
<table width=100%>
|
||
<tr>
|
||
<th class="listheading">| . $locale->text('Preisklasse') . qq|</th>
|
||
<th class="listheading">| . $locale->text('Preis') . qq|</th>
|
||
</tr>
|
||
|;
|
||
for $i (1 .. $numrows) {
|
||
print qq|
|
||
<tr>
|
||
<td width=50%><input type=hidden name="pricegroup_$i" size=30 value=$form->{"pricegroup_$i"}>$form->{"pricegroup_$i"}</td>
|
||
<td width=50%><input name="price_$i" size=11 value="$form->{"price_$i"}"></td>
|
||
<input type=hidden name="pricegroup_id_$i" value="$form->{"pricegroup_id_$i"}">
|
||
</tr>
|
||
|;
|
||
}
|
||
|
||
print qq|
|
||
</table>
|
||
</td>
|
||
</tr>
|
||
|;
|
||
|
||
$lxdebug->leave_sub();
|
||
}
|
||
|
||
sub continue { &{ $form->{nextsub} } }
|
bin/mozilla/io.pl | ||
---|---|---|
# $locale->text('Oct')
|
||
# $locale->text('Nov')
|
||
# $locale->text('Dec')
|
||
use SL::IS;
|
||
use SL::PE;
|
||
use Data::Dumper;
|
||
########################################
|
||
# Eintrag fuer Version 2.2.0 geaendert #
|
||
... | ... | |
sub display_row {
|
||
$lxdebug->enter_sub();
|
||
my $numrows = shift;
|
||
|
||
print STDERR "io.pl-display_row\n";
|
||
if ($lizenzen && $form->{vc} eq "customer") {
|
||
if ($form->{type} =~ /sales_order/) {
|
||
@column_index = (runningnumber, partnumber, description, ship, qty);
|
||
... | ... | |
}
|
||
############## ENDE Neueintrag ##################
|
||
|
||
push @column_index, qw(unit sellprice);
|
||
push @column_index, qw(unit);
|
||
|
||
#for pricegroups column
|
||
if ($form->{type} =~ (/sales_quotation/) or (($form->{level} =~ /Sales/) and ($form->{type} =~ /invoice/)) or (($form->{level} eq undef) and ($form->{type} =~ /invoice/)) or ($form->{type} =~ /sales_order/)) {
|
||
push @column_index, qw(sellprice_drag);
|
||
}
|
||
|
||
push @column_index, qw(sellprice);
|
||
|
||
if ($form->{vc} eq 'customer') {
|
||
push @column_index, qw(discount);
|
||
... | ... | |
. $locale->text('Project')
|
||
. qq|</th>|;
|
||
$column_data{sellprice} =
|
||
qq|<th align=left nowrap width=10 class=listheading>|
|
||
qq|<th align=left nowrap width=15 class=listheading>|
|
||
. $locale->text('Price')
|
||
. qq|</th>|;
|
||
$column_data{sellprice_drag} =
|
||
qq|<th align=left nowrap width=15 class=listheading>|
|
||
. $locale->text('Pricegroup')
|
||
. qq|</th>|;
|
||
$column_data{discount} =
|
||
qq|<th align=left class=listheading>|
|
||
. $locale->text('Discount')
|
||
... | ... | |
map {
|
||
$form->{"${_}_$i"} =
|
||
$form->parse_amount(\%myconfig, $form->{"${_}_$i"})
|
||
} qw(qty ship discount sellprice);
|
||
} qw(qty ship discount sellprice price_new price_old);
|
||
|
||
($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
|
||
$dec = length $dec;
|
||
... | ... | |
$form->round_amount(
|
||
$form->{"sellprice_$i"} * $form->{"discount_$i"} / 100,
|
||
$decimalplaces);
|
||
|
||
$linetotal =
|
||
$form->round_amount($form->{"sellprice_$i"} - $discount, $decimalplaces);
|
||
$linetotal = $form->round_amount($linetotal * $form->{"qty_$i"}, 2);
|
||
... | ... | |
}
|
||
|
||
$column_data{qty} =
|
||
qq|<td align=right><input name="qty_$i" size=5 value=|
|
||
. $form->format_amount(\%myconfig, $form->{"qty_$i"})
|
||
. qq|></td>|;
|
||
qq|<td align=right><input name="qty_$i" size=5 value=|.$form->format_amount(\%myconfig, $form->{"qty_$i"},0).qq|></td>|;
|
||
$column_data{ship} =
|
||
qq|<td align=right><input name="ship_$i" size=5 value=|
|
||
. $form->format_amount(\%myconfig, $form->{"ship_$i"})
|
||
. qq|></td>|;
|
||
$column_data{unit} =
|
||
qq|<td><input name="unit_$i" size=5 value="$form->{"unit_$i"}"></td>|;
|
||
$column_data{sellprice} =
|
||
qq|<td align=right><input name="sellprice_$i" size=9 value=|
|
||
. $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
|
||
$decimalplaces)
|
||
. qq|></td>|;
|
||
|
||
|
||
|
||
#print (STDERR "io.pl---111-i-$i", Dumper($form->{PRICES}));
|
||
# build in dragdrop for pricesgroups
|
||
if ($form->{"prices_$i"}) {
|
||
print STDERR " YES prices\n";
|
||
$price_tmp = $form->format_amount(\%myconfig, $form->{"price_new_$i"}, 2);
|
||
|
||
$column_data{sellprice_drag} =
|
||
qq|<td align=right><select name="sellprice_drag_$i">$form->{"prices_$i"}</select></td>|;
|
||
$column_data{sellprice} =
|
||
qq|<td><input name="sellprice_$i" size=5 value=$price_tmp></td>|;
|
||
} else {
|
||
print STDERR " NO prices\n";
|
||
# for last row and report
|
||
# set pricegroup dragdrop from report menu
|
||
if ($form->{"sellprice_$i"} != 0) {
|
||
print STDERR " HIER NOCH F?R RECHNUNGSAUFRUFE\n";
|
||
print (STDERR "sellprice_$i ", Dumper($form->{"sellprice_$i"}), " pricegroup_id_$i ", Dumper($form->{"pricegroup_id_$i"}));
|
||
$prices =
|
||
qq|<option value="$form->{"sellprice_$i"}--$form->{"pricegroup_id_$i"}" selected>$form->{"pricegroup_$i"}</option>\n|;
|
||
|
||
$form->{"pricegroup_old_$i"} = $form->{"pricegroup_id_$i"};
|
||
|
||
$column_data{sellprice_drag} =
|
||
qq|<td align=right><select name="sellprice_drag_$i">$prices</select></td>|;
|
||
|
||
}else {
|
||
# for last row
|
||
$column_data{sellprice_drag} =
|
||
qq|<td align=right><input name="sellprice_$i" size=9 value=|
|
||
. $form->format_amount(\%myconfig, $form->{"prices_$i"},
|
||
$decimalplaces)
|
||
. qq|></td>|;
|
||
}
|
||
|
||
$column_data{sellprice} =
|
||
qq|<td><input name="sellprice_$i" size=5 value=|
|
||
. $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
|
||
$decimalplaces)
|
||
. qq|></td>|;
|
||
}
|
||
#print (STDERR "io.pl---555-i-$i", Dumper($form->{"price_old_$i"}));
|
||
$column_data{discount} =
|
||
qq|<td align=right><input name="discount_$i" size=3 value=|
|
Auch abrufbar als: Unified diff
Merge von 599-602,605,614,615 aus unstable: Preisgruppen Teil 1
--Preisgruppenerweiterung auf Basis von Andres Patch - Thanks
-Preisgruppenverwaltung
-Preiseingabe der Preisgruppen in Masken Waren,etc.
-Auswahl der Preisgruppen in den Verkaufsmasken
-Erweiterung Datenbankschema
-Übersetzungen für Preisgruppen
-Bugfix Preisgruppen, in der Warenmaske zeigte er eine Preisgruppe a
"Gruppe 1" als "Gruppe" an
-Anpassung locale
--Fehler bei negativen Umsaetzen behoben
--Fehler beim Speichern von Rechnungen und Angeboten/Auftraegen wenn keine Preisgruppen vorhanden
--Fehler bei Drucken und Buchen und Preisgruppen behoben, Preisgruppen Quelltext ein wenig modifiziert