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 '
$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) = @_;
#======================================================================
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}) {
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();
$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)
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;
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="|
#======================================================================
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} } }
# $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=|
. $form->format_amount(\%myconfig, $form->{"discount_$i"})
<input type=hidden name="orderitems_id_$i" value=$form->{"orderitems_id_$i"}>
<input type=hidden name="bo_$i" value=$form->{"bo_$i"}>
+<input type=hidden name="pricegroup_old_$i" value=$form->{"pricegroup_old_$i"}>
+<input type=hidden name="price_old_$i" value=$form->{"price_old_$i"}>
+<input type=hidden name="price_new_$i" value=|.$form->format_amount(\%myconfig,$form->{"price_new_$i"}).qq|>
+
<input type=hidden name="id_$i" value=$form->{"id_$i"}>
<input type=hidden name="inventory_accno_$i" value=$form->{"inventory_accno_$i"}>
<input type=hidden name="bin_$i" value="$form->{"bin_$i"}">
$lxdebug->leave_sub();
}
-sub select_item {
+##################################################
+# build html-code for pricegroups in variable $form->{prices_$j}
+
+sub set_pricegroup {
+ my $rowcount = shift;
$lxdebug->enter_sub();
+ for $j (1 .. $rowcount) {
+
+ my $pricegroup_old = $form->{"pricegroup_old_$i"};
+ if ($form->{PRICES}{ $j }) {
+ $len = 0;
+ $prices = '';
+ $price = 0;
+ foreach $item (@{ $form->{PRICES}{ $j } }) {
+# print STDERR "-VOR PREIS--$item->{price}--PREISGRUOP-$item->{pricegroup_id}\n";
+ $price = $form->round_amount($myconfig, $item->{price},5);
+ $price = $form->format_amount($myconfig, $item->{price},2);
+ $price = $item->{price};
+# print STDERR "-NACH PREIS--$price--PREISGRUOP-$item->{pricegroup_id}\n";
+ $pricegroup_id = $item->{pricegroup_id};
+ $pricegroup = $item->{pricegroup};
+ # build dragdrop for pricegroups
+ $prices .=
+ qq|<option value="$price--$pricegroup_id"$item->{selected}>$pricegroup</option>\n|;
+
+ $len += 1;
+# print STDERR "prices---$prices\n";
+ # set new selectedpricegroup_id and prices for "Preis"
+ if ($item->{selected}) {
+ $form->{"pricegroup_old_$j"} = $pricegroup_id;
+ $form->{"price_new_$j"} = $price;
+ $form->{"sellprice_$j"} = $price;
+ }
+ if ($len >= 1) {
+ $form->{"prices_$j"} = $prices;
+ }
+ }
+ }
+ }
+ $lxdebug->leave_sub();
+}
+sub select_item {
+ $lxdebug->enter_sub();
+print STDERR "io.pl-select_item\n";
@column_index = qw(ndx partnumber description onhand sellprice);
$column_data{ndx} = qq|<th> </th>|;
}
map { $ref->{$_} =~ s/\"/"/g } qw(partnumber description unit);
-
+#sk tradediscount
+print STDERR "TRADEDISCOUNT $ref->{sellprice}\n";
$ref->{sellprice} =
$form->round_amount($ref->{sellprice} * (1 - $form->{tradediscount}), 2);
-
+print STDERR "TRADEDISCOUNT $ref->{sellprice}\n";
$column_data{ndx} =
qq|<td><input name=ndx class=radio type=radio value=$i $checked></td>|;
$column_data{partnumber} =
sub item_selected {
$lxdebug->enter_sub();
-
+print STDERR "io.pl-item_selected\n";
# replace the last row with the checked row
$i = $form->{rowcount};
$i = $form->{assembly_rows} if ($form->{item} eq 'assembly');
# index for new item
$j = $form->{ndx};
+ #sk
+ #($form->{"sellprice_$i"},$form->{"$pricegroup_old_$i"}) = split /--/, $form->{"sellprice_$i"};
+ #$form->{"sellprice_$i"} = $form->{"sellprice_$i"};
+
# if there was a price entered, override it
$sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
$form->format_amount(\%myconfig, $form->{"${_}_$i"}, $decimalplaces)
} qw(sellprice listprice) if $form->{item} ne 'assembly';
+ # get pricegroups for parts
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+ # build up html code for prices_$i
+ set_pricegroup();
+
&display_form;
$lxdebug->leave_sub();
$form->{second_run} = 1;
$form->{action} = "display_form";
$form->{rowcount}--;
+ my $rowcount = $form->{rowcount};
+ # get pricegroups for parts
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form, "new");
+ # build up html code for prices_$i
+ set_pricegroup($rowcount);
+
$form->{resubmit} = 1;
$subroutine = "display_row";
if ($form->{item} eq 'part') {
+ #set preisgruppenanzahl
+ $numrows = $form->{price_rows};
+ $subroutine = "price_row";
+
+ &{$subroutine}($numrows);
+
$numrows = ++$form->{makemodel_rows};
$subroutine = "makemodel_row";
}
if ($form->{item} eq 'assembly') {
+ $numrows = ++$form->{price_rows};
+ $subroutine = "price_row";
+
+ &{$subroutine}($numrows);
+
$numrows = ++$form->{makemodel_rows};
$subroutine = "makemodel_row";
$subroutine = "assembly_row";
}
if ($form->{item} eq 'service') {
+ $numrows = ++$form->{price_rows};
+ $subroutine = "price_row";
+
+ &{$subroutine}($numrows);
+
$numrows = 0;
}
&form_footer;
- # if ($form->{print_and_post}) {
- # &display_form;
- # }
-
$lxdebug->leave_sub();
}
sub check_form {
$lxdebug->enter_sub();
-
+print STDERR "io.pl-check_form\n";
my @a = ();
my $count = 0;
my @flds = (
map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
+ #($form->{"sellprice_$i"},$form->{"$pricegroup_old_$i"}) = split /--/, $form->{"sellprice_$i"};
+
$form->{sellprice} += ($form->{"qty_$i"} * $form->{"sellprice_$i"});
$form->{weight} += ($form->{"qty_$i"} * $form->{"weight_$i"});
$count++;
}
}
+
+ #sk
+ # if pricegroups
+ 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/)) {
+
+ # get pricegroups for parts
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+ # build up html code for prices_$i
+ set_pricegroup();
+
+ }
&display_form;
$discount = $form->parse_amount(\%myconfig, $form->{"discount_$i"});
$qty = $form->parse_amount(\%myconfig, $form->{"qty_$i"});
+ #($form->{"sellprice_$i"}, $form->{"$pricegroup_old_$i"}) = split /--/, $form->{"sellprice_$i"};
+
$amount = $sellprice * (1 - $discount / 100) * $qty;
map { $form->{"${_}_base"} += $amount }
(split / /, $form->{"taxaccounts_$i"});
sub validate_items {
$lxdebug->enter_sub();
-
+print STDERR "io.pl-validate_items\n";
# check if items are valid
if ($form->{rowcount} == 1) {
&update;
sub order {
$lxdebug->enter_sub();
-
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ }
$form->{ordnumber} = $form->{invnumber};
map { delete $form->{$_} } qw(id printed emailed queued);
sub quotation {
$lxdebug->enter_sub();
-
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ }
map { delete $form->{$_} } qw(id printed emailed queued);
if ($form->{script} eq 'ir.pl' || $form->{type} eq 'purchase_order') {
sub e_mail {
$lxdebug->enter_sub();
-
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ $form->{resubmit} = 0;
+ }
if ($myconfig{role} eq 'admin') {
$bcc = qq|
<th align=right nowrap=true>| . $locale->text('Bcc') . qq|</th>
sub print_options {
$lxdebug->enter_sub();
-
+print STDERR "io.pl-print_options\n";
$form->{sendmode} = "attachment";
$form->{copies} = 3 unless $form->{copies};
sub print {
$lxdebug->enter_sub();
-
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ }
# if this goes to the printer pass through
if ($form->{media} eq 'printer' || $form->{media} eq 'queue') {
$form->error($locale->text('Select postscript or PDF!'))
$inv = "inv";
$due = "due";
-
$numberfld = "invnumber";
$display_form =
if (!$form->{"${inv}number"} && !$form->{preview}) {
$form->{"${inv}number"} = $form->update_defaults(\%myconfig, $numberfld);
if ($form->{media} ne 'email') {
+
+ $i = $form->{rowcount};
+ # get pricegroups for parts
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+ # build up html code for prices_$i
+ set_pricegroup();
+
$form->{rowcount}--;
+
&{"$display_form"};
exit;
}
sub customer_details {
$lxdebug->enter_sub();
-
+print STDERR "io.pl-customer_details\n";
IS->customer_details(\%myconfig, \%$form);
$lxdebug->leave_sub();
}
sub ship_to {
$lxdebug->enter_sub();
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ }
$title = $form->{title};
$form->{title} = $locale->text('Ship to');
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
qw(exchangerate creditlimit creditremaining);
- $form_id = $form->{id};
+
# get details for name
&{"$form->{vc}_details"};
- $form->{id} = $form_id;
$number =
($form->{vc} eq 'customer')
? $locale->text('Customer Number')
: $locale->text('Vendor Number');
+ $i = $form->{rowcount};
+ # get pricegroups for parts
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+ # build up html code for prices_$i
+ set_pricegroup();
+
$nextsub = ($form->{display_form}) ? $form->{display_form} : "display_form";
$form->{rowcount}--;
sub add {
$lxdebug->enter_sub();
-
+print STDERR "ir.pl-add\n";
$form->{title} = $locale->text('Add Vendor Invoice');
&invoice_links;
sub invoice_links {
$lxdebug->enter_sub();
-
+print STDERR "ir.pl-invoice_links\n";
# create links
$form->{webdav} = $webdav;
sub prepare_invoice {
$lxdebug->enter_sub();
-
+print STDERR "ir.pl-prepare_invoice\n";
if ($form->{id}) {
map { $form->{$_} =~ s/\"/"/g } qw(invnumber ordnumber quonumber);
sub form_header {
$lxdebug->enter_sub();
-
+print STDERR "ir.pl-form_header\n";
# set option selected
foreach $item (qw(AP vendor currency department contact)) {
$form->{"select$item"} =~ s/ selected//;
<input type=hidden name=title value="$form->{title}">
<input type=hidden name=vc value="vendor">
<input type=hidden name=type value=$form->{type}>
+<input type=hidden name=level value=$form->{level}>
<input type=hidden name=creditlimit value=$form->{creditlimit}>
<input type=hidden name=creditremaining value=$form->{creditremaining}>
sub form_footer {
$lxdebug->enter_sub();
-
+print STDERR "ir.pl-form_footer\n";
$form->{invtotal} = $form->{invsubtotal};
if (($rows = $form->numtextrows($form->{notes}, 25, 8)) < 2) {
use SL::IS;
use SL::PE;
+use Data::Dumper;
require "$form->{path}/io.pl";
require "$form->{path}/arap.pl";
sub edit {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-edit\n";
$form->{title} = $locale->text('Edit Sales Invoice');
if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR")
sub invoice_links {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-invoice_links\n";
$form->{vc} = 'customer';
# create links
sub prepare_invoice {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-prepare_invoice\n";
$form->{type} = "invoice";
$form->{formname} = "invoice";
$form->{format} = "html";
map { $form->{$_} =~ s/\"/"/g }
qw(invnumber ordnumber quonumber shippingpoint shipvia notes intnotes);
+# # get pricegroups for parts
+# IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
foreach $ref (@{ $form->{invoice_details} }) {
$i++;
map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
$form->{"discount_$i"} =
$form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
-
($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
$dec = length $dec;
$decimalplaces = ($dec > 2) ? $dec : 2;
map { $form->{"${_}_$i"} =~ s/\"/"/g }
qw(partnumber description unit partnotes);
$form->{rowcount} = $i;
+
}
}
$lxdebug->leave_sub();
sub form_header {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-form_header\n";
# set option selected
foreach $item (qw(AR customer currency department employee contact)) {
$form->{"select$item"} =~ s/ selected//;
<tr>
<th align=right nowrap>| . $locale->text('Customer') . qq|</th>
<td colspan=3>$customer</td>
+ <input type=hidden name=customer_klass value=$form->{customer_klass}>
<input type=hidden name=customer_id value=$form->{customer_id}>
<input type=hidden name=oldcustomer value="$form->{oldcustomer}">
<th align=richt nowrap>|
sub form_footer {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-form_footer\n";
$form->{invtotal} = $form->{invsubtotal};
if (($rows = $form->numtextrows($form->{notes}, 26, 8)) < 2) {
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
qw(exchangerate creditlimit creditremaining);
-
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ }
&check_name(customer);
&check_project;
} else {
$sellprice = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
-
+#print STDERR " SELLPRICE-111- $sellprice\n";
map { $form->{item_list}[$i]{$_} =~ s/\"/"/g }
qw(partnumber description unit);
map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} }
}
}
+ # get pricegroups for parts
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form, "new");
+
+ # build up html code for prices_$i
+ &set_pricegroup($i);
}
&display_form;
sub post {
$lxdebug->enter_sub();
-
$form->isblank("invdate", $locale->text('Invoice Date missing!'));
$form->isblank("customer", $locale->text('Customer missing!'));
&update;
exit;
}
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ }
&validate_items;
$print_post = 1;
$form->{print_and_post} = 1;
&post();
+
&display_form();
$lxdebug->leave_sub();
sub delete {
$lxdebug->enter_sub();
-
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ }
$form->header;
print qq|
$button1 = qq|
<td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate}></td>
<td><input type=button name=transdate id="trigger1" value=|
- . $locale->text('button')
- . qq|></td>
+ . $locale->text('button') . qq|></td>
|;
$button2 = qq|
<td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value=$form->{reqdate}></td>
<td width="4"><input type=button name=reqdate name=reqdate id="trigger2" value=|
- . $locale->text('button')
- . qq|></td>
+ . $locale->text('button') . qq|></td>
|;
#write Trigger
<table>
<tr>
<th nowrap><input name=closed type=radio class=radio value=0 $checkedopen> |
- . $locale->text('Open')
- . qq|</th>
+ . $locale->text('Open') . qq|</th>
<th nowrap><input name=closed type=radio class=radio value=1 $checkedclosed> |
- . $locale->text('Closed')
- . qq|</th>
+ . $locale->text('Closed') . qq|</th>
</tr>
</table>
</td>
<tr>
<th align=right nowrap>| . $locale->text('Terms: Net') . qq|</th>
<td nowrap><input name=terms size="3" maxlength="3" value=$form->{terms}> |
- . $locale->text('days')
- . qq|</td>
+ . $locale->text('days') . qq|</td>
</tr>
|;
</tr>
<tr>
<th width=70% align=right nowrap>|
- . $locale->text('Quotation Number')
- . qq|</th>
+ . $locale->text('Quotation Number') . qq|</th>
<td><input name=quonumber size=11 value="$form->{quonumber}"></td>
</tr>
<tr>
<th width=70% align=right nowrap>|
- . $locale->text('Customer Order Number')
- . qq|</th>
+ . $locale->text('Customer Order Number') . qq|</th>
<td><input name=cusordnumber size=11 value="$form->{cusordnumber}"></td>
</tr>
<tr>
$ordnumber = qq|
<tr>
<th width=70% align=right nowrap>|
- . $locale->text('Quotation Number')
- . qq|</th>
+ . $locale->text('Quotation Number') . qq|</th>
<td><input name=quonumber size=11 value="$form->{quonumber}"></td>
<input type=hidden name=ordnumber value="$form->{ordnumber}">
</tr>
if ($form->{type} eq 'sales_order') {
if ($form->{selectemployee}) {
$employee = qq|
+ <input type=hidden name=customer_klass value=$form->{customer_klass}>
<tr>
<th align=right nowrap>| . $locale->text('Salesperson') . qq|</th>
<td colspan=2><select name=employee>$form->{selectemployee}</select></td>
}
} else {
$employee = qq|
+ <input type=hidden name=customer_klass value=$form->{customer_klass}>
<tr>
<th align=right nowrap>| . $locale->text('Employee') . qq|</th>
<td colspan=2><select name=employee>$form->{selectemployee}</select></td>
<input type=hidden name=$form->{vc}_id value=$form->{"$form->{vc}_id"}>
<input type=hidden name="old$form->{vc}" value="$form->{"old$form->{vc}"}">
<th align=richt nowrap>|
- . $locale->text('Contact Person')
- . qq|</th>
+ . $locale->text('Contact Person') . qq|</th>
<td colspan=3>$contact</td>
</tr>
$creditremaining
if ($form->{taxaccounts}) {
$taxincluded = qq|
<input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>|
- . $locale->text('Tax Included')
- . qq|</b><br><br>
+ . $locale->text('Tax Included') . qq|</b><br><br>
|;
}
\%myconfig, $form->{currency}, $form->{transdate}, $buysell
)));
- my $i = $form->{rowcount};
+ # for pricegroups
+ $i = $form->{rowcount};
+
$exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
if ( ($form->{"partnumber_$i"} eq "")
$form->{"sellprice_$i"} = $sellprice;
} else {
+ $form->{"sellprice_$i"} *= (1 - $form->{tradediscount});
# if there is an exchange rate adjust sellprice
$form->{"sellprice_$i"} /= $exchangerate;
}
$decimalplaces);
$form->{"qty_$i"} =
$form->format_amount(\%myconfig, $form->{"qty_$i"});
+
+ # get pricegroups for parts
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+ # build up html code for prices_$i
+ &set_pricegroup($i);
}
&display_form;
$form->{warehouse} = qq|$form->{warehouse}--$form->{warehouse_id}|;
map {
- $form->{selectwarehouse} .= "<option>$_->{description}--$_->{id}\n"
+ $form->{selectwarehouse} .=
+ "<option>$_->{description}--$_->{id}\n"
} (@{ $form->{all_warehouses} });
$warehouse = qq|
$openclosed = qq|
<tr>
<td><input name="open" class=checkbox type=checkbox value=1 checked> |
- . $locale->text('Open')
- . qq|</td>
+ . $locale->text('Open') . qq|</td>
<td><input name="closed" class=checkbox type=checkbox value=1 $form->{closed}> |
- . $locale->text('Closed')
- . qq|</td>
+ . $locale->text('Closed') . qq|</td>
</tr>
|;
} else {
$button1 = qq|
<td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}">
<input type=button name=transdatefrom id="trigger3" value=|
- . $locale->text('button')
- . qq|></td>
+ . $locale->text('button') . qq|></td>
|;
$button2 = qq|
<td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}">
<input type=button name=transdateto name=transdateto id="trigger4" value=|
- . $locale->text('button')
- . qq|></td>
+ . $locale->text('button') . qq|></td>
|;
#write Trigger
| . $locale->text('ID') . qq|</td>
<td><input name="l_$ordnumber" class=checkbox type=checkbox value=Y checked> $ordlabel</td>
<td><input name="l_transdate" class=checkbox type=checkbox value=Y checked> |
- . $locale->text('Date')
- . qq|</td>
+ . $locale->text('Date') . qq|</td>
<td><input name="l_reqdate" class=checkbox type=checkbox value=Y checked> |
- . $locale->text('Required by')
- . qq|</td>
+ . $locale->text('Required by') . qq|</td>
</tr>
<tr>
<td><input name="l_name" class=checkbox type=checkbox value=Y checked> $vclabel</td>
<td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
<td><input name="l_shipvia" class=checkbox type=checkbox value=Y> |
- . $locale->text('Ship via')
- . qq|</td>
+ . $locale->text('Ship via') . qq|</td>
</tr>
<tr>
<td><input name="l_netamount" class=checkbox type=checkbox value=Y> |
- . $locale->text('Amount')
- . qq|</td>
+ . $locale->text('Amount') . qq|</td>
<td><input name="l_tax" class=checkbox type=checkbox value=Y> |
- . $locale->text('Tax')
- . qq|</td>
+ . $locale->text('Tax') . qq|</td>
<td><input name="l_amount" class=checkbox type=checkbox value=Y checked> |
- . $locale->text('Total')
- . qq|</td>
+ . $locale->text('Total') . 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>
</tr>
</table>
</td>
# undo formatting from prepare_order
map {
- $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
+ $form->{"${_}_$i"} =
+ $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
} qw(qty ship);
$n = ($form->{"qty_$i"} -= $form->{"ship_$i"});
if (abs($n) > 0
if ($form->{type} eq 'partsgroup') {
PE->get_partsgroup(\%myconfig, \%$form);
}
-
+ if ($form->{type} eq 'pricegroup') {
+ PE->get_pricegroup(\%myconfig, \%$form);
+ }
&{"form_$form->{type}_header"};
&{"form_$form->{type}_footer"};
}
+ # for pricesgroups
+ if ($form->{type} eq 'pricegroup') {
+ $report = "pricegroup_report";
+ $sort = 'pricegroup';
+ $form->{title} = $locale->text('Pricegroup');
+
+ $number = qq|
+ <tr>
+ <th align=right width=1%>| . $locale->text('Pricegroup') . qq|</th>
+ <td><input name=pricegroup size=20></td>
+ </tr>
+|;
+
+ }
+
$form->header;
print qq|
<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>
</table>
</td>
$form->redirect($locale->text('Group saved!'));
}
+ # choice pricegroup and save
+ if ($form->{type} eq 'pricegroup') {
+ $form->isblank("pricegroup", $locale->text('Pricegroup missing!'));
+ PE->save_pricegroup(\%myconfig, \%$form);
+ $form->redirect($locale->text('Pricegroup saved!'));
+ }
+
$lxdebug->leave_sub();
}
if ($form->{type} eq 'partsgroup') {
$form->redirect($locale->text('Group deleted!'));
}
+ if ($form->{type} eq 'pricegroup') {
+ $form->redirect($locale->text('Pricegroup deleted!'));
+ }
$lxdebug->leave_sub();
}
$lxdebug->leave_sub();
}
+
+#################################
+# get pricesgroups and build up html-code
+#
+sub pricegroup_report {
+ $lxdebug->enter_sub();
+
+ map { $form->{$_} = $form->unescape($form->{$_}) } (pricegroup);
+ PE->pricegroups(\%myconfig, \%$form);
+
+ $callback =
+ "$form->{script}?action=pricegroup_report&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
+
+ if ($form->{status} eq 'all') {
+ $option = $locale->text('All');
+ }
+ if ($form->{status} eq 'orphaned') {
+ $option .= $locale->text('Orphaned');
+ }
+ if ($form->{pricegroup}) {
+ $callback .= "&pricegroup=$form->{pricegroup}";
+ $option .=
+ "\n<br>" . $locale->text('Pricegroup') . " : $form->{pricegroup}";
+ }
+
+ @column_index = $form->sort_columns(qw(pricegroup));
+
+ $column_header{pricegroup} =
+ qq|<th class=listheading width=90%>|
+ . $locale->text('Pricegroup')
+ . qq|</th>|;
+
+ $form->{title} = $locale->text('Pricegroup');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$option</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+ map { print "$column_header{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ # escape callback
+ $form->{callback} = $callback;
+
+ # escape callback for href
+ $callback = $form->escape($callback);
+
+ foreach $ref (@{ $form->{item_list} }) {
+
+ $i++;
+ $i %= 2;
+
+ print qq|
+ <tr valign=top class=listrow$i>
+|;
+ $column_data{pricegroup} =
+ qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{pricegroup}</td>|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print "
+ </tr>
+";
+ }
+
+ print qq|
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<form method=post action=$form->{script}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=type value=$form->{type}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value="|
+ . $locale->text('Add') . qq|">|;
+
+ if ($form->{menubar}) {
+ require "$form->{path}/menu.pl";
+ &menubar;
+ }
+
+ print qq|
+ </form>
+
+</body>
+</html>
+|;
+
+ $lxdebug->leave_sub();
+}
+
+#######################
+#build up pricegroup_header
+#
+sub form_pricegroup_header {
+ $lxdebug->enter_sub();
+
+ # $locale->text('Add Pricegroup')
+ # $locale->text('Edit Pricegroup')
+
+ $form->{title} = $locale->text("$form->{title} Pricegroup");
+
+ $form->{pricegroup} =~ s/\"/"/g;
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{id}>
+<input type=hidden name=type value=$form->{type}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=right>| . $locale->text('Preisgruppe') . qq|</th>
+ <td><input name=pricegroup size=30 value="$form->{pricegroup}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=2><hr size=3 noshade></td>
+ </tr>
+</table>
+|;
+
+ $lxdebug->leave_sub();
+}
+######################
+#build up pricegroup_footer
+#
+sub form_pricegroup_footer {
+ $lxdebug->enter_sub();
+
+ print qq|
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br><input type=submit class=submit name=action value="|
+ . $locale->text('Save') . qq|">
+|;
+
+ if ($form->{id} && $form->{orphaned}) {
+ print qq|
+<input type=submit class=submit name=action value="|
+ . $locale->text('Delete') . qq|">|;
+ }
+
+ if ($form->{menubar}) {
+ require "$form->{path}/menu.pl";
+ &menubar;
+ }
+
+ print qq|
+</form>
+
+</body>
+</html>
+|;
+
+ $lxdebug->leave_sub();
+}
'Add Group' => 'Warengruppe erfassen',
'Add License' => 'Lizenz erfassen',
'Add Part' => 'Ware erfassen',
+ 'Add Pricegroup' => 'Preisgruppe erfassen',
'Add Project' => 'Projekt erfassen',
'Add Purchase Order' => 'Lieferantenauftrag erfassen',
'Add Quotation' => 'Angebot erfassen',
'Bitte das Bundesland UND die Stadt bzw. den Einzugsbereich Ihres zuständigen Finanzamts auswählen.' => 'Bitte das Bundesland UND die Stadt bzw. den Einzugsbereich Ihres zuständigen Finanzamts auswählen.',
'Bitte eine Steuernummer angeben' => 'Bitte eine Steuernummer angeben',
'Books are open' => 'Die Bücher sind geöffnet.',
- 'Bought' => 'gekauft',
+ 'Bought' => 'Gekauft',
'Buchungsdatum' => 'Buchungsdatum',
'Buchungsjournal' => 'Buchungsjournal',
'Business' => 'Firma',
'Edit Group' => 'Warengruppe editieren',
'Edit Part' => 'Ware bearbeiten',
'Edit Preferences for' => 'Benutzereinstellungen für',
+ 'Edit Pricegroup' => 'Preisgruppe bearbeiten',
'Edit Project' => 'Projekt bearbeiten',
'Edit Purchase Order' => 'Lieferantenaufrag bearbeiten',
'Edit Quotation' => 'Angebot bearbeiten',
'Foreign Exchange Gain' => 'Wechselkurserträge',
'Foreign Exchange Loss' => 'Wechselkursaufwendungen',
'Free report period' => 'Freier Zeitraum',
- 'From' => 'von',
+ 'From' => 'Von',
'GIFI' => 'GIFI',
'GIFI deleted!' => 'GIFI gelöscht!',
'GIFI missing!' => 'GIFI fehlt!',
'Help' => 'Hilfe',
'Hier den Berechnungszeitraum auswählen...' => 'Hier den Berechnungszeitraum auswählen...',
'Hinweise' => 'Hinweise',
+ 'Hola' => '',
'Homepage' => 'Homepage',
'Host' => 'Datenbankcomputer',
'Hostname missing!' => 'Computername fehlt!',
'Oct' => 'Okt',
'October' => 'Oktober',
'On Hand' => 'Auf Lager',
- 'On Order' => 'ist bestellt',
+ 'On Order' => 'Ist bestellt',
'Open' => 'Offen',
'Oracle Database Administration' => 'Oracle Datenbankadministration',
'Order' => 'Auftrag',
'Order deleted!' => 'Auftrag gelöscht!',
'Ordered' => 'Vom Kunde bestellt',
'Orders' => 'Aufträge',
- 'Orphaned' => 'nie benutzt',
+ 'Orphaned' => 'Nie benutzt',
'Out of balance!' => 'Summen stimmen nicht berein!',
'Own Product' => 'eigenes Produkt',
'PDF' => 'PDF',
'Postscript' => 'Postscript',
'Preferences' => 'Benutzereinstellungen',
'Preferences saved!' => 'Einstellungen gespeichert!',
+ 'Preis' => 'Preis',
+ 'Preisgruppe' => 'Preisgruppe',
+ 'Preisklasse' => 'Preisgruppe',
'Prepayment' => 'Vorauszahlung',
'Price' => 'Preis',
+ 'Pricegroup' => 'Preisgruppe',
+ 'Pricegroup deleted!' => 'Preisgruppe gelöscht!',
+ 'Pricegroup missing!' => 'Preisgruppe fehlt!',
+ 'Pricegroup saved!' => 'Preisgruppe gespeichert!',
+ 'Pricegroups' => 'Preisgruppen',
'Print' => 'Drucken',
'Printed' => 'gedruckt.',
'Printer' => 'Drucker',
'Short' => 'kurz',
'Show' => 'Zeigen',
'Signature' => 'Unterschrift',
- 'Sold' => 'verkauft',
+ 'Sold' => 'Verkauft',
'Soll- und Habenkonto sind gleich!' => 'Soll- und Habenkonto sind gleich!',
'Source' => 'Beleg',
'Split Credit' => 'Haben splitten',
'Subtotal' => 'Zwischensumme',
'Supervisor' => 'Supervisor',
'System' => 'System',
- 'TOP100' => 'TOP100',
+ 'TOP100' => 'Top 100',
'Tax' => 'Steuer',
'Tax Accounts' => 'Steuerkonto',
'Tax Included' => 'Steuer im Preis inbegriffen',
'debug' => 'Debug',
'does not exist' => 'existiert nicht',
'done' => 'erledigt',
- 'ea' => 'Stk',
+ 'ea' => 'St.',
'emailed to' => 'gemailt an',
'for Period' => 'für den Zeitraum',
'hr' => 'Stunde',
'saved!' => 'gespeichert',
'sent' => 'gesendet',
'sent to printer' => 'an Drucker geschickt',
- 'soldtotal' => 'verkaufte Anzahl',
+ 'soldtotal' => 'Verkaufte Anzahl',
'successfully created!' => 'wurde erfolgreich erstellt',
'successfully deleted!' => 'wurde erfolgreich gelöscht',
'test' => 'test',
'Exchangerate missing!' => 'Es fehlt der Wechselkurs!',
'Feb' => 'Feb',
'February' => 'Februar',
- 'From' => 'von',
+ 'From' => 'Von',
'ID' => 'Buchungsnummer',
'Include in Report' => 'In Bericht aufnehmen',
'Invoice' => 'Rechnung',
'Exchangerate missing!' => 'Es fehlt der Wechselkurs!',
'Feb' => 'Feb',
'February' => 'Februar',
- 'From' => 'von',
+ 'From' => 'Von',
'ID' => 'Buchungsnummer',
'Include in Report' => 'In Bericht aufnehmen',
'Incoming Payments' => 'Zahlungseingänge',
'Continue' => 'Weiter',
'Customer' => 'Kunde',
'Date' => 'Datum',
- 'From' => 'von',
+ 'From' => 'Von',
'Invoice' => 'Rechnung',
'Invoice Number' => 'Rechnungsnummer',
'Marked entries printed!' => 'Markierte Einträge wurden gedruckt!',
'Description' => 'Beschreibung',
'Feb' => 'Feb',
'February' => 'Februar',
- 'From' => 'von',
+ 'From' => 'Von',
'GIFI' => 'GIFI',
'Include in Report' => 'In Bericht aufnehmen',
'Jan' => 'Jan',
'Cannot delete customer!' => 'Kunde kann nicht gelöscht werden!',
'Cannot delete vendor!' => 'Lieferant kann nicht gelöscht werden!',
'Cc' => 'Cc',
- 'City' => 'Stadt',
'Company Name' => 'Firmenname',
'Contact' => 'Kontakt',
'Contact Person' => 'Ansprechpartner',
'GIFI' => 'GIFI',
'Given Name' => 'Vorname',
'Greeting' => 'Anrede',
+ 'Hola' => 'Hola',
'Homepage' => 'Homepage',
'ID' => 'Buchungsnummer',
'Include in Report' => 'In Bericht aufnehmen',
'Obsolete' => 'Ungültig',
'Order' => 'Auftrag',
'Orders' => 'Aufträge',
- 'Orphaned' => 'nie benutzt',
+ 'Orphaned' => 'Nie benutzt',
'Password' => 'Passwort',
'Phone' => 'Telefon',
'Phone1' => 'Telefon 1 ',
'Phone2' => 'Telefon 2',
+ 'Preisklasse' => 'Preisgruppe',
'Quotation' => 'Angebot',
'Quotations' => 'Angebote',
'SIC' => 'SIC',
'Expense' => 'Aufwandskonto',
'Feb' => 'Feb',
'February' => 'Februar',
- 'From' => 'von',
+ 'From' => 'Von',
'GIFI' => 'GIFI',
'GL Transaction' => 'Dialogbuchung',
'General Ledger' => 'Finanzbuchhaltung',
'Billing Address' => 'Rechnungsadresse',
'Bin' => 'Lagerplatz',
'Bin List' => 'Lagerliste',
- 'Bought' => 'gekauft',
+ 'Bought' => 'Gekauft',
'COGS' => 'Umsatzkosten',
'Cannot delete item!' => 'Artikel kann nicht gelöscht werden!',
'Cannot stock assemblies!' => 'Erzeugnisse können nicht ins Lager!',
'Fax' => 'Fax',
'Feb' => 'Feb',
'February' => 'Februar',
- 'From' => 'von',
+ 'From' => 'Von',
'Geschäftsvolumen' => 'Geschäftsvolumen',
'Group' => 'Warengruppe',
'Group Items' => 'Waren gruppieren',
'Oct' => 'Okt',
'October' => 'Oktober',
'On Hand' => 'Auf Lager',
- 'On Order' => 'ist bestellt',
+ 'On Order' => 'Ist bestellt',
'Order Date missing!' => 'Auftragsdatum fehlt!',
'Order Number' => 'Auftragsnummer',
'Order Number missing!' => 'Auftragsnummer fehlt!',
'Ordered' => 'Vom Kunde bestellt',
- 'Orphaned' => 'nie benutzt',
+ 'Orphaned' => 'Nie benutzt',
'PDF' => 'PDF',
'Packing List' => 'Verpackungsliste',
'Packing List Date missing!' => 'Datum für Verpackungsliste fehlt!',
'Phone' => 'Telefon',
'Pick List' => 'Sammelliste',
'Postscript' => 'Postscript',
+ 'Preis' => 'Preis',
+ 'Preisklasse' => 'Preisgruppe',
'Price' => 'Preis',
+ 'Pricegroup' => 'Preisgruppe',
'Printed' => 'gedruckt.',
'Printer' => 'Drucker',
'Project' => 'Projekt',
'Shipping Address' => 'Lieferadresse',
'Shopartikel' => 'Shopartikel',
'Short' => 'kurz',
- 'Sold' => 'verkauft',
+ 'Sold' => 'Verkauft',
'Stock' => 'einlagern',
'Stock Assembly' => 'Erzeugnis einlagern',
'Street' => 'Straße',
'Subject' => 'Betreff',
'Subtotal' => 'Zwischensumme',
- 'TOP100' => 'TOP100',
+ 'TOP100' => 'Top 100',
'To' => 'An',
'Top 100' => 'Top 100',
'Top 100 hinzufuegen' => 'Top 100 hinzufügen',
'number' => 'Nummer',
'sent' => 'gesendet',
'sent to printer' => 'an Drucker geschickt',
- 'soldtotal' => 'verkaufte Anzahl',
+ 'soldtotal' => 'Verkaufte Anzahl',
};
$self{subs} = {
'order' => 'order',
'parts_subtotal' => 'parts_subtotal',
'post_as_new' => 'post_as_new',
+ 'price_row' => 'price_row',
'print' => 'print',
'print_form' => 'print_form',
'print_options' => 'print_options',
'section_menu' => 'section_menu',
'select_item' => 'select_item',
'send_email' => 'send_email',
+ 'set_pricegroup' => 'set_pricegroup',
'ship_to' => 'ship_to',
'stock_assembly' => 'stock_assembly',
'top100' => 'top100',
'dienstleistung_bearbeiten' => 'edit_service',
'speichern' => 'save',
'als_neu_speichern' => 'save_as_new',
- 'top100' => 'top100',
+ 'top_100' => 'top100',
'erneuern' => 'update',
'auswählen' => 'choice',
'auflisten' => 'list',
'Pick List' => 'Sammelliste',
'Postscript' => 'Postscript',
'Price' => 'Preis',
+ 'Pricegroup' => 'Preisgruppe',
'Printed' => 'gedruckt.',
'Printer' => 'Drucker',
'Project' => 'Projekt',
'quotation' => 'quotation',
'select_item' => 'select_item',
'send_email' => 'send_email',
+ 'set_pricegroup' => 'set_pricegroup',
'ship_to' => 'ship_to',
'validate_items' => 'validate_items',
'vendor_details' => 'vendor_details',
'Post as new' => 'Neu buchen',
'Postscript' => 'Postscript',
'Price' => 'Preis',
+ 'Pricegroup' => 'Preisgruppe',
'Printed' => 'gedruckt.',
'Printer' => 'Drucker',
'Project' => 'Projekt',
'Yes' => 'Ja',
'Zipcode' => 'PLZ',
'button' => '?',
- 'ea' => 'Stk',
+ 'ea' => 'St.',
'emailed to' => 'gemailt an',
'posted!' => 'gebucht',
'sent' => 'gesendet',
'select_name' => 'select_name',
'select_project' => 'select_project',
'send_email' => 'send_email',
+ 'set_pricegroup' => 'set_pricegroup',
'ship_to' => 'ship_to',
'update' => 'update',
'validate_items' => 'validate_items',
'Post as new' => 'Neu buchen',
'Postscript' => 'Postscript',
'Price' => 'Preis',
+ 'Pricegroup' => 'Preisgruppe',
'Print' => 'Drucken',
'Printed' => 'gedruckt.',
'Printer' => 'Drucker',
'Yes' => 'Ja',
'Zipcode' => 'PLZ',
'button' => '?',
- 'ea' => 'Stk',
+ 'ea' => 'St.',
'emailed to' => 'gemailt an',
'posted!' => 'gebucht',
'sent' => 'gesendet',
'select_name' => 'select_name',
'select_project' => 'select_project',
'send_email' => 'send_email',
+ 'set_pricegroup' => 'set_pricegroup',
'ship_to' => 'ship_to',
'update' => 'update',
'validate_items' => 'validate_items',
'Add Group' => 'Warengruppe erfassen',
'Add License' => 'Lizenz erfassen',
'Add Part' => 'Ware erfassen',
+ 'Add Pricegroup' => 'Preisgruppe erfassen',
'Add Project' => 'Projekt erfassen',
'Add Purchase Order' => 'Lieferantenauftrag erfassen',
'Add Quotation' => 'Angebot erfassen',
'Payment' => 'Zahlungsausgang',
'Payments' => 'Zahlungsausgänge',
'Preferences' => 'Benutzereinstellungen',
+ 'Pricegroups' => 'Preisgruppen',
'Programm' => 'Programm',
'Projects' => 'Projekte',
'Projecttransactions' => 'Projektbuchungen',
'Add Group' => 'Warengruppe erfassen',
'Add License' => 'Lizenz erfassen',
'Add Part' => 'Ware erfassen',
+ 'Add Pricegroup' => 'Preisgruppe erfassen',
'Add Project' => 'Projekt erfassen',
'Add Purchase Order' => 'Lieferantenauftrag erfassen',
'Add Quotation' => 'Angebot erfassen',
'Payment' => 'Zahlungsausgang',
'Payments' => 'Zahlungsausgänge',
'Preferences' => 'Benutzereinstellungen',
+ 'Pricegroups' => 'Preisgruppen',
'Programm' => 'Programm',
'Projects' => 'Projekte',
'Projecttransactions' => 'Projektbuchungen',
'Fax' => 'Fax',
'Feb' => 'Feb',
'February' => 'Februar',
- 'From' => 'von',
+ 'From' => 'Von',
'Group' => 'Warengruppe',
'Group Items' => 'Waren gruppieren',
'ID' => 'Buchungsnummer',
'Pick List' => 'Sammelliste',
'Postscript' => 'Postscript',
'Price' => 'Preis',
+ 'Pricegroup' => 'Preisgruppe',
'Print' => 'Drucken',
'Printed' => 'gedruckt.',
'Printer' => 'Drucker',
'Zipcode' => 'PLZ',
'button' => '?',
'days' => 'Tage',
- 'ea' => 'Stk',
+ 'ea' => 'St.',
'emailed to' => 'gemailt an',
'saved!' => 'gespeichert',
'sent' => 'gesendet',
'select_name' => 'select_name',
'select_project' => 'select_project',
'send_email' => 'send_email',
+ 'set_pricegroup' => 'set_pricegroup',
'ship_receive' => 'ship_receive',
'ship_to' => 'ship_to',
'subtotal' => 'subtotal',
'Accounting Menu' => 'Kontoverwaltung',
'Add' => 'Erfassen',
'Add Group' => 'Warengruppe erfassen',
+ 'Add Pricegroup' => 'Preisgruppe erfassen',
'Add Project' => 'Projekt erfassen',
'All' => 'Alle',
'Continue' => 'Weiter',
'Delete' => 'Löschen',
'Description' => 'Beschreibung',
'Edit Group' => 'Warengruppe editieren',
+ 'Edit Pricegroup' => 'Preisgruppe bearbeiten',
'Edit Project' => 'Projekt bearbeiten',
'Group' => 'Warengruppe',
'Group deleted!' => 'Warengruppe gelöscht!',
'Group saved!' => 'Warengruppe gespeichert!',
'Groups' => 'Warengruppen',
'Number' => 'Nummer',
- 'Orphaned' => 'nie benutzt',
+ 'Orphaned' => 'Nie benutzt',
+ 'Preisgruppe' => 'Preisgruppe',
+ 'Pricegroup' => 'Preisgruppe',
+ 'Pricegroup deleted!' => 'Preisgruppe gelöscht!',
+ 'Pricegroup missing!' => 'Preisgruppe fehlt!',
+ 'Pricegroup saved!' => 'Preisgruppe gespeichert!',
'Project' => 'Projekt',
'Project Number missing!' => 'Projektnummer fehlt!',
'Project deleted!' => 'Projekt gelöscht!',
'edit' => 'edit',
'form_partsgroup_footer' => 'form_partsgroup_footer',
'form_partsgroup_header' => 'form_partsgroup_header',
+ 'form_pricegroup_footer' => 'form_pricegroup_footer',
+ 'form_pricegroup_header' => 'form_pricegroup_header',
'form_project_footer' => 'form_project_footer',
'form_project_header' => 'form_project_header',
'partsgroup_report' => 'partsgroup_report',
+ 'pricegroup_report' => 'pricegroup_report',
'project_report' => 'project_report',
'save' => 'save',
'search' => 'search',
'Difference' => 'Differenz',
'Done' => 'Fertig',
'Exchangerate Difference' => 'Wechselkursunterschied',
- 'From' => 'von',
+ 'From' => 'Von',
'Increase' => 'Erhöhen',
'Out of balance!' => 'Summen stimmen nicht berein!',
'Payment' => 'Zahlungsausgang',
'Feb' => 'Feb',
'February' => 'Februar',
'Free report period' => 'Freier Zeitraum',
- 'From' => 'von',
+ 'From' => 'Von',
'GIFI' => 'GIFI',
'HTML' => 'HTML',
'Heading' => 'Überschrift',
action=add
type=project
+#sk
+[Master Data--Add Pricegroup]
+module=pe.pl
+action=add
+type=pricegroup
+
[Master Data--Add License]
module=licenses.pl
action=add
action=search
type=partsgroup
-
[Master Data--Reports--Projects]
module=pe.pl
action=search
module=licenses.pl
action=search
+#sk
+[Master Data--Reports--Pricegroups]
+module=pe.pl
+action=search
+type=pricegroup
+
[AR]
employee_id int
);
+-- pricegroups
+
+CREATE TABLE "pricegroup" (
+ "id" integer DEFAULT nextval('id'::text),
+ "pricegroup" text not null,
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE "prices" (
+ "parts_id" integer REFERENCES parts(id),
+ "pricegroup_id" integer REFERENCES pricegroup(id),
+ "price" numeric(15,5)
+);
+
+ALTER TABLE customer ADD column klass integer;
+ALTER TABLE customer ALTER column klass set default 0;
+
+--
+ALTER TABLE invoice ADD column pricegroup_id integer;
+ALTER TABLE orderitems ADD column pricegroup_id integer;
+
update defaults set version = '2.1.2', audittrail = 't';
--
"deliverydate" date,
"serialnumber" text,
"itime" timestamp DEFAULT now(),
- "mtime" timestamp
+ "mtime" timestamp,
+ "pricegroup_id" integer
);
CREATE TABLE "vendor" (
"username" varchar(50),
"user_password" varchar(12),
"salesman_id" integer,
- "c_vendor_id" text
+ "c_vendor_id" text,
+ "klass" integer DEFAULT 0
);
"serialnumber" text,
"id" integer DEFAULT nextval('orderitemsid'::text) PRIMARY KEY,
"itime" timestamp DEFAULT now(),
- "mtime" timestamp
+ "mtime" timestamp,
+ "pricegroup_id" integer
);
CREATE TABLE "exchangerate" (
license_id integer
);
+-- Preisgruppenverwaltung
+CREATE TABLE "pricegroup" (
+ "id" integer DEFAULT nextval('id'::text),
+ "pricegroup" text not null,
+ PRIMARY KEY (id)
+);
+--Preisverwaltung der Preisgruppen
+CREATE TABLE "prices" (
+ "parts_id" integer REFERENCES parts(id),
+ "pricegroup_id" integer REFERENCES pricegroup(id),
+ "price" numeric(15,5)
+);
+
+
+
+
-- Table of tax authoritys
-- for module ustva
-- Lx office